@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
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ import type { DirectEditorProps } from '@atlaskit/editor-prosemirror/view';
|
|
|
40
40
|
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
41
41
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
42
42
|
import type { EditorActionsOptions } from '@atlaskit/editor-common/types';
|
|
43
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
43
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
44
44
|
import { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
45
45
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
46
46
|
import { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -50,7 +50,6 @@ import { EditorReactContext } from '@atlaskit/editor-common/types';
|
|
|
50
50
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
51
51
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
52
52
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
53
|
-
import { EditorView as EditorView_2 } from 'prosemirror-view';
|
|
54
53
|
import { EmojiResource } from '@atlaskit/emoji/resource';
|
|
55
54
|
import { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
56
55
|
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
@@ -83,6 +82,7 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
|
83
82
|
import { jsx } from '@emotion/react';
|
|
84
83
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
85
84
|
import type { LinkingOptions } from '@atlaskit/editor-common/types';
|
|
85
|
+
import { ListState } from '@atlaskit/editor-plugin-list';
|
|
86
86
|
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
87
87
|
import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
|
|
88
88
|
import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -120,7 +120,6 @@ import PropTypes from 'prop-types';
|
|
|
120
120
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
121
121
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
122
122
|
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
123
|
-
import { PureComponent } from 'react';
|
|
124
123
|
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
125
124
|
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
126
125
|
import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
@@ -970,14 +969,6 @@ interface GapSelectionData {
|
|
|
970
969
|
// @public (undocumented)
|
|
971
970
|
export function getDefaultPresetOptionsFromEditorProps(props: EditorProps, createAnalyticsEvent?: CreateUIAnalyticsEvent): EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps;
|
|
972
971
|
|
|
973
|
-
// @public (undocumented)
|
|
974
|
-
export const getListCommands: () => {
|
|
975
|
-
indentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: INPUT_METHOD | INPUT_METHOD) => Command;
|
|
976
|
-
outdentList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: (INPUT_METHOD | INPUT_METHOD) | undefined, featureFlags: EditorFeatureFlags) => Command;
|
|
977
|
-
toggleOrderedList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView_2, inputMethod?: ListInputMethod) => boolean;
|
|
978
|
-
toggleBulletList: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView_2, inputMethod?: ListInputMethod) => boolean;
|
|
979
|
-
};
|
|
980
|
-
|
|
981
972
|
// @public (undocumented)
|
|
982
973
|
export function getNodesCount(node: Node_2): Record<string, number>;
|
|
983
974
|
|
|
@@ -1074,19 +1065,7 @@ type Listener = (data: any) => void;
|
|
|
1074
1065
|
// @public (undocumented)
|
|
1075
1066
|
export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
|
|
1076
1067
|
|
|
1077
|
-
|
|
1078
|
-
export interface ListState {
|
|
1079
|
-
// (undocumented)
|
|
1080
|
-
bulletListActive: boolean;
|
|
1081
|
-
// (undocumented)
|
|
1082
|
-
bulletListDisabled: boolean;
|
|
1083
|
-
// (undocumented)
|
|
1084
|
-
decorationSet: DecorationSet;
|
|
1085
|
-
// (undocumented)
|
|
1086
|
-
orderedListActive: boolean;
|
|
1087
|
-
// (undocumented)
|
|
1088
|
-
orderedListDisabled: boolean;
|
|
1089
|
-
}
|
|
1068
|
+
export { ListState }
|
|
1090
1069
|
|
|
1091
1070
|
// @public (undocumented)
|
|
1092
1071
|
export const listStateKey: PluginKey<ListState>;
|
|
@@ -1740,16 +1719,6 @@ interface SimpleEntry {
|
|
|
1740
1719
|
interface State {
|
|
1741
1720
|
}
|
|
1742
1721
|
|
|
1743
|
-
// @public (undocumented)
|
|
1744
|
-
interface State_2 {
|
|
1745
|
-
// (undocumented)
|
|
1746
|
-
jiraIssueCollectorScriptLoading: boolean;
|
|
1747
|
-
// (undocumented)
|
|
1748
|
-
showOptOutOption?: boolean;
|
|
1749
|
-
// (undocumented)
|
|
1750
|
-
target?: HTMLElement;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
1722
|
// @public (undocumented)
|
|
1754
1723
|
export const statusMessages: {
|
|
1755
1724
|
placeholder: {
|
|
@@ -1850,19 +1819,7 @@ interface TextSelectionData {
|
|
|
1850
1819
|
}
|
|
1851
1820
|
|
|
1852
1821
|
// @public (undocumented)
|
|
1853
|
-
export
|
|
1854
|
-
constructor(props: Props_3);
|
|
1855
|
-
// (undocumented)
|
|
1856
|
-
static contextTypes: {
|
|
1857
|
-
editorActions: PropTypes.Validator<object>;
|
|
1858
|
-
};
|
|
1859
|
-
// (undocumented)
|
|
1860
|
-
render(): jsx.JSX.Element | null;
|
|
1861
|
-
// (undocumented)
|
|
1862
|
-
showJiraCollectorDialogCallback?: () => void;
|
|
1863
|
-
// (undocumented)
|
|
1864
|
-
state: State_2;
|
|
1865
|
-
}
|
|
1822
|
+
export function ToolbarFeedback(props: Props_3): jsx.JSX.Element;
|
|
1866
1823
|
|
|
1867
1824
|
// @public (undocumented)
|
|
1868
1825
|
export const ToolbarHelp: React_2.FC<WithIntlProps<Props_2 & WrappedComponentProps<"intl">>> & {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.listsStyles = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
-
var _react = require("@emotion/react");
|
|
10
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
|
-
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
|
-
var _templateObject;
|
|
14
|
-
var listsStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: 4px 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n }\n"])), _editorSharedStyles.blockNodesVerticalMargin, _utils.browser.safari ? _styles.codeBlockInListSafariFix : '');
|
|
15
|
-
exports.listsStyles = listsStyles;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getListCommands = void 0;
|
|
7
|
-
var _commands = require("../plugins/list/commands");
|
|
8
|
-
// getListCommands provides commands for manipulating lists in the document.
|
|
9
|
-
var getListCommands = function getListCommands() {
|
|
10
|
-
return {
|
|
11
|
-
indentList: _commands.indentList,
|
|
12
|
-
outdentList: _commands.outdentList,
|
|
13
|
-
toggleOrderedList: _commands.toggleOrderedList,
|
|
14
|
-
toggleBulletList: _commands.toggleBulletList
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
exports.getListCommands = getListCommands;
|
package/dist/cjs/utils/lists.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.doesSelectionWhichStartsOrEndsInListContainEntireList = void 0;
|
|
7
|
-
var _find = require("../plugins/list/utils/find");
|
|
8
|
-
var doesSelectionWhichStartsOrEndsInListContainEntireList = function doesSelectionWhichStartsOrEndsInListContainEntireList(selection) {
|
|
9
|
-
var $from = selection.$from,
|
|
10
|
-
$to = selection.$to,
|
|
11
|
-
from = selection.from,
|
|
12
|
-
to = selection.to;
|
|
13
|
-
var selectionParentListItemNodeResolvedPos = (0, _find.findRootParentListNode)($from) || (0, _find.findRootParentListNode)($to);
|
|
14
|
-
var selectionParentListNode = selectionParentListItemNodeResolvedPos === null || selectionParentListItemNodeResolvedPos === void 0 ? void 0 : selectionParentListItemNodeResolvedPos.parent;
|
|
15
|
-
if (!selectionParentListItemNodeResolvedPos || !selectionParentListNode) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
var startOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + $from.depth - 1 : selectionParentListItemNodeResolvedPos.pos + $to.depth - 1;
|
|
19
|
-
var endOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $to.depth - 1 : selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $from.depth - 1;
|
|
20
|
-
if (!startOfEntireList || !endOfEntireList) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (from < to) {
|
|
24
|
-
return startOfEntireList >= $from.pos && endOfEntireList <= $to.pos;
|
|
25
|
-
} else if (from > to) {
|
|
26
|
-
return startOfEntireList >= $to.pos && endOfEntireList <= $from.pos;
|
|
27
|
-
} else {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.doesSelectionWhichStartsOrEndsInListContainEntireList = doesSelectionWhichStartsOrEndsInListContainEntireList;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { css } from '@emotion/react';
|
|
2
|
-
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
|
-
import { codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
5
|
-
export const listsStyles = css`
|
|
6
|
-
.ProseMirror {
|
|
7
|
-
li {
|
|
8
|
-
position: relative;
|
|
9
|
-
|
|
10
|
-
> p:not(:first-child) {
|
|
11
|
-
margin: 4px 0 0 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// In SSR the above rule will apply to all p tags because first-child would be a style tag.
|
|
15
|
-
// The following rule resets the first p tag back to its original margin
|
|
16
|
-
// defined in packages/editor/editor-common/src/styles/shared/paragraph.ts
|
|
17
|
-
> style:first-child + p {
|
|
18
|
-
margin-top: ${blockNodesVerticalMargin};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
& :not([data-node-type='decisionList']) > li {
|
|
23
|
-
${browser.safari ? codeBlockInListSafariFix : ''}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { indentList, outdentList, toggleOrderedList, toggleBulletList } from '../plugins/list/commands';
|
|
2
|
-
|
|
3
|
-
// getListCommands provides commands for manipulating lists in the document.
|
|
4
|
-
export const getListCommands = () => {
|
|
5
|
-
return {
|
|
6
|
-
indentList,
|
|
7
|
-
outdentList,
|
|
8
|
-
toggleOrderedList,
|
|
9
|
-
toggleBulletList
|
|
10
|
-
};
|
|
11
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { findRootParentListNode } from '../plugins/list/utils/find';
|
|
2
|
-
export const doesSelectionWhichStartsOrEndsInListContainEntireList = selection => {
|
|
3
|
-
const {
|
|
4
|
-
$from,
|
|
5
|
-
$to,
|
|
6
|
-
from,
|
|
7
|
-
to
|
|
8
|
-
} = selection;
|
|
9
|
-
const selectionParentListItemNodeResolvedPos = findRootParentListNode($from) || findRootParentListNode($to);
|
|
10
|
-
const selectionParentListNode = selectionParentListItemNodeResolvedPos === null || selectionParentListItemNodeResolvedPos === void 0 ? void 0 : selectionParentListItemNodeResolvedPos.parent;
|
|
11
|
-
if (!selectionParentListItemNodeResolvedPos || !selectionParentListNode) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
const startOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + $from.depth - 1 : selectionParentListItemNodeResolvedPos.pos + $to.depth - 1;
|
|
15
|
-
const endOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $to.depth - 1 : selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $from.depth - 1;
|
|
16
|
-
if (!startOfEntireList || !endOfEntireList) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if (from < to) {
|
|
20
|
-
return startOfEntireList >= $from.pos && endOfEntireList <= $to.pos;
|
|
21
|
-
} else if (from > to) {
|
|
22
|
-
return startOfEntireList >= $to.pos && endOfEntireList <= $from.pos;
|
|
23
|
-
} else {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
6
|
-
import { codeBlockInListSafariFix } from '@atlaskit/editor-common/styles';
|
|
7
|
-
export var listsStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n li {\n position: relative;\n\n > p:not(:first-child) {\n margin: 4px 0 0 0;\n }\n\n // In SSR the above rule will apply to all p tags because first-child would be a style tag.\n // The following rule resets the first p tag back to its original margin\n // defined in packages/editor/editor-common/src/styles/shared/paragraph.ts\n > style:first-child + p {\n margin-top: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n }\n"])), blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { indentList, outdentList, toggleOrderedList, toggleBulletList } from '../plugins/list/commands';
|
|
2
|
-
|
|
3
|
-
// getListCommands provides commands for manipulating lists in the document.
|
|
4
|
-
export var getListCommands = function getListCommands() {
|
|
5
|
-
return {
|
|
6
|
-
indentList: indentList,
|
|
7
|
-
outdentList: outdentList,
|
|
8
|
-
toggleOrderedList: toggleOrderedList,
|
|
9
|
-
toggleBulletList: toggleBulletList
|
|
10
|
-
};
|
|
11
|
-
};
|
package/dist/esm/utils/lists.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { findRootParentListNode } from '../plugins/list/utils/find';
|
|
2
|
-
export var doesSelectionWhichStartsOrEndsInListContainEntireList = function doesSelectionWhichStartsOrEndsInListContainEntireList(selection) {
|
|
3
|
-
var $from = selection.$from,
|
|
4
|
-
$to = selection.$to,
|
|
5
|
-
from = selection.from,
|
|
6
|
-
to = selection.to;
|
|
7
|
-
var selectionParentListItemNodeResolvedPos = findRootParentListNode($from) || findRootParentListNode($to);
|
|
8
|
-
var selectionParentListNode = selectionParentListItemNodeResolvedPos === null || selectionParentListItemNodeResolvedPos === void 0 ? void 0 : selectionParentListItemNodeResolvedPos.parent;
|
|
9
|
-
if (!selectionParentListItemNodeResolvedPos || !selectionParentListNode) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
var startOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + $from.depth - 1 : selectionParentListItemNodeResolvedPos.pos + $to.depth - 1;
|
|
13
|
-
var endOfEntireList = $from.pos < $to.pos ? selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $to.depth - 1 : selectionParentListItemNodeResolvedPos.pos + selectionParentListNode.nodeSize - $from.depth - 1;
|
|
14
|
-
if (!startOfEntireList || !endOfEntireList) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (from < to) {
|
|
18
|
-
return startOfEntireList >= $from.pos && endOfEntireList <= $to.pos;
|
|
19
|
-
} else if (from > to) {
|
|
20
|
-
return startOfEntireList >= $to.pos && endOfEntireList <= $from.pos;
|
|
21
|
-
} else {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const listsStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const getListCommands: () => {
|
|
2
|
-
indentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) => import("..").Command;
|
|
3
|
-
outdentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod: (import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) | undefined, featureFlags: import("@atlaskit/editor-common/types").FeatureFlags) => import("..").Command;
|
|
4
|
-
toggleOrderedList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
5
|
-
toggleBulletList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
6
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const listsStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const getListCommands: () => {
|
|
2
|
-
indentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) => import("..").Command;
|
|
3
|
-
outdentList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (inputMethod: (import("@atlaskit/editor-common/analytics").INPUT_METHOD.KEYBOARD | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR) | undefined, featureFlags: import("@atlaskit/editor-common/types").FeatureFlags) => import("..").Command;
|
|
4
|
-
toggleOrderedList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
5
|
-
toggleBulletList: (editorAnalyticsAPI: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI | undefined) => (view: import("prosemirror-view").EditorView, inputMethod?: import("../plugins/list/commands").InputMethod) => boolean;
|
|
6
|
-
};
|