@atlaskit/editor-common 108.5.1 → 108.6.1
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 +22 -0
- package/dist/cjs/ai-messages/ai-failed-state.js +5 -0
- package/dist/cjs/hooks/useSharedPluginState.js +1 -1
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/cjs/link/LinkSearch/LinkSearchList.js +66 -2
- package/dist/cjs/link/LinkSearch/LinkSearchListItem.js +87 -1
- package/dist/cjs/messages/block-menu.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/core-plugin/index.js +13 -2
- package/dist/cjs/safe-plugin/index.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/ai-messages/ai-failed-state.js +5 -0
- package/dist/es2019/hooks/useSharedPluginState.js +1 -1
- package/dist/es2019/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/es2019/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/es2019/link/LinkSearch/LinkSearchList.js +58 -1
- package/dist/es2019/link/LinkSearch/LinkSearchListItem.js +89 -1
- package/dist/es2019/messages/block-menu.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/core-plugin/index.js +13 -2
- package/dist/es2019/safe-plugin/index.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/ai-messages/ai-failed-state.js +5 -0
- package/dist/esm/hooks/useSharedPluginState.js +1 -1
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +3 -0
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +42 -2
- package/dist/esm/link/LinkSearch/LinkSearchList.js +63 -1
- package/dist/esm/link/LinkSearch/LinkSearchListItem.js +87 -1
- package/dist/esm/messages/block-menu.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/core-plugin/index.js +13 -2
- package/dist/esm/safe-plugin/index.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/types/ai-messages/ai-failed-state.d.ts +5 -0
- package/dist/types/hooks/useSharedPluginState.d.ts +1 -1
- package/dist/types/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
- package/dist/types/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
- package/dist/types/link/LinkSearch/LinkSearchList.d.ts +22 -1
- package/dist/types/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
- package/dist/types/safe-plugin/index.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +2 -1
- package/dist/types-ts4.5/ai-messages/ai-failed-state.d.ts +5 -0
- package/dist/types-ts4.5/hooks/useSharedPluginState.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts +3 -0
- package/dist/types-ts4.5/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +3 -0
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchList.d.ts +22 -1
- package/dist/types-ts4.5/link/LinkSearch/LinkSearchListItem.d.ts +16 -1
- package/dist/types-ts4.5/safe-plugin/index.d.ts +1 -1
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +2 -1
- package/package.json +6 -3
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { type KeyboardEvent } from 'react';
|
|
6
6
|
import { type SerializedStyles } from '@emotion/react';
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import type { LinkSearchListItemData } from './types';
|
|
@@ -10,6 +10,21 @@ export declare const container: SerializedStyles;
|
|
|
10
10
|
export declare const containerSelected: SerializedStyles;
|
|
11
11
|
export declare const nameStyle: SerializedStyles;
|
|
12
12
|
export declare const containerName: SerializedStyles;
|
|
13
|
+
export interface PropsNext {
|
|
14
|
+
id?: string;
|
|
15
|
+
item: LinkSearchListItemData;
|
|
16
|
+
onFocus?: () => void;
|
|
17
|
+
onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
18
|
+
onMouseEnter?: (objectId: string) => void;
|
|
19
|
+
onMouseLeave?: (objectId: string) => void;
|
|
20
|
+
onMouseMove?: (objectId: string) => void;
|
|
21
|
+
onSelect: (href: string, text: string) => void;
|
|
22
|
+
role?: string;
|
|
23
|
+
selected: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const ForwardedLinkSearchListItemNextWithIntl: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>>, "ref"> & React.RefAttributes<any>> & {
|
|
26
|
+
WrappedComponent: React.ComponentType<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
};
|
|
13
28
|
export interface Props {
|
|
14
29
|
id?: string;
|
|
15
30
|
item: LinkSearchListItemData;
|
|
@@ -9,7 +9,7 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
|
9
9
|
* This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node.
|
|
10
10
|
*
|
|
11
11
|
*
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {object} params - The parameters for the function.
|
|
13
13
|
* @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
|
|
14
14
|
* @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
|
|
15
15
|
*/
|
|
@@ -57,9 +57,10 @@ export type CorePlugin = NextEditorPlugin<'core', {
|
|
|
57
57
|
* Get the anchor ID for a ProseMirror node.
|
|
58
58
|
*
|
|
59
59
|
* @param node - The ProseMirror node to get the anchor ID for.
|
|
60
|
+
* @param pos - The position of the node in the document.
|
|
60
61
|
* @returns The anchor ID if found, otherwise undefined.
|
|
61
62
|
*/
|
|
62
|
-
getAnchorIdForNode: (node: PMNode) => string | undefined;
|
|
63
|
+
getAnchorIdForNode: (node: PMNode, pos: number) => string | undefined;
|
|
63
64
|
/**
|
|
64
65
|
* Replaces the current content of the editor with the provided raw value.
|
|
65
66
|
*
|
|
@@ -8,7 +8,7 @@ type Options = {
|
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
|
-
* NOTE: Generally you
|
|
11
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
12
12
|
* but selects a slice of the state which is more performant.
|
|
13
13
|
*
|
|
14
14
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
package/dist/types-ts4.5/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ type Options = {
|
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
+
*
|
|
34
|
+
* NOTE: Generally you want to use `usePluginStateWithSelector` over this which behaves similarly
|
|
35
|
+
* but selects a slice of the state which is more performant.
|
|
33
36
|
*
|
|
34
37
|
* ⚠️⚠️⚠️ This is a debounced hook ⚠️⚠️⚠️
|
|
35
38
|
* If the plugins you are listening to generate multiple shared states while the user is typing,
|
|
@@ -84,6 +84,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
|
|
|
84
84
|
private urlInputContainer;
|
|
85
85
|
private displayTextInputContainer;
|
|
86
86
|
private wrapperRef;
|
|
87
|
+
private listItemRefs;
|
|
87
88
|
private handleClearText;
|
|
88
89
|
private handleClearDisplayText;
|
|
89
90
|
private debouncedQuickSearch;
|
|
@@ -101,6 +102,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
|
|
|
101
102
|
private createClearHandler;
|
|
102
103
|
private handleClickOutside;
|
|
103
104
|
private getScreenReaderText;
|
|
105
|
+
private listItemRefCallback;
|
|
104
106
|
render(): jsx.JSX.Element;
|
|
105
107
|
private isUrlPopulatedWithSelectedItem;
|
|
106
108
|
private handleSelected;
|
|
@@ -109,6 +111,7 @@ export declare class HyperlinkLinkAddToolbar extends PureComponent<Props, State>
|
|
|
109
111
|
private handleMouseLeaveResultItem;
|
|
110
112
|
private handleSubmit;
|
|
111
113
|
private handleClearTextKeyDown;
|
|
114
|
+
private handleListItemFocus;
|
|
112
115
|
private handleKeyDown;
|
|
113
116
|
private updateTextInput;
|
|
114
117
|
private handleCancel;
|
|
@@ -2,10 +2,26 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import { PureComponent } from 'react';
|
|
5
|
+
import { PureComponent, type KeyboardEvent } from 'react';
|
|
6
6
|
import { jsx, type SerializedStyles } from '@emotion/react';
|
|
7
7
|
import type { LinkSearchListItemData } from './types';
|
|
8
8
|
export declare const linkSearchList: SerializedStyles;
|
|
9
|
+
export interface PropsNext {
|
|
10
|
+
ariaControls?: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
items?: LinkSearchListItemData[];
|
|
14
|
+
listItemRefCallback?: (el: HTMLElement | null, id: string) => void;
|
|
15
|
+
onFocus?: (index: number) => void;
|
|
16
|
+
onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
17
|
+
onMouseEnter?: (objectId: string) => void;
|
|
18
|
+
onMouseLeave?: (objectId: string) => void;
|
|
19
|
+
onMouseMove?: (objectId: string) => void;
|
|
20
|
+
onSelect: (href: string, text: string) => void;
|
|
21
|
+
role?: string;
|
|
22
|
+
selectedIndex: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const LinkSearchListNext: ({ listItemRefCallback, onFocus, onKeyDown, onSelect, onMouseMove, onMouseEnter, onMouseLeave, items, selectedIndex, isLoading, ariaControls, role, id, }: PropsNext) => jsx.JSX.Element;
|
|
9
25
|
export interface Props {
|
|
10
26
|
ariaControls?: string;
|
|
11
27
|
id?: string;
|
|
@@ -18,6 +34,11 @@ export interface Props {
|
|
|
18
34
|
role?: string;
|
|
19
35
|
selectedIndex: number;
|
|
20
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* *Warning:* With `platform_editor_a11y_insert_link_item_focus` enabled this component is no longer used and is replaced with `<LinkSearchListNext />`.
|
|
39
|
+
*
|
|
40
|
+
* If making changes to this component please ensure to also update `<LinkSearchListNext />`.
|
|
41
|
+
*/
|
|
21
42
|
export default class LinkSearchList extends PureComponent<Props, Object> {
|
|
22
43
|
render(): jsx.JSX.Element;
|
|
23
44
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { type KeyboardEvent } from 'react';
|
|
6
6
|
import { type SerializedStyles } from '@emotion/react';
|
|
7
7
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
import type { LinkSearchListItemData } from './types';
|
|
@@ -10,6 +10,21 @@ export declare const container: SerializedStyles;
|
|
|
10
10
|
export declare const containerSelected: SerializedStyles;
|
|
11
11
|
export declare const nameStyle: SerializedStyles;
|
|
12
12
|
export declare const containerName: SerializedStyles;
|
|
13
|
+
export interface PropsNext {
|
|
14
|
+
id?: string;
|
|
15
|
+
item: LinkSearchListItemData;
|
|
16
|
+
onFocus?: () => void;
|
|
17
|
+
onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
18
|
+
onMouseEnter?: (objectId: string) => void;
|
|
19
|
+
onMouseLeave?: (objectId: string) => void;
|
|
20
|
+
onMouseMove?: (objectId: string) => void;
|
|
21
|
+
onSelect: (href: string, text: string) => void;
|
|
22
|
+
role?: string;
|
|
23
|
+
selected: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const ForwardedLinkSearchListItemNextWithIntl: React.ForwardRefExoticComponent<Omit<import("react-intl-next").WithIntlProps<React.PropsWithChildren<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>>, "ref"> & React.RefAttributes<any>> & {
|
|
26
|
+
WrappedComponent: React.ComponentType<PropsNext & WrappedComponentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
};
|
|
13
28
|
export interface Props {
|
|
14
29
|
id?: string;
|
|
15
30
|
item: LinkSearchListItemData;
|
|
@@ -9,7 +9,7 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
|
9
9
|
* This function is useful for annotating DOM elements with metadata that describes the type and characteristics of the ProseMirror node.
|
|
10
10
|
*
|
|
11
11
|
*
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {object} params - The parameters for the function.
|
|
13
13
|
* @param {PMNode} params.node - The ProseMirror node from which to derive metadata.
|
|
14
14
|
* @param {HTMLElement} params.dom - The DOM element to which the metadata attributes will be attached.
|
|
15
15
|
*/
|
|
@@ -57,9 +57,10 @@ export type CorePlugin = NextEditorPlugin<'core', {
|
|
|
57
57
|
* Get the anchor ID for a ProseMirror node.
|
|
58
58
|
*
|
|
59
59
|
* @param node - The ProseMirror node to get the anchor ID for.
|
|
60
|
+
* @param pos - The position of the node in the document.
|
|
60
61
|
* @returns The anchor ID if found, otherwise undefined.
|
|
61
62
|
*/
|
|
62
|
-
getAnchorIdForNode: (node: PMNode) => string | undefined;
|
|
63
|
+
getAnchorIdForNode: (node: PMNode, pos: number) => string | undefined;
|
|
63
64
|
/**
|
|
64
65
|
* Replaces the current content of the editor with the provided raw value.
|
|
65
66
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "108.
|
|
3
|
+
"version": "108.6.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -170,14 +170,14 @@
|
|
|
170
170
|
"@atlaskit/profilecard": "^24.11.0",
|
|
171
171
|
"@atlaskit/react-ufo": "^4.5.0",
|
|
172
172
|
"@atlaskit/section-message": "^8.7.0",
|
|
173
|
-
"@atlaskit/smart-card": "^40.
|
|
173
|
+
"@atlaskit/smart-card": "^40.21.0",
|
|
174
174
|
"@atlaskit/smart-user-picker": "^8.2.0",
|
|
175
175
|
"@atlaskit/spinner": "^19.0.0",
|
|
176
176
|
"@atlaskit/status": "^3.0.0",
|
|
177
177
|
"@atlaskit/task-decision": "^19.2.0",
|
|
178
178
|
"@atlaskit/textfield": "^8.0.0",
|
|
179
179
|
"@atlaskit/theme": "^20.0.0",
|
|
180
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
180
|
+
"@atlaskit/tmp-editor-statsig": "^12.7.0",
|
|
181
181
|
"@atlaskit/tokens": "^6.3.0",
|
|
182
182
|
"@atlaskit/tooltip": "^20.4.0",
|
|
183
183
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -369,6 +369,9 @@
|
|
|
369
369
|
},
|
|
370
370
|
"platform_editor_resolve_hyperlinks_killswitch": {
|
|
371
371
|
"type": "boolean"
|
|
372
|
+
},
|
|
373
|
+
"platform_editor_a11y_insert_link_item_focus": {
|
|
374
|
+
"type": "boolean"
|
|
372
375
|
}
|
|
373
376
|
}
|
|
374
377
|
}
|