@atlaskit/editor-plugin-interaction 2.0.0 → 3.0.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 +18 -0
- package/afm-cc/tsconfig.json +1 -1
- package/dist/cjs/interactionPlugin.js +2 -6
- package/dist/cjs/pm-plugins/main.js +1 -2
- package/dist/es2019/interactionPlugin.js +2 -6
- package/dist/es2019/pm-plugins/main.js +1 -2
- package/dist/esm/interactionPlugin.js +2 -6
- package/dist/esm/pm-plugins/main.js +1 -2
- package/dist/types/interactionPluginType.d.ts +0 -1
- package/dist/types-ts4.5/interactionPluginType.d.ts +0 -1
- package/package.json +4 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-interaction
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#173895](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173895)
|
|
8
|
+
[`6e123631d7c26`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e123631d7c26) -
|
|
9
|
+
Clean up platform_editor_interaction_api_refactor
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 2.0.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 2.0.0
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -9,17 +9,13 @@ var interactionPlugin = exports.interactionPlugin = function interactionPlugin()
|
|
|
9
9
|
return {
|
|
10
10
|
name: 'interaction',
|
|
11
11
|
getSharedState: function getSharedState(editorState) {
|
|
12
|
-
var _key$getState
|
|
12
|
+
var _key$getState;
|
|
13
13
|
if (!editorState) {
|
|
14
14
|
return {
|
|
15
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
16
|
-
hasHadInteraction: false,
|
|
17
15
|
interactionState: 'hasNotHadInteraction'
|
|
18
16
|
};
|
|
19
17
|
}
|
|
20
18
|
return {
|
|
21
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
22
|
-
hasHadInteraction: Boolean((_key$getState = _main.key.getState(editorState)) === null || _key$getState === void 0 ? void 0 : _key$getState.hasHadInteraction),
|
|
23
19
|
/**
|
|
24
20
|
* Interaction state can either be null or 'hasNotHadInteraction'. We
|
|
25
21
|
* are specifically only returning an explicit value for 'hasNotHadInteraction'
|
|
@@ -27,7 +23,7 @@ var interactionPlugin = exports.interactionPlugin = function interactionPlugin()
|
|
|
27
23
|
* with the editor. The behaviour of when `hasHadInteraction` is true and
|
|
28
24
|
* when the plugin is undefined should be the same.
|
|
29
25
|
*/
|
|
30
|
-
interactionState: (_key$
|
|
26
|
+
interactionState: (_key$getState = _main.key.getState(editorState)) !== null && _key$getState !== void 0 && _key$getState.hasHadInteraction ? null : 'hasNotHadInteraction'
|
|
31
27
|
};
|
|
32
28
|
},
|
|
33
29
|
commands: {
|
|
@@ -8,7 +8,6 @@ exports.key = exports.createPlugin = void 0;
|
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
10
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var key = exports.key = new _state.PluginKey('interactionPluginHandler');
|
|
13
12
|
var handleInteraction = function handleInteraction(view) {
|
|
14
13
|
var interactionState = key.getState(view.state);
|
|
@@ -49,7 +48,7 @@ var createPlugin = exports.createPlugin = function createPlugin() {
|
|
|
49
48
|
keyup: handleInteraction,
|
|
50
49
|
// Handle drag and drop _into_ the editor from outside. Eg image DnD
|
|
51
50
|
drop: handleInteraction,
|
|
52
|
-
focus:
|
|
51
|
+
focus: handleInteraction
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
});
|
|
@@ -3,17 +3,13 @@ export const interactionPlugin = () => {
|
|
|
3
3
|
return {
|
|
4
4
|
name: 'interaction',
|
|
5
5
|
getSharedState(editorState) {
|
|
6
|
-
var _key$getState
|
|
6
|
+
var _key$getState;
|
|
7
7
|
if (!editorState) {
|
|
8
8
|
return {
|
|
9
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
10
|
-
hasHadInteraction: false,
|
|
11
9
|
interactionState: 'hasNotHadInteraction'
|
|
12
10
|
};
|
|
13
11
|
}
|
|
14
12
|
return {
|
|
15
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
16
|
-
hasHadInteraction: Boolean((_key$getState = key.getState(editorState)) === null || _key$getState === void 0 ? void 0 : _key$getState.hasHadInteraction),
|
|
17
13
|
/**
|
|
18
14
|
* Interaction state can either be null or 'hasNotHadInteraction'. We
|
|
19
15
|
* are specifically only returning an explicit value for 'hasNotHadInteraction'
|
|
@@ -21,7 +17,7 @@ export const interactionPlugin = () => {
|
|
|
21
17
|
* with the editor. The behaviour of when `hasHadInteraction` is true and
|
|
22
18
|
* when the plugin is undefined should be the same.
|
|
23
19
|
*/
|
|
24
|
-
interactionState: (_key$
|
|
20
|
+
interactionState: (_key$getState = key.getState(editorState)) !== null && _key$getState !== void 0 && _key$getState.hasHadInteraction ? null : 'hasNotHadInteraction'
|
|
25
21
|
};
|
|
26
22
|
},
|
|
27
23
|
commands: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
export const key = new PluginKey('interactionPluginHandler');
|
|
5
4
|
const handleInteraction = view => {
|
|
6
5
|
const interactionState = key.getState(view.state);
|
|
@@ -40,7 +39,7 @@ export const createPlugin = () => new SafePlugin({
|
|
|
40
39
|
keyup: handleInteraction,
|
|
41
40
|
// Handle drag and drop _into_ the editor from outside. Eg image DnD
|
|
42
41
|
drop: handleInteraction,
|
|
43
|
-
focus:
|
|
42
|
+
focus: handleInteraction
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
});
|
|
@@ -3,17 +3,13 @@ export var interactionPlugin = function interactionPlugin() {
|
|
|
3
3
|
return {
|
|
4
4
|
name: 'interaction',
|
|
5
5
|
getSharedState: function getSharedState(editorState) {
|
|
6
|
-
var _key$getState
|
|
6
|
+
var _key$getState;
|
|
7
7
|
if (!editorState) {
|
|
8
8
|
return {
|
|
9
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
10
|
-
hasHadInteraction: false,
|
|
11
9
|
interactionState: 'hasNotHadInteraction'
|
|
12
10
|
};
|
|
13
11
|
}
|
|
14
12
|
return {
|
|
15
|
-
// Clean up with platform_editor_interaction_api_refactor
|
|
16
|
-
hasHadInteraction: Boolean((_key$getState = key.getState(editorState)) === null || _key$getState === void 0 ? void 0 : _key$getState.hasHadInteraction),
|
|
17
13
|
/**
|
|
18
14
|
* Interaction state can either be null or 'hasNotHadInteraction'. We
|
|
19
15
|
* are specifically only returning an explicit value for 'hasNotHadInteraction'
|
|
@@ -21,7 +17,7 @@ export var interactionPlugin = function interactionPlugin() {
|
|
|
21
17
|
* with the editor. The behaviour of when `hasHadInteraction` is true and
|
|
22
18
|
* when the plugin is undefined should be the same.
|
|
23
19
|
*/
|
|
24
|
-
interactionState: (_key$
|
|
20
|
+
interactionState: (_key$getState = key.getState(editorState)) !== null && _key$getState !== void 0 && _key$getState.hasHadInteraction ? null : 'hasNotHadInteraction'
|
|
25
21
|
};
|
|
26
22
|
},
|
|
27
23
|
commands: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
export var key = new PluginKey('interactionPluginHandler');
|
|
6
5
|
var handleInteraction = function handleInteraction(view) {
|
|
7
6
|
var interactionState = key.getState(view.state);
|
|
@@ -42,7 +41,7 @@ export var createPlugin = function createPlugin() {
|
|
|
42
41
|
keyup: handleInteraction,
|
|
43
42
|
// Handle drag and drop _into_ the editor from outside. Eg image DnD
|
|
44
43
|
drop: handleInteraction,
|
|
45
|
-
focus:
|
|
44
|
+
focus: handleInteraction
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-interaction",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Interaction plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,24 +23,20 @@
|
|
|
23
23
|
".": "./src/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/editor-common": "^
|
|
26
|
+
"@atlaskit/editor-common": "^107.1.0",
|
|
27
27
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
28
28
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
29
29
|
"@babel/runtime": "^7.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@atlaskit/tokens": "^5.
|
|
32
|
+
"@atlaskit/tokens": "^5.4.0",
|
|
33
33
|
"react": "^18.2.0",
|
|
34
34
|
"react-dom": "^18.2.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"typescript": "~5.4.2"
|
|
38
38
|
},
|
|
39
|
-
"platform-feature-flags": {
|
|
40
|
-
"platform_editor_interaction_api_refactor": {
|
|
41
|
-
"type": "boolean"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
39
|
+
"platform-feature-flags": {},
|
|
44
40
|
"techstack": {
|
|
45
41
|
"@atlassian/frontend": {
|
|
46
42
|
"code-structure": [
|