mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-20 02:33:33 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
728868784e | ||
|
|
e59948c68c | ||
|
|
d3ba47d200 | ||
|
|
aa8d3a390c | ||
|
|
ec0e19fa4c | ||
|
|
60ee632b78 | ||
|
|
04860af353 | ||
|
|
03d369659b | ||
|
|
2c05b49c63 | ||
|
|
0cde864b85 | ||
|
|
8a2280ce2c |
2
.mvn/wrapper/maven-wrapper.properties
vendored
2
.mvn/wrapper/maven-wrapper.properties
vendored
@@ -1,3 +1,3 @@
|
||||
wrapperVersion=3.3.4
|
||||
distributionType=only-script
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.10.0/apache-maven-3.10.0-bin.zip
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.10.1/apache-maven-3.10.1-bin.zip
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## [7.5.2]
|
||||
|
||||
- Fix Youtube embeds not loading and stealing focus (#2394)
|
||||
|
||||
## [7.5.1]
|
||||
|
||||
- Fix multiple entry context menus being open at the same time (#2393)
|
||||
|
||||
## [7.5.0]
|
||||
|
||||
- Empty categories are now restored when importing OPML files (#2364)
|
||||
|
||||
706
commafeed-client/package-lock.json
generated
706
commafeed-client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@
|
||||
"@lingui/vite-plugin": "6.12.0",
|
||||
"@testing-library/jest-dom": "7.0.1",
|
||||
"@testing-library/react": "16.3.3",
|
||||
"@testing-library/user-event": "14.6.9",
|
||||
"@testing-library/user-event": "14.6.10",
|
||||
"@types/mousetrap": "1.6.15",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
@@ -67,7 +67,7 @@
|
||||
"@types/tinycon": "0.6.7",
|
||||
"@vitejs/plugin-react": "6.3.0",
|
||||
"babel-plugin-react-compiler": "^1.0.0",
|
||||
"jsdom": "31.0.0",
|
||||
"jsdom": "31.0.1",
|
||||
"typescript": "7.0.2",
|
||||
"vite": "8.3.8",
|
||||
"vite-plugin-checker": "1.0.0",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.commafeed</groupId>
|
||||
<artifactId>commafeed</artifactId>
|
||||
<version>7.5.0</version>
|
||||
<version>7.5.2</version>
|
||||
</parent>
|
||||
<artifactId>commafeed-client</artifactId>
|
||||
<name>CommaFeed Client</name>
|
||||
|
||||
@@ -106,7 +106,14 @@ const Content = React.memo((props: ContentProps) => {
|
||||
return (
|
||||
<BasicHtmlStyles>
|
||||
<Box className={classes.content}>
|
||||
<Interweave content={props.content} transform={transform} matchers={matchers} allowList={allowList} />
|
||||
<Interweave
|
||||
content={props.content}
|
||||
transform={transform}
|
||||
matchers={matchers}
|
||||
allowList={allowList}
|
||||
// attributes are already sanitized server-side
|
||||
allowAttributes
|
||||
/>
|
||||
</Box>
|
||||
</BasicHtmlStyles>
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Trans } from "@lingui/react/macro"
|
||||
import { Box } from "@mantine/core"
|
||||
import { openModal } from "@mantine/modals"
|
||||
import { useEffect } from "react"
|
||||
import { useEffect, useState } from "react"
|
||||
import InfiniteScroll from "react-infinite-scroller"
|
||||
import { throttle } from "throttle-debounce"
|
||||
import { Constants } from "@/app/constants"
|
||||
@@ -78,6 +78,23 @@ export function FeedEntries() {
|
||||
|
||||
const swipedLeft = async (entry: ExpendableEntry) => await dispatch(markEntry({ entry, read: !entry.read }))
|
||||
|
||||
// only one context menu can be opened at a time
|
||||
const [contextMenuEntryId, setContextMenuEntryId] = useState<string>()
|
||||
const contextMenuChanged = (entry: ExpendableEntry, opened: boolean) =>
|
||||
setContextMenuEntryId(current => {
|
||||
if (opened) return entry.id
|
||||
return current === entry.id ? undefined : current
|
||||
})
|
||||
|
||||
// close context menu on scroll
|
||||
useEffect(() => {
|
||||
if (!contextMenuEntryId) return
|
||||
|
||||
const listener = throttle(100, () => setContextMenuEntryId(undefined))
|
||||
window.addEventListener("scroll", listener)
|
||||
return () => window.removeEventListener("scroll", listener)
|
||||
}, [contextMenuEntryId])
|
||||
|
||||
useEffect(() => {
|
||||
const listener = throttle(100, () => {
|
||||
if (viewMode !== "expanded") return
|
||||
@@ -287,6 +304,8 @@ export function FeedEntries() {
|
||||
onHeaderClick={event => headerClicked(entry, event)}
|
||||
onBodyClick={() => bodyClicked(entry)}
|
||||
onSwipedLeft={async () => await swipedLeft(entry)}
|
||||
contextMenuOpened={entry.id === contextMenuEntryId}
|
||||
onContextMenuChange={opened => contextMenuChanged(entry, opened)}
|
||||
/>
|
||||
))}
|
||||
</InfiniteScroll>
|
||||
|
||||
@@ -21,6 +21,8 @@ interface FeedEntryProps {
|
||||
onHeaderClick: (e: React.MouseEvent) => void
|
||||
onBodyClick: (e: React.MouseEvent) => void
|
||||
onSwipedLeft: () => void
|
||||
contextMenuOpened: boolean
|
||||
onContextMenuChange: (opened: boolean) => void
|
||||
}
|
||||
|
||||
const useStyles = tss
|
||||
@@ -170,7 +172,11 @@ export function FeedEntry(props: Readonly<FeedEntryProps>) {
|
||||
"show-selection-indicator": props.showSelectionIndicator,
|
||||
})}
|
||||
>
|
||||
<FeedEntryContextMenu entry={props.entry}>
|
||||
<FeedEntryContextMenu
|
||||
entry={props.entry}
|
||||
opened={props.contextMenuOpened}
|
||||
onChange={props.onContextMenuChange}
|
||||
>
|
||||
<a
|
||||
className={classes.headerLink}
|
||||
href={props.entry.url}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Trans } from "@lingui/react/macro"
|
||||
import { Menu } from "@mantine/core"
|
||||
import { type ReactElement, useEffect, useState } from "react"
|
||||
import type { ReactElement } from "react"
|
||||
import { TbArrowBarToDown, TbExternalLink, TbMail, TbMailOpened, TbRss, TbStar, TbStarOff } from "react-icons/tb"
|
||||
import { throttle } from "throttle-debounce"
|
||||
import { markEntriesUpToEntry, markEntry, starEntry } from "@/app/entries/thunks"
|
||||
import { redirectToFeed } from "@/app/redirect/thunks"
|
||||
import { useAppDispatch, useAppSelector } from "@/app/store"
|
||||
@@ -12,6 +11,8 @@ import { useBrowserExtension } from "@/hooks/useBrowserExtension"
|
||||
|
||||
interface FeedEntryContextMenuProps {
|
||||
entry: Entry
|
||||
opened: boolean
|
||||
onChange: (opened: boolean) => void
|
||||
// element that opens the menu when right-clicked
|
||||
children: ReactElement
|
||||
}
|
||||
@@ -19,23 +20,13 @@ interface FeedEntryContextMenuProps {
|
||||
const iconSize = 16
|
||||
|
||||
export function FeedEntryContextMenu(props: Readonly<FeedEntryContextMenuProps>) {
|
||||
const [opened, setOpened] = useState(false)
|
||||
const customContextMenu = useAppSelector(state => state.user.settings?.customContextMenu)
|
||||
const sourceType = useAppSelector(state => state.entries.source.type)
|
||||
const dispatch = useAppDispatch()
|
||||
const { openLinkInBackgroundTab } = useBrowserExtension()
|
||||
|
||||
// close context menu on scroll
|
||||
useEffect(() => {
|
||||
if (!opened) return
|
||||
|
||||
const listener = throttle(100, () => setOpened(false))
|
||||
window.addEventListener("scroll", listener)
|
||||
return () => window.removeEventListener("scroll", listener)
|
||||
}, [opened])
|
||||
|
||||
return (
|
||||
<Menu position="bottom-start" opened={opened} onChange={setOpened}>
|
||||
<Menu position="bottom-start" opened={props.opened} onChange={props.onChange}>
|
||||
<Menu.ContextMenu disabled={!customContextMenu}>{props.children}</Menu.ContextMenu>
|
||||
<Menu.Dropdown>
|
||||
<Menu.Item
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.commafeed</groupId>
|
||||
<artifactId>commafeed</artifactId>
|
||||
<version>7.5.0</version>
|
||||
<version>7.5.2</version>
|
||||
</parent>
|
||||
<artifactId>commafeed-server</artifactId>
|
||||
<name>CommaFeed Server</name>
|
||||
@@ -303,7 +303,7 @@
|
||||
<dependency>
|
||||
<groupId>com.commafeed</groupId>
|
||||
<artifactId>commafeed-client</artifactId>
|
||||
<version>7.5.0</version>
|
||||
<version>7.5.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- compile-time processors -->
|
||||
@@ -483,7 +483,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mock-server</groupId>
|
||||
<artifactId>mockserver-junit-jupiter-no-dependencies</artifactId>
|
||||
<version>9.2.0</version>
|
||||
<version>9.3.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -140,6 +140,7 @@ public class FeedEntryContentCleaningService {
|
||||
|
||||
whitelist.addEnforcedAttribute("a", "target", "_blank");
|
||||
whitelist.addEnforcedAttribute("a", "rel", "noreferrer");
|
||||
whitelist.addEnforcedAttribute("iframe", "referrerpolicy", "strict-origin-when-cross-origin");
|
||||
return whitelist;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class FeedEntryContentCleaningServiceTest {
|
||||
<p>
|
||||
Some text
|
||||
<img width="965" height="320" src="https://localhost/an-image.png" alt="alt-desc" style="width:100%;">
|
||||
<iframe src="https://localhost/an-iframe" style="width:100%;"></iframe>
|
||||
<iframe src="https://localhost/an-iframe" style="width:100%;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
|
||||
aaa
|
||||
</p>
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user