@atlaskit/editor-plugin-engagement-platform 3.1.4 → 4.0.1

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,53 @@
1
1
  # @atlaskit/editor-plugin-engagement-platform
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
11
+ ## 4.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
16
+ [`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
17
+ Make `@atlaskit/editor-common` a peer dependency
18
+
19
+ **WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
20
+ all editor plugin packages.
21
+
22
+ **WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
23
+ consuming applications, preventing issues caused by multiple versions of singleton libraries (such
24
+ as context mismatches or duplicated state). This is especially important for packages that rely on
25
+ shared context or singletons.
26
+
27
+ **HOW TO ADJUST:**
28
+
29
+ - Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
30
+ any of these editor plugins.
31
+ - Ensure the version you install matches the version required by the plugins.
32
+ - You can use the
33
+ [`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
34
+ verify that all required peer dependencies are installed and compatible.
35
+ - Example install command:
36
+ ```
37
+ npm install @atlaskit/editor-common
38
+ ```
39
+ or
40
+ ```
41
+ yarn add @atlaskit/editor-common
42
+ ```
43
+
44
+ **Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
45
+ application level, you may see errors or unexpected behavior.
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies
50
+
3
51
  ## 3.1.4
4
52
 
5
53
  ### Patch Changes
@@ -27,8 +27,8 @@ export type EngagementPlatformPlugin = NextEditorPlugin<'engagementPlatform', {
27
27
  */
28
28
  stopMessage: (messageId: string) => Promise<boolean>;
29
29
  };
30
- pluginConfiguration: EngagementPlatformPluginOptions;
31
30
  dependencies: [OptionalPlugin<AnalyticsPlugin>];
31
+ pluginConfiguration: EngagementPlatformPluginOptions;
32
32
  sharedState: EngagementPlatformPluginState;
33
33
  }>;
34
34
  /**
@@ -42,8 +42,6 @@ export interface CoordinationClient {
42
42
  stop(messageId: string): Promise<boolean>;
43
43
  }
44
44
  export type EngagementPlatformPluginOptions = {
45
- epComponents: EpComponents;
46
- epHooks: EpHooks;
47
45
  /**
48
46
  * Engagement Platform API client.
49
47
  *
@@ -59,6 +57,8 @@ export type EngagementPlatformPluginOptions = {
59
57
  * The client lives in the `@atlassiansox/engagekit-ts` package.
60
58
  */
61
59
  coordinationClient: CoordinationClient;
60
+ epComponents: EpComponents;
61
+ epHooks: EpHooks;
62
62
  };
63
63
  /**
64
64
  * @private
@@ -67,17 +67,17 @@ export type EngagementPlatformPluginOptions = {
67
67
  */
68
68
  export type EngagementPlatformPluginConfig = EngagementPlatformPluginOptions;
