@atlaskit/editor-plugin-mentions 5.2.7 → 5.2.9
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/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/types/editor-commands/index.d.ts +3 -3
- package/dist/types/mentionsPluginType.d.ts +6 -6
- package/dist/types/nodeviews/mentionNodeView.d.ts +1 -1
- package/dist/types/nodeviews/profileCardRenderer.d.ts +2 -2
- package/dist/types/pm-plugins/main.d.ts +2 -2
- package/dist/types/types/index.d.ts +6 -6
- package/dist/types/ui/InviteItem/index.d.ts +1 -1
- package/dist/types/ui/PopperWrapper.d.ts +4 -4
- package/dist/types/ui/ProfileCardComponent.d.ts +2 -2
- package/dist/types/ui/SecondaryToolbarComponent.d.ts +2 -2
- package/dist/types/ui/ToolbarMention/index.d.ts +1 -1
- package/dist/types/ui/type-ahead/index.d.ts +7 -7
- package/dist/types-ts4.5/editor-commands/index.d.ts +3 -3
- package/dist/types-ts4.5/mentionsPluginType.d.ts +6 -6
- package/dist/types-ts4.5/nodeviews/mentionNodeView.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/profileCardRenderer.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/types/index.d.ts +6 -6
- package/dist/types-ts4.5/ui/InviteItem/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/PopperWrapper.d.ts +4 -4
- package/dist/types-ts4.5/ui/ProfileCardComponent.d.ts +2 -2
- package/dist/types-ts4.5/ui/SecondaryToolbarComponent.d.ts +2 -2
- package/dist/types-ts4.5/ui/ToolbarMention/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/type-ahead/index.d.ts +7 -7
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-mentions
|
|
2
2
|
|
|
3
|
+
## 5.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.2.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 5.2.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -23,7 +23,7 @@ var ACTIONS = exports.ACTIONS = {
|
|
|
23
23
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
24
24
|
};
|
|
25
25
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
26
|
-
var PACKAGE_VERSION = "5.2.
|
|
26
|
+
var PACKAGE_VERSION = "5.2.8";
|
|
27
27
|
var setProvider = function setProvider(provider) {
|
|
28
28
|
return function (state, dispatch) {
|
|
29
29
|
if (dispatch) {
|
|
@@ -12,7 +12,7 @@ export const ACTIONS = {
|
|
|
12
12
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
13
13
|
};
|
|
14
14
|
const PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
15
|
-
const PACKAGE_VERSION = "5.2.
|
|
15
|
+
const PACKAGE_VERSION = "5.2.8";
|
|
16
16
|
const setProvider = provider => (state, dispatch) => {
|
|
17
17
|
if (dispatch) {
|
|
18
18
|
dispatch(state.tr.setMeta(mentionPluginKey, {
|
|
@@ -15,7 +15,7 @@ export var ACTIONS = {
|
|
|
15
15
|
SET_PROVIDER: 'SET_PROVIDER'
|
|
16
16
|
};
|
|
17
17
|
var PACKAGE_NAME = "@atlaskit/editor-plugin-mentions";
|
|
18
|
-
var PACKAGE_VERSION = "5.2.
|
|
18
|
+
var PACKAGE_VERSION = "5.2.8";
|
|
19
19
|
var setProvider = function setProvider(provider) {
|
|
20
20
|
return function (state, dispatch) {
|
|
21
21
|
if (dispatch) {
|
|
@@ -4,6 +4,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import { type MentionProvider, type MentionDescription } from '@atlaskit/mention/resource';
|
|
5
5
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
6
|
export type InsertMentionParameters = Pick<MentionDescription, 'name' | 'id' | 'userType' | 'isXProductUser' | 'nickname' | 'accessLevel'> & {
|
|
7
|
+
localId?: string;
|
|
7
8
|
/**
|
|
8
9
|
* The name is the name that will be displayed in the editor and stored in the ADF.
|
|
9
10
|
* If using "sanitizePrivateContent" with the mentions plugin, you can pass an empty
|
|
@@ -14,17 +15,16 @@ export type InsertMentionParameters = Pick<MentionDescription, 'name' | 'id' | '
|
|
|
14
15
|
* must be done on the client side if using this.
|
|
15
16
|
*/
|
|
16
17
|
name: string;
|
|
17
|
-
localId?: string;
|
|
18
18
|
};
|
|
19
19
|
type InternalParams = {
|
|
20
|
-
sanitizePrivateContent: boolean;
|
|
21
20
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
22
21
|
mentionInsertDisplayName: boolean;
|
|
22
|
+
sanitizePrivateContent: boolean;
|
|
23
23
|
};
|
|
24
24
|
type SingleMentionFragmentParams = {
|
|
25
|
+
mentionInsertDisplayName: boolean | undefined;
|
|
25
26
|
mentionProvider: MentionProvider | undefined;
|
|
26
27
|
sanitizePrivateContent: boolean | undefined;
|
|
27
|
-
mentionInsertDisplayName: boolean | undefined;
|
|
28
28
|
tr: Transaction;
|
|
29
29
|
};
|
|
30
30
|
export declare const createSingleMentionFragment: ({ mentionInsertDisplayName, mentionProvider, tr, sanitizePrivateContent, }: SingleMentionFragmentParams) => ({ name, id, userType, nickname, localId, accessLevel, isXProductUser, }: InsertMentionParameters) => Fragment;
|
|
@@ -9,15 +9,15 @@ import type { InsertMentionParameters } from './editor-commands';
|
|
|
9
9
|
import type { MentionPluginOptions, MentionSharedState } from './types';
|
|
10
10
|
export type MentionActionOpenTypeAhead = (inputMethod: TypeAheadInputMethod) => boolean;
|
|
11
11
|
export type MentionActionAnnounceMentionsInsertion = (mentionIds: {
|
|
12
|
-
type: 'added' | 'deleted';
|
|
13
|
-
localId: string;
|
|
14
12
|
id: string;
|
|
13
|
+
localId: string;
|
|
15
14
|
taskLocalId?: string;
|
|
15
|
+
type: 'added' | 'deleted';
|
|
16
16
|
}[]) => void;
|
|
17
17
|
export type MentionActionSetProvider = (provider: Promise<MentionProvider>) => Promise<boolean>;
|
|
18
18
|
export type MentionActions = {
|
|
19
|
-
openTypeAhead: MentionActionOpenTypeAhead;
|
|
20
19
|
announceMentionsInsertion: MentionActionAnnounceMentionsInsertion;
|
|
20
|
+
openTypeAhead: MentionActionOpenTypeAhead;
|
|
21
21
|
setProvider: MentionActionSetProvider;
|
|
22
22
|
};
|
|
23
23
|
export type MentionPluginDependencies = [
|
|
@@ -28,9 +28,6 @@ export type MentionPluginDependencies = [
|
|
|
28
28
|
OptionalPlugin<SelectionPlugin>
|
|
29
29
|
];
|
|
30
30
|
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
31
|
-
pluginConfiguration: MentionPluginOptions | undefined;
|
|
32
|
-
dependencies: MentionPluginDependencies;
|
|
33
|
-
sharedState: MentionSharedState | undefined;
|
|
34
31
|
actions: MentionActions;
|
|
35
32
|
commands: {
|
|
36
33
|
/**
|
|
@@ -49,4 +46,7 @@ export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
|
49
46
|
*/
|
|
50
47
|
insertMention: (params: InsertMentionParameters) => EditorCommand;
|
|
51
48
|
};
|
|
49
|
+
dependencies: MentionPluginDependencies;
|
|
50
|
+
pluginConfiguration: MentionPluginOptions | undefined;
|
|
51
|
+
sharedState: MentionSharedState | undefined;
|
|
52
52
|
}>;
|
|
@@ -5,8 +5,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
6
|
import { type MentionPluginOptions } from '../types';
|
|
7
7
|
interface MentionNodeViewProps {
|
|
8
|
-
options?: MentionPluginOptions;
|
|
9
8
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
9
|
+
options?: MentionPluginOptions;
|
|
10
10
|
portalProviderAPI: PortalProviderAPI;
|
|
11
11
|
}
|
|
12
12
|
export declare class MentionNodeView implements NodeView {
|
|
@@ -4,11 +4,11 @@ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
import { type MentionPluginOptions } from '../types';
|
|
6
6
|
export declare const profileCardRenderer: ({ dom, options, portalProviderAPI, node, api, }: {
|
|
7
|
+
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
7
8
|
dom: Node;
|
|
9
|
+
node: PMNode;
|
|
8
10
|
options?: MentionPluginOptions;
|
|
9
11
|
portalProviderAPI: PortalProviderAPI;
|
|
10
|
-
node: PMNode;
|
|
11
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
12
12
|
}) => {
|
|
13
13
|
destroyProfileCard: () => void;
|
|
14
14
|
removeProfileCard: () => void;
|
|
@@ -6,10 +6,10 @@ export declare const ACTIONS: {
|
|
|
6
6
|
SET_PROVIDER: string;
|
|
7
7
|
};
|
|
8
8
|
interface CreateMentionPlugin {
|
|
9
|
-
|
|
9
|
+
api?: ExtractInjectionAPI<MentionsPlugin>;
|
|
10
10
|
fireEvent: FireElementsChannelEvent;
|
|
11
11
|
options?: MentionPluginOptions;
|
|
12
|
-
|
|
12
|
+
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
13
13
|
}
|
|
14
14
|
export declare function createMentionPlugin({ pmPluginFactoryParams, fireEvent, options, api, }: CreateMentionPlugin): SafePlugin<MentionPluginState>;
|
|
15
15
|
export {};
|
|
@@ -5,9 +5,9 @@ import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
|
5
5
|
export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
|
|
6
6
|
export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
|
|
7
7
|
export interface TeamInfoAttrAnalytics {
|
|
8
|
-
teamId: string;
|
|
9
8
|
includesYou: boolean;
|
|
10
9
|
memberCount: number;
|
|
10
|
+
teamId: string;
|
|
11
11
|
}
|
|
12
12
|
export interface MentionPluginConfig {
|
|
13
13
|
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
@@ -15,16 +15,16 @@ export interface MentionPluginConfig {
|
|
|
15
15
|
profilecardProvider?: Promise<ProfilecardProvider>;
|
|
16
16
|
}
|
|
17
17
|
export type MentionsChangedHandler = (changes: {
|
|
18
|
-
type: 'added' | 'deleted';
|
|
19
|
-
localId: string;
|
|
20
18
|
id: string;
|
|
19
|
+
localId: string;
|
|
21
20
|
taskLocalId?: string;
|
|
21
|
+
type: 'added' | 'deleted';
|
|
22
22
|
}[]) => void;
|
|
23
23
|
export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
24
|
-
mentionProvider?: Providers['mentionProvider'];
|
|
25
|
-
sanitizePrivateContent?: boolean;
|
|
26
24
|
allowZeroWidthSpaceAfter?: boolean;
|
|
27
25
|
handleMentionsChanged?: MentionsChangedHandler;
|
|
26
|
+
mentionProvider?: Providers['mentionProvider'];
|
|
27
|
+
sanitizePrivateContent?: boolean;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* @private
|
|
@@ -33,9 +33,9 @@ export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
|
33
33
|
*/
|
|
34
34
|
export type MentionPluginOptions = MentionsPluginOptions;
|
|
35
35
|
export type MentionPluginState = {
|
|
36
|
+
canInsertMention?: boolean;
|
|
36
37
|
mentionProvider?: MentionProvider;
|
|
37
38
|
mentions?: Array<MentionDescription>;
|
|
38
|
-
canInsertMention?: boolean;
|
|
39
39
|
};
|
|
40
40
|
export type FireElementsChannelEvent = (payload: AnalyticsEventPayload, channel?: string) => void;
|
|
41
41
|
export type MentionSharedState = MentionPluginState & {
|
|
@@ -14,10 +14,10 @@ export declare const INVITE_ITEM_DESCRIPTION: {
|
|
|
14
14
|
id: string;
|
|
15
15
|
};
|
|
16
16
|
interface Props {
|
|
17
|
-
productName?: string;
|
|
18
17
|
onMount?: () => void;
|
|
19
18
|
onMouseEnter?: OnMentionEvent;
|
|
20
19
|
onSelection?: OnMentionEvent;
|
|
20
|
+
productName?: string;
|
|
21
21
|
selected?: boolean;
|
|
22
22
|
userRole?: UserRole;
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type PopperChildrenProps } from '@atlaskit/popper';
|
|
3
3
|
interface Props {
|
|
4
|
-
/**
|
|
5
|
-
* Replacement reference element to position popper relative to.
|
|
6
|
-
*/
|
|
7
|
-
referenceElement: HTMLElement;
|
|
8
4
|
/**
|
|
9
5
|
* Returns the element to be positioned.
|
|
10
6
|
*/
|
|
11
7
|
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Replacement reference element to position popper relative to.
|
|
10
|
+
*/
|
|
11
|
+
referenceElement: HTMLElement;
|
|
12
12
|
}
|
|
13
13
|
export declare const RepositionOnUpdate: ({ children, update, }: PropsWithChildren<{
|
|
14
14
|
update: PopperChildrenProps["update"];
|
|
@@ -14,9 +14,9 @@ export declare const useProfileCardState: ({ id, provider }: ProfileCardStatePro
|
|
|
14
14
|
hasError: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare function ProfileCardComponent({ profilecardProvider, activeMention, dom, closeComponent, }: {
|
|
17
|
-
profilecardProvider?: Promise<ProfilecardProvider> | undefined;
|
|
18
17
|
activeMention: PMNode;
|
|
19
|
-
dom: HTMLElement;
|
|
20
18
|
closeComponent: () => void;
|
|
19
|
+
dom: HTMLElement;
|
|
20
|
+
profilecardProvider?: Promise<ProfilecardProvider> | undefined;
|
|
21
21
|
}): JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -3,10 +3,10 @@ import type { ExtractInjectionAPI, TypeAheadHandler } from '@atlaskit/editor-com
|
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
interface SecondaryToolbarComponentProps {
|
|
6
|
-
editorView: EditorView;
|
|
7
6
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
8
|
-
typeAhead: TypeAheadHandler;
|
|
9
7
|
disabled: boolean;
|
|
8
|
+
editorView: EditorView;
|
|
9
|
+
typeAhead: TypeAheadHandler;
|
|
10
10
|
}
|
|
11
11
|
export declare function SecondaryToolbarComponent({ editorView, api, typeAhead, disabled, }: SecondaryToolbarComponentProps): React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
interface Props {
|
|
5
|
-
onInsertMention: () => void;
|
|
6
5
|
editorView?: EditorView;
|
|
7
6
|
isDisabled?: boolean;
|
|
7
|
+
onInsertMention: () => void;
|
|
8
8
|
testId?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
@@ -9,18 +9,18 @@ export declare function memoize<ResultFn extends (mention: MentionDescription) =
|
|
|
9
9
|
clear(): void;
|
|
10
10
|
};
|
|
11
11
|
type Props = {
|
|
12
|
-
sanitizePrivateContent?: boolean;
|
|
13
|
-
mentionInsertDisplayName?: boolean;
|
|
14
|
-
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
15
|
-
fireEvent: FireElementsChannelEvent;
|
|
16
12
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
13
|
+
fireEvent: FireElementsChannelEvent;
|
|
17
14
|
handleMentionsChanged?: (mentionChanges: {
|
|
18
|
-
type: 'added' | 'deleted';
|
|
19
|
-
localId: string;
|
|
20
15
|
id: string;
|
|
21
|
-
|
|
16
|
+
localId: string;
|
|
22
17
|
method?: 'pasted' | 'typed';
|
|
18
|
+
taskLocalId?: string;
|
|
19
|
+
type: 'added' | 'deleted';
|
|
23
20
|
}[]) => void;
|
|
21
|
+
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
22
|
+
mentionInsertDisplayName?: boolean;
|
|
23
|
+
sanitizePrivateContent?: boolean;
|
|
24
24
|
};
|
|
25
25
|
export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, api, handleMentionsChanged, }: Props) => TypeAheadHandler;
|
|
26
26
|
export {};
|
|
@@ -4,6 +4,7 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import { type MentionProvider, type MentionDescription } from '@atlaskit/mention/resource';
|
|
5
5
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
6
|
export type InsertMentionParameters = Pick<MentionDescription, 'name' | 'id' | 'userType' | 'isXProductUser' | 'nickname' | 'accessLevel'> & {
|
|
7
|
+
localId?: string;
|
|
7
8
|
/**
|
|
8
9
|
* The name is the name that will be displayed in the editor and stored in the ADF.
|
|
9
10
|
* If using "sanitizePrivateContent" with the mentions plugin, you can pass an empty
|
|
@@ -14,17 +15,16 @@ export type InsertMentionParameters = Pick<MentionDescription, 'name' | 'id' | '
|
|
|
14
15
|
* must be done on the client side if using this.
|
|
15
16
|
*/
|
|
16
17
|
name: string;
|
|
17
|
-
localId?: string;
|
|
18
18
|
};
|
|
19
19
|
type InternalParams = {
|
|
20
|
-
sanitizePrivateContent: boolean;
|
|
21
20
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
22
21
|
mentionInsertDisplayName: boolean;
|
|
22
|
+
sanitizePrivateContent: boolean;
|
|
23
23
|
};
|
|
24
24
|
type SingleMentionFragmentParams = {
|
|
25
|
+
mentionInsertDisplayName: boolean | undefined;
|
|
25
26
|
mentionProvider: MentionProvider | undefined;
|
|
26
27
|
sanitizePrivateContent: boolean | undefined;
|
|
27
|
-
mentionInsertDisplayName: boolean | undefined;
|
|
28
28
|
tr: Transaction;
|
|
29
29
|
};
|
|
30
30
|
export declare const createSingleMentionFragment: ({ mentionInsertDisplayName, mentionProvider, tr, sanitizePrivateContent, }: SingleMentionFragmentParams) => ({ name, id, userType, nickname, localId, accessLevel, isXProductUser, }: InsertMentionParameters) => Fragment;
|
|
@@ -9,15 +9,15 @@ import type { InsertMentionParameters } from './editor-commands';
|
|
|
9
9
|
import type { MentionPluginOptions, MentionSharedState } from './types';
|
|
10
10
|
export type MentionActionOpenTypeAhead = (inputMethod: TypeAheadInputMethod) => boolean;
|
|
11
11
|
export type MentionActionAnnounceMentionsInsertion = (mentionIds: {
|
|
12
|
-
type: 'added' | 'deleted';
|
|
13
|
-
localId: string;
|
|
14
12
|
id: string;
|
|
13
|
+
localId: string;
|
|
15
14
|
taskLocalId?: string;
|
|
15
|
+
type: 'added' | 'deleted';
|
|
16
16
|
}[]) => void;
|
|
17
17
|
export type MentionActionSetProvider = (provider: Promise<MentionProvider>) => Promise<boolean>;
|
|
18
18
|
export type MentionActions = {
|
|
19
|
-
openTypeAhead: MentionActionOpenTypeAhead;
|
|
20
19
|
announceMentionsInsertion: MentionActionAnnounceMentionsInsertion;
|
|
20
|
+
openTypeAhead: MentionActionOpenTypeAhead;
|
|
21
21
|
setProvider: MentionActionSetProvider;
|
|
22
22
|
};
|
|
23
23
|
export type MentionPluginDependencies = [
|
|
@@ -28,9 +28,6 @@ export type MentionPluginDependencies = [
|
|
|
28
28
|
OptionalPlugin<SelectionPlugin>
|
|
29
29
|
];
|
|
30
30
|
export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
31
|
-
pluginConfiguration: MentionPluginOptions | undefined;
|
|
32
|
-
dependencies: MentionPluginDependencies;
|
|
33
|
-
sharedState: MentionSharedState | undefined;
|
|
34
31
|
actions: MentionActions;
|
|
35
32
|
commands: {
|
|
36
33
|
/**
|
|
@@ -49,4 +46,7 @@ export type MentionsPlugin = NextEditorPlugin<'mention', {
|
|
|
49
46
|
*/
|
|
50
47
|
insertMention: (params: InsertMentionParameters) => EditorCommand;
|
|
51
48
|
};
|
|
49
|
+
dependencies: MentionPluginDependencies;
|
|
50
|
+
pluginConfiguration: MentionPluginOptions | undefined;
|
|
51
|
+
sharedState: MentionSharedState | undefined;
|
|
52
52
|
}>;
|
|
@@ -5,8 +5,8 @@ import type { NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
6
6
|
import { type MentionPluginOptions } from '../types';
|
|
7
7
|
interface MentionNodeViewProps {
|
|
8
|
-
options?: MentionPluginOptions;
|
|
9
8
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
9
|
+
options?: MentionPluginOptions;
|
|
10
10
|
portalProviderAPI: PortalProviderAPI;
|
|
11
11
|
}
|
|
12
12
|
export declare class MentionNodeView implements NodeView {
|
|
@@ -4,11 +4,11 @@ import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
import { type MentionPluginOptions } from '../types';
|
|
6
6
|
export declare const profileCardRenderer: ({ dom, options, portalProviderAPI, node, api, }: {
|
|
7
|
+
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
7
8
|
dom: Node;
|
|
9
|
+
node: PMNode;
|
|
8
10
|
options?: MentionPluginOptions;
|
|
9
11
|
portalProviderAPI: PortalProviderAPI;
|
|
10
|
-
node: PMNode;
|
|
11
|
-
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
12
12
|
}) => {
|
|
13
13
|
destroyProfileCard: () => void;
|
|
14
14
|
removeProfileCard: () => void;
|
|
@@ -6,10 +6,10 @@ export declare const ACTIONS: {
|
|
|
6
6
|
SET_PROVIDER: string;
|
|
7
7
|
};
|
|
8
8
|
interface CreateMentionPlugin {
|
|
9
|
-
|
|
9
|
+
api?: ExtractInjectionAPI<MentionsPlugin>;
|
|
10
10
|
fireEvent: FireElementsChannelEvent;
|
|
11
11
|
options?: MentionPluginOptions;
|
|
12
|
-
|
|
12
|
+
pmPluginFactoryParams: PMPluginFactoryParams;
|
|
13
13
|
}
|
|
14
14
|
export declare function createMentionPlugin({ pmPluginFactoryParams, fireEvent, options, api, }: CreateMentionPlugin): SafePlugin<MentionPluginState>;
|
|
15
15
|
export {};
|
|
@@ -5,9 +5,9 @@ import type { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
|
5
5
|
export declare const MENTION_PROVIDER_REJECTED = "REJECTED";
|
|
6
6
|
export declare const MENTION_PROVIDER_UNDEFINED = "UNDEFINED";
|
|
7
7
|
export interface TeamInfoAttrAnalytics {
|
|
8
|
-
teamId: string;
|
|
9
8
|
includesYou: boolean;
|
|
10
9
|
memberCount: number;
|
|
10
|
+
teamId: string;
|
|
11
11
|
}
|
|
12
12
|
export interface MentionPluginConfig {
|
|
13
13
|
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
@@ -15,16 +15,16 @@ export interface MentionPluginConfig {
|
|
|
15
15
|
profilecardProvider?: Promise<ProfilecardProvider>;
|
|
16
16
|
}
|
|
17
17
|
export type MentionsChangedHandler = (changes: {
|
|
18
|
-
type: 'added' | 'deleted';
|
|
19
|
-
localId: string;
|
|
20
18
|
id: string;
|
|
19
|
+
localId: string;
|
|
21
20
|
taskLocalId?: string;
|
|
21
|
+
type: 'added' | 'deleted';
|
|
22
22
|
}[]) => void;
|
|
23
23
|
export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
24
|
-
mentionProvider?: Providers['mentionProvider'];
|
|
25
|
-
sanitizePrivateContent?: boolean;
|
|
26
24
|
allowZeroWidthSpaceAfter?: boolean;
|
|
27
25
|
handleMentionsChanged?: MentionsChangedHandler;
|
|
26
|
+
mentionProvider?: Providers['mentionProvider'];
|
|
27
|
+
sanitizePrivateContent?: boolean;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* @private
|
|
@@ -33,9 +33,9 @@ export interface MentionsPluginOptions extends MentionPluginConfig {
|
|
|
33
33
|
*/
|
|
34
34
|
export type MentionPluginOptions = MentionsPluginOptions;
|
|
35
35
|
export type MentionPluginState = {
|
|
36
|
+
canInsertMention?: boolean;
|
|
36
37
|
mentionProvider?: MentionProvider;
|
|
37
38
|
mentions?: Array<MentionDescription>;
|
|
38
|
-
canInsertMention?: boolean;
|
|
39
39
|
};
|
|
40
40
|
export type FireElementsChannelEvent = (payload: AnalyticsEventPayload, channel?: string) => void;
|
|
41
41
|
export type MentionSharedState = MentionPluginState & {
|
|
@@ -14,10 +14,10 @@ export declare const INVITE_ITEM_DESCRIPTION: {
|
|
|
14
14
|
id: string;
|
|
15
15
|
};
|
|
16
16
|
interface Props {
|
|
17
|
-
productName?: string;
|
|
18
17
|
onMount?: () => void;
|
|
19
18
|
onMouseEnter?: OnMentionEvent;
|
|
20
19
|
onSelection?: OnMentionEvent;
|
|
20
|
+
productName?: string;
|
|
21
21
|
selected?: boolean;
|
|
22
22
|
userRole?: UserRole;
|
|
23
23
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type PopperChildrenProps } from '@atlaskit/popper';
|
|
3
3
|
interface Props {
|
|
4
|
-
/**
|
|
5
|
-
* Replacement reference element to position popper relative to.
|
|
6
|
-
*/
|
|
7
|
-
referenceElement: HTMLElement;
|
|
8
4
|
/**
|
|
9
5
|
* Returns the element to be positioned.
|
|
10
6
|
*/
|
|
11
7
|
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Replacement reference element to position popper relative to.
|
|
10
|
+
*/
|
|
11
|
+
referenceElement: HTMLElement;
|
|
12
12
|
}
|
|
13
13
|
export declare const RepositionOnUpdate: ({ children, update, }: PropsWithChildren<{
|
|
14
14
|
update: PopperChildrenProps["update"];
|
|
@@ -14,9 +14,9 @@ export declare const useProfileCardState: ({ id, provider }: ProfileCardStatePro
|
|
|
14
14
|
hasError: boolean;
|
|
15
15
|
};
|
|
16
16
|
export declare function ProfileCardComponent({ profilecardProvider, activeMention, dom, closeComponent, }: {
|
|
17
|
-
profilecardProvider?: Promise<ProfilecardProvider> | undefined;
|
|
18
17
|
activeMention: PMNode;
|
|
19
|
-
dom: HTMLElement;
|
|
20
18
|
closeComponent: () => void;
|
|
19
|
+
dom: HTMLElement;
|
|
20
|
+
profilecardProvider?: Promise<ProfilecardProvider> | undefined;
|
|
21
21
|
}): JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -3,10 +3,10 @@ import type { ExtractInjectionAPI, TypeAheadHandler } from '@atlaskit/editor-com
|
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import type { MentionsPlugin } from '../mentionsPluginType';
|
|
5
5
|
interface SecondaryToolbarComponentProps {
|
|
6
|
-
editorView: EditorView;
|
|
7
6
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
8
|
-
typeAhead: TypeAheadHandler;
|
|
9
7
|
disabled: boolean;
|
|
8
|
+
editorView: EditorView;
|
|
9
|
+
typeAhead: TypeAheadHandler;
|
|
10
10
|
}
|
|
11
11
|
export declare function SecondaryToolbarComponent({ editorView, api, typeAhead, disabled, }: SecondaryToolbarComponentProps): React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
interface Props {
|
|
5
|
-
onInsertMention: () => void;
|
|
6
5
|
editorView?: EditorView;
|
|
7
6
|
isDisabled?: boolean;
|
|
7
|
+
onInsertMention: () => void;
|
|
8
8
|
testId?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
@@ -9,18 +9,18 @@ export declare function memoize<ResultFn extends (mention: MentionDescription) =
|
|
|
9
9
|
clear(): void;
|
|
10
10
|
};
|
|
11
11
|
type Props = {
|
|
12
|
-
sanitizePrivateContent?: boolean;
|
|
13
|
-
mentionInsertDisplayName?: boolean;
|
|
14
|
-
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
15
|
-
fireEvent: FireElementsChannelEvent;
|
|
16
12
|
api: ExtractInjectionAPI<MentionsPlugin> | undefined;
|
|
13
|
+
fireEvent: FireElementsChannelEvent;
|
|
17
14
|
handleMentionsChanged?: (mentionChanges: {
|
|
18
|
-
type: 'added' | 'deleted';
|
|
19
|
-
localId: string;
|
|
20
15
|
id: string;
|
|
21
|
-
|
|
16
|
+
localId: string;
|
|
22
17
|
method?: 'pasted' | 'typed';
|
|
18
|
+
taskLocalId?: string;
|
|
19
|
+
type: 'added' | 'deleted';
|
|
23
20
|
}[]) => void;
|
|
21
|
+
HighlightComponent?: React.ComponentType<React.PropsWithChildren<unknown>>;
|
|
22
|
+
mentionInsertDisplayName?: boolean;
|
|
23
|
+
sanitizePrivateContent?: boolean;
|
|
24
24
|
};
|
|
25
25
|
export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, api, handleMentionsChanged, }: Props) => TypeAheadHandler;
|
|
26
26
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-mentions",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.9",
|
|
4
4
|
"description": "Mentions plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-base": "^4.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-context-identifier": "^3.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-selection": "^3.
|
|
40
|
+
"@atlaskit/editor-plugin-selection": "^3.2.0",
|
|
41
41
|
"@atlaskit/editor-plugin-type-ahead": "^3.1.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
43
|
-
"@atlaskit/icon": "^
|
|
43
|
+
"@atlaskit/icon": "^28.0.0",
|
|
44
44
|
"@atlaskit/link": "^3.2.0",
|
|
45
45
|
"@atlaskit/mention": "^24.2.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/popper": "^7.1.0",
|
|
48
48
|
"@atlaskit/portal": "^5.1.0",
|
|
49
|
-
"@atlaskit/profilecard": "^24.
|
|
49
|
+
"@atlaskit/profilecard": "^24.6.0",
|
|
50
50
|
"@atlaskit/theme": "^19.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
52
52
|
"@atlaskit/tokens": "^6.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^0.18.3",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"uuid": "^3.1.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^107.
|
|
60
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@af/visual-regression": "workspace:^",
|
|
67
67
|
"@atlaskit/ssr": "workspace:^",
|
|
68
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
69
68
|
"@testing-library/react": "^13.4.0",
|
|
70
69
|
"wait-for-expect": "^1.2.0"
|
|
71
70
|
},
|