@atlaskit/editor-plugin-interaction 2.0.1 → 4.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 CHANGED
@@ -1,5 +1,57 @@
1
1
  # @atlaskit/editor-plugin-interaction
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
8
+ [`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
9
+ Make `@atlaskit/editor-common` a peer dependency
10
+
11
+ **WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
12
+ all editor plugin packages.
13
+
14
+ **WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
15
+ consuming applications, preventing issues caused by multiple versions of singleton libraries (such
16
+ as context mismatches or duplicated state). This is especially important for packages that rely on
17
+ shared context or singletons.
18
+
19
+ **HOW TO ADJUST:**
20
+
21
+ - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
22
+ any of these editor plugins.
23
+ - Ensure the version you install matches the version required by the plugins.
24
+ - You can use the
25
+ [`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
26
+ verify that all required peer dependencies are installed and compatible.
27
+ - Example install command:
28
+ ```
29
+ npm install @atlaskit/editor-common
30
+ ```
31
+ or
32
+ ```
33
+ yarn add @atlaskit/editor-common
34
+ ```
35
+
36
+ **Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
37
+ application level, you may see errors or unexpected behavior.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies
42
+
43
+ ## 3.0.0
44
+
45
+ ### Major Changes
46
+
47
+ - [#173895](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173895)
48
+ [`6e123631d7c26`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6e123631d7c26) -
49
+ Clean up platform_editor_interaction_api_refactor
50
+
51
+ ### Patch Changes
52
+
53
+ - Updated dependencies
54
+
3
55
  ## 2.0.1
4
56
 
5
57
  ### Patch Changes
@@ -18,10 +18,10 @@
18
18
  ],
19
19
  "references": [
20
20
  {
21
- "path": "../../editor-common/afm-cc/tsconfig.json"
21
+ "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
22
22
  },
23
23
  {
24
- "path": "../../../platform/feature-flags/afm-cc/tsconfig.json"
24
+ "path": "../../editor-common/afm-cc/tsconfig.json"
25
25
  },
26
26
  {
27
27
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
@@ -18,10 +18,10 @@
18
18
  ],
19
19
  "references": [
20
20
  {
21
- "path": "../../editor-common/afm-jira/tsconfig.json"
21
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
22
22
  },
23
23
  {
24
- "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
24
+ "path": "../../editor-common/afm-jira/tsconfig.json"
25
25
  },
26
26
  {
27
27
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
@@ -18,10 +18,10 @@
18
18
  ],
19
19
  "references": [
20
20
  {
21
- "path": "../../editor-common/afm-post-office/tsconfig.json"
21
+ "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
22
22
  },
23
23
  {
24
- "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
24
+ "path": "../../editor-common/afm-post-office/tsconfig.json"
25
25
  },
26
26
  {
27
27
  "path": "../../../design-system/tokens/afm-post-office/tsconfig.json"
@@ -0,0 +1,30 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.volt.json",
3
+ "compilerOptions": {
4
+ "target": "es5",
5
+ "outDir": "../../../../../volt/tsDist/@atlaskit__editor-plugin-interaction/app",
6
+ "rootDir": "../",
7
+ "composite": true
8
+ },
9
+ "include": [
10
+ "../src/**/*.ts",
11
+ "../src/**/*.tsx"
12
+ ],
13
+ "exclude": [
14
+ "../src/**/__tests__/*",
15
+ "../src/**/*.test.*",
16
+ "../src/**/test.*",
17
+ "../src/**/examples.*"
18
+ ],
19
+ "references": [
20
+ {
21
+ "path": "../../editor-common/afm-volt/tsconfig.json"
22
+ },
23
+ {
24
+ "path": "../../../platform/feature-flags/afm-volt/tsconfig.json"
25
+ },
26
+ {
27
+ "path": "../../../design-system/tokens/afm-volt/tsconfig.json"
28
+ }
29
+ ]
30
+ }
@@ -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, _key$getState2;
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$getState2 = _main.key.getState(editorState)) !== null && _key$getState2 !== void 0 && _key$getState2.hasHadInteraction ? null : 'hasNotHadInteraction'
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: (0, _platformFeatureFlags.fg)('platform_editor_interaction_api_refactor') ? handleInteraction : undefined
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, _key$getState2;
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$getState2 = key.getState(editorState)) !== null && _key$getState2 !== void 0 && _key$getState2.hasHadInteraction ? null : 'hasNotHadInteraction'
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: fg('platform_editor_interaction_api_refactor') ? handleInteraction : undefined
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, _key$getState2;
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$getState2 = key.getState(editorState)) !== null && _key$getState2 !== void 0 && _key$getState2.hasHadInteraction ? null : 'hasNotHadInteraction'
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: fg('platform_editor_interaction_api_refactor') ? handleInteraction : undefined
44
+ focus: handleInteraction
46
45
  }
47
46
  }
48
47
  });
@@ -3,7 +3,6 @@ type InteractionCommands = {
3
3
  handleInteraction: EditorCommand;
4
4
  };
5
5
  export type SharedInteractionState = {
6
- hasHadInteraction: boolean;
7
6
  interactionState: null | 'hasNotHadInteraction';
8
7
  };
9
8
  export type InteractionPlugin = NextEditorPlugin<'interaction', {
@@ -3,7 +3,6 @@ type InteractionCommands = {
3
3
  handleInteraction: EditorCommand;
4
4
  };
5
5
  export type SharedInteractionState = {
6
- hasHadInteraction: boolean;
7
6
  interactionState: null | 'hasNotHadInteraction';
8
7
  };
9
8
  export type InteractionPlugin = NextEditorPlugin<'interaction', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-interaction",
3
- "version": "2.0.1",
3
+ "version": "4.0.0",
4
4
  "description": "Interaction plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -9,8 +9,7 @@
9
9
  },
10
10
  "atlassian": {
11
11
  "team": "Editor: Jenga",
12
- "singleton": true,
13
- "runReact18": true
12
+ "singleton": true
14
13
  },
15
14
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
15
  "main": "dist/cjs/index.js",
@@ -23,24 +22,20 @@
23
22
  ".": "./src/index.ts"
24
23
  },
25
24
  "dependencies": {
26
- "@atlaskit/editor-common": "^107.0.0",
27
25
  "@atlaskit/editor-prosemirror": "7.0.0",
28
26
  "@atlaskit/platform-feature-flags": "^1.1.0",
29
27
  "@babel/runtime": "^7.0.0"
30
28
  },
31
29
  "peerDependencies": {
32
- "@atlaskit/tokens": "^5.2.0",
30
+ "@atlaskit/editor-common": "^107.6.0",
31
+ "@atlaskit/tokens": "^5.4.0",
33
32
  "react": "^18.2.0",
34
33
  "react-dom": "^18.2.0"
35
34
  },
36
35
  "devDependencies": {
37
36
  "typescript": "~5.4.2"
38
37
  },
39
- "platform-feature-flags": {
40
- "platform_editor_interaction_api_refactor": {
41
- "type": "boolean"
42
- }
43
- },
38
+ "platform-feature-flags": {},
44
39
  "techstack": {
45
40
  "@atlassian/frontend": {
46
41
  "code-structure": [