@inappstory/react-sdk 1.6.0-rc.0 → 1.6.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.
@@ -1,13 +1,13 @@
1
- import { RecursivePartial } from "../global"
1
+ import { RecursivePartial } from "../global";
2
2
 
3
3
  export type Goods = Partial<{
4
- imgSrc: string;
4
+ sku: string;
5
+ imgSrc?: string;
5
6
  title: string;
6
- subTitle: string;
7
+ subTitle?: string;
7
8
  price: string;
8
- oldPrice: string;
9
- sku: string;
10
- rawData: any;
9
+ oldPrice?: string;
10
+ rawData?: any;
11
11
  }>;
12
12
 
13
13
  export type GoodsWidgetOptions = RecursivePartial<{
@@ -20,9 +20,15 @@ export type GoodsWidgetOptions = RecursivePartial<{
20
20
  };
21
21
  custom: string;
22
22
  };
23
- openGoodsWidgetHandler: (goodsList: Goods[]) => Promise<Goods[]>;
24
- getCardHtml?: (goods: Goods, index: number) => string;
25
- itemClickHandler?: (goods: Goods) => void;
23
+ openGoodsWidgetHandler: <T extends Goods = Goods>(goodsList: T[]) => Promise<T[]>;
24
+ isLoading?: boolean;
25
+ renderItem?: <T extends Goods = Goods>(props: {
26
+ goods: T;
27
+ index: number;
28
+ onClick: (goods: T) => void;
29
+ }) => React.ReactNode;
30
+ getCardHtml?: <T extends Goods = Goods>(goods: T, index: number) => string;
31
+ itemClickHandler?: <T extends Goods = Goods>(goods: T) => void;
26
32
  }>;
27
33
 
28
34
  export type GoodsCardOptions = Partial<{
@@ -1,6 +1,5 @@
1
1
  export * from "./appearance-manager";
2
2
  export * from "./story-list";
3
- export * from "./share-page";
4
3
  export * from "./storyManager";
5
4
  export * from "./ias-container";
6
5
  export * from "./in-app-messaging"
@@ -1,5 +1,4 @@
1
1
  import { PublicEventHandler, PublicEvents } from "./ias-container";
2
- import { SharePage, SharePageOptions } from "./share-page";
3
2
  import { InAppMessaging } from "./in-app-messaging/inAppMessaging";
4
3
 
5
4
  export declare enum LinkSource {
@@ -58,7 +57,7 @@ export declare class StoryManager {
58
57
  feed?: Option<string>;
59
58
  filter?: Option<Record<string, any>>;
60
59
  }>;
61
- showSharePage(storyId: number, options?: SharePageOptions): SharePage;
60
+ showSharePage(storyId: number | string): Promise<void>;
62
61
  showStory(id: number | string): Promise<void>;
63
62
  showStoryOnce(id: number | string): Promise<void>;
64
63
  openGame(gameInstanceId: string, gameOptions?: { demoMode?: boolean }): Promise<void>;
@@ -69,7 +68,7 @@ export declare class StoryManager {
69
68
  on<Event extends keyof PublicEvents>(eventName: Event, listener: PublicEventHandler<Event>): this;
70
69
  once<Event extends keyof PublicEvents>(eventName: Event, listener: PublicEventHandler<Event>): this;
71
70
  off<Event extends keyof PublicEvents>(eventName: Event, listener: PublicEventHandler<Event>): this;
72
- static use(plugin: any, options?: any): void;
71
+ static use(plugin: Plugin, options?: any): void;
73
72
  }
74
73
 
75
74
  export declare const storyManager: StoryManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/react-sdk",
3
- "version": "1.6.0-rc.0",
3
+ "version": "1.6.1",
4
4
  "description": "React SDK",
5
5
  "keywords": [
6
6
  "stories",
@@ -29,8 +29,12 @@
29
29
  "default": "./dist/index.umd.js"
30
30
  },
31
31
  "./plugins/dotLottie": {
32
- "types": "./plugins/dotLottie/dotLottie.d.ts",
33
- "default": "./plugins/dotLottie/dotLottie.umd.js"
32
+ "types": "./plugins/dotLottie/iasDotLottiePlugin.d.ts",
33
+ "default": "./plugins/dotLottie/iasDotLottiePlugin.umd.js"
34
+ },
35
+ "./plugins/videoOnDemand": {
36
+ "types": "./plugins/videoOnDemand/iasVideoOnDemandPlugin.d.ts",
37
+ "default": "./plugins/videoOnDemand/iasVideoOnDemandPlugin.umd.js"
34
38
  }
35
39
  },
36
40
  "main": "dist/index.umd.js",
@@ -50,8 +54,7 @@
50
54
  "Samsung >= 5"
51
55
  ],
52
56
  "dependencies": {
53
- "@inappstory/slide-api": "^0.0.22",
54
- "@inappstory/video-player": "^1.0.1",
57
+ "@inappstory/slide-api": "^0.0.30",
55
58
  "async-mutex": "^0.5.0",
56
59
  "bowser": "^2.11.0",
57
60
  "classnames": "^2.5.1",
@@ -62,7 +65,6 @@
62
65
  "mobx": "^6.9.0",
63
66
  "mobx-react-lite": "^4.1.0",
64
67
  "parse-css-sides": "^3.0.1",
65
- "react-input-mask": "^2.0.4",
66
68
  "uuid": "^10.0.0"
67
69
  },
68
70
  "peerDependencies": {
@@ -0,0 +1,8 @@
1
+ export declare class IasDotLottiePlugin {
2
+ name: string;
3
+ install(storyManager: any): void;
4
+ uninstall(): void;
5
+ }
6
+
7
+ declare const pluginInstance: IasDotLottiePlugin;
8
+ export default pluginInstance;