@atlaskit/editor-core 187.28.0 → 187.28.2
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 +14 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/cjs/create-editor/create-plugins-list.js +2 -2
- package/dist/cjs/index.js +0 -7
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/base/index.js +7 -126
- package/dist/cjs/plugins/base/plugin.js +140 -0
- package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +3 -9
- package/dist/cjs/plugins/index.js +2 -2
- package/dist/cjs/plugins/list/index.js +17 -0
- package/dist/cjs/plugins/list/utils/find.js +4 -3
- package/dist/cjs/plugins/media/toolbar/index.js +1 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +7 -2
- package/dist/cjs/plugins/media/utils/media-single.js +7 -5
- package/dist/cjs/plugins/paste/handlers.js +27 -3
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +58 -36
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +3 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +8 -9
- package/dist/cjs/test-utils.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +19 -18
- package/dist/cjs/ui/ToolbarFeedback/index.js +22 -16
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/es2019/create-editor/create-plugins-list.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/base/index.js +2 -104
- package/dist/es2019/plugins/base/plugin.js +109 -0
- package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -4
- package/dist/es2019/plugins/index.js +1 -1
- package/dist/es2019/plugins/list/index.js +19 -0
- package/dist/es2019/plugins/list/utils/find.js +2 -2
- package/dist/es2019/plugins/media/toolbar/index.js +2 -2
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
- package/dist/es2019/plugins/media/utils/media-single.js +3 -4
- package/dist/es2019/plugins/paste/handlers.js +27 -3
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +62 -38
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +3 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
- package/dist/es2019/test-utils.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +25 -3
- package/dist/es2019/ui/ToolbarFeedback/index.js +14 -9
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/esm/create-editor/create-plugins-list.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/base/index.js +2 -123
- package/dist/esm/plugins/base/plugin.js +128 -0
- package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -4
- package/dist/esm/plugins/index.js +1 -1
- package/dist/esm/plugins/list/index.js +19 -0
- package/dist/esm/plugins/list/utils/find.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +2 -2
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
- package/dist/esm/plugins/media/utils/media-single.js +5 -4
- package/dist/esm/plugins/paste/handlers.js +25 -3
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +60 -37
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +3 -3
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
- package/dist/esm/test-utils.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +6 -5
- package/dist/esm/ui/ToolbarFeedback/index.js +20 -14
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/plugins/base/index.d.ts +4 -16
- package/dist/types/plugins/base/plugin.d.ts +23 -0
- package/dist/types/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
- package/dist/types/plugins/index.d.ts +1 -1
- package/dist/types/plugins/list/types.d.ts +1 -8
- package/dist/types/plugins/list/utils/find.d.ts +1 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/paste/handlers.d.ts +4 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -2
- package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
- package/dist/types/ui/ToolbarFeedback/index.d.ts +1 -19
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/base/index.d.ts +4 -18
- package/dist/types-ts4.5/plugins/base/plugin.d.ts +25 -0
- package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
- package/dist/types-ts4.5/plugins/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/list/types.d.ts +1 -8
- package/dist/types-ts4.5/plugins/list/utils/find.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +4 -2
- package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +2 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +5 -2
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
- package/dist/types-ts4.5/ui/ToolbarFeedback/index.d.ts +1 -19
- package/package.json +2 -2
- package/report.api.md +4 -58
- package/tmp/api-report-tmp.d.ts +4 -47
- package/dist/cjs/plugins/list/styles.js +0 -15
- package/dist/cjs/utils/list-commands.js +0 -17
- package/dist/cjs/utils/lists.js +0 -31
- package/dist/es2019/plugins/list/styles.js +0 -26
- package/dist/es2019/utils/list-commands.js +0 -11
- package/dist/es2019/utils/lists.js +0 -26
- package/dist/esm/plugins/list/styles.js +0 -7
- package/dist/esm/utils/list-commands.js +0 -11
- package/dist/esm/utils/lists.js +0 -24
- package/dist/types/plugins/list/styles.d.ts +0 -1
- package/dist/types/utils/list-commands.d.ts +0 -6
- package/dist/types/utils/lists.d.ts +0 -2
- package/dist/types-ts4.5/plugins/list/styles.d.ts +0 -1
- package/dist/types-ts4.5/utils/list-commands.d.ts +0 -6
- package/dist/types-ts4.5/utils/lists.d.ts +0 -2
|
@@ -19,7 +19,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
19
19
|
indentDisabled,
|
|
20
20
|
outdentDisabled,
|
|
21
21
|
featureFlags,
|
|
22
|
-
|
|
22
|
+
pluginInjectionApi
|
|
23
23
|
} = props;
|
|
24
24
|
if (isSmall) {
|
|
25
25
|
return jsx(ToolbarDropdown, {
|
|
@@ -36,7 +36,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
36
36
|
indentDisabled: indentDisabled,
|
|
37
37
|
outdentDisabled: outdentDisabled,
|
|
38
38
|
disabled: disabled,
|
|
39
|
-
onItemActivated: onItemActivated(
|
|
39
|
+
onItemActivated: onItemActivated(pluginInjectionApi),
|
|
40
40
|
featureFlags: featureFlags
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -51,7 +51,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
51
51
|
indentDisabled: indentDisabled,
|
|
52
52
|
outdentDisabled: outdentDisabled,
|
|
53
53
|
disabled: disabled,
|
|
54
|
-
onItemActivated: onItemActivated(
|
|
54
|
+
onItemActivated: onItemActivated(pluginInjectionApi),
|
|
55
55
|
featureFlags: featureFlags
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { indentList, outdentList, toggleBulletList, toggleOrderedList } from '../../list/commands';
|
|
2
1
|
import { getIndentCommand as indentParagraphOrHeading, getOutdentCommand as outdentParagraphOrHeading } from '../../indentation/commands';
|
|
3
2
|
import { getIndentCommand as indentTaskList, getUnindentCommand as outdentTaskList } from '../../tasks-and-decisions/pm-plugins/keymaps';
|
|
4
3
|
import { INPUT_METHOD } from '../../analytics';
|
|
5
4
|
import { pluginKey as indentationButtonsPluginKey } from '../pm-plugins/indentation-buttons';
|
|
6
|
-
export const onItemActivated =
|
|
5
|
+
export const onItemActivated = pluginInjectionApi => ({
|
|
7
6
|
buttonName,
|
|
8
7
|
editorView,
|
|
9
8
|
featureFlags
|
|
10
9
|
}) => {
|
|
11
10
|
switch (buttonName) {
|
|
12
11
|
case 'bullet_list':
|
|
13
|
-
toggleBulletList(
|
|
12
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleBulletList(editorView, INPUT_METHOD.TOOLBAR);
|
|
14
13
|
break;
|
|
15
14
|
case 'ordered_list':
|
|
16
|
-
toggleOrderedList(
|
|
15
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.toggleOrderedList(editorView, INPUT_METHOD.TOOLBAR);
|
|
17
16
|
break;
|
|
18
17
|
case 'indent':
|
|
19
18
|
{
|
|
@@ -23,7 +22,7 @@ export const onItemActivated = editorAnalyticsAPI => ({
|
|
|
23
22
|
indentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
24
23
|
}
|
|
25
24
|
if (node === 'list') {
|
|
26
|
-
indentList(
|
|
25
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.indentList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
27
26
|
}
|
|
28
27
|
if (node === 'taskList') {
|
|
29
28
|
indentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -38,7 +37,7 @@ export const onItemActivated = editorAnalyticsAPI => ({
|
|
|
38
37
|
outdentParagraphOrHeading(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
39
38
|
}
|
|
40
39
|
if (node === 'list') {
|
|
41
|
-
outdentList(
|
|
40
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.list.actions.outdentList(INPUT_METHOD.TOOLBAR, featureFlags)(editorView.state, editorView.dispatch);
|
|
42
41
|
}
|
|
43
42
|
if (node === 'taskList') {
|
|
44
43
|
outdentTaskList(INPUT_METHOD.TOOLBAR)(editorView.state, editorView.dispatch);
|
|
@@ -3,7 +3,7 @@ import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
|
3
3
|
import { createSchema } from './create-editor/create-schema';
|
|
4
4
|
import { sortByOrder } from './create-editor/sort-by-order';
|
|
5
5
|
import { analyticsPluginKey } from './plugins/analytics/plugin-key';
|
|
6
|
-
import basePlugin from './plugins/base';
|
|
6
|
+
import { basePlugin } from './plugins/base';
|
|
7
7
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
8
8
|
export function getFireAnalytics(editorView) {
|
|
9
9
|
var _analyticsPluginKey$g;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { jsx, css, useTheme } from '@emotion/react';
|
|
4
|
-
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles, smartCardStyles, embedCardStyles } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
4
|
+
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles, smartCardStyles, embedCardStyles, codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { blockNodesVerticalMargin, editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { unsupportedStyles } from '../../plugins/unsupported-content/styles';
|
|
7
7
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
8
8
|
import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
|
|
@@ -10,7 +10,6 @@ import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
|
10
10
|
import { placeholderStyles } from '../../plugins/placeholder/styles';
|
|
11
11
|
import { blocktypeStyles } from '../../plugins/block-type/styles';
|
|
12
12
|
import { codeBlockStyles } from '../../plugins/code-block/styles';
|
|
13
|
-
import { listsStyles } from '../../plugins/list/styles';
|
|
14
13
|
import { ruleStyles } from '../../plugins/rule/styles';
|
|
15
14
|
import { mediaStyles } from '../../plugins/media/styles';
|
|
16
15
|
import { layoutStyles } from '../../plugins/layout/styles';
|
|
@@ -28,11 +27,34 @@ import { statusStyles } from '../../plugins/status/styles';
|
|
|
28
27
|
import { dateStyles } from '../../plugins/date/styles';
|
|
29
28
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
30
29
|
import { linkSharedStyle, codeMarkSharedStyles } from '@atlaskit/editor-common/styles';
|
|
30
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
31
31
|
export const linkStyles = css`
|
|
32
32
|
.ProseMirror {
|
|
33
33
|
${linkSharedStyle}
|
|
34
34
|
}
|
|
35
35
|
`;
|
|
36
|
+
const listsStyles = css`
|
|
37
|
+
.ProseMirror {
|
|
38
|
+
li {
|
|
39
|
+
position: relative;
|
|
40
|
+
|
|
41
|
+
> p:not(:first-child) {
|
|
42
|
+
margin: 4px 0 0 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// In SSR the above rule will apply to all p tags because first-child would be a style tag.
|
|
46
|
+
// The following rule resets the first p tag back to its original margin
|
|
47
|
+
// defined in packages/editor/editor-common/src/styles/shared/paragraph.ts
|
|
48
|
+
> style:first-child + p {
|
|
49
|
+
margin-top: ${blockNodesVerticalMargin};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
& :not([data-node-type='decisionList']) > li {
|
|
54
|
+
${browser.safari ? codeBlockInListSafariFix : ''}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
36
58
|
const contentStyles = props => css`
|
|
37
59
|
.ProseMirror {
|
|
38
60
|
outline: none;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
/** @jsx jsx */
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
@@ -17,7 +18,7 @@ import { openFeedbackDialog } from '../../plugins/feedback-dialog';
|
|
|
17
18
|
import deprecationWarnings from '../../utils/deprecation-warnings';
|
|
18
19
|
import pickBy from '../../utils/pick-by';
|
|
19
20
|
import { analyticsEventKey } from '../../plugins/analytics/consts';
|
|
20
|
-
import {
|
|
21
|
+
import { usePresetContext } from '../../presets/context';
|
|
21
22
|
const PopupWithOutsideListeners = withOuterListeners(Popup);
|
|
22
23
|
const POPUP_HEIGHT = 388;
|
|
23
24
|
const POPUP_WIDTH = 280;
|
|
@@ -36,7 +37,7 @@ const deprecations = [{
|
|
|
36
37
|
type: 'removed'
|
|
37
38
|
}];
|
|
38
39
|
const isNullOrUndefined = attr => attr === null || attr === undefined;
|
|
39
|
-
|
|
40
|
+
class ToolbarFeedbackInternal extends PureComponent {
|
|
40
41
|
constructor(props) {
|
|
41
42
|
super(props);
|
|
42
43
|
_defineProperty(this, "state", {
|
|
@@ -70,16 +71,14 @@ export default class ToolbarFeedback extends PureComponent {
|
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
73
|
_defineProperty(this, "openJiraIssueCollector", async () => {
|
|
73
|
-
var _window$localStorage$,
|
|
74
|
+
var _this$props$api, _window$localStorage$, _basePluginState$cont;
|
|
74
75
|
this.setState({
|
|
75
76
|
jiraIssueCollectorScriptLoading: true,
|
|
76
77
|
showOptOutOption: false
|
|
77
78
|
});
|
|
78
|
-
const
|
|
79
|
-
editorView
|
|
80
|
-
} = this.context.editorActions;
|
|
79
|
+
const basePluginState = (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : _this$props$api.dependencies.base.sharedState.currentState();
|
|
81
80
|
const sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
|
|
82
|
-
const contentId =
|
|
81
|
+
const contentId = basePluginState === null || basePluginState === void 0 ? void 0 : (_basePluginState$cont = basePluginState.contextIdentifier) === null || _basePluginState$cont === void 0 ? void 0 : _basePluginState$cont.objectId;
|
|
83
82
|
const tabId = window.sessionStorage['awc.tab.id'];
|
|
84
83
|
await openFeedbackDialog({
|
|
85
84
|
...this.getFeedbackInfo(),
|
|
@@ -159,6 +158,12 @@ export default class ToolbarFeedback extends PureComponent {
|
|
|
159
158
|
}, "Learn more")))))) : null;
|
|
160
159
|
}
|
|
161
160
|
}
|
|
162
|
-
_defineProperty(
|
|
161
|
+
_defineProperty(ToolbarFeedbackInternal, "contextTypes", {
|
|
163
162
|
editorActions: PropTypes.object.isRequired
|
|
164
|
-
});
|
|
163
|
+
});
|
|
164
|
+
export default function ToolbarFeedback(props) {
|
|
165
|
+
const api = usePresetContext();
|
|
166
|
+
return jsx(ToolbarFeedbackInternal, _extends({
|
|
167
|
+
api: api
|
|
168
|
+
}, props));
|
|
169
|
+
}
|
|
@@ -35,7 +35,6 @@ import { getParticipantsCount } from '../plugins/collab-edit/get-participants-co
|
|
|
35
35
|
import { EVENT_NAME_DISPATCH_TRANSACTION, EVENT_NAME_STATE_APPLY, EVENT_NAME_UPDATE_STATE, EVENT_NAME_VIEW_STATE_UPDATED, EVENT_NAME_ON_CHANGE, TransactionTracker } from '../utils/performance/track-transactions';
|
|
36
36
|
import { countNodes as _countNodes } from '../utils/count-nodes';
|
|
37
37
|
import { PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD, DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS } from './consts';
|
|
38
|
-
import { getContextIdentifier } from '../plugins/base/pm-plugins/context-identifier';
|
|
39
38
|
import ReactEditorViewContext from './ReactEditorViewContext';
|
|
40
39
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
41
40
|
import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
|
|
@@ -395,9 +394,10 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
395
394
|
var forceSeverityTracking = typeof proseMirrorRenderedTracking === 'undefined' && shouldForceTracking();
|
|
396
395
|
_this.proseMirrorRenderedSeverity = !!forceSeverityTracking || proseMirrorRenderedTracking !== null && proseMirrorRenderedTracking !== void 0 && proseMirrorRenderedTracking.trackSeverity ? getAnalyticsEventSeverity(duration, (_proseMirrorRenderedT = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityNormalThreshold) !== null && _proseMirrorRenderedT !== void 0 ? _proseMirrorRenderedT : PROSEMIRROR_RENDERED_NORMAL_SEVERITY_THRESHOLD, (_proseMirrorRenderedT2 = proseMirrorRenderedTracking === null || proseMirrorRenderedTracking === void 0 ? void 0 : proseMirrorRenderedTracking.severityDegradedThreshold) !== null && _proseMirrorRenderedT2 !== void 0 ? _proseMirrorRenderedT2 : PROSEMIRROR_RENDERED_DEGRADED_SEVERITY_THRESHOLD) : undefined;
|
|
397
396
|
if (_this.view) {
|
|
398
|
-
var
|
|
397
|
+
var _this$pluginInjection, _this$experienceStore10;
|
|
399
398
|
var nodes = getNodesCount(_this.view.state.doc);
|
|
400
399
|
var ttfb = getResponseEndTime();
|
|
400
|
+
var contextIdentifier = (_this$pluginInjection = _this.pluginInjectionAPI.api().dependencies.base) === null || _this$pluginInjection === void 0 ? void 0 : _this$pluginInjection.sharedState.currentState();
|
|
401
401
|
_this.dispatchAnalyticsEvent({
|
|
402
402
|
action: ACTION.PROSEMIRROR_RENDERED,
|
|
403
403
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -407,7 +407,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
407
407
|
nodes: nodes,
|
|
408
408
|
ttfb: ttfb,
|
|
409
409
|
severity: _this.proseMirrorRenderedSeverity,
|
|
410
|
-
objectId:
|
|
410
|
+
objectId: contextIdentifier === null || contextIdentifier === void 0 ? void 0 : contextIdentifier.objectId,
|
|
411
411
|
distortedDuration: distortedDuration
|
|
412
412
|
},
|
|
413
413
|
eventType: EVENT_TYPE.OPERATIONAL
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
import createUniversalPreset from '../labs/next/presets/universal';
|
|
5
|
-
import { GUTTER_SIZE_MOBILE_IN_PX } from '
|
|
5
|
+
import { GUTTER_SIZE_MOBILE_IN_PX } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
7
7
|
import { createFeatureFlagsFromProps } from './feature-flags-from-props';
|
|
8
8
|
var isCodeBlockAllowed = function isCodeBlockAllowed(options) {
|
package/dist/esm/index.js
CHANGED
|
@@ -41,7 +41,6 @@ export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded } from './plugins
|
|
|
41
41
|
|
|
42
42
|
// Used in editor-test-helpers and mobile bridge
|
|
43
43
|
export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
|
|
44
|
-
export { getListCommands } from './utils/list-commands';
|
|
45
44
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
46
45
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
47
46
|
export { default as EditorActions } from './actions';
|
|
@@ -7,7 +7,7 @@ import { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
|
7
7
|
import { textFormattingPlugin } from '@atlaskit/editor-plugin-text-formatting';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import unsupportedContentPlugin from '../../../plugins/unsupported-content';
|
|
10
|
-
import basePlugin from '../../../plugins/base';
|
|
10
|
+
import { basePlugin } from '../../../plugins/base';
|
|
11
11
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
12
12
|
import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
13
13
|
import typeAheadPlugin from '../../../plugins/type-ahead';
|
|
@@ -1,123 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
|
|
5
|
-
import { history } from '@atlaskit/editor-prosemirror/history';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
9
|
-
import filterStepsPlugin from './pm-plugins/filter-steps';
|
|
10
|
-
import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
|
|
11
|
-
import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
|
|
12
|
-
import contextIdentifierPlugin from './pm-plugins/context-identifier';
|
|
13
|
-
import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
14
|
-
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
15
|
-
import scrollGutter from './pm-plugins/scroll-gutter';
|
|
16
|
-
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
17
|
-
import frozenEditor from './pm-plugins/frozen-editor';
|
|
18
|
-
// Chrome >= 88
|
|
19
|
-
export var isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
20
|
-
var basePlugin = function basePlugin(options, api) {
|
|
21
|
-
var _api$dependencies, _api$dependencies$fea;
|
|
22
|
-
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
23
|
-
return {
|
|
24
|
-
name: 'base',
|
|
25
|
-
pmPlugins: function pmPlugins() {
|
|
26
|
-
var plugins = [{
|
|
27
|
-
name: 'filterStepsPlugin',
|
|
28
|
-
plugin: function plugin(_ref) {
|
|
29
|
-
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
30
|
-
return filterStepsPlugin(dispatchAnalyticsEvent);
|
|
31
|
-
}
|
|
32
|
-
}];
|
|
33
|
-
|
|
34
|
-
// In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
35
|
-
// the cursor appears at the right most point of the parent container.
|
|
36
|
-
// In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
37
|
-
// no cursor is presented to users.
|
|
38
|
-
// In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
39
|
-
// it is not possible to navigate with arrow keys.
|
|
40
|
-
// This plugin works around the issues by inserting decorations between
|
|
41
|
-
// inline nodes which are set as contenteditable, and have a zero width space.
|
|
42
|
-
plugins.push({
|
|
43
|
-
name: 'inlineCursorTargetPlugin',
|
|
44
|
-
plugin: function plugin() {
|
|
45
|
-
return options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
plugins.push({
|
|
49
|
-
name: 'newlinePreserveMarksPlugin',
|
|
50
|
-
plugin: newlinePreserveMarksPlugin
|
|
51
|
-
}, {
|
|
52
|
-
name: 'frozenEditor',
|
|
53
|
-
plugin: function plugin(_ref2) {
|
|
54
|
-
var _options$inputTrackin;
|
|
55
|
-
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
56
|
-
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
57
|
-
}
|
|
58
|
-
}, {
|
|
59
|
-
name: 'history',
|
|
60
|
-
plugin: function plugin() {
|
|
61
|
-
return history();
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
// should be last :(
|
|
65
|
-
{
|
|
66
|
-
name: 'codeBlockIndent',
|
|
67
|
-
plugin: function plugin() {
|
|
68
|
-
return keymap(_objectSpread(_objectSpread({}, baseKeymap), {}, {
|
|
69
|
-
'Mod-[': function Mod() {
|
|
70
|
-
return true;
|
|
71
|
-
},
|
|
72
|
-
'Mod-]': function Mod() {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
}));
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
name: 'contextIdentifier',
|
|
79
|
-
plugin: function plugin(_ref3) {
|
|
80
|
-
var dispatch = _ref3.dispatch,
|
|
81
|
-
providerFactory = _ref3.providerFactory;
|
|
82
|
-
return contextIdentifierPlugin(dispatch, providerFactory);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
if (options && options.allowScrollGutter) {
|
|
86
|
-
plugins.push({
|
|
87
|
-
name: 'scrollGutterPlugin',
|
|
88
|
-
plugin: function plugin() {
|
|
89
|
-
return scrollGutter(options.allowScrollGutter);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
if (isChromeWithSelectionBug && !getBooleanFF('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
|
|
94
|
-
plugins.push({
|
|
95
|
-
name: 'fixChrome88SelectionPlugin',
|
|
96
|
-
plugin: function plugin() {
|
|
97
|
-
return fixChrome88SelectionPlugin();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
plugins.push({
|
|
102
|
-
name: 'disableSpellcheckingPlugin',
|
|
103
|
-
plugin: function plugin() {
|
|
104
|
-
return disableSpellcheckingPlugin(featureFlags);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return plugins;
|
|
108
|
-
},
|
|
109
|
-
nodes: function nodes() {
|
|
110
|
-
return [{
|
|
111
|
-
name: 'doc',
|
|
112
|
-
node: doc
|
|
113
|
-
}, {
|
|
114
|
-
name: 'paragraph',
|
|
115
|
-
node: paragraph
|
|
116
|
-
}, {
|
|
117
|
-
name: 'text',
|
|
118
|
-
node: text
|
|
119
|
-
}];
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
export default basePlugin;
|
|
1
|
+
import basePlugin from './plugin';
|
|
2
|
+
export { basePlugin };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
import { baseKeymap } from '@atlaskit/editor-prosemirror/commands';
|
|
5
|
+
import { history } from '@atlaskit/editor-prosemirror/history';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { browser } from '@atlaskit/editor-common/utils';
|
|
8
|
+
import { doc, paragraph, text } from '@atlaskit/adf-schema';
|
|
9
|
+
import filterStepsPlugin from './pm-plugins/filter-steps';
|
|
10
|
+
import fixChrome88SelectionPlugin from './pm-plugins/fix-chrome-88-selection';
|
|
11
|
+
import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
|
|
12
|
+
import contextIdentifierPlugin, { getContextIdentifier } from './pm-plugins/context-identifier';
|
|
13
|
+
import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
14
|
+
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
15
|
+
import scrollGutter from './pm-plugins/scroll-gutter';
|
|
16
|
+
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
17
|
+
import frozenEditor from './pm-plugins/frozen-editor';
|
|
18
|
+
// Chrome >= 88
|
|
19
|
+
export var isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
20
|
+
var basePlugin = function basePlugin(options, api) {
|
|
21
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
22
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
23
|
+
return {
|
|
24
|
+
name: 'base',
|
|
25
|
+
getSharedState: function getSharedState(editorState) {
|
|
26
|
+
return {
|
|
27
|
+
contextIdentifier: getContextIdentifier(editorState)
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
pmPlugins: function pmPlugins() {
|
|
31
|
+
var plugins = [{
|
|
32
|
+
name: 'filterStepsPlugin',
|
|
33
|
+
plugin: function plugin(_ref) {
|
|
34
|
+
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
35
|
+
return filterStepsPlugin(dispatchAnalyticsEvent);
|
|
36
|
+
}
|
|
37
|
+
}];
|
|
38
|
+
|
|
39
|
+
// In Chrome, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
40
|
+
// the cursor appears at the right most point of the parent container.
|
|
41
|
+
// In Firefox, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
42
|
+
// no cursor is presented to users.
|
|
43
|
+
// In Safari, when the selection is placed between adjacent nodes which are not contenteditatble
|
|
44
|
+
// it is not possible to navigate with arrow keys.
|
|
45
|
+
// This plugin works around the issues by inserting decorations between
|
|
46
|
+
// inline nodes which are set as contenteditable, and have a zero width space.
|
|
47
|
+
plugins.push({
|
|
48
|
+
name: 'inlineCursorTargetPlugin',
|
|
49
|
+
plugin: function plugin() {
|
|
50
|
+
return options && options.allowInlineCursorTarget ? inlineCursorTargetPlugin() : undefined;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
plugins.push({
|
|
54
|
+
name: 'newlinePreserveMarksPlugin',
|
|
55
|
+
plugin: newlinePreserveMarksPlugin
|
|
56
|
+
}, {
|
|
57
|
+
name: 'frozenEditor',
|
|
58
|
+
plugin: function plugin(_ref2) {
|
|
59
|
+
var _options$inputTrackin;
|
|
60
|
+
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
61
|
+
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
name: 'history',
|
|
65
|
+
plugin: function plugin() {
|
|
66
|
+
return history();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
// should be last :(
|
|
70
|
+
{
|
|
71
|
+
name: 'codeBlockIndent',
|
|
72
|
+
plugin: function plugin() {
|
|
73
|
+
return keymap(_objectSpread(_objectSpread({}, baseKeymap), {}, {
|
|
74
|
+
'Mod-[': function Mod() {
|
|
75
|
+
return true;
|
|
76
|
+
},
|
|
77
|
+
'Mod-]': function Mod() {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
name: 'contextIdentifier',
|
|
84
|
+
plugin: function plugin(_ref3) {
|
|
85
|
+
var dispatch = _ref3.dispatch,
|
|
86
|
+
providerFactory = _ref3.providerFactory;
|
|
87
|
+
return contextIdentifierPlugin(dispatch, providerFactory);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
if (options && options.allowScrollGutter) {
|
|
91
|
+
plugins.push({
|
|
92
|
+
name: 'scrollGutterPlugin',
|
|
93
|
+
plugin: function plugin() {
|
|
94
|
+
return scrollGutter(options.allowScrollGutter);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (isChromeWithSelectionBug && !getBooleanFF('platform.editor.disable-chrome-88-selection-fix_uk53m')) {
|
|
99
|
+
plugins.push({
|
|
100
|
+
name: 'fixChrome88SelectionPlugin',
|
|
101
|
+
plugin: function plugin() {
|
|
102
|
+
return fixChrome88SelectionPlugin();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
plugins.push({
|
|
107
|
+
name: 'disableSpellcheckingPlugin',
|
|
108
|
+
plugin: function plugin() {
|
|
109
|
+
return disableSpellcheckingPlugin(featureFlags);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return plugins;
|
|
113
|
+
},
|
|
114
|
+
nodes: function nodes() {
|
|
115
|
+
return [{
|
|
116
|
+
name: 'doc',
|
|
117
|
+
node: doc
|
|
118
|
+
}, {
|
|
119
|
+
name: 'paragraph',
|
|
120
|
+
node: paragraph
|
|
121
|
+
}, {
|
|
122
|
+
name: 'text',
|
|
123
|
+
node: text
|
|
124
|
+
}];
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export default basePlugin;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { isEmptyDocument } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { GUTTER_SELECTOR, GUTTER_SIZE_IN_PX, isEmptyDocument } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { getMobileDimensionsPluginState } from '../../mobile-dimensions/utils';
|
|
4
|
-
export var GUTTER_SIZE_IN_PX = 120; // Default gutter size
|
|
5
|
-
export var GUTTER_SIZE_MOBILE_IN_PX = 36; // Gutter size for Mobile
|
|
6
|
-
export var GUTTER_SELECTOR = '#editor-scroll-gutter';
|
|
7
4
|
var MIN_TAP_SIZE_IN_PX = 40;
|
|
8
5
|
function supportsIntersectionObserver() {
|
|
9
6
|
if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { basePlugin } from './base';
|
|
2
2
|
export { default as blockTypePlugin } from './block-type';
|
|
3
3
|
export { pluginKey as blockPluginStateKey } from './block-type';
|
|
4
4
|
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
@@ -7,6 +7,11 @@ import { listMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '../analytics';
|
|
8
8
|
import { toggleBulletList, toggleOrderedList, tooltip } from '../../keymaps';
|
|
9
9
|
import { IconList, IconListNumber } from '@atlaskit/editor-common/quick-insert';
|
|
10
|
+
import { isInsideListItem } from './utils/selection';
|
|
11
|
+
import { indentList, outdentList, toggleBulletList as toggleBulletListCommand, toggleOrderedList as toggleOrderedListCommand } from './commands';
|
|
12
|
+
import { findRootParentListNode } from './utils/find';
|
|
13
|
+
import { pluginKey as listPluginKey } from './pm-plugins/main';
|
|
14
|
+
|
|
10
15
|
/*
|
|
11
16
|
Toolbar buttons to bullet and ordered list can be found in
|
|
12
17
|
packages/editor/editor-core/src/plugins/toolbar-lists-indentation/ui/Toolbar.tsx
|
|
@@ -17,6 +22,20 @@ var listPlugin = function listPlugin(options, api) {
|
|
|
17
22
|
var editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions;
|
|
18
23
|
return {
|
|
19
24
|
name: 'list',
|
|
25
|
+
actions: {
|
|
26
|
+
indentList: indentList(editorAnalyticsAPI),
|
|
27
|
+
outdentList: outdentList(editorAnalyticsAPI),
|
|
28
|
+
toggleOrderedList: toggleOrderedListCommand(editorAnalyticsAPI),
|
|
29
|
+
toggleBulletList: toggleBulletListCommand(editorAnalyticsAPI),
|
|
30
|
+
isInsideListItem: isInsideListItem,
|
|
31
|
+
findRootParentListNode: findRootParentListNode
|
|
32
|
+
},
|
|
33
|
+
getSharedState: function getSharedState(editorState) {
|
|
34
|
+
if (!editorState) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return listPluginKey.getState(editorState);
|
|
38
|
+
},
|
|
20
39
|
nodes: function nodes() {
|
|
21
40
|
return [{
|
|
22
41
|
name: 'bulletList',
|
|
@@ -36,7 +36,7 @@ export function findFirstParentListItemNode($pos) {
|
|
|
36
36
|
pos: listItemNodePosition.pos
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
export function findRootParentListNode($pos) {
|
|
39
|
+
export var findRootParentListNode = function findRootParentListNode($pos) {
|
|
40
40
|
var doc = $pos.doc;
|
|
41
41
|
if ($pos.pos + 1 > doc.content.size) {
|
|
42
42
|
return null;
|
|
@@ -56,4 +56,4 @@ export function findRootParentListNode($pos) {
|
|
|
56
56
|
}
|
|
57
57
|
var listNodePosition = doc.resolve(parentList.pos);
|
|
58
58
|
return findRootParentListNode(listNodePosition);
|
|
59
|
-
}
|
|
59
|
+
};
|
|
@@ -29,7 +29,7 @@ import ImageBorderItem from '../ui/ImageBorder';
|
|
|
29
29
|
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
30
30
|
import { shouldShowImageBorder } from './imageBorder';
|
|
31
31
|
import { PixelEntry } from '../ui/PixelEntry';
|
|
32
|
-
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT,
|
|
32
|
+
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_GUTTER_SIZE, calcMediaSinglePixelWidth } from '@atlaskit/editor-common/media-single';
|
|
33
33
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
34
34
|
var remove = function remove(state, dispatch) {
|
|
35
35
|
if (dispatch) {
|
|
@@ -296,7 +296,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
296
296
|
mediaWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
|
|
297
297
|
mediaHeight: mediaHeight || DEFAULT_IMAGE_HEIGHT,
|
|
298
298
|
validate: function validate(value) {
|
|
299
|
-
if (value !== '' && !isNaN(value) && value >=
|
|
299
|
+
if (value !== '' && !isNaN(value) && value >= MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH && value <= akEditorFullWidthLayoutWidth) {
|
|
300
300
|
return true;
|
|
301
301
|
}
|
|
302
302
|
return false;
|