zen-wdg 2.0.13 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-wdg",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Minimal widget library for Gridstack-based newtab extensions",
|
|
5
5
|
"main": "dist/zen-wdg.umd.js",
|
|
6
6
|
"module": "dist/zen-wdg.es.js",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"license": "AGPL-3.0",
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
27
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
28
27
|
"terser": "^5.43.1",
|
|
29
28
|
"typescript": "^5.8.3",
|
|
30
29
|
"vite": "^6.0.0",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="search">
|
|
3
|
+
<img src="../assets/favicon.png" />
|
|
4
|
+
<Input placeholder="Search something" full class="bg" v-model="text" @enter-pressed="search()" />
|
|
5
|
+
<Button icon="material-symbols-light:search-rounded" size="25px" flat class="text-color" @click="search()" />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import Input from '../components/UI/Input.vue';
|
|
11
|
+
import Button from '../components/UI/Button.vue';
|
|
12
|
+
export default {
|
|
13
|
+
name: 'ZSearchWidget',
|
|
14
|
+
|
|
15
|
+
data() {
|
|
16
|
+
return {
|
|
17
|
+
text: '',
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
props: {
|
|
22
|
+
searchTarget: {
|
|
23
|
+
type: String,
|
|
24
|
+
require: true,
|
|
25
|
+
default: "same"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
components: {
|
|
30
|
+
Input,
|
|
31
|
+
Button
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
methods: {
|
|
35
|
+
search() {
|
|
36
|
+
const query = encodeURIComponent(this.text);
|
|
37
|
+
const url = `https://astiango.co/?q=${query}`;
|
|
38
|
+
if(this.searchTarget == 'new') {
|
|
39
|
+
chrome.tabs.create({ url: url});
|
|
40
|
+
} else if(this.searchTarget == 'same') {
|
|
41
|
+
chrome.tabs.update({ url: url });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
.search {
|
|
50
|
+
width: 100%;
|
|
51
|
+
background-color: var(--bg-color);
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding: .2rem 1rem;
|
|
55
|
+
border-radius: 5rem;
|
|
56
|
+
border: .01rem solid var(--orange);
|
|
57
|
+
box-shadow: 0 0 .4rem var(--border-color);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.search img {
|
|
61
|
+
width: 20px;
|
|
62
|
+
}
|
|
63
|
+
</style>
|