New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alga-css

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alga-css - npm Package Compare versions

Comparing version 1.0.0-beta-27 to 1.0.0-beta-28

alga/offCanvas.alga

2

package.json
{
"name": "alga-css",
"version": "1.0.0-beta-27",
"version": "1.0.0-beta-28",
"description": "Alga CSS is a scope or component oriented CSS toolkit for quickly reuse CSS components and it can be stored in .alga format file as a custom CSS component and also it has many built-in customizable CSS properties that can be directly inserted to HTML Element class",

@@ -5,0 +5,0 @@ "main": "./src/index.js",

@@ -135,2 +135,68 @@ const chokidar = require('chokidar')

const pluginLoader = () => {
let newPackNodes = []
const filterPackNodes = []
for(let rule of config.inits) {
let param = rule.params.trim()
let name = param
if(param.includes('.')) {
const prms = param.split('.')
param = prms[0].trim()
name = prms[1].trim()
}
if(!filterPackNodes.includes(param) && config.components[param]) {
filterPackNodes.push(param)
let newNodes = []
if(rule?.nodes) {
for(let node of rule.nodes) {
if(node.type === 'rule' && (rule?.nodes?.length || 0) >= 1) {
const ruleNodeName = node.selector.replace(/\#|\./, '').trim()
for(let ruleNode of node.nodes) {
if(ruleNodeName === 'props') {
if(ruleNode.prop in config.components[param][ruleNodeName]) {
config.components[param][ruleNodeName][ruleNode.prop].value = ruleNode.value
}
}
}
} else {
if(node.type === 'decl' && String(node?.prop) in config.components[param]['props']) {
config.components[param]['props'][node.prop].value = node.value
}
}
}
}
let newBodyVar = []
if(config.components[param]?.[name]?.['body']) {
newBodyVar = config.components[param][name]['body']
}
newNodes = [
...newNodes,
...declaration(newBodyVar,
{
refs: config.components[param]['refs'],
props: config.components[param]['props'],
provide: config.components[param]['provide']
},
{
screen: config.screen,
state: config.state,
prefers: config.prefers,
color: config.color
})
]
const newRoot = config.components[param]['root']
newRoot.removeAll()
if(config.important) {
newRoot.append(...newNodes)
} else {
const newLayer = layer(newNodes, name, rule.source)
newRoot.append(newLayer)
}
newPackNodes.push(newRoot)
}
}
return newPackNodes.flat()
}
root.walkAtRules(config.directive, rule => {

@@ -157,2 +223,4 @@ if(config.directive === 'layer') {

}
} else if(!rule.params.includes(',') && (name.includes('modules') || param.includes('modules'))) {
rule.append(...pluginLoader())
} else {

@@ -203,3 +271,5 @@ let fileName = param

rule.remove()
} else if(!rule.params.includes(',') && (name.includes('modules') || param.includes('modules'))) {
rule.append(...pluginLoader())
rule.remove()
} else {

@@ -330,65 +400,2 @@ let fileName = param

let newPackNodes = []
const filterPackNodes = []
for(let rule of config.inits) {
let param = rule.params.trim()
let name = param
if(param.includes('.')) {
const prms = param.split('.')
param = prms[0].trim()
name = prms[1].trim()
}
if(!filterPackNodes.includes(param) && config.components[param]) {
filterPackNodes.push(param)
let newNodes = []
if(rule?.nodes) {
for(let node of rule.nodes) {
if(node.type === 'rule' && (rule?.nodes?.length || 0) >= 1) {
const ruleNodeName = node.selector.replace(/\#|\./, '').trim()
for(let ruleNode of node.nodes) {
if(ruleNodeName === 'props') {
if(ruleNode.prop in config.components[param][ruleNodeName]) {
config.components[param][ruleNodeName][ruleNode.prop].value = ruleNode.value
}
}
}
} else {
if(node.type === 'decl' && String(node?.prop) in config.components[param]['props']) {
config.components[param]['props'][node.prop].value = node.value
}
}
}
}
let newBodyVar = []
if(config.components[param]?.[name]?.['body']) {
newBodyVar = config.components[param][name]['body']
}
newNodes = [
...newNodes,
...declaration(newBodyVar,
{
refs: config.components[param]['refs'],
props: config.components[param]['props'],
provide: config.components[param]['provide']
},
{
screen: config.screen,
state: config.state,
prefers: config.prefers,
color: config.color
})
]
const newRoot = config.components[param]['root']
newRoot.removeAll()
if(config.important) {
newRoot.append(...newNodes)
} else {
const newLayer = layer(newNodes, name, rule.source)
newRoot.append(newLayer)
}
newPackNodes.push(newRoot)
}
}
root.append(...newPackNodes.flat())
}

@@ -395,0 +402,0 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc