release build 1.1.0

This commit is contained in:
Bruce Liu 2021-12-16 17:26:30 +08:00
parent 7092a57b2c
commit dea293683a
8 changed files with 35 additions and 31 deletions

View File

@ -12,7 +12,11 @@ import {
Icon, Icon,
Link, Link,
} from "@fluentui/react" } from "@fluentui/react"
import { RSSSource, SourceOpenTarget, SourceTextDirection } from "../scripts/models/source" import {
RSSSource,
SourceOpenTarget,
SourceTextDirection,
} from "../scripts/models/source"
import { shareSubmenu } from "./context-menu" import { shareSubmenu } from "./context-menu"
import { platformCtrl, decodeFetchResponse } from "../scripts/utils" import { platformCtrl, decodeFetchResponse } from "../scripts/utils"
@ -95,8 +99,8 @@ class Article extends React.Component<ArticleProps, ArticleState> {
text: font === "" ? intl.get("default") : font, text: font === "" ? intl.get("default") : font,
canCheck: true, canCheck: true,
checked: this.state.fontFamily === font, checked: this.state.fontFamily === font,
onClick: () => this.setFont(font) onClick: () => this.setFont(font),
})) })),
}) })
updateTextDirection = (direction: SourceTextDirection) => { updateTextDirection = (direction: SourceTextDirection) => {
@ -111,7 +115,8 @@ class Article extends React.Component<ArticleProps, ArticleState> {
iconProps: { iconName: "Forward" }, iconProps: { iconName: "Forward" },
canCheck: true, canCheck: true,
checked: this.props.source.textDir === SourceTextDirection.LTR, checked: this.props.source.textDir === SourceTextDirection.LTR,
onClick: () => this.updateTextDirection(SourceTextDirection.LTR), onClick: () =>
this.updateTextDirection(SourceTextDirection.LTR),
}, },
{ {
key: "RTL", key: "RTL",
@ -119,17 +124,20 @@ class Article extends React.Component<ArticleProps, ArticleState> {
iconProps: { iconName: "Back" }, iconProps: { iconName: "Back" },
canCheck: true, canCheck: true,
checked: this.props.source.textDir === SourceTextDirection.RTL, checked: this.props.source.textDir === SourceTextDirection.RTL,
onClick: () => this.updateTextDirection(SourceTextDirection.RTL), onClick: () =>
this.updateTextDirection(SourceTextDirection.RTL),
}, },
{ {
key: "Vertical", key: "Vertical",
text: intl.get("article.Vertical"), text: intl.get("article.Vertical"),
iconProps: { iconName: "Down" }, iconProps: { iconName: "Down" },
canCheck: true, canCheck: true,
checked: this.props.source.textDir === SourceTextDirection.Vertical, checked:
onClick: () => this.updateTextDirection(SourceTextDirection.Vertical), this.props.source.textDir === SourceTextDirection.Vertical,
onClick: () =>
this.updateTextDirection(SourceTextDirection.Vertical),
}, },
] ],
}) })
moreMenuProps = (): IContextualMenuProps => ({ moreMenuProps = (): IContextualMenuProps => ({
@ -354,13 +362,9 @@ class Article extends React.Component<ArticleProps, ArticleState> {
</> </>
) )
) )
return `article/article.html?a=${a}&h=${h}&f=${ return `article/article.html?a=${a}&h=${h}&f=${encodeURIComponent(
encodeURIComponent(this.state.fontFamily) this.state.fontFamily
}&s=${ )}&s=${this.state.fontSize}&d=${this.props.source.textDir}&u=${
this.state.fontSize
}&d=${
this.props.source.textDir
}&u=${
this.props.item.link this.props.item.link
}&m=${this.state.loadFull ? 1 : 0}` }&m=${this.state.loadFull ? 1 : 0}`
} }

View File

