🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@cubetool/plugin-cli-plus

Package Overview
Dependencies
Maintainers
7
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubetool/plugin-cli-plus - npm Package Compare versions

Comparing version
2.0.0-beta.5
to
2.0.0-beta.6
+60
-0
html/index.html

@@ -30,2 +30,58 @@ <!DOCTYPE html>

<script>
/** 临时 hack 响应式样式实现*/
var _originAddCube = addCube;
let dynamicCubeCss = (() => {
let allWcss = {};
let wcssStyle = document.createElement('style');
wcssStyle.type = 'text/css';
wcssStyle.id = 'cube-wcss-style';
document.head.append(wcssStyle);
function updateCss(cssCode){
wcssStyle.innerHTML = cssCode;
}
function updateStyle(width){
let cssCode = '';
for(let scope in allWcss){
const [min, max] = scope.split(',').map(i => parseInt(i, 10));
if(width >= min && width < max){
const csses = allWcss[scope];
csses.forEach(code => {
cssCode += code;
});
}
}
updateCss(cssCode);
}
return {
addWcss(wcss){
if(wcss && wcss.length){
wcss.forEach(wcssData => {
const {scope, code} = wcssData;
if(!allWcss[scope]){
allWcss[scope] = []
}
allWcss[scope].push(code)
})
}
},
widthHandle(){
document.getElementById('wrap-width').addEventListener('change', e => {
updateStyle(e.target.value);
});
updateStyle(document.getElementById('wrap-width').value);
},
}
})();
var addCube = function(pkgid, data){
dynamicCubeCss.addWcss(data.wcss)
_originAddCube(pkgid, data);
}
window.dynamicCubeCss = dynamicCubeCss;
</script>
<script>
const insertHttpProxyCtrl = function(wrap){

@@ -85,2 +141,6 @@ const tpl = `

insertHttpProxyCtrl(document.querySelector('.cube-ctrl'));
// 动态 cube css 处理(临时处理)
dynamicCubeCss.widthHandle();
return cool

@@ -87,0 +147,0 @@ }

+1
-1
{
"name": "@cubetool/plugin-cli-plus",
"version": "2.0.0-beta.5",
"version": "2.0.0-beta.6",
"description": "开发者工具核心 CLI 功能增强插件",

@@ -5,0 +5,0 @@ "author": "TTFE",