@atlaskit/prosemirror-input-rules 3.2.2 → 3.3.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 +16 -0
- package/afm-cc/tsconfig.json +1 -2
- package/afm-jira/tsconfig.json +19 -19
- package/afm-post-office/tsconfig.json +20 -0
- package/dist/es2019/index.js +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/types/handler.d.ts +2 -1
- package/dist/types/plugin.d.ts +2 -1
- package/dist/types/types.d.ts +0 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types-ts4.5/handler.d.ts +2 -1
- package/dist/types-ts4.5/plugin.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +0 -1
- package/dist/types-ts4.5/utils.d.ts +1 -1
- package/package.json +3 -3
- package/src/__tests__/unit/handler.ts +6 -1
- package/src/__tests__/unit/plugin.ts +4 -0
- package/src/handler.ts +1 -1
- package/src/index.ts +2 -0
- package/src/plugin.ts +2 -6
- package/src/types.ts +0 -2
- package/src/utils.ts +2 -1
- package/tsconfig.app.json +0 -1
- package/tsconfig.dev.json +1 -2
- package/tsconfig.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/prosemirror-input-rules
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#105322](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105322)
|
|
8
|
+
[`8876083532adc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8876083532adc) -
|
|
9
|
+
Bumped editor-prosemirror version to 7.0.0
|
|
10
|
+
|
|
11
|
+
## 3.2.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#164503](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/164503)
|
|
16
|
+
[`9dcc5abdbf880`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9dcc5abdbf880) -
|
|
17
|
+
Removed internal re-exports in input rules
|
|
18
|
+
|
|
3
19
|
## 3.2.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
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
|
+
],
|
|
19
|
+
"references": []
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
],
|
|
19
|
+
"references": []
|
|
20
|
+
}
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
// Entry file in package.json
|
|
3
|
+
|
|
1
4
|
export { leafNodeReplacementCharacter, TEXT_INPUT_RULE_TRANSACTION_KEY, MAX_REGEX_MATCH } from './constants';
|
|
2
5
|
export { createInputRulePlugin } from './plugin';
|
|
3
6
|
export { createPlugin } from './utils';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
2
|
+
// Entry file in package.json
|
|
3
|
+
|
|
1
4
|
export { leafNodeReplacementCharacter, TEXT_INPUT_RULE_TRANSACTION_KEY, MAX_REGEX_MATCH } from './constants';
|
|
2
5
|
export { createInputRulePlugin } from './plugin';
|
|
3
6
|
export { createPlugin } from './utils';
|
package/dist/types/handler.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type {
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
|
+
import type { HandleInputEvent, OnBeforeRegexMatch, OnInputEvent } from './types';
|
|
3
4
|
type Options = {
|
|
4
5
|
pluginKey: PluginKey;
|
|
5
6
|
rules: InputRuleWrapper[];
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { InputRuleWrapper
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
|
+
import type { OnBeforeRegexMatch, OnInputEvent } from './types';
|
|
3
4
|
type Options = {
|
|
4
5
|
allowInsertTextOnDocument?: boolean;
|
|
5
6
|
onInputEvent?: OnInputEvent;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { InputRuleWrapper } from './editor-common';
|
|
4
|
-
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply } from './editor-common';
|
|
5
4
|
export type HandleInputEvent = (props: {
|
|
6
5
|
view: EditorView;
|
|
7
6
|
from: number;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { InputRuleWrapper } from './
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
3
|
type Options = {
|
|
4
4
|
isBlockNodeRule?: boolean;
|
|
5
5
|
allowInsertTextOnDocument?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type {
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
|
+
import type { HandleInputEvent, OnBeforeRegexMatch, OnInputEvent } from './types';
|
|
3
4
|
type Options = {
|
|
4
5
|
pluginKey: PluginKey;
|
|
5
6
|
rules: InputRuleWrapper[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { InputRuleWrapper
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
|
+
import type { OnBeforeRegexMatch, OnInputEvent } from './types';
|
|
3
4
|
type Options = {
|
|
4
5
|
allowInsertTextOnDocument?: boolean;
|
|
5
6
|
onInputEvent?: OnInputEvent;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { InputRuleWrapper } from './editor-common';
|
|
4
|
-
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply } from './editor-common';
|
|
5
4
|
export type HandleInputEvent = (props: {
|
|
6
5
|
view: EditorView;
|
|
7
6
|
from: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { InputRuleWrapper } from './
|
|
2
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
3
3
|
type Options = {
|
|
4
4
|
isBlockNodeRule?: boolean;
|
|
5
5
|
allowInsertTextOnDocument?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/prosemirror-input-rules",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "A package that contains helpers to create autoformatting rules for ProseMirror",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"singleton": true
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/editor-prosemirror": "
|
|
30
|
+
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
31
31
|
"@babel/runtime": "^7.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@atlaskit/editor-common": "^
|
|
34
|
+
"@atlaskit/editor-common": "^99.10.0"
|
|
35
35
|
},
|
|
36
36
|
"techstack": {
|
|
37
37
|
"@atlassian/frontend": {
|
|
@@ -6,8 +6,9 @@ import { createEditorState } from '@atlaskit/editor-test-helpers/create-editor-s
|
|
|
6
6
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
7
7
|
import { code_block, doc, p } from '@atlaskit/editor-test-helpers/doc-builder';
|
|
8
8
|
|
|
9
|
+
import type { InputRuleWrapper } from '../../editor-common';
|
|
9
10
|
import { createInputEventHandler } from '../../handler';
|
|
10
|
-
import type { HandleInputEvent
|
|
11
|
+
import type { HandleInputEvent } from '../../types';
|
|
11
12
|
|
|
12
13
|
describe('input-tule/handles/createInputEventHandler', () => {
|
|
13
14
|
let inputEvent: HandleInputEvent;
|
|
@@ -40,6 +41,8 @@ describe('input-tule/handles/createInputEventHandler', () => {
|
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
RULE_BEFORE = {
|
|
44
|
+
// Ignored via go/ees005
|
|
45
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
43
46
|
match: /^(before).*/,
|
|
44
47
|
handler: ruleHandlerMock,
|
|
45
48
|
};
|
|
@@ -91,6 +94,8 @@ describe('input-tule/handles/createInputEventHandler', () => {
|
|
|
91
94
|
let inputHandleResult: boolean;
|
|
92
95
|
beforeEach(() => {
|
|
93
96
|
const RULE_AFTER = {
|
|
97
|
+
// Ignored via go/ees005
|
|
98
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
94
99
|
match: /^(after).*/,
|
|
95
100
|
handler: jest.fn().mockImplementation((state) => {
|
|
96
101
|
return state.tr;
|
|
@@ -40,6 +40,8 @@ describe('input-tule/plugin/createInputRulePlugin', () => {
|
|
|
40
40
|
return state.tr;
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
// Ignored via go/ees005
|
|
44
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
43
45
|
const INLINE_CODE_REGEX = /(\S*)(`[^\s][^`]*`)$/;
|
|
44
46
|
const myCustomInputRule = new SafePlugin(
|
|
45
47
|
createInputRulePlugin(
|
|
@@ -106,6 +108,8 @@ describe('input-tule/plugin/createInputRulePlugin', () => {
|
|
|
106
108
|
return state.tr;
|
|
107
109
|
});
|
|
108
110
|
|
|
111
|
+
// Ignored via go/ees005
|
|
112
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
109
113
|
const CODE_BLOCK_REGEX = /(?!\s)(`{3,})/;
|
|
110
114
|
const myCustomInputRule = new SafePlugin(
|
|
111
115
|
createInputRulePlugin(
|
package/src/handler.ts
CHANGED
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
TEXT_INPUT_RULE_TRANSACTION_KEY,
|
|
7
7
|
} from './constants';
|
|
8
8
|
import { isGapCursorSelection } from './editor-common';
|
|
9
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
9
10
|
import type {
|
|
10
11
|
HandleInputEvent,
|
|
11
12
|
InputRulePluginState,
|
|
12
|
-
InputRuleWrapper,
|
|
13
13
|
MatchedRule,
|
|
14
14
|
OnBeforeRegexMatch,
|
|
15
15
|
OnInputEvent,
|
package/src/index.ts
CHANGED
package/src/plugin.ts
CHANGED
|
@@ -2,13 +2,9 @@ import type { SafePluginSpec } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
|
|
4
4
|
import { TEXT_INPUT_RULE_TRANSACTION_KEY } from './constants';
|
|
5
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
5
6
|
import { createInputEventHandler } from './handler';
|
|
6
|
-
import type {
|
|
7
|
-
InputRulePluginState,
|
|
8
|
-
InputRuleWrapper,
|
|
9
|
-
OnBeforeRegexMatch,
|
|
10
|
-
OnInputEvent,
|
|
11
|
-
} from './types';
|
|
7
|
+
import type { InputRulePluginState, OnBeforeRegexMatch, OnInputEvent } from './types';
|
|
12
8
|
|
|
13
9
|
type Options = {
|
|
14
10
|
allowInsertTextOnDocument?: boolean;
|
package/src/types.ts
CHANGED
|
@@ -3,8 +3,6 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
3
3
|
|
|
4
4
|
import type { InputRuleWrapper } from './editor-common';
|
|
5
5
|
|
|
6
|
-
export type { InputRuleHandler, InputRuleWrapper, OnHandlerApply } from './editor-common';
|
|
7
|
-
|
|
8
6
|
export type HandleInputEvent = (props: {
|
|
9
7
|
view: EditorView;
|
|
10
8
|
from: number;
|
package/src/utils.ts
CHANGED
|
@@ -4,8 +4,9 @@ import type { EditorState, SafePluginSpec } from '@atlaskit/editor-prosemirror/s
|
|
|
4
4
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
|
|
6
6
|
import { isGapCursorSelection } from './editor-common';
|
|
7
|
+
import type { InputRuleWrapper } from './editor-common';
|
|
7
8
|
import { createInputRulePlugin } from './plugin';
|
|
8
|
-
import type {
|
|
9
|
+
import type { OnInputEvent } from './types';
|
|
9
10
|
|
|
10
11
|
const hasUnsupportedMarks = (
|
|
11
12
|
state: EditorState,
|
package/tsconfig.app.json
CHANGED
package/tsconfig.dev.json
CHANGED
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
],
|
|
28
28
|
"exclude": ["./dist/**/*", "./build/**/*", "./node_modules/**/*"],
|
|
29
29
|
"compilerOptions": {
|
|
30
|
-
"baseUrl": "./",
|
|
31
30
|
"composite": true,
|
|
32
31
|
"outDir": "../../../tsDist/@atlaskit__prosemirror-input-rules/dev"
|
|
33
32
|
},
|
|
34
33
|
"references": [
|
|
35
34
|
{
|
|
36
|
-
"path": "tsconfig.app.json"
|
|
35
|
+
"path": "./tsconfig.app.json"
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
38
|
"path": "../editor-common/tsconfig.app.json"
|