mirror of
https://github.com/liriliri/eruda.git
synced 2026-05-20 08:47:20 +08:00
release: v2.6.1
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## 2.6.1 (26 Nov 2022)
|
||||||
|
|
||||||
|
* fix: dark mode scrollbar style
|
||||||
|
* fix: unable to load timing plugin
|
||||||
|
|
||||||
## 2.6.0 (25 Nov 2022)
|
## 2.6.0 (25 Nov 2022)
|
||||||
|
|
||||||
* feat(console): select and copy
|
* feat(console): select and copy
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const BundleAnalyzerPlugin =
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
||||||
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
.BundleAnalyzerPlugin
|
||||||
|
|
||||||
exports = require('./webpack.prod')
|
exports = require('./webpack.prod')
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eruda",
|
"name": "eruda",
|
||||||
"version": "2.6.0",
|
"version": "2.6.1",
|
||||||
"description": "Console for Mobile Browsers",
|
"description": "Console for Mobile Browsers",
|
||||||
"main": "eruda.js",
|
"main": "eruda.js",
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
extend,
|
extend,
|
||||||
} from '../lib/util'
|
} from '../lib/util'
|
||||||
import evalCss from '../lib/evalCss'
|
import evalCss from '../lib/evalCss'
|
||||||
|
import { isDarkTheme } from '../lib/themes'
|
||||||
import LunaNotification from 'luna-notification'
|
import LunaNotification from 'luna-notification'
|
||||||
|
|
||||||
export default class DevTools extends Emitter {
|
export default class DevTools extends Emitter {
|
||||||
@@ -156,7 +157,7 @@ export default class DevTools extends Emitter {
|
|||||||
|
|
||||||
this._setTransparency(cfg.get('transparency'))
|
this._setTransparency(cfg.get('transparency'))
|
||||||
this._setDisplaySize(cfg.get('displaySize'))
|
this._setDisplaySize(cfg.get('displaySize'))
|
||||||
evalCss.setTheme(cfg.get('theme'))
|
this._setTheme(cfg.get('theme'))
|
||||||
|
|
||||||
cfg.on('change', (key, val) => {
|
cfg.on('change', (key, val) => {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
@@ -165,7 +166,7 @@ export default class DevTools extends Emitter {
|
|||||||
case 'displaySize':
|
case 'displaySize':
|
||||||
return this._setDisplaySize(val)
|
return this._setDisplaySize(val)
|
||||||
case 'theme':
|
case 'theme':
|
||||||
return evalCss.setTheme(val)
|
return this._setTheme(val)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -193,6 +194,16 @@ export default class DevTools extends Emitter {
|
|||||||
this._navBar.destroy()
|
this._navBar.destroy()
|
||||||
this._$el.remove()
|
this._$el.remove()
|
||||||
}
|
}
|
||||||
|
_setTheme(theme) {
|
||||||
|
const { $container } = this
|
||||||
|
|
||||||
|
if (isDarkTheme(theme)) {
|
||||||
|
$container.addClass('eruda-dark')
|
||||||
|
} else {
|
||||||
|
$container.rmClass('eruda-dark')
|
||||||
|
}
|
||||||
|
evalCss.setTheme(theme)
|
||||||
|
}
|
||||||
_setTransparency(opacity) {
|
_setTransparency(opacity) {
|
||||||
if (!isNum(opacity)) return
|
if (!isNum(opacity)) return
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { extend, isArr } from './util'
|
import { extend, isArr } from './util'
|
||||||
|
import contain from 'licia/contain'
|
||||||
|
|
||||||
const keyMap = [
|
const keyMap = [
|
||||||
'background',
|
'background',
|
||||||
@@ -70,6 +71,24 @@ function createLightTheme(theme) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const darkThemes = [
|
||||||
|
'Dark',
|
||||||
|
'Material Oceanic',
|
||||||
|
'Material Darker',
|
||||||
|
'Material Palenight',
|
||||||
|
'Material Deep Ocean',
|
||||||
|
'Monokai Pro',
|
||||||
|
'Dracula',
|
||||||
|
'Arc Dark',
|
||||||
|
'Atom One Dark',
|
||||||
|
'Solarized Dark',
|
||||||
|
'Night Owl',
|
||||||
|
]
|
||||||
|
|
||||||
|
export function isDarkTheme(theme) {
|
||||||
|
return contain(darkThemes, theme)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
Light: createLightTheme({
|
Light: createLightTheme({
|
||||||
darkerBackground: '#f3f3f3',
|
darkerBackground: '#f3f3f3',
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
@import 'luna';
|
@import 'luna';
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
&.dark {
|
||||||
|
color-scheme: dark;
|
||||||
|
}
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user