@atlaskit/editor-core 178.0.1 → 178.1.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 +40 -0
- package/dist/cjs/create-editor/create-plugins-list.js +3 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +26 -13
- package/dist/cjs/plugins/annotation/index.js +4 -2
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/cjs/plugins/block-type/commands/delete-block-content.js +53 -0
- package/dist/cjs/plugins/block-type/commands/index.js +9 -1
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -3
- package/dist/cjs/plugins/card/pm-plugins/doc.js +21 -4
- package/dist/cjs/plugins/card/toolbar.js +4 -2
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -1
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +16 -9
- package/dist/cjs/plugins/collab-edit/actions.js +1 -1
- package/dist/cjs/plugins/collab-edit/index.js +1 -1
- package/dist/cjs/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/cjs/plugins/hyperlink/index.js +2 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +15 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +27 -22
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/cjs/plugins/list/styles.js +1 -1
- package/dist/cjs/plugins/media/commands/helpers.js +24 -2
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +232 -183
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +1 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/keymap.js +46 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/events/create-selection-between.js +86 -0
- package/dist/cjs/plugins/selection/pm-plugins/events/keydown.js +84 -0
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +6 -56
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +7 -2
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +4 -2
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +22 -61
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +22 -56
- package/dist/cjs/ui/Addon/click-area-helper.js +28 -6
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/cjs/utils/document.js +11 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +3 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +28 -13
- package/dist/es2019/plugins/annotation/index.js +4 -2
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/es2019/plugins/block-type/commands/delete-block-content.js +49 -0
- package/dist/es2019/plugins/block-type/commands/index.js +2 -1
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/es2019/plugins/card/pm-plugins/doc.js +19 -3
- package/dist/es2019/plugins/card/toolbar.js +4 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +5 -2
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +15 -9
- package/dist/es2019/plugins/collab-edit/actions.js +1 -1
- package/dist/es2019/plugins/collab-edit/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/es2019/plugins/hyperlink/index.js +2 -1
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +11 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -5
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/es2019/plugins/list/styles.js +15 -11
- package/dist/es2019/plugins/media/commands/helpers.js +18 -1
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +37 -13
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +1 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/keymap.js +45 -0
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/events/create-selection-between.js +79 -0
- package/dist/es2019/plugins/selection/pm-plugins/events/keydown.js +77 -0
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +5 -55
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +6 -2
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +3 -2
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +20 -31
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +20 -27
- package/dist/es2019/ui/Addon/click-area-helper.js +28 -6
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/es2019/utils/document.js +9 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +3 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +26 -13
- package/dist/esm/plugins/annotation/index.js +4 -2
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +6 -2
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +8 -1
- package/dist/esm/plugins/block-type/commands/delete-block-content.js +46 -0
- package/dist/esm/plugins/block-type/commands/index.js +2 -1
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +3 -3
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +8 -4
- package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -2
- package/dist/esm/plugins/card/pm-plugins/doc.js +20 -3
- package/dist/esm/plugins/card/toolbar.js +4 -2
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +5 -2
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +16 -9
- package/dist/esm/plugins/collab-edit/actions.js +1 -1
- package/dist/esm/plugins/collab-edit/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +1 -1
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +5 -0
- package/dist/esm/plugins/floating-toolbar/ui/Select.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +18 -9
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +1 -0
- package/dist/esm/plugins/hyperlink/index.js +2 -1
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +15 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +27 -22
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +6 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/esm/plugins/list/styles.js +1 -1
- package/dist/esm/plugins/media/commands/helpers.js +20 -1
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +14 -16
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +235 -184
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +1 -2
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/keymap.js +45 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/events/create-selection-between.js +76 -0
- package/dist/esm/plugins/selection/pm-plugins/events/keydown.js +74 -0
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +4 -57
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +1 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/dropdown-menu.js +7 -2
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +4 -2
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +17 -58
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +17 -53
- package/dist/esm/ui/Addon/click-area-helper.js +28 -6
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +2 -1
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +22 -9
- package/dist/esm/utils/document.js +11 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +1 -1
- package/dist/types/plugins/block-type/commands/delete-block-content.d.ts +10 -0
- package/dist/types/plugins/block-type/commands/index.d.ts +1 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +1 -0
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +6 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -0
- package/dist/types/plugins/media/commands/helpers.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +3 -1
- package/dist/types/plugins/media/types.d.ts +2 -0
- package/dist/types/plugins/selection/pm-plugins/events/create-selection-between.d.ts +4 -0
- package/dist/types/plugins/selection/pm-plugins/events/keydown.d.ts +2 -0
- package/dist/types/ui/Addon/ClickAreaBlock/index.d.ts +2 -5
- package/dist/types/ui/Addon/ClickAreaInline/index.d.ts +2 -5
- package/dist/types/ui/Addon/click-area-helper.d.ts +1 -1
- package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +1 -0
- package/docs/0-intro.tsx +9 -0
- package/package.json +17 -19
- package/report.api.md +4 -1
|
@@ -27,6 +27,7 @@ import { ELEMENT_ITEM_HEIGHT } from './constants';
|
|
|
27
27
|
var InsertMenu = function InsertMenu(_ref) {
|
|
28
28
|
var editorView = _ref.editorView,
|
|
29
29
|
dropdownItems = _ref.dropdownItems,
|
|
30
|
+
showElementBrowserLink = _ref.showElementBrowserLink,
|
|
30
31
|
onInsert = _ref.onInsert,
|
|
31
32
|
toggleVisiblity = _ref.toggleVisiblity;
|
|
32
33
|
|
|
@@ -56,7 +57,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
56
57
|
};
|
|
57
58
|
}, [onInsert]);
|
|
58
59
|
var quickInsertDropdownItems = dropdownItems.map(transform);
|
|
59
|
-
var viewMoreItem = quickInsertDropdownItems.pop();
|
|
60
|
+
var viewMoreItem = showElementBrowserLink && quickInsertDropdownItems.pop();
|
|
60
61
|
var onInsertItem = useCallback(function (item) {
|
|
61
62
|
toggleVisiblity();
|
|
62
63
|
|
|
@@ -28,18 +28,24 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
28
28
|
var wrapperRef = useRef(null);
|
|
29
29
|
var selectedItemIndex = useRef(0);
|
|
30
30
|
var incrementIndex = useCallback(function (list) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
var index = 0;
|
|
32
|
+
|
|
33
|
+
if (document.activeElement) {
|
|
34
|
+
index = list.indexOf(document.activeElement);
|
|
35
|
+
index = (index + 1) % list.length;
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
selectedItemIndex.current = index;
|
|
36
39
|
}, []);
|
|
37
40
|
var decrementIndex = useCallback(function (list) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
var index = 0;
|
|
42
|
+
|
|
43
|
+
if (document.activeElement) {
|
|
44
|
+
index = list.indexOf(document.activeElement);
|
|
45
|
+
index = (list.length + index - 1) % list.length;
|
|
42
46
|
}
|
|
47
|
+
|
|
48
|
+
selectedItemIndex.current = index;
|
|
43
49
|
}, []);
|
|
44
50
|
|
|
45
51
|
var handleArrowRight = function handleArrowRight() {
|
|
@@ -105,12 +111,19 @@ export var ToolbarArrowKeyNavigationProvider = function ToolbarArrowKeyNavigatio
|
|
|
105
111
|
return;
|
|
106
112
|
}
|
|
107
113
|
|
|
114
|
+
var menuWrapper = document.querySelector('.menu-key-handler-wrapper');
|
|
115
|
+
|
|
116
|
+
if (menuWrapper) {
|
|
117
|
+
// if menu wrapper exists, then a menu is open and arrow keys will be handled by MenuArrowKeyNavigationProvider
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
|
|
108
121
|
var filteredFocusableElements = getFilteredFocusableElements(wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current);
|
|
109
122
|
|
|
110
123
|
if (!filteredFocusableElements || (filteredFocusableElements === null || filteredFocusableElements === void 0 ? void 0 : filteredFocusableElements.length) === 0) {
|
|
111
124
|
return;
|
|
112
125
|
} //This is kind of hack to reset the current focused toolbar item
|
|
113
|
-
//to handle some
|
|
126
|
+
//to handle some use cases such as Tab in/out of main toolbar
|
|
114
127
|
|
|
115
128
|
|
|
116
129
|
if (!((_wrapperRef$current = wrapperRef.current) !== null && _wrapperRef$current !== void 0 && _wrapperRef$current.contains(targetElement))) {
|
|
@@ -214,11 +214,20 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
|
|
|
214
214
|
|
|
215
215
|
if (isTransformed && dispatchAnalyticsEvent) {
|
|
216
216
|
dispatchAnalyticsEvent({
|
|
217
|
-
action: ACTION.
|
|
217
|
+
action: ACTION.DEDUPE_MARKS_TRANSFORMED_V2,
|
|
218
218
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
219
219
|
eventType: EVENT_TYPE.OPERATIONAL,
|
|
220
220
|
attributes: {
|
|
221
|
-
|
|
221
|
+
/** UGC WARNING
|
|
222
|
+
*
|
|
223
|
+
* DO NOT include the `mark` attributes inside, we map here to only
|
|
224
|
+
* extract the mark type as that is the only non-UGC safe information
|
|
225
|
+
* that we can add to event-attributes
|
|
226
|
+
*
|
|
227
|
+
*/
|
|
228
|
+
discardedMarkTypes: discardedMarks.map(function (mark) {
|
|
229
|
+
return mark.type;
|
|
230
|
+
})
|
|
222
231
|
}
|
|
223
232
|
});
|
|
224
233
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -24,7 +24,7 @@ export declare class AlignmentToolbar extends React.Component<Props & WrappedCom
|
|
|
24
24
|
private toggleOpen;
|
|
25
25
|
private handleOpenChange;
|
|
26
26
|
private hide;
|
|
27
|
-
private
|
|
27
|
+
private hideOnEscape;
|
|
28
28
|
}
|
|
29
29
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
30
30
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node as PMNode } from 'prosemirror-model';
|
|
2
|
+
import { Command } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Prevent removing the block when deleting block content
|
|
5
|
+
*
|
|
6
|
+
* @param state EditorState<any>
|
|
7
|
+
* @param dispatch CommandDispatch
|
|
8
|
+
* @returns boolean
|
|
9
|
+
*/
|
|
10
|
+
export declare function deleteBlockContent(isNodeAWrappingBlockNode: (node?: PMNode | null) => boolean): Command;
|
|
@@ -3,3 +3,4 @@ export type { InputMethod } from './block-type';
|
|
|
3
3
|
export { insertBlock } from './insert-block';
|
|
4
4
|
export { isConvertableToCodeBlock, transformToCodeBlockAction, } from './transform-to-code-block';
|
|
5
5
|
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
|
6
|
+
export { deleteBlockContent } from './delete-block-content';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node } from 'prosemirror-model';
|
|
2
1
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { Node } from 'prosemirror-model';
|
|
3
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
4
|
import { CardAdf, CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import { ACTION, InputMethodInsertLink } from '../../../plugins/analytics';
|
|
@@ -13,6 +13,7 @@ export interface LinkToolbarAppearanceProps {
|
|
|
13
13
|
editorView?: EditorView;
|
|
14
14
|
url?: string;
|
|
15
15
|
allowEmbeds?: boolean;
|
|
16
|
+
allowBlockCards?: boolean;
|
|
16
17
|
platform?: CardPlatform;
|
|
17
18
|
}
|
|
18
19
|
export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, {}> {
|
|
@@ -16,5 +16,6 @@ export interface Props {
|
|
|
16
16
|
filterOption?: ((option: SelectOption, rawInput: string) => boolean) | null;
|
|
17
17
|
setDisableParentScroll?: (disable: boolean) => void;
|
|
18
18
|
ariaLabel?: string;
|
|
19
|
+
classNamePrefix?: string;
|
|
19
20
|
}
|
|
20
21
|
export default function Search(props: Props): JSX.Element;
|
|
@@ -7,6 +7,11 @@ import { LinkPickerProps } from '@atlaskit/link-picker';
|
|
|
7
7
|
declare type OptionalKeys<T extends {}, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
8
8
|
export interface EditorLinkPickerProps extends OptionalKeys<LinkPickerProps, 'onCancel'> {
|
|
9
9
|
view: EditorView;
|
|
10
|
+
/**
|
|
11
|
+
* Used for analytics purposes to describe how the link picker was invoked
|
|
12
|
+
* Should be roughly equivalent to the `inputMethod` analytics value
|
|
13
|
+
*/
|
|
14
|
+
invokeMethod?: string;
|
|
10
15
|
}
|
|
11
|
-
export declare const EditorLinkPicker: ({ view, onCancel, ...restProps }: EditorLinkPickerProps) => JSX.Element;
|
|
16
|
+
export declare const EditorLinkPicker: ({ view, onCancel, invokeMethod, ...restProps }: EditorLinkPickerProps) => JSX.Element;
|
|
12
17
|
export {};
|
|
@@ -3,7 +3,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { LinkInputType, LinkPickerOptions } from '../../types';
|
|
5
5
|
import { EditorLinkPickerProps } from '../EditorLinkPicker';
|
|
6
|
-
export interface Props extends Pick<EditorLinkPickerProps, 'onCancel'> {
|
|
6
|
+
export interface Props extends Pick<EditorLinkPickerProps, 'onCancel' | 'invokeMethod'> {
|
|
7
7
|
view: EditorView;
|
|
8
8
|
providerFactory: ProviderFactory;
|
|
9
9
|
onSubmit: (href: string, title: string | undefined, displayText: string | undefined, inputMethod: LinkInputType) => void;
|
package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface BlockInsertElementBrowserProps {
|
|
|
14
14
|
popupsMountPoint?: HTMLElement;
|
|
15
15
|
popupsScrollableElement?: HTMLElement;
|
|
16
16
|
plusButtonRef?: HTMLElement;
|
|
17
|
+
showElementBrowserLink: boolean;
|
|
17
18
|
onRef(el: HTMLElement): void;
|
|
18
19
|
onClick: React.MouseEventHandler;
|
|
19
20
|
onInsert: OnInsert;
|
|
@@ -14,6 +14,7 @@ export interface BlockInsertMenuProps {
|
|
|
14
14
|
popupsScrollableElement?: HTMLElement;
|
|
15
15
|
replacePlusMenuWithElementBrowser: boolean;
|
|
16
16
|
spacing: 'none' | 'default';
|
|
17
|
+
showElementBrowserLink: boolean;
|
|
17
18
|
onRef(el: HTMLElement): void;
|
|
18
19
|
onPlusButtonRef(el: HTMLElement): void;
|
|
19
20
|
onClick: React.MouseEventHandler;
|
|
@@ -17,5 +17,6 @@ export declare const findAllMediaSingleNodes: (mediaPluginState: MediaPluginStat
|
|
|
17
17
|
export declare const findMediaNode: (mediaPluginState: MediaPluginState, id: string, isMediaSingle: boolean) => MediaNodeWithPosHandler | null;
|
|
18
18
|
export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null | undefined;
|
|
19
19
|
export declare const updateAllMediaNodesAttrs: (id: string, attrs: object, isMediaSingle: boolean) => Command;
|
|
20
|
+
export declare const updateCurrentMediaNodeAttrs: (attrs: object, mediaNode: MediaNodeWithPosHandler) => Command;
|
|
20
21
|
export declare const updateMediaNodeAttrs: (id: string, attrs: object, isMediaSingle: boolean) => Command;
|
|
21
22
|
export declare const replaceExternalMedia: (pos: number, attrs: object) => Command;
|
|
@@ -26,8 +26,10 @@ export declare class MediaNodeUpdater {
|
|
|
26
26
|
constructor(props: MediaNodeUpdaterProps);
|
|
27
27
|
isMediaBlobUrl(): boolean;
|
|
28
28
|
updateContextId: () => Promise<void>;
|
|
29
|
-
hasFileAttributesDefined
|
|
29
|
+
private hasFileAttributesDefined;
|
|
30
|
+
private getNewFileAttrsForNode;
|
|
30
31
|
updateFileAttrs: (isMediaSingle?: boolean) => Promise<void>;
|
|
32
|
+
updateNodeAttrs: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
31
33
|
getAttrs: () => MediaADFAttrs | undefined;
|
|
32
34
|
getObjectId: () => Promise<string | null>;
|
|
33
35
|
uploadExternalMedia: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
|
|
@@ -6,6 +6,7 @@ import { FileIdentifier } from '@atlaskit/media-client';
|
|
|
6
6
|
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
7
|
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
8
8
|
import { UploadParams, MediaFile } from '@atlaskit/media-picker/types';
|
|
9
|
+
import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
9
10
|
import { PlaceholderTextOptions } from '../../plugins/placeholder-text/types';
|
|
10
11
|
export declare type MediaStateStatus = 'unknown' | 'ready' | 'cancelled' | 'preview' | 'error' | 'mobile-upload-end';
|
|
11
12
|
export interface MediaOptions {
|
|
@@ -34,6 +35,7 @@ export interface MediaOptions {
|
|
|
34
35
|
useForgePlugins?: boolean;
|
|
35
36
|
allowTemplatePlaceholders?: boolean | PlaceholderTextOptions;
|
|
36
37
|
alignLeftOnInsert?: boolean;
|
|
38
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
37
39
|
featureFlags?: MediaFeatureFlags;
|
|
38
40
|
}
|
|
39
41
|
export interface MediaSingleOptions {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TextSelection } from 'prosemirror-state';
|
|
2
|
+
import type { ResolvedPos } from 'prosemirror-model';
|
|
3
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
|
+
export declare const onCreateSelectionBetween: (view: EditorView, $anchor: ResolvedPos, $head: ResolvedPos) => TextSelection | null;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
3
|
import { EditorView } from 'prosemirror-view';
|
|
5
4
|
export interface Props {
|
|
6
5
|
editorView?: EditorView;
|
|
7
6
|
children?: any;
|
|
8
7
|
editorDisabled?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
render(): jsx.JSX.Element;
|
|
13
|
-
}
|
|
9
|
+
export declare const ClickAreaBlock: React.FC<Props>;
|
|
10
|
+
export default ClickAreaBlock;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
3
|
import { EditorView } from 'prosemirror-view';
|
|
5
4
|
export interface Props {
|
|
6
5
|
editorView?: EditorView;
|
|
7
6
|
}
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
render(): jsx.JSX.Element;
|
|
11
|
-
}
|
|
7
|
+
export declare const ClickAreaInline: React.FC<Props>;
|
|
8
|
+
export default ClickAreaInline;
|
|
@@ -9,5 +9,5 @@ import { EditorView } from 'prosemirror-view';
|
|
|
9
9
|
* 2. if another modal is open (e.g. delete confirmation modal for confluence table) then ignore clicks as they shouldn't influence editor state
|
|
10
10
|
*/
|
|
11
11
|
export declare const checkForModal: (target: HTMLElement) => boolean;
|
|
12
|
-
declare const clickAreaClickHandler: (view: EditorView<any>, event: React.MouseEvent<any>) =>
|
|
12
|
+
declare const clickAreaClickHandler: (view: EditorView<any>, event: React.MouseEvent<any>) => false | undefined;
|
|
13
13
|
export { clickAreaClickHandler };
|
|
@@ -6,7 +6,7 @@ export interface Props {
|
|
|
6
6
|
value: AlignmentState;
|
|
7
7
|
label: string;
|
|
8
8
|
isSelected?: boolean;
|
|
9
|
-
onClick: (value: AlignmentState) => void;
|
|
9
|
+
onClick: (value: AlignmentState, shouldClosePopup: boolean) => void;
|
|
10
10
|
content: React.ReactElement<any>;
|
|
11
11
|
shortcut?: Keymap;
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { InsertMenuProps } from './types';
|
|
3
|
-
declare const InsertMenu: ({ editorView, dropdownItems, onInsert, toggleVisiblity, }: InsertMenuProps) => jsx.JSX.Element;
|
|
3
|
+
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, }: InsertMenuProps) => jsx.JSX.Element;
|
|
4
4
|
export default InsertMenu;
|
|
@@ -23,6 +23,7 @@ export declare type IntlMessage = {
|
|
|
23
23
|
export interface InsertMenuProps {
|
|
24
24
|
dropdownItems: BlockMenuItem[];
|
|
25
25
|
editorView: EditorView;
|
|
26
|
+
showElementBrowserLink: boolean;
|
|
26
27
|
toggleVisiblity: SimpleEventHandler<MouseEvent | KeyboardEvent>;
|
|
27
28
|
onInsert: OnInsert;
|
|
28
29
|
}
|
package/docs/0-intro.tsx
CHANGED
|
@@ -208,6 +208,15 @@ ${code`
|
|
|
208
208
|
|
|
209
209
|
We’d love to hear your feedback.
|
|
210
210
|
|
|
211
|
+
## Theming and dark mode support
|
|
212
|
+
To render certain ADF content correctly in different color themes, such as light and dark mode, this package utilise
|
|
213
|
+
the \`@atlaskit/editor-palette\` package, which converts colors stored in ADF to Atlassian Design Tokens.
|
|
214
|
+
Learn more about this utility in the [Editor Palette docs](/packages/editor/editor-palette).
|
|
215
|
+
|
|
216
|
+
Full light and dark mode support for the Editor is a work in progress. Currently, the following experiences do not yet support theming:
|
|
217
|
+
- Custom table backgrounds
|
|
218
|
+
- Custom panel backgrounds
|
|
219
|
+
|
|
211
220
|
## Tab indexing / focus
|
|
212
221
|
If you are displaying a title you may need to listen for a tab event to
|
|
213
222
|
explicitly enable and focus the editor.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "178.0
|
|
3
|
+
"version": "178.1.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/activity": "^1.0.1",
|
|
28
27
|
"@atlaskit/activity-provider": "^2.3.0",
|
|
29
28
|
"@atlaskit/adf-schema": "^25.1.0",
|
|
30
29
|
"@atlaskit/adf-utils": "^18.0.0",
|
|
31
30
|
"@atlaskit/analytics-gas-types": "^5.0.0",
|
|
32
|
-
"@atlaskit/analytics-listeners": "^8.
|
|
33
|
-
"@atlaskit/analytics-namespaced-context": "^6.
|
|
31
|
+
"@atlaskit/analytics-listeners": "^8.5.0",
|
|
32
|
+
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
34
33
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
35
34
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
36
35
|
"@atlaskit/avatar": "^21.1.0",
|
|
@@ -41,10 +40,10 @@
|
|
|
41
40
|
"@atlaskit/code": "^14.4.0",
|
|
42
41
|
"@atlaskit/date": "^0.9.0",
|
|
43
42
|
"@atlaskit/datetime-picker": "^12.3.0",
|
|
44
|
-
"@atlaskit/editor-common": "^72.
|
|
43
|
+
"@atlaskit/editor-common": "^72.2.0",
|
|
45
44
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
46
45
|
"@atlaskit/editor-markdown-transformer": "^5.0.0",
|
|
47
|
-
"@atlaskit/editor-plugin-table": "^1.
|
|
46
|
+
"@atlaskit/editor-plugin-table": "^1.1.0",
|
|
48
47
|
"@atlaskit/editor-shared-styles": "^2.3.0",
|
|
49
48
|
"@atlaskit/editor-tables": "^2.2.0",
|
|
50
49
|
"@atlaskit/emoji": "^67.0.0",
|
|
@@ -55,21 +54,22 @@
|
|
|
55
54
|
"@atlaskit/link-picker": "^1.16.0",
|
|
56
55
|
"@atlaskit/locale": "^2.3.0",
|
|
57
56
|
"@atlaskit/logo": "^13.10.0",
|
|
58
|
-
"@atlaskit/media-card": "^74.
|
|
57
|
+
"@atlaskit/media-card": "^74.5.0",
|
|
59
58
|
"@atlaskit/media-client": "^20.0.0",
|
|
60
|
-
"@atlaskit/media-common": "^2.
|
|
59
|
+
"@atlaskit/media-common": "^2.19.0",
|
|
61
60
|
"@atlaskit/media-filmstrip": "^46.1.0",
|
|
62
|
-
"@atlaskit/media-picker": "^64.
|
|
63
|
-
"@atlaskit/media-ui": "^22.
|
|
64
|
-
"@atlaskit/media-viewer": "^47.
|
|
61
|
+
"@atlaskit/media-picker": "^64.2.0",
|
|
62
|
+
"@atlaskit/media-ui": "^22.3.0",
|
|
63
|
+
"@atlaskit/media-viewer": "^47.4.0",
|
|
65
64
|
"@atlaskit/mention": "^21.0.0",
|
|
66
65
|
"@atlaskit/menu": "^1.4.0",
|
|
67
66
|
"@atlaskit/modal-dialog": "^12.4.0",
|
|
67
|
+
"@atlaskit/prosemirror-collab": "^0.1.0",
|
|
68
68
|
"@atlaskit/prosemirror-input-rules": "^2.1.0",
|
|
69
69
|
"@atlaskit/radio": "^5.4.0",
|
|
70
70
|
"@atlaskit/section-message": "^6.3.0",
|
|
71
71
|
"@atlaskit/select": "^16.1.0",
|
|
72
|
-
"@atlaskit/smart-card": "^23.
|
|
72
|
+
"@atlaskit/smart-card": "^23.14.0",
|
|
73
73
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
74
74
|
"@atlaskit/spinner": "^15.3.0",
|
|
75
75
|
"@atlaskit/status": "^1.2.0",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"@atlaskit/width-detector": "^4.0.0",
|
|
86
86
|
"@babel/runtime": "^7.0.0",
|
|
87
87
|
"@emotion/react": "^11.7.1",
|
|
88
|
-
"@types/prosemirror-collab": "^1.1.1",
|
|
89
88
|
"@types/prosemirror-commands": "1.0.1",
|
|
90
89
|
"@types/prosemirror-history": "^1.0.1",
|
|
91
90
|
"@types/prosemirror-inputrules": "^1.0.3",
|
|
@@ -107,7 +106,6 @@
|
|
|
107
106
|
"markdown-it": "^12.3.2",
|
|
108
107
|
"memoize-one": "^6.0.0",
|
|
109
108
|
"prop-types": "^15.5.10",
|
|
110
|
-
"prosemirror-collab": "^1.2.2",
|
|
111
109
|
"prosemirror-commands": "1.1.11",
|
|
112
110
|
"prosemirror-history": "^1.1.3",
|
|
113
111
|
"prosemirror-keymap": "1.1.4",
|
|
@@ -134,16 +132,16 @@
|
|
|
134
132
|
},
|
|
135
133
|
"devDependencies": {
|
|
136
134
|
"@atlaskit/atlassian-navigation": "^2.3.0",
|
|
137
|
-
"@atlaskit/breadcrumbs": "11.7.
|
|
135
|
+
"@atlaskit/breadcrumbs": "11.7.8",
|
|
138
136
|
"@atlaskit/code": "^14.4.0",
|
|
139
|
-
"@atlaskit/collab-provider": "8.0
|
|
137
|
+
"@atlaskit/collab-provider": "8.1.0",
|
|
140
138
|
"@atlaskit/docs": "*",
|
|
141
139
|
"@atlaskit/drawer": "^7.4.0",
|
|
142
140
|
"@atlaskit/dropdown-menu": "^11.5.0",
|
|
143
141
|
"@atlaskit/droplist": "^11.0.0",
|
|
144
142
|
"@atlaskit/editor-bitbucket-transformer": "^8.0.0",
|
|
145
143
|
"@atlaskit/editor-extension-dropbox": "^0.3.0",
|
|
146
|
-
"@atlaskit/editor-plugin-table": "^1.
|
|
144
|
+
"@atlaskit/editor-plugin-table": "^1.1.0",
|
|
147
145
|
"@atlaskit/editor-test-helpers": "^18.0.0",
|
|
148
146
|
"@atlaskit/flag": "^15.0.0",
|
|
149
147
|
"@atlaskit/inline-dialog": "^13.4.0",
|
|
@@ -157,7 +155,7 @@
|
|
|
157
155
|
"@atlaskit/page-layout": "^1.3.0",
|
|
158
156
|
"@atlaskit/profilecard": "^18.2.0",
|
|
159
157
|
"@atlaskit/pubsub": "^6.2.0",
|
|
160
|
-
"@atlaskit/renderer": "^105.
|
|
158
|
+
"@atlaskit/renderer": "^105.1.0",
|
|
161
159
|
"@atlaskit/section-message": "^6.3.0",
|
|
162
160
|
"@atlaskit/share": "*",
|
|
163
161
|
"@atlaskit/smart-user-picker": "^6.0.0",
|
|
@@ -169,7 +167,7 @@
|
|
|
169
167
|
"@atlaskit/visual-regression": "*",
|
|
170
168
|
"@atlaskit/webdriver-runner": "*",
|
|
171
169
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
172
|
-
"@atlassian/link-picker-atlassian-plugin": "^26.
|
|
170
|
+
"@atlassian/link-picker-atlassian-plugin": "^26.1.0",
|
|
173
171
|
"@atlassian/link-picker-plugins": "^14.1.0",
|
|
174
172
|
"@atlassian/search-provider": "2.3.9",
|
|
175
173
|
"@atlassian/ufo": "^0.1.0",
|
package/report.api.md
CHANGED
|
@@ -48,6 +48,7 @@ import { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
|
48
48
|
import { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
49
49
|
import { EditorPlugin } from '@atlaskit/editor-common/types';
|
|
50
50
|
import { EditorReactContext } from '@atlaskit/editor-common/types';
|
|
51
|
+
import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
51
52
|
import { EditorState } from 'prosemirror-state';
|
|
52
53
|
import { EditorView } from 'prosemirror-view';
|
|
53
54
|
import { EmojiResource } from '@atlaskit/emoji/resource';
|
|
@@ -1666,6 +1667,8 @@ export interface MediaOptions {
|
|
|
1666
1667
|
// (undocumented)
|
|
1667
1668
|
customMediaPicker?: CustomMediaPicker;
|
|
1668
1669
|
// (undocumented)
|
|
1670
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
1671
|
+
// (undocumented)
|
|
1669
1672
|
enableDownloadButton?: boolean;
|
|
1670
1673
|
// (undocumented)
|
|
1671
1674
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -2869,7 +2872,7 @@ export { WithPluginState };
|
|
|
2869
2872
|
|
|
2870
2873
|
```json
|
|
2871
2874
|
{
|
|
2872
|
-
"@atlaskit/link-provider": "^1.3.
|
|
2875
|
+
"@atlaskit/link-provider": "^1.3.8",
|
|
2873
2876
|
"@atlaskit/media-core": "^34.0.1",
|
|
2874
2877
|
"react": "^16.8.0",
|
|
2875
2878
|
"react-dom": "^16.8.0",
|