@prose-reader/core 1.40.0 → 1.41.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/prose.js +24 -34
- package/dist/prose.js.map +1 -1
- package/dist/prose.umd.cjs +24 -34
- package/dist/prose.umd.cjs.map +1 -1
- package/package.json +3 -3
- package/dist/utils/manifest.d.ts +0 -2
package/dist/prose.umd.cjs
CHANGED
|
@@ -52,13 +52,16 @@
|
|
|
52
52
|
}
|
|
53
53
|
return true;
|
|
54
54
|
};
|
|
55
|
-
const groupBy = (list, getKey) => list.reduce(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
previous[group]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
const groupBy = (list, getKey) => list.reduce(
|
|
56
|
+
(previous, currentItem) => {
|
|
57
|
+
const group = getKey(currentItem);
|
|
58
|
+
if (!previous[group])
|
|
59
|
+
previous[group] = [];
|
|
60
|
+
previous[group].push(currentItem);
|
|
61
|
+
return previous;
|
|
62
|
+
},
|
|
63
|
+
{}
|
|
64
|
+
);
|
|
62
65
|
const getBase64FromBlob = (data) => {
|
|
63
66
|
const reader = new FileReader();
|
|
64
67
|
return new Promise((resolve) => {
|
|
@@ -239,15 +242,18 @@
|
|
|
239
242
|
};
|
|
240
243
|
const mapKeysTo = (keys) => {
|
|
241
244
|
return operators.map((obj) => {
|
|
242
|
-
return Object.entries(obj).reduce(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
return Object.entries(obj).reduce(
|
|
246
|
+
(acc, [key, entry]) => {
|
|
247
|
+
if (keys.includes(key)) {
|
|
248
|
+
return {
|
|
249
|
+
...acc,
|
|
250
|
+
[key]: entry
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return acc;
|
|
254
|
+
},
|
|
255
|
+
{}
|
|
256
|
+
);
|
|
251
257
|
});
|
|
252
258
|
};
|
|
253
259
|
const fixReflowable = (reader) => {
|
|
@@ -3796,16 +3802,10 @@
|
|
|
3796
3802
|
selectionTracker$.pipe(
|
|
3797
3803
|
operators.filter(({ event: event2 }) => event2 === `selectstart`),
|
|
3798
3804
|
operators.switchMap(
|
|
3799
|
-
(
|
|
3805
|
+
() => fingerTracker$.pipe(
|
|
3800
3806
|
operators.filter(({ event: event2 }) => event2 === `fingermove`),
|
|
3801
3807
|
operators.debounce(() => rxjs.interval(1e3)),
|
|
3802
|
-
operators.takeUntil(
|
|
3803
|
-
fingerTracker$.pipe(
|
|
3804
|
-
operators.filter(({ event: event2 }) => event2 === `fingerout`),
|
|
3805
|
-
operators.tap(() => {
|
|
3806
|
-
})
|
|
3807
|
-
)
|
|
3808
|
-
),
|
|
3808
|
+
operators.takeUntil(fingerTracker$.pipe(operators.filter(({ event: event2 }) => event2 === `fingerout`))),
|
|
3809
3809
|
operators.tap(({ data }) => {
|
|
3810
3810
|
})
|
|
3811
3811
|
)
|
|
@@ -3989,15 +3989,6 @@
|
|
|
3989
3989
|
return element2;
|
|
3990
3990
|
}, element);
|
|
3991
3991
|
};
|
|
3992
|
-
const getCoverItem = (manifest) => {
|
|
3993
|
-
var _a;
|
|
3994
|
-
const coverItem = (_a = manifest.guide) == null ? void 0 : _a.find((item) => item.type === `cover`);
|
|
3995
|
-
return manifest.spineItems.findIndex((item) => {
|
|
3996
|
-
if (!(coverItem == null ? void 0 : coverItem.href))
|
|
3997
|
-
return false;
|
|
3998
|
-
return item.href.endsWith(coverItem.href);
|
|
3999
|
-
});
|
|
4000
|
-
};
|
|
4001
3992
|
const NAMESPACE$4 = `spineItemManager`;
|
|
4002
3993
|
const createSpineItemManager = ({ context }) => {
|
|
4003
3994
|
const focus$ = new rxjs.Subject();
|
|
@@ -4009,7 +4000,6 @@
|
|
|
4009
4000
|
const manifest = context.getManifest();
|
|
4010
4001
|
const newItemLayoutInformation = [];
|
|
4011
4002
|
const isGloballyPrePaginated = (manifest == null ? void 0 : manifest.renditionLayout) === `pre-paginated`;
|
|
4012
|
-
manifest ? getCoverItem(manifest) : void 0;
|
|
4013
4003
|
orderedSpineItemsSubject$.value.reduce(
|
|
4014
4004
|
({ horizontalOffset, verticalOffset }, item, index) => {
|
|
4015
4005
|
let minimumWidth = context.getPageSize().width;
|