@ -20,7 +20,6 @@ import {
DefaultButton, DefaultButton,
ChoiceGroup, ChoiceGroup,
IChoiceGroupOption, IChoiceGroupOption,
loadTheme,
Dropdown, Dropdown,
IDropdownOption, IDropdownOption,
PrimaryButton, PrimaryButton,

View File

@ -17,7 +17,11 @@ import {
closeContextMenu, closeContextMenu,
openImageMenu, openImageMenu,
} from "../scripts/models/app" } from "../scripts/models/app"
import { RSSSource, SourceTextDirection, updateSource } from "../scripts/models/source" import {
RSSSource,
SourceTextDirection,
updateSource,
} from "../scripts/models/source"
type ArticleContainerProps = { type ArticleContainerProps = {
itemId: number itemId: number

View File

@ -27,7 +27,7 @@ window.utils.addMainContextListener((pos, text) => {
}) })
window.fontList = [""] window.fontList = [""]
window.utils.initFontList().then((fonts) => { window.utils.initFontList().then(fonts => {
window.fontList.push(...fonts) window.fontList.push(...fonts)
}) })

View File

@ -1,16 +1,9 @@
import { import { ipcMain, shell, dialog, app, session, clipboard } from "electron"
ipcMain,
shell,
dialog,
app,
session,
clipboard,
} from "electron"
import { WindowManager } from "./window" import { WindowManager } from "./window"
import fs = require("fs") import fs = require("fs")
import { ImageCallbackTypes, TouchBarTexts } from "../schema-types" import { ImageCallbackTypes, TouchBarTexts } from "../schema-types"
import { initMainTouchBar } from "./touchbar" import { initMainTouchBar } from "./touchbar"
import fontList = require('font-list') import fontList = require("font-list")
export function setUtilsListeners(manager: WindowManager) { export function setUtilsListeners(manager: WindowManager) {
async function openExternal(url: string, background = false) { async function openExternal(url: string, background = false) {
@ -28,9 +21,12 @@ export function setUtilsListeners(manager: WindowManager) {
} }
app.on("web-contents-created", (_, contents) => { app.on("web-contents-created", (_, contents) => {
contents.setWindowOpenHandler((details) => { contents.setWindowOpenHandler(details => {
if (contents.getType() === "webview") if (contents.getType() === "webview")
openExternal(details.url, details.disposition === "background-tab") openExternal(
details.url,
details.disposition === "background-tab"
)
return { return {
action: manager.hasWindow() ? "deny" : "allow", action: manager.hasWindow() ? "deny" : "allow",
} }

View File

@ -18,5 +18,6 @@ Currently, Fluent Reader supports the following languages.
| nl | Nederlands | [@Vistaus](https://github.com/Vistaus) | | nl | Nederlands | [@Vistaus](https://github.com/Vistaus) |
| it | Italiano | [@andrewasd](https://github.com/andrewasd) | | it | Italiano | [@andrewasd](https://github.com/andrewasd) |
| pt-BR | Português do Brasil | [@fabianski7](https://github.com/fabianski7) | | pt-BR | Português do Brasil | [@fabianski7](https://github.com/fabianski7) |
| ko | 한글 | [@1drive](https://github.com/1drive) |
Refer to the repo of [react-intl-universal](https://github.com/alibaba/react-intl-universal) to get started on internationalization. Refer to the repo of [react-intl-universal](https://github.com/alibaba/react-intl-universal) to get started on internationalization.

View File

@ -491,7 +491,7 @@ export function sourceReducer(
} }
case MARK_ALL_READ: { case MARK_ALL_READ: {
let nextState = { ...state } let nextState = { ...state }
action.sids.forEach((sid) => { action.sids.forEach(sid => {
nextState[sid] = { nextState[sid] = {
...state[sid], ...state[sid],
unreadCount: action.time ? state[sid].unreadCount : 0, unreadCount: action.time ? state[sid].unreadCount : 0,

View File

@ -24,7 +24,7 @@ module.exports = [
filename: "electron.js", filename: "electron.js",
}, },
node: { node: {
__dirname: false __dirname: false,
}, },
plugins: [new HardSourceWebpackPlugin()], plugins: [new HardSourceWebpackPlugin()],
}, },