@remirror/extension-mention
Advanced tools
Comparing version 0.4.2-canary.0 to 0.4.2-canary.1
@@ -1,3 +0,3 @@ | ||
import { CommandMarkTypeParams, MarkExtension, MarkExtensionSpec, Plugin, RangeParams, SchemaMarkTypeParams } from '@remirror/core'; | ||
import { MentionExtensionCommands, MentionExtensionOptions } from './mention-types'; | ||
import { CommandMarkTypeParams, ExtensionManagerMarkTypeParams, MarkExtension, MarkExtensionSpec, Plugin, RangeParams } from '@remirror/core'; | ||
import { MentionExtensionOptions } from './mention-types'; | ||
import { SuggestionState } from './suggestion-plugin'; | ||
@@ -9,3 +9,3 @@ /** | ||
*/ | ||
export declare class MentionExtension extends MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}> { | ||
export declare class MentionExtension extends MarkExtension<MentionExtensionOptions> { | ||
readonly name: "mention"; | ||
@@ -38,5 +38,5 @@ /** | ||
}; | ||
pasteRules({ type }: SchemaMarkTypeParams): import("prosemirror-state").Plugin<any, any>[]; | ||
plugin(params: SchemaMarkTypeParams): Plugin<SuggestionState>; | ||
pasteRules({ type }: ExtensionManagerMarkTypeParams): import("prosemirror-state").Plugin<any, any>[]; | ||
plugin(params: ExtensionManagerMarkTypeParams): Plugin<SuggestionState>; | ||
} | ||
//# sourceMappingURL=mention-extension.d.ts.map |
@@ -1,7 +0,7 @@ | ||
import { ActionGetter, CompareStateParams, EditorState, EditorView, FromToParams, MarkExtension, MarkType, SchemaMarkTypeParams, TextParams, TransactionParams } from '@remirror/core'; | ||
import { ActionGetter, CompareStateParams, EditorState, EditorView, ExtensionManagerMarkTypeParams, FromToParams, MarkExtension, MarkType, TextParams, TransactionParams } from '@remirror/core'; | ||
import { Plugin } from 'prosemirror-state'; | ||
import { DecorationSet } from 'prosemirror-view'; | ||
import { MentionExtensionCommands, MentionExtensionOptions, SuggestionStage, SuggestionStateMatch } from './mention-types'; | ||
export interface SuggestionStateCreateParams extends SchemaMarkTypeParams { | ||
extension: MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}>; | ||
import { MentionExtensionOptions, SuggestionStage, SuggestionStateMatch } from './mention-types'; | ||
export interface SuggestionStateCreateParams extends ExtensionManagerMarkTypeParams { | ||
extension: MarkExtension<MentionExtensionOptions>; | ||
} | ||
@@ -51,3 +51,3 @@ export declare class SuggestionState { | ||
readonly stage: SuggestionStage; | ||
constructor(extension: MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}>, type: MarkType, getActions: ActionGetter); | ||
constructor(extension: MarkExtension<MentionExtensionOptions>, type: MarkType, getActions: ActionGetter); | ||
/** | ||
@@ -54,0 +54,0 @@ * Initialize the SuggestionState with a view which is stored for use later. |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "0.4.2-canary.0", | ||
"version": "0.4.2-canary.1", | ||
"main": "lib/index.js", | ||
@@ -34,3 +34,3 @@ "module": "lib/dist/extension-mention.esm.js", | ||
"@emotion/core": "^10.0.14", | ||
"@remirror/core": "0.4.2-canary.0", | ||
"@remirror/core": "0.4.2-canary.1", | ||
"@types/prosemirror-keymap": "^1.0.1", | ||
@@ -48,3 +48,3 @@ "@types/prosemirror-state": "^1.2.3", | ||
"sideEffects": false, | ||
"gitHead": "e6500c65aecbffad1b0f9bb2c0b8d4891ba764d3" | ||
"gitHead": "0330899c87713ed1398df695715d1fed87267462" | ||
} |
@@ -6,2 +6,3 @@ import { | ||
EditorState, | ||
ExtensionManagerMarkTypeParams, | ||
getMarkRange, | ||
@@ -21,10 +22,5 @@ getMatchString, | ||
replaceText, | ||
SchemaMarkTypeParams, | ||
TransactionTransformer, | ||
} from '@remirror/core'; | ||
import { | ||
MentionExtensionAttrs as MentionAttrs, | ||
MentionExtensionCommands, | ||
MentionExtensionOptions, | ||
} from './mention-types'; | ||
import { MentionExtensionAttrs as MentionAttrs, MentionExtensionOptions } from './mention-types'; | ||
import { DEFAULT_MATCHER, escapeChar, getRegexPrefix, regexToString } from './mention-utils'; | ||
@@ -40,3 +36,3 @@ import { createSuggestionPlugin, SuggestionState } from './suggestion-plugin'; | ||
*/ | ||
export class MentionExtension extends MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}> { | ||
export class MentionExtension extends MarkExtension<MentionExtensionOptions> { | ||
get name() { | ||
@@ -180,3 +176,3 @@ return 'mention' as const; | ||
// this is some @awesome text and #should @work | ||
public pasteRules({ type }: SchemaMarkTypeParams) { | ||
public pasteRules({ type }: ExtensionManagerMarkTypeParams) { | ||
return this.options.matchers.map(matcher => { | ||
@@ -200,3 +196,3 @@ const { startOfLine, char, supportedCharacters } = { ...DEFAULT_MATCHER, ...matcher }; | ||
public plugin(params: SchemaMarkTypeParams): Plugin<SuggestionState> { | ||
public plugin(params: ExtensionManagerMarkTypeParams): Plugin<SuggestionState> { | ||
return createSuggestionPlugin({ extension: this, ...params }); | ||
@@ -203,0 +199,0 @@ } |
@@ -407,6 +407,6 @@ import { | ||
export const isExitReason = (value: unknown): value is ExitReason => | ||
isString(value) && Object.values(ExitReason).includes(value); | ||
isString(value) && Object.values(ExitReason).includes(value as ExitReason); | ||
export const isChangeReason = (value: unknown): value is ChangeReason => | ||
isString(value) && Object.values(ChangeReason).includes(value); | ||
isString(value) && Object.values(ChangeReason).includes(value as ChangeReason); | ||
@@ -413,0 +413,0 @@ /** |
@@ -8,2 +8,3 @@ import { | ||
EditorView, | ||
ExtensionManagerMarkTypeParams, | ||
FromToParams, | ||
@@ -15,3 +16,2 @@ isMarkActive, | ||
ResolvedPosParams, | ||
SchemaMarkTypeParams, | ||
TextParams, | ||
@@ -27,4 +27,2 @@ transactionChanged, | ||
ExitReason, | ||
MentionExtensionAttrs, | ||
MentionExtensionCommands, | ||
MentionExtensionOptions, | ||
@@ -51,4 +49,4 @@ SuggestionActions, | ||
export interface SuggestionStateCreateParams extends SchemaMarkTypeParams { | ||
extension: MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}>; | ||
export interface SuggestionStateCreateParams extends ExtensionManagerMarkTypeParams { | ||
extension: MarkExtension<MentionExtensionOptions>; | ||
} | ||
@@ -97,4 +95,4 @@ | ||
const { name, range } = match; | ||
const create = this.getActions<MentionExtensionAttrs>('createMention'); | ||
const update = this.getActions<MentionExtensionAttrs>('updateMention'); | ||
const create = this.getActions('createMention'); | ||
const update = this.getActions('updateMention'); | ||
const remove = this.getActions('removeMention'); | ||
@@ -159,3 +157,3 @@ const stage = this.stage; | ||
constructor( | ||
private extension: MarkExtension<MentionExtensionOptions, MentionExtensionCommands, {}>, | ||
private extension: MarkExtension<MentionExtensionOptions>, | ||
private type: MarkType, | ||
@@ -162,0 +160,0 @@ private getActions: ActionGetter, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
424075
5733
+ Added@remirror/core@0.4.2-canary.1(transitive)
- Removed@remirror/core@0.4.2-canary.0(transitive)