Commit d4c904bf authored by Domi's avatar Domi

feat: search

parent 161be698
<svg width="1080" height="1080" viewBox="0 0 1080 1080" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M515.09 725.824L472.006 824.503C455.444 862.434 402.954 862.434 386.393 824.503L343.308 725.824C304.966 638.006 235.953 568.104 149.868 529.892L31.2779 477.251C-6.42601 460.515 -6.42594 405.665 31.2779 388.929L146.164 337.932C234.463 298.737 304.714 226.244 342.401 135.431L386.044 30.2693C402.239 -8.75637 456.159 -8.75646 472.355 30.2692L515.998 135.432C553.685 226.244 623.935 298.737 712.234 337.932L827.121 388.929C864.825 405.665 864.825 460.515 827.121 477.251L708.53 529.892C622.446 568.104 553.433 638.006 515.09 725.824Z" fill="url(#paint0_radial_2525_777)"/>
<path d="M915.485 1036.98L903.367 1064.75C894.499 1085.08 866.349 1085.08 857.481 1064.75L845.364 1036.98C823.765 987.465 784.862 948.042 736.318 926.475L698.987 909.889C678.802 900.921 678.802 871.578 698.987 862.61L734.231 846.951C784.023 824.829 823.623 783.947 844.851 732.75L857.294 702.741C865.966 681.826 894.882 681.826 903.554 702.741L915.997 732.75C937.225 783.947 976.826 824.829 1026.62 846.951L1061.86 862.61C1082.05 871.578 1082.05 900.921 1061.86 909.889L1024.53 926.475C975.987 948.042 937.083 987.465 915.485 1036.98Z" fill="url(#paint1_radial_2525_777)"/>
<defs>
<radialGradient id="paint0_radial_2525_777" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(670.447 474.006) rotate(78.858) scale(665.5 665.824)">
<stop stop-color="#1BA1E3"/>
<stop offset="0.0001" stop-color="#1BA1E3"/>
<stop offset="0.300221" stop-color="#5489D6"/>
<stop offset="0.545524" stop-color="#9B72CB"/>
<stop offset="0.825372" stop-color="#D96570"/>
<stop offset="1" stop-color="#F49C46"/>
</radialGradient>
<radialGradient id="paint1_radial_2525_777" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(670.447 474.006) rotate(78.858) scale(665.5 665.824)">
<stop stop-color="#1BA1E3"/>
<stop offset="0.0001" stop-color="#1BA1E3"/>
<stop offset="0.300221" stop-color="#5489D6"/>
<stop offset="0.545524" stop-color="#9B72CB"/>
<stop offset="0.825372" stop-color="#D96570"/>
<stop offset="1" stop-color="#F49C46"/>
</radialGradient>
</defs>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><linearGradient id="ZkmZ8eVihrQTUnr9TZpNla" x1="11.905" x2="17.941" y1="1.952" y2="40.401" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3dbffc"/><stop offset="1" stop-color="#183efb"/></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNla)" d="M17.572,37.076L20,35.619V10.603c0-1.632-0.796-3.161-2.133-4.096L12.36,2.652 C11.366,1.956,10,2.667,10,3.881V32.5c0,0.22,0.02,0.555,0.033,0.772C10.369,36.867,14.382,38.99,17.572,37.076z"/><linearGradient id="ZkmZ8eVihrQTUnr9TZpNlb" x1="14.342" x2="34.121" y1="41.478" y2="25.575" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#33bef0"/><stop offset=".159" stop-color="#32b9f0"/><stop offset=".341" stop-color="#2facf2"/><stop offset=".533" stop-color="#2a95f4"/><stop offset=".733" stop-color="#2475f6"/><stop offset=".936" stop-color="#1b4cfa"/><stop offset="1" stop-color="#183efb"/></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNlb)" d="M32.682,27.904L20,35.5v0l-2.428,1.457c-3.191,1.915-7.203-0.209-7.54-3.804 C10.372,38.922,15.145,43.5,21,43.5c1.963,0,3.888-0.536,5.568-1.551l6.834-4.126c0.817-0.493,1.522-1.075,2.15-1.707 C37.906,33.415,36.739,28.669,32.682,27.904z"/><linearGradient id="ZkmZ8eVihrQTUnr9TZpNlc" x1="24.223" x2="45.699" y1="17.113" y2="38.588" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#3dbffd"/><stop offset="1" stop-color="#1de9b6"/></linearGradient><path fill="url(#ZkmZ8eVihrQTUnr9TZpNlc)" d="M33.636,19.568l-7.607-3.803c-1.234-0.617-2.576,0.618-2.064,1.899l1.755,5.886 c0.499,1.248,1.479,2.242,2.719,2.758L32.5,28c4.057,0.766,5.352,5.251,3.052,8.117C40.399,31.24,40.088,22.794,33.636,19.568z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 2406 2406">
<path d="M1 578.4C1 259.5 259.5 1 578.4 1h1249.1c319 0 577.5 258.5 577.5 577.4V2406H578.4C259.5 2406 1 2147.5 1 1828.6V578.4z" fill="#74aa9c"/>
<path id="a" d="M1107.3 299.1c-197.999 0-373.9 127.3-435.2 315.3L650 743.5v427.9c0 21.4 11 40.4 29.4 51.4l344.5 198.515V833.3h.1v-27.9L1372.7 604c33.715-19.52 70.44-32.857 108.47-39.828L1447.6 450.3C1361 353.5 1237.1 298.5 1107.3 299.1zm0 117.5-.6.6c79.699 0 156.3 27.5 217.6 78.4-2.5 1.2-7.4 4.3-11 6.1L952.8 709.3c-18.4 10.4-29.4 30-29.4 51.4V1248l-155.1-89.4V755.8c-.1-187.099 151.601-338.9 339-339.2z" fill="#fff"/>
<use xlink:href="#a" transform="rotate(60 1203 1203)"/>
<use xlink:href="#a" transform="rotate(120 1203 1203)"/>
<use xlink:href="#a" transform="rotate(180 1203 1203)"/>
<use xlink:href="#a" transform="rotate(240 1203 1203)"/>
<use xlink:href="#a" transform="rotate(300 1203 1203)"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" viewBox="0 0 512 512"><rect fill="#CC9B7A" width="512" height="512" rx="104.187" ry="105.042"/><path fill="#1F1F1E" fill-rule="nonzero" d="M318.663 149.787h-43.368l78.952 212.423 43.368.004-78.952-212.427zm-125.326 0l-78.952 212.427h44.255l15.932-44.608 82.846-.004 16.107 44.612h44.255l-79.126-212.427h-45.317zm-4.251 128.341l26.91-74.701 27.083 74.701h-53.993z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-7-.5-14.5T799-507q-5 29-27 48t-52 19h-80q-33 0-56.5-23.5T560-520v-40H400v-80q0-33 23.5-56.5T480-720h40q0-23 12.5-40.5T563-789q-20-5-40.5-8t-42.5-3q-134 0-227 93t-93 227h200q66 0 113 47t47 113v40H400v110q20 5 39.5 7.5T480-160Z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px"><path fill="#FFC107" d="M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"/><path fill="#FF3D00" d="M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"/><path fill="#4CAF50" d="M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"/><path fill="#1976D2" d="M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"/></svg>
\ No newline at end of file
<svg viewBox="0 0 291.72499821636245 291.1" xmlns="http://www.w3.org/2000/svg" width="2500" height="2495"><path d="M219.51 291.1H71.58C32.05 291.1 0 259.05 0 219.51V71.58C0 32.05 32.05 0 71.58 0h147.93c39.53 0 71.58 32.05 71.58 71.58v147.93c.01 39.54-32.04 71.59-71.58 71.59z"/><g fill="#25f4ee"><path d="M120.96 123.89v-8.8a64.83 64.83 0 0 0-9.23-.79c-29.93-.06-56.42 19.33-65.41 47.87s1.62 59.62 26.18 76.71c-25.77-27.58-24.3-70.83 3.28-96.6a68.425 68.425 0 0 1 45.18-18.39z"/><path d="M122.62 223.53c16.73-.02 30.48-13.2 31.22-29.92V44.44h27.25a50.7 50.7 0 0 1-.79-9.44h-37.27v149.02c-.62 16.8-14.41 30.11-31.22 30.14-5.02-.04-9.97-1.28-14.42-3.6a31.276 31.276 0 0 0 25.23 12.97zM231.98 95.05v-8.29c-10.03 0-19.84-2.96-28.19-8.51a51.63 51.63 0 0 0 28.19 16.8z"/></g><path d="M203.8 78.26a51.301 51.301 0 0 1-12.76-33.89h-9.95a51.564 51.564 0 0 0 22.71 33.89zM111.73 151.58c-17.28.09-31.22 14.17-31.13 31.45a31.293 31.293 0 0 0 16.71 27.53c-10.11-13.96-6.99-33.48 6.97-43.6a31.191 31.191 0 0 1 18.34-5.93c3.13.04 6.24.53 9.23 1.45v-37.93c-3.05-.46-6.14-.7-9.23-.72h-1.66v28.84c-3.01-.82-6.12-1.18-9.23-1.09z" fill="#fe2c55"/><path d="M231.98 95.05v28.84a88.442 88.442 0 0 1-51.69-16.8v75.77c-.08 37.81-30.75 68.42-68.56 68.42a67.816 67.816 0 0 1-39.22-12.4c25.73 27.67 69.02 29.25 96.7 3.52a68.397 68.397 0 0 0 21.83-50.09v-75.56a88.646 88.646 0 0 0 51.76 16.58V96.21c-3.64-.02-7.26-.4-10.82-1.16z" fill="#fe2c55"/><path d="M180.29 182.87V107.1a88.505 88.505 0 0 0 51.76 16.58V94.84a51.73 51.73 0 0 1-28.26-16.58 51.634 51.634 0 0 1-22.71-33.89h-27.25v149.24c-.71 17.27-15.27 30.69-32.54 29.99a31.278 31.278 0 0 1-24.06-12.9c-15.29-8.05-21.16-26.97-13.11-42.26a31.274 31.274 0 0 1 27.53-16.71c3.13.03 6.24.51 9.23 1.44V123.9c-37.74.64-67.82 32.19-67.18 69.93a68.353 68.353 0 0 0 18.73 45.86 67.834 67.834 0 0 0 39.29 11.61c37.82-.01 68.49-30.62 68.57-68.43z" fill="#fff"/></svg>
\ No newline at end of file
......@@ -71,11 +71,41 @@
"send": "div > span:has(svg[width=\"240\"])",
"wait": "div > span:has(svg[width=\"240\"]):not([style*=\"display: none\"])"
}
},
{
"host": "tongyi.aliyun.com",
"path": "qianwen",
"maxInputLength": 2000,
"selector": {
"input": "textarea",
"send": "div[class*=\"tools\"] div[class*=\"chatBtn\"]",
"wait": [
{
"target": "div[class*=\"inputContainer\"] > button[class*=\"pauseBtn\"]",
"match": ""
}
]
}
},
{
"host": "www.doubao.com",
"path": "chat",
"maxInputLength": 2000,
"selector": {
"input": "textarea.semi-input-textarea",
"send": "button.flow-end-msg-send",
"wait": [
{
"target": "div[class*=\"inputContainer\"] > button[class*=\"pauseBtn\"]",
"match": ""
}
]
}
}
],
"webviewPatchs": [
{
"re": "www.google.com",
"re": "www.google.com|bing.com",
"l": "",
"ua": "Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Mobile Safari/537.36"
}
......@@ -102,6 +132,9 @@
"title": "Text to Image",
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIEAAACBCAYAAADnoNlQAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQA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4O6B0F1DjswoobVCqVisQzUgqngFfAGWJhFDDInAY4XSaGX2IZE7aGrZxAJFBRVfCVYAUSE1TbZjr4GE+q8Fcb3AJ2A5vEdgFb0RH4RfzUQAbTUvRDMK0Ak8P1sjDQnLgJ2I/B/Yc8BciYOmm8AAAAASUVORK5CYII="
}
]
],
"search": {
"defaultEngine": "google"
}
}
}
......@@ -4,7 +4,7 @@ import IconMinimize from "@/components/icons/IconMinimize.vue"
import IconSplitRight from "@/components/icons/IconSplitscreenRight.vue"
import IconClose from "@/components/icons/IconClose.vue"
import { ContentEventType, MessageType } from "@/types"
import { pipWindow } from "@/store"
import { pipWindow } from "@/store/content"
import { throttle } from "lodash-es"
import IconRefresh from "./icons/IconRefresh.vue"
import { dispatchContentEvent } from "@/content/event"
......
<script setup lang="ts">
import { ref, reactive, watch, onMounted } from "vue"
import { throttle } from "lodash-es"
import IconSearch from "@/components/icons/IconSearch.vue"
import IconGlobe from "@/components/icons/IconGlobe.vue"
import { getLocal } from "@/utils/ext"
import config from "@/assets/config.json"
const bingImg = chrome.runtime.getURL("img/bing.svg")
const googleImg = chrome.runtime.getURL("img/google.svg")
enum Engine {
google = "google",
bing = "bing",
}
const emit = defineEmits({
go: (url: string) => true,
})
const focus = ref(false)
const collapsed = ref(true)
const input = ref<HTMLInputElement>()
const value = ref("")
const autocomplete = reactive({
suggestions: [] as string[],
selected: -1,
})
const engine = ref(Engine.google)
const engineListVisible = ref(false)
let timerId = -1
watch(focus, (value) => {
if (value) {
collapsed.value = !value
clearTimeout(timerId)
} else {
timerId = window.setTimeout(() => {
collapsed.value = !value
}, 300)
}
})
onMounted(() => {
getLocal({
searchEngine: config.data.search.defaultEngine as Engine.google,
}).then(({ searchEngine }) => {
engine.value = searchEngine
})
})
const handleInput = throttle(async (e: Event) => {
const value = input.value?.value || ""
if (!value || value.length < 2) {
autocomplete.suggestions = []
return
}
if (engine.value === Engine.google) {
const res = await fetch(
`https://www.google.com/complete/search?q=${value}&client=chrome`
)
const data = await res.json()
autocomplete.suggestions = data[1]
} else if (engine.value === Engine.bing) {
const res = await fetch(`https://api.bing.com/osjson.aspx?query=${value}`)
const data = await res.json()
autocomplete.suggestions = data[1]
}
}, 600)
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Enter" && value.value) {
go(value.value)
}
}
function isLink(value: string) {
return /^https?:\/\/|(\w+\.)+\w{2,5}/.test(value.trim())
}
function go(value: string) {
const v = value.trim()
if (isLink(value)) {
const url = v.startsWith("http") ? v : `http://${v}`
emit("go", url)
return
}
const url =
engine.value === Engine.google
? `https://www.google.com/search?q=${v}`
: `https://www.bing.com/search?q=${v}`
emit("go", url)
}
function switchEngine(value: Engine) {
engineListVisible.value = false
engine.value = value
chrome.storage.local.set({ searchEngine: value })
}
</script>
<template>
<div class="relative h-10 w-full">
<div
class="absolute border border-foreground/20 rounded-[20px] w-full shadow bg-background z-10 overflow-hidden"
>
<div aria-label="search box" class="flex px-2 items-center">
<button
class="size-8 flex items-center justify-center shrink-0 rounded-full hover:bg-background-soft cursor-pointer"
@click="engineListVisible = !engineListVisible"
>
<img
class="size-5"
:src="engine == Engine.bing ? bingImg : googleImg"
/>
</button>
<div class="px-1 py-2 w-full" @click="input?.focus()">
<input
ref="input"
type="text"
autocomplete="search"
class="border-none outline-none bg-transparent text-base w-full"
placeholder="Search..."
v-model="value"
@focus="engineListVisible = !(focus = true)"
@blur="focus = false"
@input="handleInput"
@keydown="handleKeyDown"
/>
</div>
</div>
<div v-if="engineListVisible" class="border-t">
<div
class="flex items-center px-2 py-1 cursor-pointer hover:bg-background-soft"
@click="switchEngine(Engine.google)"
>
<div class="size-8 flex items-center justify-center">
<img class="size-5" :src="googleImg" />
</div>
<span class="px-1">Google</span>
</div>
<div
class="flex items-center px-2 py-1 cursor-pointer hover:bg-background-soft"
@click="switchEngine(Engine.bing)"
>
<div class="size-8 flex items-center justify-center">
<img class="size-5" :src="bingImg" />
</div>
<span class="px-1">Bing</span>
</div>
</div>
<div
v-if="!collapsed && value"
:class="[
'scrollbar overflow-auto border-t transition-all duration-300 ease-in-out',
!collapsed ? 'max-h-52' : 'max-h-0',
]"
>
<div
class="px-2 py-1 flex items-center cursor-pointer hover:bg-background-soft"
@click="go(value)"
>
<div class="size-8 flex items-center justify-center">
<IconGlobe v-if="isLink(value)" class="size-5" />
<IconSearch v-else class="size-5" />
</div>
<span class="px-1">
{{ value }}
</span>
</div>
<div v-if="autocomplete.suggestions.length">
<div
v-for="suggestion in autocomplete.suggestions"
:key="suggestion"
class="px-2 py-1 flex items-center cursor-pointer hover:bg-background-soft"
@click="go(suggestion)"
>
<div class="size-8 flex items-center justify-center">
<IconGlobe v-if="isLink(suggestion)" class="size-5" />
<IconSearch v-else class="size-5" />
</div>
<span class="px-1">
{{ suggestion }}
</span>
</div>
</div>
</div>
</div>
</div>
</template>
<style scoped></style>
......@@ -2,6 +2,9 @@
import IconSplitscreenRight from "@/components/icons/IconSplitscreenRight.vue"
import IconAmpStories from "@/components/icons/IconAmpStories.vue"
import IconClose from "./icons/IconClose.vue"
import { handleImgError } from "@/utils/dom"
const globeImg = chrome.runtime.getURL("img/globe.svg")
defineProps<{
icon: string
......@@ -16,26 +19,22 @@ defineEmits(["click", "remove"])
<template>
<button
:class="[
'group shrink-0 relative flex flex-col items-center justify-self-center rounded-lg p-1 bg-background-soft hover:bg-background-mute',
'group shrink-0 relative flex flex-col items-center justify-self-center rounded-lg py-1 px-0.5 hover:bg-background-soft',
small ? 'w-[58px]' : 'w-16',
]"
@click="$emit('click')"
>
<!-- <span
class="size-6 rounded mt-2 mb-1"
:style="{
background: 'center / contain url(' + icon + ')',
}"
>
</span> -->
<div class="p-2.5 rounded-full bg-background-soft">
<img
class="size-6 rounded mt-2 mb-1"
class="size-6 rounded"
:src="icon"
:data-fallback="globeImg"
loading="lazy"
@error="(e) => (e.target as HTMLImageElement).src = ''"
@error="handleImgError"
/>
<div class="flex flex-col justify-center h-6 my-1 w-full">
<div class="text-xs max-w-full break-words leading-3 line-clamp-2">
</div>
<div class="flex flex-col justify-center h-8 w-full">
<div class="text-xs max-w-full break-words leading-tight line-clamp-2">
{{ title }}
</div>
</div>
......@@ -53,7 +52,7 @@ defineEmits(["click", "remove"])
v-if="badge === 'remove'"
:class="[
'size-4 absolute top-[-4px] right-[-4px] opacity-0 group-hover:opacity-65 rounded-full',
'bg-background-soft hover:text-red-500 flex items-center justify-center',
'bg-background-soft hover:bg-red-100 hover:text-red-600 hover:scale-105 flex items-center justify-center',
]"
@click="
(e) => {
......
......@@ -8,6 +8,7 @@ import { fetchDoc } from "@/content/pip"
const props = defineProps<{
url: string
ua?: string
}>()
const emit = defineEmits<{
......@@ -76,7 +77,7 @@ const patch = computed(() => {
return {
url,
ua: patch?.ua || "",
ua: patch?.ua || props.ua || "",
l: patch?.l || "",
}
})
......
......@@ -2,7 +2,7 @@
import { onMounted, onUnmounted, reactive, ref, computed } from "vue"
import IconNoteStackAdd from "@/components/icons/IconNoteStackAdd.vue"
import IconClose from "@/components/icons/IconClose.vue"
import { chatDocsPanel, docsAddon } from "@/store"
import { chatDocsPanel, docsAddon } from "@/store/content"
import ChatDocsPanel from "@/components/chatdocs/ChatDocsPanel.vue"
import { watchEffect } from "vue"
import { useI18n } from "@/utils/i18n"
......
<script setup lang="ts">
import { watch, computed, reactive, ref, onMounted, watchEffect } from "vue"
import { chatDocsPanel } from "@/store"
import { chatDocsPanel } from "@/store/content"
import { contentService } from "@/utils/service"
import { convertBlobToBase64, semanticClip } from "@/utils/utils"
import ScrollView from "@/components/ScrollView.vue"
......
<script setup lang="ts">
import IconNoteStackAdd from "@/components/icons/IconNoteStackAdd.vue"
import type { chatDocsPanel } from "@/store"
import type { chatDocsPanel } from "@/store/content"
import { ref } from "vue"
import { useI18n } from "@/utils/i18n"
import { getDocItem } from "./helper"
......
......@@ -2,7 +2,7 @@
import IconClose from "@/components/icons/IconClose.vue"
import IconProgressActivity from "@/components/icons/IconProgressActivity.vue"
import IconNoteStack from "@/components/icons/IconNoteStack.vue"
import type { chatDocsPanel } from "@/store"
import type { chatDocsPanel } from "@/store/content"
import { useI18n } from "@/utils/i18n"
defineProps<{
......
import type { chatDocsPanel } from "@/store"
import type { chatDocsPanel } from "@/store/content/content"
type Selector = {
input: string
......
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
height="24"
viewBox="0 -960 960 960"
width="24"
fill="currentColor"
>
<path
d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-7-.5-14.5T799-507q-5 29-27 48t-52 19h-80q-33 0-56.5-23.5T560-520v-40H400v-80q0-33 23.5-56.5T480-720h40q0-23 12.5-40.5T563-789q-20-5-40.5-8t-42.5-3q-134 0-227 93t-93 227h200q66 0 113 47t47 113v40H400v110q20 5 39.5 7.5T480-160Z"
/>
</svg>
</template>
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
height="24"
viewBox="0 -960 960 960"
width="24"
fill="currentColor"
>
<path
d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"
/>
</svg>
</template>
<script setup lang="ts">
import { ref, onMounted, onUnmounted, watch } from "vue"
import { pipWindow } from "@/store"
import { pipWindow } from "@/store/content"
import IconHide from "@/components/icons/IconHide.vue"
import IconArrowCircleRight from "@/components/icons/IconArrowCircleRight.vue"
import IconClose from "@/components/icons/IconClose.vue"
......
......@@ -115,7 +115,7 @@ onUnmounted(() => {
>
<PageScrollbar class="ml-[-2px]" />
<div class="relative flex-1 flex flex-col bg-background">
<div class="relative flex-1 flex flex-col bg-background shadow-md">
<div
class="absolute h-full w-1 top-0 left-[-2px] cursor-ew-resize"
@pointerdown="autoPointerCapture"
......
<script setup lang="ts">
import { ref } from "vue"
import ContentSidebar from "./ContentSidebar.vue"
import { sidebarAddon } from "@/store"
import { sidebarAddon } from "@/store/content"
import { autoPointerCapture } from "@/utils/dom"
const logoUrl = chrome.runtime.getURL("/logo.svg")
......
<script setup lang="ts">
import { pipLauncher } from "@/store"
import { pipLauncher } from "@/store/content"
import PipLauncher from "@/components/PipLauncher.vue"
import { MessageType } from "@/types"
......
<script setup lang="ts">
import Multitasking from "@/components/Multitasking.vue"
import PipSplash from "@/components/PipSplash.vue"
import { pipLoading } from "@/store"
import { pipLoading } from "@/store/content"
import LoadingBar from "@/components/LoadingBar.vue"
import ChatDocsAddon from "@/components/chatdocs/ChatDocsAddon.vue"
</script>
......
......@@ -5,7 +5,7 @@ import {
pipLoading,
pipWindow,
sidebarAddon,
} from "@/store"
} from "@/store/content"
import { ContentEventType, FrameMessageType, MessageType } from "@/types"
import Copilot from "./Copilot.vue"
import { waitMessage } from "@/utils/ext"
......
......@@ -22,14 +22,14 @@ export const allFrameScript = {
export const defaultSidebarPath = "sidebar.html"
const manifest = {
manifest_version: 3,
// maximum of 45 characters
name: "__MSG_name__",
version: "1.2.7",
// edge 12 characters
// short_name: "__MSG_short_name__",
// no more than 132 characters
description: "__MSG_description__",
version: "1.2.5",
manifest_version: 3,
action: {
default_icon: {
16: "logo.png",
......@@ -92,7 +92,7 @@ const manifest = {
},
web_accessible_resources: [
{
resources: ["/js/*", "/assets/*", "sidebar.html", "logo.svg"],
resources: ["/js/*", "/assets/*", "/img/*", "sidebar.html", "logo.svg"],
matches: ["<all_urls>"],
use_dynamic_url: true,
},
......
<script setup lang="ts">
import ContentSidebar from "@/components/sidebar/ContentSidebar.vue"
import ContentSidebarAddon from "@/components/sidebar/ContentSidebarAddon.vue"
</script>
<template>
<ContentSidebar />
<!-- <ContentSidebarAddon /> -->
</template>
<style scoped></style>
<script setup lang="ts">
import { ref, onMounted, onUnmounted, computed, reactive, watch } from "vue"
import { emptyTab, checkContent, getStoreUrl, getLocal } from "@/utils/ext"
import { pipWindow } from "@/store"
import { pipWindow } from "@/store/popup"
import { MessageType } from "@/types"
import { useI18n } from "@/utils/i18n"
import config from "@/assets/config.json"
......@@ -20,6 +20,9 @@ import IconArrowCircleRight from "@/components/icons/IconArrowCircleRight.vue"
import IconSplitscreenRight from "@/components/icons/IconSplitscreenRight.vue"
import SiteButton from "@/components/SiteButton.vue"
import { getIsEdge } from "@/utils/ext"
import { handleImgError } from "@/utils/dom"
const globeImg = chrome.runtime.getURL("img/globe.svg")
const isEdge = getIsEdge()
const { t } = useI18n()
......@@ -232,13 +235,21 @@ function showChatDocs() {
},
]"
>
<div
<!-- <div
v-if="avaiable"
class="size-5"
:style="{
background: 'center / contain url(' + activeTab?.favIconUrl + ')',
}"
></div>
></div> -->
<img
v-if="avaiable"
class="size-5"
loading="lazy"
:src="activeTab?.favIconUrl || ''"
:data-fallback="globeImg"
@error="handleImgError"
/>
<IconGppMaybe v-else class="size-5" />
<div class="truncate">
{{ avaiable ? host : t("protectedTabTips") }}
......@@ -253,7 +264,7 @@ function showChatDocs() {
>
<button
v-if="!pipWindow.tab"
class="hover:bg-background-mute bg-background-soft disabled:bg-background-soft disabled:opacity-65"
class="hover:bg-background-mute bg-background-soft disabled:bg-background-soft disabled:opacity-50 disabled:cursor-not-allowed"
:disabled="!avaiable"
:title="t('openInPip')"
@click="handleWriteHtml"
......@@ -270,7 +281,7 @@ function showChatDocs() {
<PipWindowActions v-else />
<button
class="hover:bg-background-mute bg-background-soft disabled:bg-background-soft disabled:opacity-65"
class="hover:bg-background-mute bg-background-soft disabled:bg-background-soft disabled:opacity-50 disabled:cursor-not-allowed"
:disabled="isEdge && !avaiable"
:title="t('openInSidebar')"
@click="
......
......@@ -13,6 +13,7 @@ import Webview from "@/components/Webview.vue"
import { useI18n } from "@/utils/i18n"
import { MessageType } from "@/types"
import SiteButton from "@/components/SiteButton.vue"
import Search from "@/components/Search.vue"
const logoUrl = chrome.runtime.getURL("/logo.svg")
const { t } = useI18n()
......@@ -21,15 +22,15 @@ const url = ref("")
const mode = ref("")
const popularItems = reactive(config.data.popularSites)
const recentItems = reactive<{ url: string; title: string; icon: string }[]>([])
const currentTab = reactive({
tabId: 0,
})
const ua = ref("")
const protectedUrl = computed(() => {
return isProtectedUrl(url.value)
})
const currentTab = reactive({
tabId: 0,
})
async function handleMessage(message: any) {
switch (message.type) {
case MessageType.openInSidebar:
......@@ -95,6 +96,8 @@ async function removeRecentItems(url: string) {
onMounted(() => {
const q = new URLSearchParams(location.search)
mode.value = q.get("mode") || "sidepanel"
// ua.value =
// "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
getLocal({
popularSites: config.data.popularSites,
......@@ -135,7 +138,12 @@ function go(link: string) {
<template>
<div class="w-full h-screen">
<Webview v-if="!protectedUrl" :url="url" @page-info="updateRecentItems" />
<Webview
v-if="!protectedUrl"
:url="url"
:ua="ua"
@page-info="updateRecentItems"
/>
<div v-else class="flex flex-col p-6 max-w-md mx-auto">
<div class="flex flex-col items-center gap-2 mx-auto mt-16">
......@@ -143,7 +151,11 @@ function go(link: string) {
<span class="text-2xl font-bold my-2">{{ t("sidebar") }}</span>
</div>
<div class="grid grid-cols-4 gap-y-4 justify-between mt-24">
<div class="my-12">
<Search @go="go" />
</div>
<div class="flex flex-wrap gap-x-4 gap-y-4 justify-center">
<SiteButton
v-for="item of recentItems"
:icon="item.icon"
......@@ -155,8 +167,8 @@ function go(link: string) {
</div>
<!-- <div class="text-center my-3">Popular</div> -->
<div class="w-full my-6 border-b border-b-slate-400/60 h-0"></div>
<div class="grid grid-cols-4 gap-y-4 justify-between">
<div class="w-full my-6 border-b border-background-soft h-0"></div>
<div class="flex flex-wrap gap-x-4 gap-y-4 justify-center">
<SiteButton
v-for="item of popularItems"
:icon="item.icon"
......
import "@/assets/main.css"
import { createApp } from "vue"
// import "@/content/index"
import "@/content/index"
// import "@/pages/popup"
import Dev from "./Dev.vue"
......
import { reactive, ref } from "vue"
export const pipWindow = reactive({
id: 0,
window: null as Window | null,
windowsWindow: null as chrome.windows.Window | null,
tab: null as chrome.tabs.Tab | null,
})
......@@ -239,3 +239,11 @@ export function autoPointerCapture(e: PointerEvent) {
;(e.target as HTMLElement)?.setPointerCapture(e.pointerId)
}
}
export function handleImgError(e: Event) {
const img = e.target
if (!img || !(img instanceof HTMLImageElement)) return
if (!img.dataset.fallback) return
if (img.src == img.dataset.fallback) return
setTimeout(() => (img.src = img.dataset.fallback || ""), 100)
}
......@@ -89,6 +89,13 @@ def cli(
continue
last_hash = current_hash
if locales_data["msg_name"].find("<code>") == -1:
msg_path = os.path.join(i18n_dir, locales_data["msg_name"])
update_msg(msg_path, data, overwrite=overwrite)
print(f'{time.strftime("%H:%M:%S")} UPDATED hash={current_hash}')
continue
for code in data:
filename = locales_data["msg_name"].replace("<code>", code)
msg_path = os.path.join(i18n_dir, filename)
......
......@@ -46,10 +46,7 @@ async function main(data = window.json) {
if (item.desc) {
desc = item.desc
desc = desc.replace(/\s+😎/, "\n\n\n😎")
desc = desc.replace(/\s+😘/, "\n\n😘")
desc = desc.replace(/\s+😊/, "\n\n😊")
desc = desc.replace(/\s+👻/, "\n\n👻")
log("inputDesc: ", desc)
await inputDesc(desc)
}
......@@ -110,9 +107,22 @@ async function click({ target, waitFor }) {
}
async function dispatchInput(input, value) {
let success = false
let count = 0
while (!success) {
input.value = value
input.dispatchEvent(new Event("input", { bubbles: true }))
input.dispatchEvent(new Event("change", { bubbles: true }))
count++
await sleep(150)
if (input.value == value || count > 30) {
break
}
log("waiting for: input value")
}
}
async function goDetail(code) {
......@@ -120,6 +130,7 @@ async function goDetail(code) {
const label = edgeLanguages[code]
await click({
target: `#extensionListTable #edit-button[aria-label*="${label}"]`,
waitFor: 'textarea[aria-label*="Description"]',
})
return
......@@ -136,13 +147,15 @@ async function inputDesc(desc) {
const textarea = document.querySelector(
'textarea[aria-label*="Description"]'
)
dispatchInput(textarea, desc)
await dispatchInput(textarea, desc)
return
}
const textarea = document.querySelectorAll("article section label textarea")[1]
dispatchInput(textarea, desc)
const textarea = document.querySelectorAll(
"article section label textarea"
)[0]
await dispatchInput(textarea, desc)
}
async function saveDraft() {
......@@ -151,7 +164,7 @@ async function saveDraft() {
}
await click({
target: ".command-bar-right he-button:nth-child(1)",
target: ".command-bar-right v6_he-button:nth-child(1)",
waitFor: ".alert.alert-success",
})
}
......@@ -162,7 +175,7 @@ async function closeDetails() {
}
await click({
target: ".command-bar-right he-button:nth-child(2)",
target: ".command-bar-right v6_he-button:nth-child(2)",
waitFor: "#extensionListTable",
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment