@atlaskit/prosemirror-input-rules 3.4.0 → 3.4.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/prosemirror-input-rules
2
2
 
3
+ ## 3.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+
10
+ ## 3.4.1
11
+
12
+ ### Patch Changes
13
+
14
+ - [`098cfbb01dc36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098cfbb01dc36) -
15
+ Add missing npmignore files to remove unnecessary files from published package
16
+
3
17
  ## 3.4.0
4
18
 
5
19
  ### Minor Changes
@@ -8,8 +8,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
8
8
  export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
9
9
  export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
10
10
  export interface InputRuleWrapper {
11
- match: RegExp;
12
11
  handler: InputRuleHandler;
12
+ match: RegExp;
13
13
  onHandlerApply?: OnHandlerApply;
14
14
  }
15
15
  export declare const isGapCursorSelection: (selection: Selection) => boolean;
@@ -2,11 +2,11 @@ import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { InputRuleWrapper } from './editor-common';
3
3
  import type { HandleInputEvent, OnBeforeRegexMatch, OnInputEvent } from './types';
4
4
  type Options = {
5
- pluginKey: PluginKey;
6
- rules: InputRuleWrapper[];
7
5
  allowInsertTextOnDocument: boolean;
8
- onInputEvent?: OnInputEvent;
9
6
  onBeforeRegexMatch?: OnBeforeRegexMatch;
7
+ onInputEvent?: OnInputEvent;
8
+ pluginKey: PluginKey;
9
+ rules: InputRuleWrapper[];
10
10
  };
11
11
  export declare const createInputEventHandler: ({ rules, pluginKey, allowInsertTextOnDocument, onInputEvent, onBeforeRegexMatch, }: Options) => HandleInputEvent;
12
12
  export {};
@@ -3,10 +3,10 @@ import type { InputRuleWrapper } from './editor-common';
3
3
  import type { OnBeforeRegexMatch, OnInputEvent } from './types';
4
4
  type Options = {
5
5
  allowInsertTextOnDocument?: boolean;
6
- checkOnBlur?: boolean;
7
6
  appendTextOnBlur?: string;
8
- onInputEvent?: OnInputEvent;
7
+ checkOnBlur?: boolean;
9
8
  onBeforeRegexMatch?: OnBeforeRegexMatch;
9
+ onInputEvent?: OnInputEvent;
10
10
  };
11
11
  export declare function createInputRulePlugin(pluginName: string, rules: InputRuleWrapper[], options?: Options): SafePluginSpec;
12
12
  export {};
@@ -2,23 +2,23 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { InputRuleWrapper } from './editor-common';
4
4
  export type HandleInputEvent = (props: {
5
- view: EditorView;
6
5
  from: number;
7
- to: number;
8
6
  text: string;
7
+ to: number;
8
+ view: EditorView;
9
9
  }) => boolean;
10
10
  export type InputRulePluginState = {
11
- matchedRule: MatchedRule;
12
11
  from: number;
13
- to: number;
12
+ matchedRule: MatchedRule;
14
13
  textInserted: string;
14
+ to: number;
15
15
  } | null;
16
16
  export type MatchedRule = InputRuleWrapper & {
17
17
  result: RegExpExecArray;
18
18
  };
19
19
  export type OnInputEvent = (props: {
20
- state: EditorState;
21
20
  from: number;
21
+ state: EditorState;
22
22
  to: number;
23
23
  }) => boolean;
24
24
  export type OnBeforeRegexMatch = (tr: Transaction) => void;
@@ -1,17 +1,17 @@
1
1
  import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { InputRuleWrapper } from './editor-common';
3
3
  type Options = {
4
- isBlockNodeRule?: boolean;
5
4
  allowInsertTextOnDocument?: boolean;
6
- /**
7
- * Run checks on blur of the editor as well as during input
8
- */
9
- checkOnBlur?: boolean;
10
5
  /**
11
6
  * Append text to the checked text on blur. Useful for checks that normally require a trailing
12
7
  * space or similar
13
8
  */
14
9
  appendTextOnBlur?: string;
10
+ /**
11
+ * Run checks on blur of the editor as well as during input
12
+ */
13
+ checkOnBlur?: boolean;
14
+ isBlockNodeRule?: boolean;
15
15
  };
16
16
  export declare const createPlugin: (pluginName: string, rules: Array<InputRuleWrapper>, options?: Options) => SafePluginSpec;
17
17
  export {};
@@ -8,8 +8,8 @@ import type { EditorState, Selection, Transaction } from '@atlaskit/editor-prose
8
8
  export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
9
9
  export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
10
10
  export interface InputRuleWrapper {
11
- match: RegExp;
12
11
  handler: InputRuleHandler;
12
+ match: RegExp;
13
13
  onHandlerApply?: OnHandlerApply;
14
14
  }
15
15
  export declare const isGapCursorSelection: (selection: Selection) => boolean;
@@ -2,11 +2,11 @@ import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { InputRuleWrapper } from './editor-common';
3
3
  import type { HandleInputEvent, OnBeforeRegexMatch, OnInputEvent } from './types';
4
4
  type Options = {
5
- pluginKey: PluginKey;
6
- rules: InputRuleWrapper[];
7
5
  allowInsertTextOnDocument: boolean;
8
- onInputEvent?: OnInputEvent;
9
6
  onBeforeRegexMatch?: OnBeforeRegexMatch;
7
+ onInputEvent?: OnInputEvent;
8
+ pluginKey: PluginKey;
9
+ rules: InputRuleWrapper[];
10
10
  };
11
11
  export declare const createInputEventHandler: ({ rules, pluginKey, allowInsertTextOnDocument, onInputEvent, onBeforeRegexMatch, }: Options) => HandleInputEvent;
12
12
  export {};
@@ -3,10 +3,10 @@ import type { InputRuleWrapper } from './editor-common';
3
3
  import type { OnBeforeRegexMatch, OnInputEvent } from './types';
4
4
  type Options = {
5
5
  allowInsertTextOnDocument?: boolean;
6
- checkOnBlur?: boolean;
7
6
  appendTextOnBlur?: string;
8
- onInputEvent?: OnInputEvent;
7
+ checkOnBlur?: boolean;
9
8
  onBeforeRegexMatch?: OnBeforeRegexMatch;
9
+ onInputEvent?: OnInputEvent;
10
10
  };
11
11
  export declare function createInputRulePlugin(pluginName: string, rules: InputRuleWrapper[], options?: Options): SafePluginSpec;
12
12
  export {};
@@ -2,23 +2,23 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { InputRuleWrapper } from './editor-common';
4
4
  export type HandleInputEvent = (props: {
5
- view: EditorView;
6
5
  from: number;
7
- to: number;
8
6
  text: string;
7
+ to: number;
8
+ view: EditorView;
9
9
  }) => boolean;
10
10
  export type InputRulePluginState = {
11
- matchedRule: MatchedRule;
12
11
  from: number;
13
- to: number;
12
+ matchedRule: MatchedRule;
14
13
  textInserted: string;
14
+ to: number;
15
15
  } | null;
16
16
  export type MatchedRule = InputRuleWrapper & {
17
17
  result: RegExpExecArray;
18
18
  };
19
19
  export type OnInputEvent = (props: {
20
- state: EditorState;
21
20
  from: number;
21
+ state: EditorState;
22
22
  to: number;
23
23
  }) => boolean;
24
24
  export type OnBeforeRegexMatch = (tr: Transaction) => void;
@@ -1,17 +1,17 @@
1
1
  import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { InputRuleWrapper } from './editor-common';
3
3
  type Options = {
4
- isBlockNodeRule?: boolean;
5
4
  allowInsertTextOnDocument?: boolean;
6
- /**
7
- * Run checks on blur of the editor as well as during input
8
- */
9
- checkOnBlur?: boolean;
10
5
  /**
11
6
  * Append text to the checked text on blur. Useful for checks that normally require a trailing
12
7
  * space or similar
13
8
  */
14
9
  appendTextOnBlur?: string;
10
+ /**
11
+ * Run checks on blur of the editor as well as during input
12
+ */
13
+ checkOnBlur?: boolean;
14
+ isBlockNodeRule?: boolean;
15
15
  };
16
16
  export declare const createPlugin: (pluginName: string, rules: Array<InputRuleWrapper>, options?: Options) => SafePluginSpec;
17
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/prosemirror-input-rules",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "A package that contains helpers to create autoformatting rules for ProseMirror",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,7 +31,7 @@
31
31
  "@babel/runtime": "^7.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@atlaskit/editor-common": "^107.17.0"
34
+ "@atlaskit/editor-common": "^107.29.0"
35
35
  },
36
36
  "techstack": {
37
37
  "@atlassian/frontend": {
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.confluence.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "composite": true,
7
- "outDir": "../../../../../confluence/tsDist/@atlaskit__prosemirror-input-rules",
8
- "rootDir": "../"
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.dev-agents.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../dev-agents/tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.jira.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.post-office.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../post-office/tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.rovo-extension.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../rovo-extension/tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.townsquare.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../townsquare/tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*",
18
- "../src/**/examples.*",
19
- "../src/**/examples/*",
20
- "../src/**/examples/**/*",
21
- "../src/**/*.stories.*",
22
- "../src/**/stories/*",
23
- "../src/**/stories/**/*"
24
- ],
25
- "references": []
26
- }
@@ -1,20 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.volt.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../volt/tsDist/@atlaskit__prosemirror-input-rules/app",
7
- "rootDir": "../",
8
- "composite": true
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*"
18
- ],
19
- "references": []
20
- }
@@ -1,23 +0,0 @@
1
- {
2
- "extends": "../tsconfig",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "paths": {}
7
- },
8
- "include": [
9
- "../src/**/*.ts",
10
- "../src/**/*.tsx"
11
- ],
12
- "exclude": [
13
- "../src/**/__tests__/*",
14
- "../src/**/*.test.*",
15
- "../src/**/test.*",
16
- "../src/**/examples.*",
17
- "../src/**/examples/*",
18
- "../src/**/examples/**/*",
19
- "../src/**/*.stories.*",
20
- "../src/**/stories/*",
21
- "../src/**/stories/**/*"
22
- ]
23
- }