@inappstory/react-sdk 1.9.1 → 1.9.3
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 +52 -35
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +2 -2
package/dist/index.esm.mjs
CHANGED
|
@@ -850,7 +850,7 @@ ___CSS_LOADER_EXPORT___.locals = {
|
|
|
850
850
|
|
|
851
851
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
852
852
|
// Module
|
|
853
|
-
___CSS_LOADER_EXPORT___.push([module.id, ".story--ieMN1{height:100%;width:100%;
|
|
853
|
+
___CSS_LOADER_EXPORT___.push([module.id, ".story--ieMN1{height:100%;width:100%;position:relative;backface-visibility:hidden;transform:translateZ(0);overflow:hidden;border-radius:var(--slide-border-radius, 0)}@supports(clip-path: inset(0 round 0)){.story--ieMN1{overflow:visible;border-radius:0;clip-path:inset(0 round var(--slide-border-radius, 0px))}}.story--ieMN1.story_mobile--ugLFZ{border-radius:0}.story--ieMN1.story_mobile--ugLFZ .story-slides--Ekd4b{border-radius:var(--slide-border-radius, 0)}.story--ieMN1 .story-slides--Ekd4b{position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0}", "",{"version":3,"sources":["webpack://./src/StoryReader/Story/story.module.scss"],"names":[],"mappings":"AAAA,cACI,WAAA,CACA,UAAA,CACA,iBAAA,CACA,0BAAA,CACA,uBAAA,CACA,eAAA,CACA,2CAAA,CAEA,uCATJ,cAUQ,gBAAA,CACA,eAAA,CACA,wDAAA,CAAA,CAGJ,kCACI,eAAA,CAEA,uDACI,2CAAA,CAIR,mCACI,iBAAA,CACA,eAAA,CACA,KAAA,CACA,MAAA,CACA,QAAA,CACA,OAAA","sourcesContent":[".story {\n height: 100%;\n width: 100%;\n position: relative;\n backface-visibility: hidden;\n transform: translateZ(0);\n overflow: hidden;\n border-radius: var(--slide-border-radius, 0);\n\n @supports (clip-path: inset(0 round 0)) {\n overflow: visible;\n border-radius: 0;\n clip-path: inset(0 round var(--slide-border-radius, 0px));\n }\n\n &.story_mobile {\n border-radius: 0;\n\n .story-slides {\n border-radius: var(--slide-border-radius, 0);\n }\n }\n\n .story-slides {\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n }\n}"],"sourceRoot":""}]);
|
|
854
854
|
// Exports
|
|
855
855
|
___CSS_LOADER_EXPORT___.locals = {
|
|
856
856
|
"story": "story--ieMN1",
|
|
@@ -8649,11 +8649,13 @@ let StoryPauseManager = (() => {
|
|
|
8649
8649
|
}
|
|
8650
8650
|
pauseSystem(source) {
|
|
8651
8651
|
this._systemPause.pause(source);
|
|
8652
|
+
this.ctx.notifyPauseStateChange();
|
|
8652
8653
|
}
|
|
8653
8654
|
resumeSystem(source) {
|
|
8654
8655
|
if (!this._systemPause.isPaused)
|
|
8655
8656
|
return;
|
|
8656
8657
|
this._systemPause.resume(source);
|
|
8658
|
+
this.ctx.notifyPauseStateChange();
|
|
8657
8659
|
}
|
|
8658
8660
|
resumeAll() {
|
|
8659
8661
|
if (this.isPaused) {
|
|
@@ -10155,9 +10157,9 @@ let StoryViewModel = (() => {
|
|
|
10155
10157
|
this.isStarted = false;
|
|
10156
10158
|
this.slideApiHandlers.clearNarrativeSessionDataCache();
|
|
10157
10159
|
this.resumeAll();
|
|
10158
|
-
await this.activeSlide.stop({ prepareForRestart: 1 /* ON_SLIDE_STOP_PREPARE_FOR_RESTART.PREPARE */ });
|
|
10159
10160
|
document.removeEventListener("visibilitychange", this.handleVisibilityChange);
|
|
10160
10161
|
document.removeEventListener("keydown", this.handleKeydown);
|
|
10162
|
+
await this.activeSlide.stop({ prepareForRestart: 1 /* ON_SLIDE_STOP_PREPARE_FOR_RESTART.PREPARE */ });
|
|
10161
10163
|
});
|
|
10162
10164
|
}
|
|
10163
10165
|
canGoNext() {
|
|
@@ -10273,8 +10275,8 @@ let StoryViewModel = (() => {
|
|
|
10273
10275
|
this.resumeAll();
|
|
10274
10276
|
if (!((_b = this.storyManager.config.cache) === null || _b === void 0 ? void 0 : _b.prefetch))
|
|
10275
10277
|
await this.preloadActiveSlide(ACTIVE_SLIDE_PRELOAD_PRIORITY);
|
|
10276
|
-
await activeSlide.init();
|
|
10277
10278
|
await (lastSlide === null || lastSlide === void 0 ? void 0 : lastSlide.stop({ prepareForRestart: 2 /* ON_SLIDE_STOP_PREPARE_FOR_RESTART.NOT_PREPARE */ }));
|
|
10279
|
+
await activeSlide.init();
|
|
10278
10280
|
await activeSlide.start();
|
|
10279
10281
|
this._activeSlideStartTime = Date.now();
|
|
10280
10282
|
}
|
|
@@ -10471,7 +10473,7 @@ class GameClientConfig {
|
|
|
10471
10473
|
value: void 0
|
|
10472
10474
|
});
|
|
10473
10475
|
const storyManagerConfig = this.storyManager.config;
|
|
10474
|
-
const sdkVersion = "1.9.
|
|
10476
|
+
const sdkVersion = "1.9.3";
|
|
10475
10477
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
10476
10478
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
10477
10479
|
this.sessionId = session.id;
|
|
@@ -11680,9 +11682,9 @@ let GameReaderViewModel = (() => {
|
|
|
11680
11682
|
async createAndOpenSession({ iframe, game, params }) {
|
|
11681
11683
|
const gameOrigin = new URL(game.url).origin;
|
|
11682
11684
|
const session = this.gameSessionFactory.create(iframe, gameOrigin);
|
|
11685
|
+
this.useGameModules(session, game);
|
|
11683
11686
|
const dto = game.toInitDto(params);
|
|
11684
11687
|
await session.open(dto);
|
|
11685
|
-
this.useGameModules(session, game);
|
|
11686
11688
|
this.storyManager.emit("startGame", { id: game.id });
|
|
11687
11689
|
return session;
|
|
11688
11690
|
}
|
|
@@ -21036,7 +21038,7 @@ class UgcEditorStore {
|
|
|
21036
21038
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
21037
21039
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
21038
21040
|
const storyManagerConfig = this.storyManager.config;
|
|
21039
|
-
const sdkVersion = "1.9.
|
|
21041
|
+
const sdkVersion = "1.9.3";
|
|
21040
21042
|
this._config = {
|
|
21041
21043
|
sessionId: session.id,
|
|
21042
21044
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -21507,11 +21509,11 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21507
21509
|
return deviceDescriptor.deviceId;
|
|
21508
21510
|
}
|
|
21509
21511
|
get sdkVersionName() {
|
|
21510
|
-
const sdkVersionName = "1.9.
|
|
21512
|
+
const sdkVersionName = "1.9.3";
|
|
21511
21513
|
return sdkVersionName || "0.0.0";
|
|
21512
21514
|
}
|
|
21513
21515
|
get sdkVersionCode() {
|
|
21514
|
-
const sdkVersionCode =
|
|
21516
|
+
const sdkVersionCode = 10903;
|
|
21515
21517
|
return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
21516
21518
|
}
|
|
21517
21519
|
get lang() {
|
|
@@ -21575,7 +21577,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21575
21577
|
this.rootStore.storyManagerConfigStore.setConfig(configDto);
|
|
21576
21578
|
}
|
|
21577
21579
|
setUserAgent(userAgent) {
|
|
21578
|
-
const sdkVersionCode =
|
|
21580
|
+
const sdkVersionCode = 10903;
|
|
21579
21581
|
const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
21580
21582
|
// According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
|
|
21581
21583
|
this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;
|
|
@@ -25611,17 +25613,15 @@ class StorySlidesContainer extends HTMLElement {
|
|
|
25611
25613
|
this.styleElement = style;
|
|
25612
25614
|
this.mountPoint.prepend(style);
|
|
25613
25615
|
}
|
|
25614
|
-
|
|
25615
|
-
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
|
|
25619
|
-
|
|
25620
|
-
|
|
25621
|
-
this.mountPoint.addEventListener("click", this.handleClick);
|
|
25622
|
-
});
|
|
25616
|
+
attach(story) {
|
|
25617
|
+
/** React uses its own virtual DOM and can reuse or move nodes without actually removing them from the DOM. So connectedCallback and disconnectedCallback are not always called.React uses its own virtual DOM and can reuse or move nodes without actually removing them from the DOM. So connectedCallback and disconnectedCallback are not always called. */
|
|
25618
|
+
if (!this.mountPoint)
|
|
25619
|
+
throw new Error("[IAS]: Mount point was undefined");
|
|
25620
|
+
this.story = story;
|
|
25621
|
+
this.story.attachRoot(this.mountPoint);
|
|
25622
|
+
this.mountPoint.addEventListener("click", this.handleClick);
|
|
25623
25623
|
}
|
|
25624
|
-
|
|
25624
|
+
detach() {
|
|
25625
25625
|
var _a, _b;
|
|
25626
25626
|
/** React uses its own virtual DOM and can reuse or move nodes without actually removing them from the DOM. So connectedCallback and disconnectedCallback are not always called. */
|
|
25627
25627
|
(_a = this.story) === null || _a === void 0 ? void 0 : _a.detachRoot();
|
|
@@ -25654,29 +25654,31 @@ var StorySlidesRenderer_rest = (undefined && undefined.__rest) || function (s, e
|
|
|
25654
25654
|
|
|
25655
25655
|
|
|
25656
25656
|
|
|
25657
|
-
const StorySlidesRenderer = (0,external_mobx_react_lite_namespaceObject.observer)((_a) => {
|
|
25657
|
+
const StorySlidesRenderer = (0,external_mobx_react_lite_namespaceObject.observer)((0,external_react_namespaceObject.forwardRef)((_a, ref) => {
|
|
25658
25658
|
var { className, story, preventNavigation, isActiveStory } = _a, props = StorySlidesRenderer_rest(_a, ["className", "story", "preventNavigation", "isActiveStory"]);
|
|
25659
25659
|
const storySlidesRef = (0,external_react_namespaceObject.useRef)(null);
|
|
25660
|
-
(0,external_react_namespaceObject.
|
|
25661
|
-
|
|
25662
|
-
|
|
25663
|
-
|
|
25664
|
-
|
|
25665
|
-
|
|
25666
|
-
|
|
25667
|
-
|
|
25668
|
-
|
|
25669
|
-
|
|
25670
|
-
|
|
25671
|
-
|
|
25660
|
+
(0,external_react_namespaceObject.useImperativeHandle)(ref, () => {
|
|
25661
|
+
return {
|
|
25662
|
+
setStyle: (style) => {
|
|
25663
|
+
var _a;
|
|
25664
|
+
(_a = storySlidesRef.current) === null || _a === void 0 ? void 0 : _a.setStyle(style);
|
|
25665
|
+
},
|
|
25666
|
+
attach: (story) => {
|
|
25667
|
+
var _a;
|
|
25668
|
+
(_a = storySlidesRef.current) === null || _a === void 0 ? void 0 : _a.attach(story);
|
|
25669
|
+
},
|
|
25670
|
+
detach: () => {
|
|
25671
|
+
var _a;
|
|
25672
|
+
(_a = storySlidesRef.current) === null || _a === void 0 ? void 0 : _a.detach();
|
|
25673
|
+
}
|
|
25672
25674
|
};
|
|
25673
|
-
}, [
|
|
25675
|
+
}, [ref, storySlidesRef]);
|
|
25674
25676
|
const bottomOffset = !props.isDesktopGeometry ? `${story.actionPanel.height}px` : "0px";
|
|
25675
25677
|
// Bug with attributes in React 19. Explicit cast to string required
|
|
25676
25678
|
return ((0,jsx_runtime_namespaceObject.jsx)("story-slides-container", { ref: storySlidesRef, style: {
|
|
25677
25679
|
bottom: bottomOffset
|
|
25678
25680
|
}, class: className, dir: story.dir, "prevent-navigation": preventNavigation.toString(), "is-active-story": isActiveStory.toString() }));
|
|
25679
|
-
});
|
|
25681
|
+
}));
|
|
25680
25682
|
|
|
25681
25683
|
;// CONCATENATED MODULE: ./src/StoryReader/Story/Story.tsx
|
|
25682
25684
|
var Story_rest = (undefined && undefined.__rest) || function (s, e) {
|
|
@@ -25708,6 +25710,7 @@ const Story_Story = (0,external_mobx_react_lite_namespaceObject.observer)((_a) =
|
|
|
25708
25710
|
var { story, geometry, className } = _a, props = Story_rest(_a, ["story", "geometry", "className"]);
|
|
25709
25711
|
const { storyReaderOptions, commonOptions, goodsWidgetOptions } = useIASContainer();
|
|
25710
25712
|
const storyRef = (0,external_react_namespaceObject.useRef)(null);
|
|
25713
|
+
const slideRef = (0,external_react_namespaceObject.useRef)(null);
|
|
25711
25714
|
const isActiveStory = story === props.activeStory;
|
|
25712
25715
|
const isDesktopGeometry = geometry instanceof DesktopStoryGeometry;
|
|
25713
25716
|
const useModernLayout = storyReaderOptions.layout === StoryReaderLayout.Modern;
|
|
@@ -25720,6 +25723,20 @@ const Story_Story = (0,external_mobx_react_lite_namespaceObject.observer)((_a) =
|
|
|
25720
25723
|
story.actionPanel.setOptions(commonOptions);
|
|
25721
25724
|
story.actionPanel.setActionPanelHeight(bottomOffset);
|
|
25722
25725
|
}, [story, commonOptions, storyReaderOptions.actionPanelBottomOffset, isDesktopGeometry]);
|
|
25726
|
+
(0,external_react_namespaceObject.useLayoutEffect)(() => {
|
|
25727
|
+
if (!slideRef.current)
|
|
25728
|
+
return;
|
|
25729
|
+
slideRef.current.setStyle(story.context.style);
|
|
25730
|
+
}, [story.context.style]);
|
|
25731
|
+
(0,external_react_namespaceObject.useLayoutEffect)(() => {
|
|
25732
|
+
if (!slideRef.current)
|
|
25733
|
+
return;
|
|
25734
|
+
const storySlides = slideRef.current;
|
|
25735
|
+
storySlides.attach(story);
|
|
25736
|
+
return () => {
|
|
25737
|
+
storySlides.detach();
|
|
25738
|
+
};
|
|
25739
|
+
}, [story]);
|
|
25723
25740
|
const handleReloadStory = async () => {
|
|
25724
25741
|
const storyError = Boolean(story.error);
|
|
25725
25742
|
try {
|
|
@@ -25738,7 +25755,7 @@ const Story_Story = (0,external_mobx_react_lite_namespaceObject.observer)((_a) =
|
|
|
25738
25755
|
story.sharePanel.completeNativeSharing({ result: false });
|
|
25739
25756
|
}, onTouchStart: () => {
|
|
25740
25757
|
story.sharePanel.completeNativeSharing({ result: false });
|
|
25741
|
-
}, "data-testid": "story", children: [isDesktopGeometry && useModernLayout && story.isSlideRendered && (0,jsx_runtime_namespaceObject.jsx)(StoryBackdrop, { hidden: isActiveStory }), story.canBeShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryHeader, { hidden: shouldHideHeader, story: story, onClose: props.onClose, isDesktopGeometry: isDesktopGeometry })), (0,jsx_runtime_namespaceObject.jsx)(StorySlidesRenderer, { className: Story_story_module["story-slides"], story: story, preventNavigation: useModernLayout && isDesktopGeometry, isActiveStory: isActiveStory, isDesktopGeometry: isDesktopGeometry }), story.actionPanel.needShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryActionPanel, { dir: story.dir, isDesktopGeometry: isDesktopGeometry, hidden: shouldHideActionPanel, actionPanel: story.actionPanel, commonOptions: commonOptions, storyReaderOptions: storyReaderOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(GoodsWidgetViewer, { story: story, goodsWidgetOptions: goodsWidgetOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(TextInputModal, { story: story, storyRef: storyRef, storyGeometry: geometry })), story.sharePanel.isOpened && ((0,jsx_runtime_namespaceObject.jsx)(SharePanel, { dir: story.dir, className: Story_story_module["share-panel-wrapper"], shareText: story.sharePanel.params.text, shareType: story.sharePanel.params.type, shareLink: story.sharePanel.params.link, onShareCompelete: (result) => story.sharePanel.handleShareComplete(story.sharePanel.params.id, result), sharePanelOptions: storyReaderOptions.sharePanel })), (0,jsx_runtime_namespaceObject.jsx)(Loader, { needShowErrorScreen: story.needShowErrorScreen, needShowLoaderScreen: story.needShowLoaderScreen, onReload: handleReloadStory })] }));
|
|
25758
|
+
}, "data-testid": "story", children: [isDesktopGeometry && useModernLayout && story.isSlideRendered && (0,jsx_runtime_namespaceObject.jsx)(StoryBackdrop, { hidden: isActiveStory }), story.canBeShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryHeader, { hidden: shouldHideHeader, story: story, onClose: props.onClose, isDesktopGeometry: isDesktopGeometry })), (0,jsx_runtime_namespaceObject.jsx)(StorySlidesRenderer, { className: Story_story_module["story-slides"], story: story, ref: slideRef, preventNavigation: useModernLayout && isDesktopGeometry, isActiveStory: isActiveStory, isDesktopGeometry: isDesktopGeometry }), story.actionPanel.needShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryActionPanel, { dir: story.dir, isDesktopGeometry: isDesktopGeometry, hidden: shouldHideActionPanel, actionPanel: story.actionPanel, commonOptions: commonOptions, storyReaderOptions: storyReaderOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(GoodsWidgetViewer, { story: story, goodsWidgetOptions: goodsWidgetOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(TextInputModal, { story: story, storyRef: storyRef, storyGeometry: geometry })), story.sharePanel.isOpened && ((0,jsx_runtime_namespaceObject.jsx)(SharePanel, { dir: story.dir, className: Story_story_module["share-panel-wrapper"], shareText: story.sharePanel.params.text, shareType: story.sharePanel.params.type, shareLink: story.sharePanel.params.link, onShareCompelete: (result) => story.sharePanel.handleShareComplete(story.sharePanel.params.id, result), sharePanelOptions: storyReaderOptions.sharePanel })), (0,jsx_runtime_namespaceObject.jsx)(Loader, { needShowErrorScreen: story.needShowErrorScreen, needShowLoaderScreen: story.needShowLoaderScreen, onReload: handleReloadStory })] }));
|
|
25742
25759
|
});
|
|
25743
25760
|
|
|
25744
25761
|
;// CONCATENATED MODULE: ./src/StoryReader/Story/index.ts
|