@atlaskit/editor-plugin-engagement-platform 12.0.0 → 13.1.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,38 @@
1
1
  # @atlaskit/editor-plugin-engagement-platform
2
2
 
3
+ ## 13.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c98e0cf5cc4f6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c98e0cf5cc4f6) -
8
+ Autofix: add explicit package exports (barrel removal)
9
+
10
+ ## 13.0.0
11
+
12
+ ### Major Changes
13
+
14
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
15
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
16
+
17
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
18
+
19
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
20
+
21
+ ```diff
22
+ - "typesVersions": {
23
+ - ">=4.5 <4.9": {
24
+ - "*": [
25
+ - "dist/types-ts4.5/*",
26
+ - "dist/types-ts4.5/index.d.ts"
27
+ - ]
28
+ - }
29
+ - },
30
+ ```
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 12.0.0
4
37
 
5
38
  ### Patch Changes
package/compass.yml ADDED
@@ -0,0 +1,41 @@
1
+ configVersion: 1
2
+ id: ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/5519bb89-825c-4220-bc20-9d4454b28639
3
+ name: '@atlaskit/editor-plugin-engagement-platform'
4
+ ownerId: ari:cloud:identity::team/0250ee69-f755-47fd-a468-bf8a9d10a3c5 # Editor AI
5
+ labels:
6
+ - platform-code
7
+ - platform-afm
8
+ typeId: OTHER
9
+ fields:
10
+ tier: 4
11
+ lifecycle: Active
12
+ isMonorepoProject: true
13
+ links:
14
+ - name: Root Repository
15
+ type: REPOSITORY
16
+ url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master
17
+ - name: Slack Channel
18
+ type: CHAT_CHANNEL
19
+ url: https://atlassian.enterprise.slack.com/archives/C03ULQ29LJ0 # #team-cc-editor-ai
20
+ - name: Editor Plugin Engagement Platform
21
+ type: REPOSITORY
22
+ url: https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/editor/editor-plugin-engagement-platform
23
+ customFields:
24
+ - name: Department
25
+ type: text
26
+ value: Eng - Editor
27
+ - name: Trusted Reviewer Teams
28
+ type: text
29
+ value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
30
+ - name: Technical Owner
31
+ type: user
32
+ value: ari:cloud:identity::user/612646c53fe26c00694fbe6a # Chris Kimber
33
+ - name: Required Reviewers Opt In
34
+ type: boolean
35
+ value: true
36
+ - name: Reviewer Selection Mechanism
37
+ type: text
38
+ value: random(2)
39
+ - name: Required Reviewer Approvals
40
+ type: number
41
+ value: 1
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@atlaskit/editor-plugin-engagement-platform/engagementPlatformPlugin",
3
+ "main": "../dist/cjs/engagementPlatformPlugin.js",
4
+ "module": "../dist/esm/engagementPlatformPlugin.js",
5
+ "module:es2019": "../dist/es2019/engagementPlatformPlugin.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/engagementPlatformPlugin.d.ts"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@atlaskit/editor-plugin-engagement-platform/engagementPlatformPluginType",
3
+ "main": "../dist/cjs/engagementPlatformPluginType.js",
4
+ "module": "../dist/esm/engagementPlatformPluginType.js",
5
+ "module:es2019": "../dist/es2019/engagementPlatformPluginType.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/engagementPlatformPluginType.d.ts"
8
+ }
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.1.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.25.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
- }