@@ -3,6 +3,7 @@ import 'floating-vue/dist/style.css'
3
3
import ' vanilla-jsoneditor/themes/jse-theme-dark.css'
4
4
import ' vue-virtual-scroller/dist/vue-virtual-scroller.css'
5
5
import ' ./styles/global.css'
6
+ import { useEyeDropper } from ' @vueuse/core'
6
7
import { setupClientRPC } from ' ./setup/client-rpc'
7
8
import { splitScreenAvailable } from ' ~/composables/storage'
8
9
@@ -72,19 +73,33 @@ onMounted(async () => {
72
73
}
73
74
})
74
75
75
- registerCommands (() =>
76
- splitScreenAvailable .value
77
- ? [
78
- {
79
- id: ' action:split-screen' ,
80
- title: ` ${splitScreenEnabled .value ? ' Close' : ' Open' } Split Screen ` ,
81
- icon: ' i-carbon-split-screen' ,
82
- action : () => {
83
- splitScreenEnabled .value = ! splitScreenEnabled .value
84
- },
76
+ const copy = useCopy ()
77
+ const eyeDropper = useEyeDropper ({})
78
+
79
+ registerCommands (() => [
80
+ ... (splitScreenAvailable .value
81
+ ? [{
82
+ id: ' action:split-screen' ,
83
+ title: ` ${splitScreenEnabled .value ? ' Close' : ' Open' } Split Screen ` ,
84
+ icon: ' i-carbon-split-screen' ,
85
+ action : () => {
86
+ splitScreenEnabled .value = ! splitScreenEnabled .value
87
+ },
88
+ }]
89
+ : []),
90
+ ... (eyeDropper .isSupported .value
91
+ ? [{
92
+ id: ' action:eye-dropper' ,
93
+ title: ' Eye Dropper' ,
94
+ icon: ' i-carbon-eyedropper' ,
95
+ action : async () => {
96
+ const { sRGBHex } = await eyeDropper .open () || {}
97
+ if (sRGBHex )
98
+ copy (sRGBHex )
85
99
},
86
- ]
87
- : [])
100
+ }]
101
+ : []),
102
+ ])
88
103
</script >
89
104
90
105
<template >
0 commit comments