@inappstory/js-sdk 3.1.5 → 3.2.0-rc.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/dist/index.esm.mjs +489 -31
- package/dist/index.umd.js +489 -28
- package/dist/types/global.d.ts +1 -1
- package/dist/types/in-app-messaging/iamErrors.d.ts +55 -0
- package/dist/types/in-app-messaging/inAppMessaging.d.ts +44 -0
- package/dist/types/in-app-messaging/index.d.ts +2 -0
- package/dist/types/{storyManager.d.ts → inAppStoryManager.d.ts} +8 -6
- package/dist/types/index.d.ts +3 -2
- package/package.json +2 -1
- package/plugins/dotLottie/dotLottie.umd.js +1 -1
package/dist/types/global.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppearanceManager } from "./appearance-manager";
|
|
2
|
-
import { StoryManager, StoryManagerConfig } from "./
|
|
2
|
+
import { StoryManager, StoryManagerConfig } from "./inAppStoryManager";
|
|
3
3
|
|
|
4
4
|
export type RecursivePartial<T> = {
|
|
5
5
|
[P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> | null : T[P] | null;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare class IamNotFoundByEventError extends Error {
|
|
2
|
+
constructor(eventName: string);
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export declare class IamNotFoundByIdError extends Error {
|
|
7
|
+
constructor(messageId: string | number);
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare class IamNotFoundLimitError extends Error {
|
|
12
|
+
constructor(messageId: string | number);
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare class IamMessageOpenError extends Error {
|
|
17
|
+
constructor(messageId: string | number);
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare class IamOtherReaderIsOpenError extends Error {
|
|
22
|
+
constructor();
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare class IamShowOnlyIfLoadedError extends Error {
|
|
27
|
+
constructor();
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare class IamFrequencyLimitError extends Error {
|
|
32
|
+
constructor();
|
|
33
|
+
name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare class IamCheckDisplayTimeRangeError extends Error {
|
|
37
|
+
constructor();
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare class IamMessageLimitExceededError extends Error {
|
|
42
|
+
constructor(messageId: string | number);
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type IamError =
|
|
47
|
+
| IamNotFoundByEventError
|
|
48
|
+
| IamNotFoundByIdError
|
|
49
|
+
| IamNotFoundLimitError
|
|
50
|
+
| IamMessageOpenError
|
|
51
|
+
| IamOtherReaderIsOpenError
|
|
52
|
+
| IamShowOnlyIfLoadedError
|
|
53
|
+
| IamFrequencyLimitError
|
|
54
|
+
| IamCheckDisplayTimeRangeError
|
|
55
|
+
| IamMessageLimitExceededError;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare enum IamMessageType {
|
|
2
|
+
BottomSheet = 1,
|
|
3
|
+
Modal = 2,
|
|
4
|
+
Fullscreen = 3
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IamMessage {
|
|
8
|
+
id: number;
|
|
9
|
+
campaignName: string;
|
|
10
|
+
type: IamMessageType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type IamEvents = {
|
|
14
|
+
close: {
|
|
15
|
+
message: IamMessage;
|
|
16
|
+
};
|
|
17
|
+
widgetEvent: {
|
|
18
|
+
message: IamMessage;
|
|
19
|
+
name: string;
|
|
20
|
+
data: Record<string, any>;
|
|
21
|
+
};
|
|
22
|
+
clickOnButton: {
|
|
23
|
+
id: number;
|
|
24
|
+
index: number;
|
|
25
|
+
url: string;
|
|
26
|
+
elementId: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type IamEventHandler<Event extends keyof IamEvents> = (event: IamEvents[Event]) => void;
|
|
31
|
+
|
|
32
|
+
export interface InAppMessaging {
|
|
33
|
+
get activeMessage(): IamMessage | null;
|
|
34
|
+
get isLoaded(): boolean;
|
|
35
|
+
get isLoading(): boolean;
|
|
36
|
+
get isOpened(): boolean;
|
|
37
|
+
|
|
38
|
+
preload(): Promise<IamMessage[]>;
|
|
39
|
+
showMessageById(messageId: number | string, showOnlyIfLoaded?: boolean): Promise<IamMessage>;
|
|
40
|
+
showMessageByEvent(eventName: string, showOnlyIfLoaded?: boolean): Promise<IamMessage>;
|
|
41
|
+
on<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
42
|
+
once<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
43
|
+
off<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
44
|
+
}
|
|
@@ -2,6 +2,7 @@ import { SharePage, SharePageOptions } from "./share-page";
|
|
|
2
2
|
import { AppearanceManager } from "./appearance-manager/appearanceManager";
|
|
3
3
|
import { StoriesList, UGCStoriesList } from "./story-list";
|
|
4
4
|
import { PublicEventHandler, PublicEvents } from "./publicEvents";
|
|
5
|
+
import { InAppMessaging } from "./in-app-messaging";
|
|
5
6
|
|
|
6
7
|
export declare enum StoryLinkSource {
|
|
7
8
|
StoryList = "storyList",
|
|
@@ -9,7 +10,7 @@ export declare enum StoryLinkSource {
|
|
|
9
10
|
GameReader = "gameReader"
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export type
|
|
13
|
+
export type InAppStoryManagerConfig = {
|
|
13
14
|
apiKey: string;
|
|
14
15
|
userId?: string | number;
|
|
15
16
|
userIdSign?: string;
|
|
@@ -38,17 +39,18 @@ export type StoryLinkClickHandler = (payload: {
|
|
|
38
39
|
|
|
39
40
|
export interface Plugin {
|
|
40
41
|
name: string;
|
|
41
|
-
install(
|
|
42
|
-
uninstall(
|
|
42
|
+
install(inAppStoryManager: InAppStoryManager, options?: any): void;
|
|
43
|
+
uninstall(inAppStoryManager: InAppStoryManager, options?: any): void;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
export declare class
|
|
46
|
+
export declare class InAppStoryManager {
|
|
46
47
|
get sdkVersionName(): string;
|
|
47
48
|
get sdkVersionCode(): number;
|
|
49
|
+
inAppMessaging: InAppMessaging;
|
|
48
50
|
set storyLinkClickHandler(value: StoryLinkClickHandler);
|
|
49
51
|
|
|
50
|
-
constructor(config:
|
|
51
|
-
static getInstance():
|
|
52
|
+
constructor(config: InAppStoryManagerConfig);
|
|
53
|
+
static getInstance(): InAppStoryManager;
|
|
52
54
|
static use(plugin: any, options?: any): void;
|
|
53
55
|
|
|
54
56
|
destroy(): void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./appearance-manager";
|
|
2
2
|
export * from "./story-list";
|
|
3
3
|
export * from "./share-page";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./publicEvents"
|
|
4
|
+
export * from "./inAppStoryManager";
|
|
5
|
+
export * from "./publicEvents";
|
|
6
|
+
export * from "./in-app-messaging";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inappstory/js-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-rc.0",
|
|
4
4
|
"description": "JS SDK",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.mjs",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"react-dom": "^18.2.0",
|
|
55
55
|
"mobx-react-lite": "^4.1.0",
|
|
56
56
|
"mobx": "^6.9.0",
|
|
57
|
+
"lit": "^3.2.1",
|
|
57
58
|
"async-mutex": "^0.5.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {},
|