Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dcloudio/uni-nvue-styler

Package Overview
Dependencies
Maintainers
10
Versions
421
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcloudio/uni-nvue-styler - npm Package Compare versions

Comparing version 3.0.0-alpha-4020620240828001 to 3.0.0-alpha-4020720240904001

67

dist/uni-nvue-styler.cjs.js

@@ -135,42 +135,12 @@ 'use strict';

const backgroundImage = 'background-image' ;
function createTransformBackground(options) {
return (decl) => {
const { value, important, raws, source } = decl;
// nvue 平台维持原有逻辑不变
const isUvuePlatform = options.type === 'uvue';
if (isUvuePlatform) {
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [
createDecl(backgroundImage, 'none', important, raws, source),
createDecl(backgroundColor, value, important, raws, source),
];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [
createDecl(backgroundImage, value, important, raws, source),
createDecl(backgroundColor, 'transparent', important, raws, source),
];
}
else if (value == '') {
return [
createDecl(backgroundImage, 'none', important, raws, source),
createDecl(backgroundColor, 'transparent', important, raws, source),
];
}
return [decl];
}
else {
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [createDecl(backgroundColor, value, important, raws, source)];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [createDecl(backgroundImage, value, important, raws, source)];
}
else if (value == '') {
return [decl];
}
return [decl];
}
};
}
const transformBackground = (decl) => {
const { value, important, raws, source } = decl;
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [createDecl(backgroundColor, value, important, raws, source)];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [createDecl(backgroundImage, value, important, raws, source)];
}
return [decl];
};

@@ -192,14 +162,5 @@ const borderWidth = '-width' ;

});
const isUvuePlatform = options.type === 'uvue';
if (isUvuePlatform) {
if (splitResult.length > 0 && value !== '') {
return [decl];
}
if (splitResult.length) {
return [decl];
}
else {
// nvue 维持不变
if (splitResult.length > 0) {
return [decl];
}
}
return [

@@ -425,3 +386,3 @@ createDecl(prop + borderWidth, (result[0] || (options.type === 'uvue' ? 'medium' : '0')).trim(), important, raws, source),

border: transformBorder,
background: createTransformBackground(options),
background: transformBackground,
borderTop: transformBorder,

@@ -459,3 +420,3 @@ borderRight: transformBorder,

const plugin = {
postcssPlugin: `${options.type || 'nvue'}:expand`,
postcssPlugin: 'nvue:expand',
Declaration(decl) {

@@ -462,0 +423,0 @@ if (decl[expanded]) {

@@ -19,42 +19,12 @@ import { hyphenate, capitalize } from '@vue/shared';

const backgroundImage = 'backgroundImage';
function createTransformBackground(options) {
return (decl) => {
const { value, important, raws, source } = decl;
// nvue 平台维持原有逻辑不变
const isUvuePlatform = options.type === 'uvue';
if (isUvuePlatform) {
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [
createDecl(backgroundImage, 'none', important, raws, source),
createDecl(backgroundColor, value, important, raws, source),
];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [
createDecl(backgroundImage, value, important, raws, source),
createDecl(backgroundColor, 'transparent', important, raws, source),
];
}
else if (value == '') {
return [
createDecl(backgroundImage, 'none', important, raws, source),
createDecl(backgroundColor, 'transparent', important, raws, source),
];
}
return [decl];
}
else {
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [createDecl(backgroundColor, value, important, raws, source)];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [createDecl(backgroundImage, value, important, raws, source)];
}
else if (value == '') {
return [decl];
}
return [decl];
}
};
}
const transformBackground = (decl) => {
const { value, important, raws, source } = decl;
if (/^#?\S+$/.test(value) || /^rgba?(.+)$/.test(value)) {
return [createDecl(backgroundColor, value, important, raws, source)];
}
else if (/^linear-gradient(.+)$/.test(value)) {
return [createDecl(backgroundImage, value, important, raws, source)];
}
return [decl];
};

@@ -76,14 +46,5 @@ const borderWidth = 'Width';

});
const isUvuePlatform = options.type === 'uvue';
if (isUvuePlatform) {
if (splitResult.length > 0 && value !== '') {
return [decl];
}
if (splitResult.length) {
return [decl];
}
else {
// nvue 维持不变
if (splitResult.length > 0) {
return [decl];
}
}
return [

@@ -247,3 +208,3 @@ createDecl(prop + borderWidth, (result[0] || (options.type === 'uvue' ? 'medium' : '0')).trim(), important, raws, source),

border: transformBorder,
background: createTransformBackground(options),
background: transformBackground,
borderTop: transformBorder,

@@ -278,3 +239,3 @@ borderRight: transformBorder,

const plugin = {
postcssPlugin: `${options.type || 'nvue'}:expand`,
postcssPlugin: 'nvue:expand',
Declaration(decl) {

@@ -281,0 +242,0 @@ if (decl[expanded]) {

{
"name": "@dcloudio/uni-nvue-styler",
"version": "3.0.0-alpha-4020620240828001",
"version": "3.0.0-alpha-4020720240904001",
"description": "uni-nvue-styler",
"main": "./dist/uni-nvue-styler.cjs.js",
"types": "./dist/uni-nvue-styler.d.ts",
"module": "./dist/uni-nvue-styler.es.js",
"files": [

@@ -9,0 +8,0 @@ "dist",

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