@atlaskit/editor-plugin-engagement-platform 12.0.0 → 13.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,31 @@
1
1
  # @atlaskit/editor-plugin-engagement-platform
2
2
 
3
+ ## 13.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 12.0.0
4
30
 
5
31
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-engagement-platform",
3
- "version": "12.0.0",
3
+ "version": "13.0.0",
4
4
  "description": "Engagement platform plugin for @atlaskit/editor-core“",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -18,23 +18,15 @@
18
18
  "module": "dist/esm/index.js",
19
19
  "module:es2019": "dist/es2019/index.js",
20
20
  "types": "dist/types/index.d.ts",
21
- "typesVersions": {
22
- ">=4.5 <5.4": {
23
- "*": [
24
- "dist/types-ts4.5/*",
25
- "dist/types-ts4.5/index.d.ts"
26
- ]
27
- }
28
- },
29
21
  "sideEffects": false,
30
22
  "atlaskit:src": "src/index.ts",
31
23
  "dependencies": {
32
- "@atlaskit/editor-plugin-analytics": "^11.0.0",
33
- "@atlaskit/editor-prosemirror": "^7.3.0",
24
+ "@atlaskit/editor-plugin-analytics": "^12.0.0",
25
+ "@atlaskit/editor-prosemirror": "^8.0.0",
34
26
  "@babel/runtime": "^7.0.0"
35
27
  },
36
28
  "peerDependencies": {
37
- "@atlaskit/editor-common": "^115.0.0",
29
+ "@atlaskit/editor-common": "^116.0.0",
38
30
  "react": "^18.2.0",
39
31
  "react-dom": "^18.2.0"
40
32
  },
