@inappstory/react-sdk 0.2.5 → 0.3.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.
- package/dist/index.js +184 -4
- package/dist/types/appearance-manager/appearanceCommon.d.ts +15 -13
- package/dist/types/appearance-manager/gameReader.d.ts +30 -0
- package/dist/types/appearance-manager/goodsWidget.d.ts +43 -0
- package/dist/types/appearance-manager/index.d.ts +0 -3
- package/dist/types/appearance-manager/overrideByMediaQuery.d.ts +18 -0
- package/dist/types/appearance-manager/sharePanel.d.ts +44 -0
- package/dist/types/appearance-manager/storiesList.d.ts +103 -85
- package/dist/types/appearance-manager/storyReader.ts +64 -67
- package/dist/types/global.d.ts +11 -0
- package/dist/types/ias-container/IasContainer.d.ts +10 -0
- package/dist/types/ias-container/appearanceOptionsProps.d.ts +17 -0
- package/dist/types/ias-container/index.d.ts +1 -1
- package/dist/types/ias-container/publicEvents.d.ts +86 -0
- package/dist/types/ias-container/storyManagerEventsProps.d.ts +31 -0
- package/dist/types/index.d.ts +4 -10
- package/dist/types/share-page/index.d.ts +1 -0
- package/dist/types/share-page/sharePage.d.ts +9 -0
- package/dist/types/story-list/FavoriteStoryList.d.ts +5 -6
- package/dist/types/story-list/StoryList.d.ts +12 -11
- package/dist/types/story-list/UGCStoryList.d.ts +10 -8
- package/dist/types/story-list/favoriteCardCompositeViewModel.ts +3 -3
- package/dist/types/story-list/favoriteStoryCardViewModel.d.ts +1 -2
- package/dist/types/story-list/index.d.ts +8 -8
- package/dist/types/story-list/navigationViewModel.d.ts +1 -3
- package/dist/types/story-list/storyCardViewModel.d.ts +3 -3
- package/dist/types/storyManager.d.ts +43 -0
- package/package.json +2 -2
- package/dist/types/appearance-manager/AppearanceManager.d.ts +0 -38
- package/dist/types/appearance-manager/AppearanceManager.h.d.ts +0 -26
- package/dist/types/appearance-manager/gameReader.ts +0 -33
- package/dist/types/appearance-manager/goodsWidget.ts +0 -39
- package/dist/types/appearance-manager/storyFavoriteReader.ts +0 -20
- package/dist/types/appearance-manager/utils.d.ts +0 -7
- package/dist/types/ias-container/ias-container.d.ts +0 -8
- package/dist/types/story-list/storyListViewModel.d.ts +0 -21
- package/dist/types/story-list/viewModel.d.ts +0 -5
- package/dist/types/story-manager/StoryManager.d.ts +0 -45
- package/dist/types/story-manager/StoryManager.h.d.ts +0 -21
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
interface BaseEvent {
|
|
2
|
+
id: number;
|
|
3
|
+
title?: string;
|
|
4
|
+
tags: Array<string>;
|
|
5
|
+
slidesCount?: number;
|
|
6
|
+
feed?: string;
|
|
7
|
+
source?: string;
|
|
8
|
+
filter: Record<string, unknown>;
|
|
9
|
+
ugcPayload: Record<string, unknown>;
|
|
10
|
+
defaultListLength: number;
|
|
11
|
+
favoriteListLength: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare enum CloseAction {
|
|
15
|
+
closeReaderByCloseBtn = "closeReaderByCloseBtn", // closed by btn with cross icon in StoryReader
|
|
16
|
+
closeReaderByEscBtn = "closeReaderByEscBtn", // closed by ESC on keyboard (desktop only)
|
|
17
|
+
swipeDown = "swipeDown", // closed by swipe down StoryReader (mobile only)
|
|
18
|
+
swipe = "swipe", // closed by swipe on next story (mobile only)
|
|
19
|
+
lastSlideClick = "lastSlideClick", // closed by first (move backward) or last (move forward) slide in story
|
|
20
|
+
auto = "auto", // closed by auto transition (by timer) on next story
|
|
21
|
+
externalCloseReader = "externalCloseReader" // closed by public API method StoryManager.closeStoryReader
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ClickOnStoryEvent extends BaseEvent {
|
|
25
|
+
index: number;
|
|
26
|
+
isDeeplink: boolean;
|
|
27
|
+
url?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ShowStoryEvent extends BaseEvent {}
|
|
31
|
+
|
|
32
|
+
export interface CloseStoryEvent extends BaseEvent {
|
|
33
|
+
action: CloseAction;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ShowSlideEvent extends BaseEvent {
|
|
37
|
+
index: number;
|
|
38
|
+
payload: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ClickOnButtonEvent extends BaseEvent {
|
|
42
|
+
index: number;
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface LikeStoryEvent extends BaseEvent {
|
|
47
|
+
value: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface DislikeStoryEvent extends BaseEvent {
|
|
51
|
+
value: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface FavoriteStoryEvent extends BaseEvent {
|
|
55
|
+
value: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface ShareStoryEvent extends BaseEvent {}
|
|
59
|
+
|
|
60
|
+
export interface ShareStoryWithPathEvent extends BaseEvent {
|
|
61
|
+
url: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ClickOnFavoriteCellEvent {
|
|
65
|
+
feed: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface FeedLoadEvent {
|
|
69
|
+
feed: string;
|
|
70
|
+
stories: Array<{ id: number; title: string; tags: Array<string>; slidesCount: number }>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface FeedImpressionEvent {
|
|
74
|
+
feed: string;
|
|
75
|
+
stories: Array<{ id: number; title: string; tags: Array<string>; slidesCount: number }>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface VisibleAreaUpdatedEvent {
|
|
79
|
+
feed: string;
|
|
80
|
+
stories: Array<{ id: number; title: string; tags: Array<string>; slidesCount: number }>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface WidgetEvent {
|
|
84
|
+
name: string;
|
|
85
|
+
data: any;
|
|
86
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClickOnButtonEvent,
|
|
3
|
+
ClickOnStoryEvent,
|
|
4
|
+
CloseStoryEvent,
|
|
5
|
+
DislikeStoryEvent,
|
|
6
|
+
FavoriteStoryEvent,
|
|
7
|
+
FeedImpressionEvent,
|
|
8
|
+
LikeStoryEvent,
|
|
9
|
+
ShareStoryEvent,
|
|
10
|
+
ShareStoryWithPathEvent,
|
|
11
|
+
ShowSlideEvent,
|
|
12
|
+
ShowStoryEvent,
|
|
13
|
+
VisibleAreaUpdatedEvent,
|
|
14
|
+
WidgetEvent
|
|
15
|
+
} from "./publicEvents";
|
|
16
|
+
|
|
17
|
+
export interface StoryManagerEventsProps {
|
|
18
|
+
onClickOnStory?: (event: ClickOnStoryEvent) => void;
|
|
19
|
+
onShowStory?: (event: ShowStoryEvent) => void;
|
|
20
|
+
onCloseStory?: (event: CloseStoryEvent) => void;
|
|
21
|
+
onShowSlide?: (event: ShowSlideEvent) => void;
|
|
22
|
+
onClickOnButton?: (event: ClickOnButtonEvent) => void;
|
|
23
|
+
onLikeStory?: (event: LikeStoryEvent) => void;
|
|
24
|
+
onDislikeStory?: (event: DislikeStoryEvent) => void;
|
|
25
|
+
onFavoriteStory?: (event: FavoriteStoryEvent) => void;
|
|
26
|
+
onShareStory?: (event: ShareStoryEvent) => void;
|
|
27
|
+
onShareStoryWithPath?: (event: ShareStoryWithPathEvent) => void;
|
|
28
|
+
onFeedImpression?: (event: FeedImpressionEvent) => void;
|
|
29
|
+
onVisibleAreaUpdated?: (event: VisibleAreaUpdatedEvent) => void;
|
|
30
|
+
onWidgetEvent?: (event: WidgetEvent) => void;
|
|
31
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
+
import "./global.d.ts";
|
|
1
2
|
export * from "./appearance-manager";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export { FavoriteStoryList } from "./story-list/FavoriteStoryList";
|
|
6
|
-
export { StoryListViewModel } from "./story-list/storyListViewModel";
|
|
7
|
-
export { FavoriteStoryCardViewModel } from "./story-list/favoriteStoryCardViewModel";
|
|
8
|
-
export { NavigationViewModel } from "./story-list/navigationViewModel";
|
|
9
|
-
export { StoryCardViewModel } from "./story-list/storyCardViewModel";
|
|
10
|
-
export { StoryListLoadStatus } from "./story-list/storyListLoadStatus";
|
|
11
|
-
export { StoryManagerConfig } from "./story-manager/StoryManager.h";
|
|
3
|
+
export * from "./story-list";
|
|
4
|
+
export * from "./share-page";
|
|
5
|
+
export { storyManager, StoryManagerConfig } from "./storyManager";
|
|
12
6
|
export { IASContainer } from "./ias-container";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SharePage, SharePageOptions } from "./sharePage"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NavigationViewModel } from "./navigationViewModel";
|
|
1
|
+
import { StoriesListOptions, NavigationViewModel } from "..";
|
|
3
2
|
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
4
|
-
import {
|
|
5
|
-
import { StoryListViewModel } from "./storyListViewModel.d";
|
|
3
|
+
import { OverrideByMediaQuery } from "../appearance-manager/overrideByMediaQuery";
|
|
6
4
|
|
|
7
5
|
interface FavoriteStoryListProps {
|
|
8
|
-
|
|
6
|
+
options?: StoriesListOptions;
|
|
7
|
+
optionsOverrideByMediaQuery?: OverrideByMediaQuery<StoriesListOptions>[]
|
|
9
8
|
storyCardView?: (storyCard: StoryCardViewModel) => JSX.Element;
|
|
10
|
-
navigationView?: (navigation:
|
|
9
|
+
navigationView?: (navigation: NavigationViewModel) => JSX.Element;
|
|
11
10
|
}
|
|
12
11
|
export declare const FavoriteStoryList: (props: FavoriteStoryListProps) => JSX.Element;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoriesListOptions } from "..";
|
|
2
2
|
import { NavigationViewModel } from "./navigationViewModel";
|
|
3
3
|
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
4
4
|
import { StoryListLoadStatus } from "./storyListLoadStatus";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { FavoriteCardCompositeViewModel } from "./favoriteCardCompositeViewModel";
|
|
6
|
+
import { OverrideByMediaQuery } from "../appearance-manager/overrideByMediaQuery";
|
|
7
7
|
|
|
8
8
|
interface StoryListProps {
|
|
9
|
-
|
|
9
|
+
options: StoriesListOptions;
|
|
10
|
+
optionsOverrideByMediaQuery?: OverrideByMediaQuery<StoriesListOptions>
|
|
10
11
|
feedSlug: string;
|
|
11
12
|
testKey?: string;
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
onUgcCardClick?: () => void;
|
|
14
|
+
onFavoriteCardClick: () => void;
|
|
14
15
|
useUgcCard?: boolean;
|
|
16
|
+
hasFavorite?: boolean;
|
|
15
17
|
onLoadStart?: () => void;
|
|
16
18
|
onLoadEnd?: (storyListLoadStatus: StoryListLoadStatus) => void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
favoriteCardView?: (favoriteCardCompositeViewModel: FavoriteCardCompositeViewModel) => JSX.Element
|
|
19
|
+
storyCardView?: (storyCard: StoryCardViewModel) => JSX.Element;
|
|
20
|
+
navigationView?: (navigation: NavigationViewModel) => JSX.Element;
|
|
21
|
+
favoriteCardView?: (favoriteCardCompositeViewModel: FavoriteCardCompositeViewModel) => JSX.Element;
|
|
21
22
|
}
|
|
22
|
-
export declare const StoryList: (props: StoryListProps) => JSX.Element;
|
|
23
|
+
export declare const StoryList: (props: StoryListProps) => JSX.Element;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoriesListOptions } from "..";
|
|
2
2
|
import { NavigationViewModel } from "./navigationViewModel";
|
|
3
3
|
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
4
4
|
import { StoryListLoadStatus } from "./storyListLoadStatus";
|
|
5
|
-
import { StoryListViewModel } from "./storyListViewModel
|
|
5
|
+
import { StoryListViewModel } from "./storyListViewModel";
|
|
6
|
+
import { OverrideByMediaQuery } from "../appearance-manager/overrideByMediaQuery";
|
|
6
7
|
|
|
7
8
|
interface UGCStoryListProps {
|
|
8
|
-
|
|
9
|
+
options?: StoriesListOptions;
|
|
10
|
+
optionsOverrideByMediaQuery?: OverrideByMediaQueryCommon<StoriesListOptions>[]
|
|
9
11
|
testKey?: string;
|
|
10
|
-
|
|
12
|
+
onUgcCardClick?: () => void;
|
|
11
13
|
useUgcCard?: boolean;
|
|
14
|
+
hasFavorite?: boolean;
|
|
12
15
|
filter?: Record<string, any>;
|
|
13
16
|
onLoadStart?: () => void;
|
|
14
17
|
onLoadEnd?: (storyListLoadStatus: StoryListLoadStatus) => void;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
navigationView?: (navigation: NavigationViewModel) => JSX.Element
|
|
18
|
+
storyCardView?: (storyCard: StoryCardViewModel) => JSX.Element;
|
|
19
|
+
navigationView?: (navigation: NavigationViewModel) => JSX.Element;
|
|
18
20
|
}
|
|
19
|
-
export declare const UGCStoryList: (props: UGCStoryListProps) => JSX.Element;
|
|
21
|
+
export declare const UGCStoryList: (props: UGCStoryListProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FavoriteStoryCardViewModel, StoryCardViewModel } from ".";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
export interface FavoriteCardCompositeViewModel extends StoryCardViewModel {
|
|
4
|
+
favoriteStories: FavoriteStoryCardViewModel[];
|
|
5
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { StoriesListCardOptions } from "../appearance-manager";
|
|
2
1
|
import { StoryCardViewModel } from "./storyCardViewModel";
|
|
3
2
|
|
|
4
|
-
export
|
|
3
|
+
export interface FavoriteStoryCardViewModel extends StoryCardViewModel {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './favoriteCardCompositeViewModel';
|
|
2
|
-
export * from './favoriteStoryCardViewModel';
|
|
3
|
-
export * from './FavoriteStoryList';
|
|
4
|
-
export * from './navigationViewModel';
|
|
5
|
-
export * from './storyCardViewModel';
|
|
6
|
-
export * from './StoryList';
|
|
2
|
+
export * from './favoriteStoryCardViewModel.d';
|
|
3
|
+
export * from './FavoriteStoryList.d';
|
|
4
|
+
export * from './navigationViewModel.d';
|
|
5
|
+
export * from './storyCardViewModel.d';
|
|
6
|
+
export * from './StoryList.d';
|
|
7
7
|
export * from './storyListLoadStatus';
|
|
8
|
-
export * from './storyListViewModel';
|
|
9
|
-
export * from './UGCStoryList';
|
|
10
|
-
export * from './viewModel';
|
|
8
|
+
export * from './storyListViewModel.d';
|
|
9
|
+
export * from './UGCStoryList.d';
|
|
10
|
+
export * from './viewModel.d';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoriesListCardOptions } from "../appearance-manager";
|
|
2
2
|
import { ViewModel } from "./viewModel";
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface StoryCardViewModel {
|
|
5
5
|
id: number;
|
|
6
6
|
title: string;
|
|
7
7
|
titleColor: string;
|
|
@@ -16,11 +16,11 @@ export declare class StoryCardViewModel extends ViewModel {
|
|
|
16
16
|
deeplink: string | null;
|
|
17
17
|
hideInReader: boolean | null;
|
|
18
18
|
gameInstance?: { id?: string };
|
|
19
|
-
hasAudio:
|
|
19
|
+
hasAudio: boolean | null;
|
|
20
20
|
isFavoriteCard: boolean;
|
|
21
21
|
isUgcCard: boolean;
|
|
22
22
|
isOpened: boolean;
|
|
23
|
-
videoCoverSrc:
|
|
23
|
+
videoCoverSrc: string | null;
|
|
24
24
|
|
|
25
25
|
get options(): StoriesListCardOptions;
|
|
26
26
|
get isTitleCardInner(): boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SharePage, SharePageOptions } from "./share-page";
|
|
2
|
+
|
|
3
|
+
export type StoryManagerConfig = {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
userId?: string | number;
|
|
6
|
+
tags?: Array<string>;
|
|
7
|
+
placeholders?: Record<string, string>;
|
|
8
|
+
imagePlaceholders?: Record<string, string>;
|
|
9
|
+
lang?: string;
|
|
10
|
+
nonce?: string;
|
|
11
|
+
disableDeviceId?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type UgcEditorConfig = {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
editor: Record<any, any>;
|
|
18
|
+
sdkVersion: string;
|
|
19
|
+
appPackageId?: string;
|
|
20
|
+
deviceId: string;
|
|
21
|
+
userId?: string;
|
|
22
|
+
lang: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface StoryManager {
|
|
26
|
+
get sdkVersionName(): string;
|
|
27
|
+
get sdkVersionCode(): number;
|
|
28
|
+
set storyLinkClickHandler(callback: Function);
|
|
29
|
+
showOnboardingStories(options?: { feed?: string; customTags?: Array<string>; limit?: number }): Promise<boolean>;
|
|
30
|
+
showSharePage(storyId: number, options?: SharePageOptions): SharePage;
|
|
31
|
+
showStory(id: number | string): Promise<boolean>;
|
|
32
|
+
openGame(gameInstanceId: string, gameOptions?: { demoMode?: boolean }): Promise<void>;
|
|
33
|
+
closeGame(): Promise<boolean>;
|
|
34
|
+
closeStoryReader(): Promise<boolean | undefined>;
|
|
35
|
+
closeGoodsWidget(): void
|
|
36
|
+
getUgcEditorConfig(): Promise<UgcEditorConfig>
|
|
37
|
+
getNonce(): string | undefined
|
|
38
|
+
on(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
39
|
+
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
40
|
+
off(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export declare const storyManager: StoryManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inappstory/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "React SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@emotion/styled": "^11.11.0",
|
|
33
33
|
"bowser": "^2.4.0",
|
|
34
34
|
"classnames": "^2.5.1",
|
|
35
|
-
"effector": "^22.1.2",
|
|
36
35
|
"lodash": "^4.17.21",
|
|
37
36
|
"parse-css-sides": "^3.0.1",
|
|
37
|
+
"react-input-mask": "^2.0.4",
|
|
38
38
|
"uuid": "^8.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { AppearanceCommonOptions } from "./appearanceCommon";
|
|
4
|
-
import { StoriesListOptions } from "./storiesList";
|
|
5
|
-
import { StoryReaderOptions } from "./storyReader";
|
|
6
|
-
import { StoryFavoriteReaderOptions } from "./storyFavoriteReader";
|
|
7
|
-
import { GoodsWidgetOptions } from "./goodsWidget";
|
|
8
|
-
import { GameReaderOptions } from "./gameReader";
|
|
9
|
-
import { OverrideByMediaQuery } from "./AppearanceManager.h";
|
|
10
|
-
|
|
11
|
-
export declare class AppearanceManager extends EventEmitter {
|
|
12
|
-
constructor();
|
|
13
|
-
private _commonOptions;
|
|
14
|
-
setCommonOptions(options: AppearanceCommonOptions, withUpdateEvent?: boolean): AppearanceManager;
|
|
15
|
-
get commonOptions(): AppearanceCommonOptions;
|
|
16
|
-
private _storiesListOptions;
|
|
17
|
-
setStoriesListOptions(options: Partial<StoriesListOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
18
|
-
get storiesListOptions(): StoriesListOptions;
|
|
19
|
-
private _storyReaderOptions;
|
|
20
|
-
setStoryReaderOptions(options: Partial<StoryReaderOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
21
|
-
get storyReaderOptions(): StoryReaderOptions;
|
|
22
|
-
private _storyFavoriteReaderOptions;
|
|
23
|
-
setStoryFavoriteReaderOptions(options: Partial<StoryFavoriteReaderOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
24
|
-
get storyFavoriteReaderOptions(): StoryFavoriteReaderOptions;
|
|
25
|
-
private _goodsWidgetOptions;
|
|
26
|
-
setGoodsWidgetOptions(options: Partial<GoodsWidgetOptions>, withUpdateEvent?: boolean): AppearanceManager;
|
|
27
|
-
get goodsWidgetOptions(): GoodsWidgetOptions;
|
|
28
|
-
private _gameReaderOptions;
|
|
29
|
-
setGameReaderOptions(options: GameReaderOptions, withUpdateEvent?: boolean): AppearanceManager;
|
|
30
|
-
get gameReaderOptions(): GameReaderOptions;
|
|
31
|
-
setOptionsOverrideByMediaQuery(overrideByMediaQueries: OverrideByMediaQuery[]): AppearanceManager;
|
|
32
|
-
private _mqls;
|
|
33
|
-
initMediaQueries(overrideByMediaQueries: OverrideByMediaQuery[]): void;
|
|
34
|
-
private _composeMqlCondition;
|
|
35
|
-
private _composeOptionsOverrideByMediaQuery;
|
|
36
|
-
private removeMediaQueryEventListeners;
|
|
37
|
-
destroy(): void;
|
|
38
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { StoryReaderOptions } from "./storyReader";
|
|
2
|
-
import { GameReaderOptions } from "./gameReader";
|
|
3
|
-
import { AppearanceCommonOptions } from "./appearanceCommon";
|
|
4
|
-
import { StoriesListOptions } from "./storiesList";
|
|
5
|
-
import { StoryFavoriteReaderOptions } from "./storyFavoriteReader";
|
|
6
|
-
import { GoodsWidgetOptions } from "./goodsWidget";
|
|
7
|
-
|
|
8
|
-
export type AppearanceManagerEvents = "updatedCommonOptions" | "updatedStoriesListOptions" | "updatedStoryReaderOptions" | "updatedFavoriteReaderOptions" | "updatedGameReaderOptions" | "updatedGoodsWidgetOptions";
|
|
9
|
-
|
|
10
|
-
export type StoryReaderUpdateComposedOptions = {
|
|
11
|
-
storyReaderOptions: StoryReaderOptions;
|
|
12
|
-
gameReaderOptions: GameReaderOptions;
|
|
13
|
-
appearanceCommon: AppearanceCommonOptions;
|
|
14
|
-
};
|
|
15
|
-
export type AppearanceManagerOptionGroups = {
|
|
16
|
-
commonOptions: AppearanceCommonOptions;
|
|
17
|
-
storiesListOptions: StoriesListOptions;
|
|
18
|
-
storyReaderOptions: StoryReaderOptions;
|
|
19
|
-
storyFavoriteReaderOptions: StoryFavoriteReaderOptions;
|
|
20
|
-
goodsWidgetOptions: GoodsWidgetOptions;
|
|
21
|
-
gameReaderOptions: GameReaderOptions;
|
|
22
|
-
};
|
|
23
|
-
export type OverrideByMediaQuery = Partial<{
|
|
24
|
-
viewportMinSize: number | "sm" | "md" | "lg" | "xl";
|
|
25
|
-
mediaQuery: null | string;
|
|
26
|
-
}> & Partial<AppearanceManagerOptionGroups>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppearanceCommonOptions,
|
|
3
|
-
CloseButtonPosition
|
|
4
|
-
} from "./appearanceCommon";
|
|
5
|
-
|
|
6
|
-
export type GameReaderOptions = {
|
|
7
|
-
loader?: {
|
|
8
|
-
default: {
|
|
9
|
-
color: string | null,
|
|
10
|
-
accentColor: string | null,
|
|
11
|
-
},
|
|
12
|
-
custom: string | null
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
closeButtonPosition?: CloseButtonPosition;
|
|
16
|
-
|
|
17
|
-
closeButton?: {
|
|
18
|
-
svgSrc: {
|
|
19
|
-
baseState: string
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
backdropColor?: string
|
|
24
|
-
game?: {
|
|
25
|
-
backdropColor: string
|
|
26
|
-
},
|
|
27
|
-
forceDesktopMode?: AppearanceCommonOptions["forceDesktopMode"]
|
|
28
|
-
forceCheckOrientation?: boolean
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type OpenGameOptions = Partial<{
|
|
32
|
-
demoMode: boolean;
|
|
33
|
-
}>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export type Goods = {}
|
|
2
|
-
|
|
3
|
-
export type GoodsWidgetRenderingType = "default" | "customCard"
|
|
4
|
-
|
|
5
|
-
export type GoodsWidgetOptions = {
|
|
6
|
-
goodsWidgetRenderingType: GoodsWidgetRenderingType; // DEPRECATED?
|
|
7
|
-
goodsList: GoodsListOptions,
|
|
8
|
-
goodsCard: GoodsCardOptions
|
|
9
|
-
loader: {
|
|
10
|
-
default: {
|
|
11
|
-
color: string,
|
|
12
|
-
accentColor: string,
|
|
13
|
-
},
|
|
14
|
-
custom?: string
|
|
15
|
-
},
|
|
16
|
-
openGoodsWidgetHandler: (goodsList: Goods[]) => Promise<Goods[]>;
|
|
17
|
-
getCardHtml?: (goods: Goods, index: number) => string;
|
|
18
|
-
itemClickHandler?: (goods: Goods) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type GoodsCardOptions = {
|
|
22
|
-
mainTextColor: string;
|
|
23
|
-
oldPriceTextColor: string;
|
|
24
|
-
imageBackgroundColor: string;
|
|
25
|
-
imageCornerRadius: number;
|
|
26
|
-
titleFont?: string;
|
|
27
|
-
subtitleFont?: string;
|
|
28
|
-
priceFont?: string;
|
|
29
|
-
oldPriceFont?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type GoodsListOptions = {
|
|
33
|
-
renderingType: GoodsWidgetRenderingType;
|
|
34
|
-
closeBackgroundColor: string;
|
|
35
|
-
closeImage?: string;
|
|
36
|
-
substrateHeight: number;
|
|
37
|
-
substrateColor: string;
|
|
38
|
-
dimColor: string;
|
|
39
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CloseButtonPosition } from "./appearanceCommon";
|
|
2
|
-
|
|
3
|
-
export type StoryFavoriteReaderOptions = Partial<{
|
|
4
|
-
title: Partial<{
|
|
5
|
-
content: string;
|
|
6
|
-
font: string;
|
|
7
|
-
color: string;
|
|
8
|
-
backgroundColor: string;
|
|
9
|
-
}>,
|
|
10
|
-
extraCss: string;
|
|
11
|
-
closeButtonPosition?: CloseButtonPosition;
|
|
12
|
-
closeButton: {
|
|
13
|
-
svgSrc: {
|
|
14
|
-
baseState: string
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
headerTopOffset: number;
|
|
18
|
-
bottomOffset: number;
|
|
19
|
-
backgroundColor: string;
|
|
20
|
-
}>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { StoriesListOptions } from "../appearance-manager/storiesList";
|
|
2
|
-
import { ViewModel } from "./viewModel";
|
|
3
|
-
import { StoryCardViewModel } from "./storyCardViewModel"
|
|
4
|
-
import { FavoriteStoryCardViewModel } from "./favoriteStoryCardViewModel";
|
|
5
|
-
import { FavoriteCardCompositeViewModel } from ".";
|
|
6
|
-
|
|
7
|
-
export declare class StoryListViewModel extends ViewModel {
|
|
8
|
-
get defaultStories(): StoryCardViewModel[];
|
|
9
|
-
get favoriteStories(): FavoriteStoryCardViewModel[];
|
|
10
|
-
get favoriteCard(): FavoriteCardCompositeViewModel;
|
|
11
|
-
get ugcCard(): StoryCardViewModel;
|
|
12
|
-
set modeDesktop(value: boolean);
|
|
13
|
-
get modeDesktop(): boolean;
|
|
14
|
-
get session(): any | null;
|
|
15
|
-
get options(): StoriesListOptions;
|
|
16
|
-
get hasFavoriteCard(): boolean
|
|
17
|
-
get hasUgcCard(): boolean
|
|
18
|
-
onStoryClick(story: StoryCardViewModel, index?: number): void;
|
|
19
|
-
destroy(): void;
|
|
20
|
-
reload(): void;
|
|
21
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from "events";
|
|
3
|
-
import { AppearanceManager, StoryListViewModel, StoryManagerConfig } from "..";
|
|
4
|
-
|
|
5
|
-
export type IdentityFields = {
|
|
6
|
-
feedSlug: string;
|
|
7
|
-
filter?: Record<string, any>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export declare class StoryManager extends EventEmitter {
|
|
11
|
-
static instance: StoryManager;
|
|
12
|
-
constructor(storyManagerConfig: StoryManagerConfig);
|
|
13
|
-
destroy(): void;
|
|
14
|
-
set storyLinkClickHandler(callback: Function);
|
|
15
|
-
set openGoodsWidgetHandler(callback: (skuList: Array<Dict>) => Promise<Array<Dict>>);
|
|
16
|
-
get openGoodsWidgetHandler(): (skuList: Array<Dict>) => Promise<Array<Dict>>;
|
|
17
|
-
static getInstance(): StoryManager | null;
|
|
18
|
-
createStoryListViewModel({ appearanceManager, ...params }: {
|
|
19
|
-
identityFields: IdentityFields;
|
|
20
|
-
appearanceManager: AppearanceManager;
|
|
21
|
-
useUgcCard: boolean;
|
|
22
|
-
ugcCardClickHandler?: () => void;
|
|
23
|
-
}): StoryListViewModel;
|
|
24
|
-
setTags(tags: Array<string>): void;
|
|
25
|
-
setUserId(userId: string | number): void;
|
|
26
|
-
setLang(lang: "ru" | "en"): void;
|
|
27
|
-
setPlaceholders(placeholders: Dict<string, string>): void;
|
|
28
|
-
setImagePlaceholders(imagePlaceholders: Dict<string, string>): void;
|
|
29
|
-
showOnboardingStories(appearanceManager: AppearanceManager, options?: {
|
|
30
|
-
feed?: Option<string>;
|
|
31
|
-
customTags?: Array<string>;
|
|
32
|
-
limit?: Option<number>;
|
|
33
|
-
}): Promise<boolean>;
|
|
34
|
-
showStory(id: number | string, appearanceManager: AppearanceManager, ref?: string): Promise<boolean>;
|
|
35
|
-
openGame(gameInstanceId: string, appearanceManager: AppearanceManager, gameOptions?: { demoMode?: boolean }): Promise<void>;
|
|
36
|
-
closeGame(): Promise<boolean>;
|
|
37
|
-
closeStoryReader(): Promise<false | undefined>;
|
|
38
|
-
closeGoodsWidget(): void;
|
|
39
|
-
onBeforeStoryReaderOpen: Option<() => void>;
|
|
40
|
-
onBeforeFavoriteReaderOpen: Option<() => void>;
|
|
41
|
-
onStoryReaderClosed: Option<() => void>;
|
|
42
|
-
onFavoriteReaderClosed: Option<() => void>;
|
|
43
|
-
get sdkVersionName(): string;
|
|
44
|
-
get sdkVersionCode(): number;
|
|
45
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type StoryManagerConfig = {
|
|
2
|
-
appPackageId?: string;
|
|
3
|
-
apiKey: string;
|
|
4
|
-
userId?: Optional<string | number>;
|
|
5
|
-
tags?: Optional<Array<string>>;
|
|
6
|
-
placeholders?: Optional<Dict<string, string>>;
|
|
7
|
-
imagePlaceholders?: Optional<Dict<string, string>>;
|
|
8
|
-
lang?: Optional<"ru" | "en">;
|
|
9
|
-
nonce?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export type UgcEditorConfig = {
|
|
13
|
-
sessionId: string;
|
|
14
|
-
apiKey: string;
|
|
15
|
-
editor: Record<any, any>;
|
|
16
|
-
sdkVersion: string;
|
|
17
|
-
appPackageId?: string;
|
|
18
|
-
deviceId: string;
|
|
19
|
-
userId?: string;
|
|
20
|
-
lang: string;
|
|
21
|
-
};
|