@prose-reader/core 1.109.0 → 1.110.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.
@@ -985,6 +985,26 @@
985
985
  ...rest
986
986
  });
987
987
  }
988
+ goToAbsolutePageIndex({
989
+ absolutePageIndex,
990
+ ...rest
991
+ }) {
992
+ const foundInfo = this.reader.spine.locator.getSpineInfoFromAbsolutePageIndex({
993
+ absolutePageIndex
994
+ });
995
+ if (foundInfo) {
996
+ const position = this.reader.navigation.navigationResolver.getNavigationForSpineItemPage(
997
+ {
998
+ pageIndex: foundInfo.pageIndex,
999
+ spineItemId: foundInfo.itemIndex
1000
+ }
1001
+ );
1002
+ return this.reader.navigation.navigate({
1003
+ position,
1004
+ ...rest
1005
+ });
1006
+ }
1007
+ }
988
1008
  }
989
1009
  class PanNavigator {
990
1010
  constructor(reader) {
@@ -1126,7 +1146,8 @@
1126
1146
  goToBottomSpineItem: manualNavigator.goToBottomSpineItem.bind(manualNavigator),
1127
1147
  goToLeftSpineItem: manualNavigator.goToLeftSpineItem.bind(manualNavigator),
1128
1148
  goToRightSpineItem: manualNavigator.goToRightSpineItem.bind(manualNavigator),
1129
- goToPageOfSpineItem: manualNavigator.goToPageOfSpineItem.bind(manualNavigator)
1149
+ goToPageOfSpineItem: manualNavigator.goToPageOfSpineItem.bind(manualNavigator),
1150
+ goToAbsolutePageIndex: manualNavigator.goToAbsolutePageIndex.bind(manualNavigator)
1130
1151
  }
1131
1152
  };
1132
1153
  };
@@ -1270,9 +1291,9 @@
1270
1291
  const chaptersInfo$ = trackChapterInfo(reader);
1271
1292
  const totalPages$ = trackTotalPages(reader);
1272
1293
  const currentValue = new rxjs.BehaviorSubject({
1273
- ...reader.pagination.state,
1294
+ ...reader.pagination.getState(),
1274
1295
  ...mapPaginationInfoToExtendedInfo(reader)(
1275
- reader.pagination.state,
1296
+ reader.pagination.getState(),
1276
1297
  getChaptersInfo(reader)
1277
1298
  ),
1278
1299
  beginAbsolutePageIndex: 0,
@@ -1320,9 +1341,7 @@
1320
1341
  ...reader,
1321
1342
  pagination: {
1322
1343
  ...reader.pagination,
1323
- get state() {
1324
- return getPaginationInfo();
1325
- },
1344
+ getState: () => getPaginationInfo(),
1326
1345
  state$: paginationInfo$
1327
1346
  }
1328
1347
  };
@@ -5182,7 +5201,9 @@
5182
5201
  rxjs.mergeMap((response) => getHtmlFromResource(response)),
5183
5202
  rxjs.tap((htmlDoc) => {
5184
5203
  if (htmlDoc) {
5185
- frameElement == null ? void 0 : frameElement.setAttribute(`srcdoc`, htmlDoc);
5204
+ const blob = new Blob([htmlDoc], { type: "text/html" });
5205
+ const blobURL = URL.createObjectURL(blob);
5206
+ frameElement == null ? void 0 : frameElement.setAttribute(`src`, blobURL);
5186
5207
  }
5187
5208
  }),
5188
5209
  rxjs.map(() => frameElement),
@@ -7392,7 +7413,7 @@
7392
7413
  load,
7393
7414
  destroy,
7394
7415
  pagination: {
7395
- state: pagination.state,
7416
+ getState: () => pagination.state,
7396
7417
  state$: pagination.state$
7397
7418
  },
7398
7419
  settings: settingsManager,