@@ -1,3 +0,0 @@
1
- import type { CoordinationClient } from '../engagementPlatformPluginType';
2
- import type { EngagementPlatformPluginApi } from './types';
3
- export declare function startMessage(api: EngagementPlatformPluginApi | undefined, coordinationClient: CoordinationClient): (messageId: string, variationId?: string) => Promise<boolean>;
@@ -1,3 +0,0 @@
1
- import type { CoordinationClient } from '../engagementPlatformPluginType';
2
- import type { EngagementPlatformPluginApi } from './types';
3
- export declare function stopMessage(api: EngagementPlatformPluginApi | undefined, coordinationClient: CoordinationClient): (messageId: string) => Promise<boolean>;
@@ -1,2 +0,0 @@
1
- import type { EngagementPlatformPlugin } from '../engagementPlatformPluginType';
2
- export type EngagementPlatformPluginApi = Parameters<EngagementPlatformPlugin>[0]['api'];
@@ -1,2 +0,0 @@
1
- import type { EngagementPlatformPlugin } from './engagementPlatformPluginType';
2
- export declare const engagementPlatformPlugin: EngagementPlatformPlugin;
@@ -1,91 +0,0 @@
1
- import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
2
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
3
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type { EngagementPlatformPmPluginState } from './pm-plugins/engagementPlatformPmPlugin/types';
5
- export type EngagementPlatformPlugin = NextEditorPlugin<'engagementPlatform', {
6
- actions: {
7
- /**
8
- * Start an Engagement Platform external message with given ID and optional variation ID.
9
- *
10
- * This API action requires the `coordinationClient` to be provided in the plugin configuration.
11
- *
12
- * WARNING: Don't forget to STOP
13
- *
14
- * You must call {@link stopMessage} when your message has finished being displayed to a user.
15
- * If you do not call {@link stopMessage}, your message will prevent the user from seeing any other
16
- * messages until the Expiry time for the message is reached.
17
- *
18
- * @see https://developer.atlassian.com/platform/personalization/engagement/guides/external/create-external-message/#using-the-lower-level-react-class-directly---coordinationclient
19
- */
20
- startMessage: (messageId: string, variationId?: string) => Promise<boolean>;
21
- /**
22
- * Stop an Engagement Platform external message with given ID.
23
- *
24
- * This API action requires the `coordinationClient` to be provided in the plugin configuration.
25
- *
26
- * @see https://developer.atlassian.com/platform/personalization/engagement/guides/external/create-external-message/#using-the-lower-level-react-class-directly---coordinationclient
27
- */
28
- stopMessage: (messageId: string) => Promise<boolean>;
29
- };
30
- dependencies: [
31
- OptionalPlugin<AnalyticsPlugin>
32
- ];
33
- pluginConfiguration: EngagementPlatformPluginOptions;
34
- sharedState: EngagementPlatformPluginState;
35
- }>;
36
- /**
37
- * Engagement Platform coordination client.
38
- *
39
- * Product implementations should satisfy this interface.
40
- */
41
- export interface CoordinationClient {
42
- start(messageId: string, variationId?: string): Promise<boolean>;
43
- stop(messageId: string): Promise<boolean>;
44
- }
45
- export type EngagementPlatformPluginOptions = {
46
- /**
47
- * Engagement Platform API client.
48
- *
49
- * This client is used to start and stop external messages in the Engagement Platform.
50
- * It should be provided by a product.
51
- *
52
- * Without this client the next Engagement Platform plugin api calls will not work:
53
- * - `startMessage`
54
- * - `stopMessage`
55
- * - `getMessageActivities`
56
- * - `isMessageActive`
57
- *
58
- * Product packages provide this client implementation.
59
- */
60
- coordinationClient: CoordinationClient;
61
- epComponents?: EpComponents;
62
- epHooks?: EpHooks;
63
- };
64
- /**
65
- * @private
66
- * @deprecated Use {@link EngagementPlatformPluginOptions} instead.
67
- * @see https://product-fabric.atlassian.net/browse/ED-27496
68
- */
69
- export type EngagementPlatformPluginConfig = EngagementPlatformPluginOptions;
70
- export type EpComponents = {
71
- Coordination: ComponentType<{
72
- children: JSX.Element;
73
- client: CoordinationClient;
74
- fallback: ReactNode;
75
- messageId: string;
76
- }>;
77
- EngagementInlineDialog: ComponentType<PropsWithChildren<{
78
- engagementId: string;
79
- }>>;
80
- EngagementSpotlight: ComponentType<{
81
- engagementId: string;
82
- }>;
83
- };
84
- export type EpHooks = {
85
- useCoordination: (client: CoordinationClient, messageId: string) => [
86
- boolean,
87
- (force?: boolean) => Promise<void>
88
- ];
89
- };
90
- /** Shared state of the Engagement Platform plugin. */
91
- export type EngagementPlatformPluginState = EngagementPlatformPmPluginState | undefined;
@@ -1,2 +0,0 @@
1
- export { engagementPlatformPlugin } from './engagementPlatformPlugin';
2
- export type { EngagementPlatformPlugin, EngagementPlatformPluginConfig, EngagementPlatformPluginOptions, EpComponents, EpHooks, CoordinationClient, EngagementPlatformPluginState, } from './engagementPlatformPluginType';
@@ -1,4 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EngagementPlatformPluginOptions } from '../../engagementPlatformPluginType';
3
- import type { EngagementPlatformPmPluginState } from './types';
4
- export declare const engagementPlatformPmPlugin: (pluginConfig: EngagementPlatformPluginOptions) => SafePlugin<EngagementPlatformPmPluginState>;
@@ -1,3 +0,0 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
2
- import type { EngagementPlatformPmPluginCommand } from './types';
3
- export declare const engagementPlatformPmPluginCommand: (command: EngagementPlatformPmPluginCommand) => EditorCommand;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { EngagementPlatformPluginState } from '../../engagementPlatformPluginType';
3
- export declare const engagementPlatformPmPluginKey: PluginKey<EngagementPlatformPluginState>;
@@ -1,55 +0,0 @@
1
- import type { CoordinationClient, EpComponents, EpHooks } from '../../engagementPlatformPluginType';
2
- export interface EngagementPlatformPmPluginState {
3
- /** Engagement Platform coordination client */
4
- coordinationClient: CoordinationClient;
5
- epComponents?: EpComponents;
6
- epHooks?: EpHooks;
7
- /**
8
- * State of Engagement Platform messages in the Editor.
9
- *
10
- * Contains a map of message IDs to their active state.
11
- */
12
- messageStates: {
13
- [messageId: string]: boolean;
14
- };
15
- /**
16
- * Promise for each message that has been started.
17
- *
18
- * This is used to prevent multiple start requests for the same message.
19
- */
20
- startMessagePromises: {
21
- [messageId: string]: Promise<boolean>;
22
- };
23
- /**
24
- * Promise for each message that has been stopped.
25
- *
26
- * This is used to prevent multiple stop requests for the same message.
27
- */
28
- stopMessagePromises: {
29
- [messageId: string]: Promise<boolean>;
30
- };
31
- }
32
- /** Command to EP plugin, that set state of a message with given ID. */
33
- export interface SetMessageStateCommand {
34
- messageId: string;
35
- state: boolean;
36
- type: 'setMessageState';
37
- }
38
- /** Command to EP plugin, that set promise for starting a message with given ID. */
39
- export interface SetStartMessagePromiseCommand {
40
- messageId: string;
41
- promise: Promise<boolean> | undefined;
42
- type: 'setStartMessagePromise';
43
- }
44
- /** Command to EP plugin, that set promise for stopping a message with given ID. */
45
- export interface SetStopMessagePromiseCommand {
46
- messageId: string;
47
- promise: Promise<boolean> | undefined;
48
- type: 'setStopMessagePromise';
49
- }
50
- /** Commands that can be applied to the Engagement Platform plugin state. */
51
- export type EngagementPlatformPmPluginCommand = SetMessageStateCommand | SetStartMessagePromiseCommand | SetStopMessagePromiseCommand;
52
- export interface EngagementPlatformPmPluginTrMeta {
53
- /** List of commands that should be applied to the Engagement Platform plugin state. */
54
- commands: EngagementPlatformPmPluginCommand[];
55
- }