69
69
  export type EpComponents = {
70
- EngagementSpotlight: ComponentType<{
71
- engagementId: string;
70
+ Coordination: ComponentType<{
71
+ children: JSX.Element;
72
+ client: CoordinationClient;
73
+ fallback: ReactNode;
74
+ messageId: string;
72
75
  }>;
73
76
  EngagementInlineDialog: ComponentType<PropsWithChildren<{
74
77
  engagementId: string;
75
78
  }>>;
76
- Coordination: ComponentType<{
77
- client: CoordinationClient;
78
- messageId: string;
79
- fallback: ReactNode;
80
- children: JSX.Element;
79
+ EngagementSpotlight: ComponentType<{
80
+ engagementId: string;
81
81
  }>;
82
82
  };
83
83
  export type EpHooks = {
@@ -1,5 +1,9 @@
1
1
  import type { CoordinationClient, EpComponents, EpHooks } from '../../engagementPlatformPluginType';
2
2
  export interface EngagementPlatformPmPluginState {
3
+ /** Engagement Platform coordination client */
4
+ coordinationClient: CoordinationClient;
5
+ epComponents: EpComponents;
6
+ epHooks: EpHooks;
3
7
  /**
4
8
  * State of Engagement Platform messages in the Editor.
5
9
  *
@@ -24,28 +28,24 @@ export interface EngagementPlatformPmPluginState {
24
28
  stopMessagePromises: {
25
29
  [messageId: string]: Promise<boolean>;
26
30
  };
27
- /** Engagement Platform coordination client */
28
- coordinationClient: CoordinationClient;
29
- epComponents: EpComponents;
30
- epHooks: EpHooks;
31
31
  }
32
32
  /** Command to EP plugin, that set state of a message with given ID. */
33
33
  export interface SetMessageStateCommand {
34
- type: 'setMessageState';
35
34
  messageId: string;
36
35
  state: boolean;
36
+ type: 'setMessageState';
37
37
  }
38
38
  /** Command to EP plugin, that set promise for starting a message with given ID. */
39
39
  export interface SetStartMessagePromiseCommand {
40
- type: 'setStartMessagePromise';
41
40
  messageId: string;
42
41
  promise: Promise<boolean> | undefined;
42
+ type: 'setStartMessagePromise';
43
43
  }
44
44
  /** Command to EP plugin, that set promise for stopping a message with given ID. */
45
45
  export interface SetStopMessagePromiseCommand {
46
- type: 'setStopMessagePromise';
47
46
  messageId: string;
48
47
  promise: Promise<boolean> | undefined;
48
+ type: 'setStopMessagePromise';
49
49
  }
50
50
  /** Commands that can be applied to the Engagement Platform plugin state. */
51
51
  export type EngagementPlatformPmPluginCommand = SetMessageStateCommand | SetStartMessagePromiseCommand | SetStopMessagePromiseCommand;
@@ -27,10 +27,10 @@ export type EngagementPlatformPlugin = NextEditorPlugin<'engagementPlatform', {
27
27
  */
28
28
  stopMessage: (messageId: string) => Promise<boolean>;
29
29
  };
30
- pluginConfiguration: EngagementPlatformPluginOptions;
31
30
  dependencies: [
32
31
  OptionalPlugin<AnalyticsPlugin>
33
32
  ];
33
+ pluginConfiguration: EngagementPlatformPluginOptions;
34
34
  sharedState: EngagementPlatformPluginState;
35
35
  }>;
36
36
  /**
@@ -44,8 +44,6 @@ export interface CoordinationClient {
44
44
  stop(messageId: string): Promise<boolean>;
45
45
  }
46
46
  export type EngagementPlatformPluginOptions = {
47
- epComponents: EpComponents;
48
- epHooks: EpHooks;
49
47
  /**
50
48
  * Engagement Platform API client.
51
49
  *
@@ -61,6 +59,8 @@ export type EngagementPlatformPluginOptions = {
61
59
  * The client lives in the `@atlassiansox/engagekit-ts` package.
62
60
  */
63
61
  coordinationClient: CoordinationClient;
62
+ epComponents: EpComponents;
63
+ epHooks: EpHooks;
64
64
  };
65
65
  /**
66
66
  * @private
@@ -69,17 +69,17 @@ export type EngagementPlatformPluginOptions = {
69
69
  */
70
70
  export type EngagementPlatformPluginConfig = EngagementPlatformPluginOptions;
71
71
  export type EpComponents = {
72
- EngagementSpotlight: ComponentType<{
73
- engagementId: string;
72
+ Coordination: ComponentType<{
73
+ children: JSX.Element;
74
+ client: CoordinationClient;
75
+ fallback: ReactNode;
76
+ messageId: string;
74
77
  }>;
75
78
  EngagementInlineDialog: ComponentType<PropsWithChildren<{
76
79
  engagementId: string;
77
80
  }>>;
78
- Coordination: ComponentType<{
79
- client: CoordinationClient;
80
- messageId: string;
81
- fallback: ReactNode;
82
- children: JSX.Element;
81
+ EngagementSpotlight: ComponentType<{
82
+ engagementId: string;
83
83
  }>;
84
84
  };
85
85
  export type EpHooks = {
@@ -1,5 +1,9 @@
1
1
  import type { CoordinationClient, EpComponents, EpHooks } from '../../engagementPlatformPluginType';
2
2
  export interface EngagementPlatformPmPluginState {
3
+ /** Engagement Platform coordination client */
4
+ coordinationClient: CoordinationClient;
5
+ epComponents: EpComponents;
6
+ epHooks: EpHooks;
3
7
  /**
4
8
  * State of Engagement Platform messages in the Editor.
5
9
  *
@@ -24,28 +28,24 @@ export interface EngagementPlatformPmPluginState {
24
28
  stopMessagePromises: {
25
29
  [messageId: string]: Promise<boolean>;
26
30
  };
27
- /** Engagement Platform coordination client */
28
- coordinationClient: CoordinationClient;
29
- epComponents: EpComponents;
30
- epHooks: EpHooks;
31
31
  }
32
32
  /** Command to EP plugin, that set state of a message with given ID. */
33
33
  export interface SetMessageStateCommand {
34
- type: 'setMessageState';
35
34
  messageId: string;
36
35
  state: boolean;
36
+ type: 'setMessageState';
37
37
  }
38
38
  /** Command to EP plugin, that set promise for starting a message with given ID. */
39
39
  export interface SetStartMessagePromiseCommand {
40
- type: 'setStartMessagePromise';
41
40
  messageId: string;
42
41
  promise: Promise<boolean> | undefined;
42
+ type: 'setStartMessagePromise';
43
43
  }
44
44
  /** Command to EP plugin, that set promise for stopping a message with given ID. */
45
45
  export interface SetStopMessagePromiseCommand {
46
- type: 'setStopMessagePromise';
47
46
  messageId: string;
48
47
  promise: Promise<boolean> | undefined;
48
+ type: 'setStopMessagePromise';
49
49
  }
50
50
  /** Commands that can be applied to the Engagement Platform plugin state. */
51
51
  export type EngagementPlatformPmPluginCommand = SetMessageStateCommand | SetStartMessagePromiseCommand | SetStopMessagePromiseCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-engagement-platform",
3
- "version": "3.1.4",
3
+ "version": "4.0.1",
4
4
  "description": "Engagement platform plugin for @atlaskit/editor-core“",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -11,8 +11,7 @@
11
11
  "team": "Editor: Core Experiences",
12
12
  "inPublicMirror": false,
13
13
  "singleton": true,
14
- "releaseModel": "continuous",
15
- "runReact18": true
14
+ "releaseModel": "continuous"
16
15
  },
17
16
  "repository": "https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo",
18
17
  "main": "dist/cjs/index.js",
@@ -33,12 +32,12 @@
33
32
  ".": "./src/index.ts"
34
33
  },
35
34
  "dependencies": {
36
- "@atlaskit/editor-common": "^107.0.0",
37
- "@atlaskit/editor-plugin-analytics": "^2.3.0",
35
+ "@atlaskit/editor-plugin-analytics": "^3.0.0",
38
36
  "@atlaskit/editor-prosemirror": "7.0.0",
39
37
  "@babel/runtime": "^7.0.0"
40
38
  },
41
39
  "peerDependencies": {
40
+ "@atlaskit/editor-common": "^107.28.0",
42
41
  "react": "^18.2.0",
43
42
  "react-dom": "^18.2.0"
44
43
  },