forked from raycast/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update safari extension (raycast#14378)
* Update safari extension - Update safari extension - Update safari extension - Initial commit * Update safari extension * Update CHANGELOG.md and optimise images --------- Co-authored-by: raycastbot <bot@raycast.com>
- Loading branch information
1 parent
bb7586f
commit dc4c457
Showing
41 changed files
with
992 additions
and
2,514 deletions.
There are no files selected for viewing
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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { closeMainWindow, showToast, Toast } from "@raycast/api"; | ||
import { runAppleScript } from "@raycast/utils"; | ||
import { safariAppIdentifier } from "./utils"; | ||
|
||
export default async function Command() { | ||
try { | ||
await runAppleScript(` | ||
tell application "${safariAppIdentifier}" | ||
set theURL to URL of current tab of window 1 | ||
add reading list item theURL | ||
end tell | ||
`); | ||
await closeMainWindow(); | ||
await showToast({ | ||
style: Toast.Style.Success, | ||
title: "Added to Reading List", | ||
}); | ||
} catch (error) { | ||
showToast({ | ||
style: Toast.Style.Failure, | ||
title: "Failed to add to Reading List", | ||
message: error instanceof Error ? error.message : undefined, | ||
}); | ||
} | ||
} |
This file was deleted.
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
32 changes: 0 additions & 32 deletions
32
extensions/safari/src/components/AddToReadingListAction.tsx
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { List } from "@raycast/api"; | ||
import _ from "lodash"; | ||
import BookmarkListItem from "./BookmarkListItem"; | ||
import { GeneralBookmark } from "../types"; | ||
import { plural } from "../utils"; | ||
import BookmarkListItem from "./BookmarkListItem"; | ||
|
||
const BookmarkListSection = (props: { title: string; filteredBookmarks: GeneralBookmark[] }) => ( | ||
<List.Section title={_.startCase(props.title)} subtitle={plural(props.filteredBookmarks.length, "bookmark")}> | ||
{props.filteredBookmarks.map((bookmark) => ( | ||
<BookmarkListItem key={bookmark.uuid} bookmark={bookmark} /> | ||
))} | ||
</List.Section> | ||
); | ||
|
||
export default BookmarkListSection; | ||
export default function BookmarkListSection(props: { title: string; filteredBookmarks: GeneralBookmark[] }) { | ||
return ( | ||
<List.Section title={_.startCase(props.title)} subtitle={plural(props.filteredBookmarks.length, "bookmark")}> | ||
{props.filteredBookmarks.map((bookmark) => ( | ||
<BookmarkListItem key={bookmark.uuid} bookmark={bookmark} /> | ||
))} | ||
</List.Section> | ||
); | ||
} |
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
18 changes: 9 additions & 9 deletions
18
extensions/safari/src/components/CopyMarkdownLinkAction.tsx
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,11 +1,11 @@ | ||
import { Action } from "@raycast/api"; | ||
|
||
const CopyMarkdownLinkAction = (props: { title?: string; url: string }) => ( | ||
<Action.CopyToClipboard | ||
title="Copy Markdown" | ||
content={`[${props.title ?? "Untitled"}](${props.url})`} | ||
shortcut={{ modifiers: ["cmd", "ctrl"], key: "." }} | ||
/> | ||
); | ||
|
||
export default CopyMarkdownLinkAction; | ||
export default function CopyMarkdownLinkAction(props: { title?: string; url: string }) { | ||
return ( | ||
<Action.CopyToClipboard | ||
title="Copy Markdown" | ||
content={`[${props.title ?? "Untitled"}](${props.url})`} | ||
shortcut={{ modifiers: ["cmd", "ctrl"], key: "." }} | ||
/> | ||
); | ||
} |
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,13 +1,11 @@ | ||
import { Action } from "@raycast/api"; | ||
|
||
const CopyTitleAction = (props: { title?: string }) => { | ||
export default function CopyTitleAction(props: { title?: string }) { | ||
return props.title ? ( | ||
<Action.CopyToClipboard | ||
title="Copy Title" | ||
content={props.title} | ||
shortcut={{ modifiers: ["cmd", "shift"], key: "." }} | ||
/> | ||
) : null; | ||
}; | ||
|
||
export default CopyTitleAction; | ||
} |
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,7 +1,5 @@ | ||
import { Action } from "@raycast/api"; | ||
|
||
const CopyUrlAction = (props: { url: string }) => ( | ||
<Action.CopyToClipboard title="Copy URL" content={props.url} shortcut={{ modifiers: ["cmd"], key: "." }} /> | ||
); | ||
|
||
export default CopyUrlAction; | ||
export default function CopyUrlAction(props: { url: string }) { | ||
return <Action.CopyToClipboard title="Copy URL" content={props.url} shortcut={{ modifiers: ["cmd"], key: "." }} />; | ||
} |
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,11 +1,10 @@ | ||
import { ActionPanel } from "@raycast/api"; | ||
|
||
import SearchInBrowserAction from "./SearchInBrowserAction"; | ||
|
||
const DefaultActions = (props: { searchText: string }) => ( | ||
<ActionPanel> | ||
<SearchInBrowserAction searchText={props.searchText} /> | ||
</ActionPanel> | ||
); | ||
|
||
export default DefaultActions; | ||
export default function DefaultActions(props: { searchText: string }) { | ||
return ( | ||
<ActionPanel> | ||
<SearchInBrowserAction searchText={props.searchText} /> | ||
</ActionPanel> | ||
); | ||
} |
Oops, something went wrong.