Skip to content

Commit

Permalink
v2022.6.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
a5huynh committed Jun 3, 2022
2 parents 7c62cd5 + 111f67d commit 3d618d7
Show file tree
Hide file tree
Showing 29 changed files with 1,082 additions and 518 deletions.
474 changes: 195 additions & 279 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
⚠️ Spyglass is very much in its early stages, but it’s in a place where it's functional and can be used to replace basic searches. ⚠️

Download now:
[Mac](https://github.com/a5huynh/spyglass/releases/download/v2022.5.27/Spyglass_22.5.27_x64.dmg)
| [Windows](https://github.com/a5huynh/spyglass/releases/download/v2022.5.27/Spyglass_22.5.27_x64_en-US.msi)
| [Linux (AppImage)](https://github.com/a5huynh/spyglass/releases/download/v2022.5.27/spyglass_22.5.27_amd64.AppImage)
[Mac](https://github.com/a5huynh/spyglass/releases/download/v2022.5.28/Spyglass_22.5.28_x64.dmg)
| [Windows](https://github.com/a5huynh/spyglass/releases/download/v2022.5.28/Spyglass_22.5.28_x64_en-US.msi)
| [Linux (AppImage)](https://github.com/a5huynh/spyglass/releases/download/v2022.5.28/spyglass_22.5.28_amd64.AppImage)


Looking for lenses? Check out our [community contributions](https://github.com/spyglass-search/lens-box)!

---

Expand All @@ -22,6 +25,7 @@ Download now:
* [How does it know what to crawl](#how-does-it-know-what-to-crawl)
* [Example: Curated recipe searching](#curated-recipe-searching)
* [Example: Narrowing down by a specific topic](#curated-recipe-searching)
* [Lens Directory](#lens-directory)
* [Settings](#settings)
* [Updating the shorcut](#updating-the-shortcut)

Expand Down Expand Up @@ -157,6 +161,10 @@ programming language and not the Rust game / The Rust Belt / oxidation / etc.
)
```

## Lens Directory

Looking for lenses? Check out our [community contributions](https://github.com/spyglass-search/lens-box)!


## Settings

Expand Down
20 changes: 20 additions & 0 deletions crates/client/public/glue.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export async function onRefreshResults(callback) {
await listen('refresh_results', callback);
}

export async function on_refresh_lens_manager(callback) {
await listen('refresh_lens_manager', callback);
}

export async function crawlStats() {
return await invoke("crawl_stats");
}
Expand All @@ -29,6 +33,18 @@ export async function deleteDoc(id) {
return await invoke("delete_doc", { id });
}

export async function install_lens(downloadUrl) {
return await invoke("install_lens", { downloadUrl })
}

export async function listInstalledLenses() {
return await invoke("list_installed_lenses");
}

export async function listInstallableLenses() {
return await invoke("list_installable_lenses");
}

export async function searchDocs(lenses, query) {
return await invoke("search_docs", { lenses, query });
}
Expand All @@ -41,6 +57,10 @@ export async function openResult(url) {
return await invoke("open_result", { url });
}

export async function openLensFolder() {
return await invoke("open_lens_folder");
}

export async function resizeWindow(height) {
return await invoke("resize_window", { height });
}
73 changes: 64 additions & 9 deletions crates/client/public/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ Ensure the default browser behavior of the `hidden` attribute.
margin-top: -0.5rem;
}

.ml-2 {
margin-left: 0.5rem;
}

.block {
display: block;
}
Expand All @@ -534,6 +538,10 @@ Ensure the default browser behavior of the `hidden` attribute.
display: flex;
}

.contents {
display: contents;
}

.hidden {
display: none;
}
Expand All @@ -558,6 +566,14 @@ Ensure the default browser behavior of the `hidden` attribute.
height: 7rem;
}

.h-5 {
height: 1.25rem;
}

.h-20 {
height: 5rem;
}

.h-24 {
height: 6rem;
}
Expand All @@ -578,6 +594,10 @@ Ensure the default browser behavior of the `hidden` attribute.
width: 0.75rem;
}

.w-5 {
width: 1.25rem;
}

.w-16 {
width: 4rem;
}
Expand Down Expand Up @@ -607,6 +627,10 @@ Ensure the default browser behavior of the `hidden` attribute.
animation: spin 1s linear infinite;
}

.cursor-pointer {
cursor: pointer;
}

.flex-row {
flex-direction: row;
}
Expand All @@ -623,6 +647,14 @@ Ensure the default browser behavior of the `hidden` attribute.
justify-content: center;
}

.gap-8 {
gap: 2rem;
}

.gap-4 {
gap: 1rem;
}

.divide-y > :not([hidden]) ~ :not([hidden]) {
--tw-divide-y-reverse: 0;
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
Expand Down Expand Up @@ -727,6 +759,11 @@ Ensure the default browser behavior of the `hidden` attribute.
background-color: rgb(22 78 99 / var(--tw-bg-opacity));
}

.bg-stone-900 {
--tw-bg-opacity: 1;
background-color: rgb(28 25 23 / var(--tw-bg-opacity));
}

.bg-sky-600 {
--tw-bg-opacity: 1;
background-color: rgb(2 132 199 / var(--tw-bg-opacity));
Expand All @@ -742,11 +779,6 @@ Ensure the default browser behavior of the `hidden` attribute.
background-color: rgb(63 98 18 / var(--tw-bg-opacity));
}

.bg-stone-900 {
--tw-bg-opacity: 1;
background-color: rgb(28 25 23 / var(--tw-bg-opacity));
}

.p-4 {
padding: 1rem;
}
Expand All @@ -759,14 +791,14 @@ Ensure the default browser behavior of the `hidden` attribute.
padding: 0.75rem;
}

.p-16 {
padding: 4rem;
}

.p-0 {
padding: 0px;
}

.p-16 {
padding: 4rem;
}

.py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
Expand Down Expand Up @@ -812,6 +844,10 @@ Ensure the default browser behavior of the `hidden` attribute.
padding-right: 0px;
}

.pt-2 {
padding-top: 0.5rem;
}

.text-center {
text-align: center;
}
Expand Down Expand Up @@ -850,6 +886,11 @@ Ensure the default browser behavior of the `hidden` attribute.
line-height: 1.75rem;
}

.text-xl {
font-size: 1.25rem;
line-height: 1.75rem;
}

.leading-relaxed {
line-height: 1.625;
}
Expand Down Expand Up @@ -879,6 +920,15 @@ Ensure the default browser behavior of the `hidden` attribute.
color: rgb(220 38 38 / var(--tw-text-opacity));
}

.text-green-400 {
--tw-text-opacity: 1;
color: rgb(74 222 128 / var(--tw-text-opacity));
}

.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.hover\:bg-neutral-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(82 82 82 / var(--tw-bg-opacity));
Expand All @@ -889,6 +939,11 @@ Ensure the default browser behavior of the `hidden` attribute.
color: rgb(220 38 38 / var(--tw-text-opacity));
}

.hover\:text-white:hover {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}

.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
Expand Down
6 changes: 3 additions & 3 deletions crates/client/src/components/btn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use wasm_bindgen_futures::spawn_local;
use yew::prelude::*;

use crate::components::icons;

#[derive(Properties, PartialEq)]
pub struct TooltipProps {
pub label: String,
Expand Down Expand Up @@ -56,9 +58,7 @@ pub fn delete_btn(props: &DeleteButtonProps) -> Html {
{onclick}
class="hover:text-red-600 text-neutral-600 group">
<Tooltip label={"Delete"} />
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
<icons::TrashIcon height={"h-4"} width={"w-4"} />
</button>
}
}
89 changes: 89 additions & 0 deletions crates/client/src/components/icons.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
use yew::function_component;
use yew::prelude::*;

#[derive(Properties, PartialEq)]
pub struct IconProps {
#[prop_or_default]
pub animate_spin: bool,
#[prop_or("h-5".into())]
pub height: String,
#[prop_or("w-5".into())]
pub width: String,
}

impl IconProps {
pub fn class(&self) -> Vec<Option<String>> {
let animated = if self.animate_spin {
Some("animate-spin".to_string())
} else {
None
};

vec![animated, Some(format!("{} {}", self.height, self.width))]
}
}

#[function_component(BadgeCheckIcon)]
pub fn badge_check_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
</svg>
}
}

#[function_component(DocumentDownloadIcon)]
pub fn document_download_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M6 2a2 2 0 00-2 2v12a2 2 0 002 2h8a2 2 0 002-2V7.414A2 2 0 0015.414 6L12 2.586A2 2 0 0010.586 2H6zm5 6a1 1 0 10-2 0v3.586l-1.293-1.293a1 1 0 10-1.414 1.414l3 3a1 1 0 001.414 0l3-3a1 1 0 00-1.414-1.414L11 11.586V8z" clip-rule="evenodd" />
</svg>
}
}

#[function_component(EmojiSadIcon)]
pub fn emoji_sad_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
}
}

#[function_component(EyeIcon)]
pub fn eye_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} viewBox="0 0 20 20" fill="currentColor">
<path d="M10 12a2 2 0 100-4 2 2 0 000 4z" />
<path fill-rule="evenodd" d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z" clip-rule="evenodd" />
</svg>
}
}

#[function_component(FolderOpenIcon)]
pub fn folder_open_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} viewBox="0 0 20 20" fill="currentColor">
<path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1H8a3 3 0 00-3 3v1.5a1.5 1.5 0 01-3 0V6z" clip-rule="evenodd" />
<path d="M6 12a2 2 0 012-2h8a2 2 0 012 2v2a2 2 0 01-2 2H2h2a2 2 0 002-2v-2z" />
</svg>
}
}

#[function_component(RefreshIcon)]
pub fn refresh_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
</svg>
}
}

#[function_component(TrashIcon)]
pub fn trash_icon(props: &IconProps) -> Html {
html! {
<svg xmlns="http://www.w3.org/2000/svg" class={props.class()} fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
}
}
1 change: 1 addition & 0 deletions crates/client/src/components/lens.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading

0 comments on commit 3d618d7

Please sign in to comment.