-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(refactor): global Redux store persist, per-publication session st…
…ate, OPDS catalog last column info, tags editor prevent empty text, mismatched reader settings (PR #930 Fixes #1036 Fixes #1037 Fixes #1035 Fixes #911)
- Loading branch information
Showing
203 changed files
with
8,545 additions
and
3,011 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
export interface ISessionApi { | ||
enable: (bool: boolean) => Promise<void>; | ||
isEnabled: () => Promise<boolean>; | ||
} | ||
|
||
export interface ISessionModuleApi { | ||
"session/enable": ISessionApi["enable"]; | ||
"session/isEnabled": ISessionApi["isEnabled"]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
import { ReaderConfig } from "readium-desktop/common/models/reader"; | ||
|
||
import { IEventPayload_R2_EVENT_READIUMCSS } from "@r2-navigator-js/electron/common/events"; | ||
import { | ||
colCountEnum, IReadiumCSS, readiumCSSDefaults, textAlignEnum, | ||
} from "@r2-navigator-js/electron/common/readium-css-settings"; | ||
|
||
export const computeReadiumCssJsonMessage = (settings: ReaderConfig): IEventPayload_R2_EVENT_READIUMCSS => { | ||
|
||
const cssJson: IReadiumCSS = { | ||
|
||
a11yNormalize: readiumCSSDefaults.a11yNormalize, | ||
|
||
backgroundColor: readiumCSSDefaults.backgroundColor, | ||
|
||
bodyHyphens: readiumCSSDefaults.bodyHyphens, | ||
|
||
colCount: settings.colCount === "1" ? colCountEnum.one : | ||
(settings.colCount === "2" ? colCountEnum.two : colCountEnum.auto), | ||
|
||
darken: settings.darken, | ||
|
||
font: settings.font, | ||
|
||
fontSize: settings.fontSize, | ||
|
||
invert: settings.invert, | ||
|
||
letterSpacing: settings.letterSpacing, | ||
|
||
ligatures: readiumCSSDefaults.ligatures, | ||
|
||
lineHeight: settings.lineHeight, | ||
|
||
night: settings.night, | ||
|
||
pageMargins: settings.pageMargins, | ||
|
||
paged: settings.paged, | ||
|
||
paraIndent: readiumCSSDefaults.paraIndent, | ||
|
||
paraSpacing: settings.paraSpacing, | ||
|
||
sepia: settings.sepia, | ||
|
||
noFootnotes: settings.noFootnotes, | ||
|
||
textAlign: settings.align === textAlignEnum.left ? textAlignEnum.left : | ||
(settings.align === textAlignEnum.right ? textAlignEnum.right : | ||
(settings.align === textAlignEnum.justify ? textAlignEnum.justify : | ||
(settings.align === textAlignEnum.start ? textAlignEnum.start : undefined))), | ||
|
||
textColor: readiumCSSDefaults.textColor, | ||
|
||
typeScale: readiumCSSDefaults.typeScale, | ||
|
||
wordSpacing: settings.wordSpacing, | ||
|
||
mathJax: settings.enableMathJax, | ||
|
||
reduceMotion: readiumCSSDefaults.reduceMotion, | ||
}; | ||
|
||
const jsonMsg: IEventPayload_R2_EVENT_READIUMCSS = { setCSS: cssJson }; | ||
return jsonMsg; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
|
||
import { | ||
IReaderRootState, | ||
} from "readium-desktop/common/redux/states/renderer/readerRootState"; | ||
|
||
export enum EventType { | ||
request = "REQUEST", | ||
response = "RESPONSE", | ||
} | ||
|
||
export const CHANNEL = "READER_INIT"; | ||
|
||
export interface EventPayload { | ||
type: EventType; | ||
payload: Partial<IReaderRootState>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
// ==LICENSE-BEGIN== | ||
// Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// Use of this source code is governed by a BSD-style license | ||
// that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// ==LICENSE-END== | ||
// // ==LICENSE-BEGIN== | ||
// // Copyright 2017 European Digital Reading Lab. All rights reserved. | ||
// // Licensed to the Readium Foundation under one or more contributor license agreements. | ||
// // Use of this source code is governed by a BSD-style license | ||
// // that can be found in the LICENSE file exposed on Github (readium) in the project repository. | ||
// // ==LICENSE-END== | ||
|
||
import { BrowserWindow } from "electron"; | ||
// import { BrowserWindow } from "electron"; | ||
|
||
import { IOnWindowMoveResize } from "../rectangle/window"; | ||
import { Identifiable } from "./identifiable"; | ||
// import { IOnWindowMoveResize } from "../rectangle/window"; | ||
// import { Identifiable } from "./identifiable"; | ||
|
||
export enum AppWindowType { | ||
Library = "library", | ||
Reader = "reader", | ||
} | ||
// export enum AppWindowType { | ||
// Library = "library", | ||
// Reader = "reader", | ||
// } | ||
|
||
export interface AppWindow extends Identifiable { | ||
type: AppWindowType; | ||
browserWindow: BrowserWindow; | ||
browserWindowID: number; | ||
onWindowMoveResize: IOnWindowMoveResize; | ||
registerIndex: number; | ||
} | ||
// export interface AppWindow extends Identifiable { | ||
// type: AppWindowType; | ||
// browserWindow: BrowserWindow; | ||
// browserWindowID: number; | ||
// onWindowMoveResize: IOnWindowMoveResize; | ||
// registerIndex: number; | ||
// } |
Oops, something went wrong.