@prose-reader/core 1.39.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.
@@ -9,7 +9,7 @@ export declare const createReaderWithEnhancers: (options: {
9
9
  fontScale?: number | undefined;
10
10
  lineHeight?: number | "publisher" | undefined;
11
11
  fontWeight?: 200 | "publisher" | 100 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | undefined;
12
- fontJustification?: "right" | "left" | "publisher" | "center" | "justify" | undefined;
12
+ fontJustification?: "center" | "right" | "left" | "publisher" | "justify" | undefined;
13
13
  } & {
14
14
  loadingElementCreate?: ((options: {
15
15
  container: HTMLElement;
@@ -5362,13 +5362,13 @@ export declare const createReaderWithEnhancers: (options: {
5362
5362
  fontScale?: number | undefined;
5363
5363
  lineHeight?: number | "publisher" | undefined;
5364
5364
  fontWeight?: 200 | "publisher" | 100 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | undefined;
5365
- fontJustification?: "right" | "left" | "publisher" | "center" | "justify" | undefined;
5365
+ fontJustification?: "center" | "right" | "left" | "publisher" | "justify" | undefined;
5366
5366
  }>>;
5367
5367
  setSettings: (settings: Partial<import("./settings").PublicSettings> & import("./enhancers/layoutEnhancer/types").SettingsInput & {
5368
5368
  fontScale?: number | undefined;
5369
5369
  lineHeight?: number | "publisher" | undefined;
5370
5370
  fontWeight?: 200 | "publisher" | 100 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | undefined;
5371
- fontJustification?: "right" | "left" | "publisher" | "center" | "justify" | undefined;
5371
+ fontJustification?: "center" | "right" | "left" | "publisher" | "justify" | undefined;
5372
5372
  }) => void;
5373
5373
  } & {
5374
5374
  loading: {
package/dist/prose.js CHANGED
@@ -51,13 +51,16 @@ const isShallowEqual = (objectA, objectB, options) => {
51
51
  }
52
52
  return true;
53
53
  };
54
- const groupBy = (list, getKey) => list.reduce((previous, currentItem) => {
55
- const group = getKey(currentItem);
56
- if (!previous[group])
57
- previous[group] = [];
58
- previous[group].push(currentItem);
59
- return previous;
60
- }, {});
54
+ const groupBy = (list, getKey) => list.reduce(
55
+ (previous, currentItem) => {
56
+ const group = getKey(currentItem);
57
+ if (!previous[group])
58
+ previous[group] = [];
59
+ previous[group].push(currentItem);
60
+ return previous;
61
+ },
62
+ {}
63
+ );
61
64
  const getBase64FromBlob = (data) => {
62
65
  const reader = new FileReader();
63
66
  return new Promise((resolve) => {
@@ -238,15 +241,18 @@ const createMovingSafePan$ = (reader) => {
238
241
  };
239
242
  const mapKeysTo = (keys) => {
240
243
  return map$1((obj) => {
241
- return Object.entries(obj).reduce((acc, [key, entry]) => {
242
- if (keys.includes(key)) {
243
- return {
244
- ...acc,
245
- [key]: entry
246
- };
247
- }
248
- return acc;
249
- }, {});
244
+ return Object.entries(obj).reduce(
245
+ (acc, [key, entry]) => {
246
+ if (keys.includes(key)) {
247
+ return {
248
+ ...acc,
249
+ [key]: entry
250
+ };
251
+ }
252
+ return acc;
253
+ },
254
+ {}
255
+ );
250
256
  });
251
257
  };
252
258
  const fixReflowable = (reader) => {
@@ -3795,16 +3801,10 @@ const createSpine = ({
3795
3801
  selectionTracker$.pipe(
3796
3802
  filter(({ event: event2 }) => event2 === `selectstart`),
3797
3803
  switchMap$1(
3798
- (_) => fingerTracker$.pipe(
3804
+ () => fingerTracker$.pipe(
3799
3805
  filter(({ event: event2 }) => event2 === `fingermove`),
3800
3806
  debounce(() => interval(1e3)),
3801
- takeUntil$1(
3802
- fingerTracker$.pipe(
3803
- filter(({ event: event2 }) => event2 === `fingerout`),
3804
- tap(() => {
3805
- })
3806
- )
3807
- ),
3807
+ takeUntil$1(fingerTracker$.pipe(filter(({ event: event2 }) => event2 === `fingerout`))),
3808
3808
  tap(({ data }) => {
3809
3809
  })
3810
3810
  )
@@ -3988,15 +3988,6 @@ const createContainerElement = (doc, hooks$) => {
3988
3988
  return element2;
3989
3989
  }, element);
3990
3990
  };
3991
- const getCoverItem = (manifest) => {
3992
- var _a;
3993
- const coverItem = (_a = manifest.guide) == null ? void 0 : _a.find((item) => item.type === `cover`);
3994
- return manifest.spineItems.findIndex((item) => {
3995
- if (!(coverItem == null ? void 0 : coverItem.href))
3996
- return false;
3997
- return item.href.endsWith(coverItem.href);
3998
- });
3999
- };
4000
3991
  const NAMESPACE$4 = `spineItemManager`;
4001
3992
  const createSpineItemManager = ({ context }) => {
4002
3993
  const focus$ = new Subject();
@@ -4008,7 +3999,6 @@ const createSpineItemManager = ({ context }) => {
4008
3999
  const manifest = context.getManifest();
4009
4000
  const newItemLayoutInformation = [];
4010
4001
  const isGloballyPrePaginated = (manifest == null ? void 0 : manifest.renditionLayout) === `pre-paginated`;
4011
- manifest ? getCoverItem(manifest) : void 0;
4012
4002
  orderedSpineItemsSubject$.value.reduce(
4013
4003
  ({ horizontalOffset, verticalOffset }, item, index) => {
4014
4004
  let minimumWidth = context.getPageSize().width;