@inappstory/react-sdk 1.3.5 → 1.4.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 +583 -22
- package/dist/index.umd.js +583 -20
- package/dist/types/in-app-messaging/iamErrors.d.ts +55 -0
- package/dist/types/in-app-messaging/inAppMessaging.d.ts +45 -0
- package/dist/types/in-app-messaging/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/storyManager.d.ts +14 -1
- package/package.json +5 -4
- package/plugins/dotLottie/dotLottie.umd.js +1 -1
|
@@ -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,45 @@
|
|
|
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
|
+
close(): Promise<void>
|
|
42
|
+
on<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
43
|
+
once<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
44
|
+
off<Event extends keyof IamEvents>(eventName: Event, listener: IamEventHandler<Event>): this;
|
|
45
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PublicEventHandler, PublicEvents } from "./ias-container";
|
|
2
2
|
import { SharePage, SharePageOptions } from "./share-page";
|
|
3
|
+
import { InAppMessaging } from "./in-app-messaging/inAppMessaging";
|
|
3
4
|
|
|
4
5
|
export declare enum LinkSource {
|
|
5
6
|
StoryList = "storyList",
|
|
@@ -43,8 +44,20 @@ export interface Plugin {
|
|
|
43
44
|
export declare class StoryManager {
|
|
44
45
|
get sdkVersionName(): string;
|
|
45
46
|
get sdkVersionCode(): number;
|
|
47
|
+
inAppMessaging: InAppMessaging
|
|
48
|
+
|
|
46
49
|
set storyLinkClickHandler(value: StoryLinkClickHandler);
|
|
47
|
-
showOnboardingStories(options?: { feed?: string; customTags?: Array<string>; limit?: number }): Promise<
|
|
50
|
+
showOnboardingStories(options?: { feed?: string; customTags?: Array<string>; limit?: number }): Promise<{
|
|
51
|
+
stories: {
|
|
52
|
+
title: Option<string>;
|
|
53
|
+
tags: Array<string>;
|
|
54
|
+
slidesCount: Option<number>;
|
|
55
|
+
ugcPayload?: Record<string, unknown>;
|
|
56
|
+
id: number;
|
|
57
|
+
}[];
|
|
58
|
+
feed?: Option<string>;
|
|
59
|
+
filter?: Option<Record<string, any>>;
|
|
60
|
+
}>;
|
|
48
61
|
showSharePage(storyId: number, options?: SharePageOptions): SharePage;
|
|
49
62
|
showStory(id: number | string): Promise<void>;
|
|
50
63
|
showStoryOnce(id: number | string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inappstory/react-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React SDK",
|
|
5
5
|
"main": "dist/index.umd.js",
|
|
6
6
|
"module": "dist/index.esm.mjs",
|
|
@@ -45,13 +45,14 @@
|
|
|
45
45
|
"@inappstory/video-player": "^1.0.1",
|
|
46
46
|
"bowser": "^2.4.0",
|
|
47
47
|
"classnames": "^2.5.1",
|
|
48
|
-
"
|
|
48
|
+
"lit": "^3.2.1",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
|
+
"mobx": "^6.9.0",
|
|
51
|
+
"mobx-react-lite": "^4.1.0",
|
|
50
52
|
"parse-css-sides": "^3.0.1",
|
|
51
53
|
"react-input-mask": "^2.0.4",
|
|
52
54
|
"uuid": "^10.0.0",
|
|
53
|
-
"
|
|
54
|
-
"mobx": "^6.9.0"
|
|
55
|
+
"async-mutex": "^0.5.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"react": ">=17.0.2",
|