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

wix-style-processor

Package Overview
Dependencies
Maintainers
1
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wix-style-processor - npm Package Compare versions

Comparing version 3.0.124 to 3.0.125

dist/es/src/customSyntaxHelper.d.ts

4

dist/src/customSyntaxHelper.js

@@ -17,4 +17,4 @@ "use strict";

var _a;
var match;
if (match = value.match(customSyntaxRegex)) {
var match = value.match(customSyntaxRegex);
if (match) {
(_a = this.customSyntaxStrs).push.apply(_a, match);

@@ -21,0 +21,0 @@ }

"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __rest = (this && this.__rest) || function (s, e) {

@@ -40,3 +48,3 @@ var t = {};

catch (e) {
throw "Unparsable color " + colorValue;
throw new Error("Unparsable color " + colorValue);
}

@@ -51,11 +59,3 @@ },

var _a = utils_1.parseJson(font), theme = _a.theme, overrides = __rest(_a, ["theme"]);
fontValue = Object.assign({
style: '',
variant: '',
weight: '',
stretch: '',
size: '',
lineHeight: '',
family: []
}, tpaParams.fonts[theme], overrides);
fontValue = __assign({ style: '', variant: '', weight: '', stretch: '', size: '', lineHeight: '', family: [] }, tpaParams.fonts[theme], overrides);
}

@@ -62,0 +62,0 @@ else if (tpaParams.fonts[font]) {

"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -13,7 +21,7 @@ var styleUpdater_1 = require("./styleUpdater");

plugins: new plugins_1.Plugins(),
init: function (options, domService) {
init: function (options, domService, wixService) {
var _this = this;
if (options === void 0) { options = {}; }
if (domService === void 0) { domService = domService_1.default; }
var wixService = new wixService_1.WixService(window.Wix);
if (wixService === void 0) { wixService = new wixService_1.WixService(window.Wix); }
Object.keys(defaultPlugins_1.defaultPlugins)

@@ -27,3 +35,3 @@ .forEach(function (funcName) { return _this.plugins.addCssFunction(funcName, defaultPlugins_1.defaultPlugins[funcName]); });

defaultOptions.shouldApplyCSSFunctions = !wixService.shouldRunAsStandalone();
options = Object.assign({}, defaultOptions, options);
options = __assign({}, defaultOptions, options);
this.styleUpdater = styleUpdater_1.StyleUpdaterFactory(wixService, domService, options);

@@ -30,0 +38,0 @@ if (wixService.isEditorMode() || wixService.isPreviewMode()) {

@@ -34,3 +34,3 @@ "use strict";

Plugins.prototype.updateRegex = function () {
this.regex = new RegExp('(' + Object.keys(this.cssFunctions).join('|') + ')\\((.*)\\)');
this.regex = new RegExp("(" + Object.keys(this.cssFunctions).join('|') + ")\\((.*)\\)");
};

@@ -37,0 +37,0 @@ return Plugins;

"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -15,4 +23,4 @@ var utils_1 = require("./utils");

// Basic definitions
returnValue['white'] = '#FFFFFF';
returnValue['black'] = '#000000';
returnValue.white = '#FFFFFF';
returnValue.black = '#000000';
// Basic template colors

@@ -23,5 +31,5 @@ utils_1.forEach(siteColors, function (_a) {

});
returnValue = Object.assign(returnValue, fixedColorStyles);
returnValue = __assign({}, returnValue, fixedColorStyles);
// Fix for a bug in a very specific template
returnValue['background'] = (fixedColorStyles.background || {}).value || (returnValue['color-1'] === '#FFFFFF') && (returnValue['color-2'] === '#F4EFE1') ? returnValue['color-2'] : returnValue['color-1'];
returnValue.background = (fixedColorStyles.background || {}).value || (returnValue['color-1'] === '#FFFFFF') && (returnValue['color-2'] === '#F4EFE1') ? returnValue['color-2'] : returnValue['color-1'];
return returnValue;

@@ -28,0 +36,0 @@ }

@@ -12,3 +12,3 @@ "use strict";

var utils_1 = require("./utils");
var parseCssFont = require("parse-css-font");
var parse_css_font_1 = require("parse-css-font");
exports.wixStylesFontUtils = {

@@ -24,6 +24,3 @@ getFullFontStyles: function (_a) {

var presetValue = preset.value.replace(/^font\s*:\s*/, '');
parsedSiteTextPresets[key] = Object.assign({}, parseCssFont(presetValue), {
preset: key,
editorKey: preset.editorKey
}, preset.displayName ? { displayName: preset.displayName } : {});
parsedSiteTextPresets[key] = __assign({}, parse_css_font_1.default(presetValue), { preset: key, editorKey: preset.editorKey }, (preset.displayName ? { displayName: preset.displayName } : {}));
});

@@ -35,8 +32,8 @@ var parsedFontStyles = {};

// LIGHT/MEDIUM/STRONG
ret['LIGHT'] = parseCssFont('12px HelveticaNeueW01-45Ligh');
ret['MEDIUM'] = parseCssFont('12px HelveticaNeueW01-55Roma');
ret['STRONG'] = parseCssFont('12px HelveticaNeueW01-65Medi');
ret = Object.assign(ret, parsedFontStyles);
ret.LIGHT = parse_css_font_1.default('12px HelveticaNeueW01-45Ligh');
ret.MEDIUM = parse_css_font_1.default('12px HelveticaNeueW01-55Roma');
ret.STRONG = parse_css_font_1.default('12px HelveticaNeueW01-65Medi');
ret = __assign({}, ret, parsedFontStyles);
utils_1.forEach(ret, function (font, key) {
ret[key] = Object.assign({}, font, { supports: { uppercase: true } });
ret[key] = __assign({}, font, { supports: { uppercase: true } });
if (['snellroundhandw', 'niconne'].some(function (fontName) { return font.family.indexOf(fontName) > -1; })) {

@@ -76,11 +73,11 @@ ret[key].supports.uppercase = false;

if (utils_1.isNumber(size)) {
size = size + 'px';
size = size + "px";
}
var lineHeight = font.lineHeight || 'normal';
if (utils_1.isNumber(lineHeight)) {
lineHeight = lineHeight + 'px';
lineHeight = lineHeight + "px";
}
value += size + '/' + lineHeight + ' ';
value += size + "/" + lineHeight + " ";
value += font.cssFontFamily || font.family;
var fontObj = __assign({}, parseCssFont(value));
var fontObj = __assign({}, parse_css_font_1.default(value));
fontObj.underline = font.style && font.style.underline;

@@ -87,0 +84,0 @@ return fontObj;

@@ -5,3 +5,3 @@ {

"description": "An alternative Wix Styles TPA processor",
"version": "3.0.124",
"version": "3.0.125",
"author": {

@@ -13,3 +13,6 @@ "name": "Eran Shabi",

"main": "dist/src/index.js",
"module": "dist/es/src/index.js",
"types": "dist/src/index.d.ts",
"files": [
"dist/es",
"dist/src",

@@ -29,20 +32,22 @@ "README.md"

"color": "^1.0.3",
"parse-css-font": "^2.0.2",
"stylis": "^3.2.4"
"parse-css-font": "^3.0.2",
"stylis": "^3.5.1"
},
"devDependencies": {
"@types/chai": "^3.4.34",
"@types/chai-as-promised": "^0.0.29",
"@types/mocha": "^2.2.39",
"chai": "^3.5.0",
"express": "^4.15.3",
"express-session": "^1.15.3",
"jsdom": "^11.1.0",
"@types/chai": "^4.1.4",
"@types/chai-as-promised": "^7.1.0",
"@types/mocha": "^5.2.4",
"chai": "^4.1.2",
"express": "^4.16.3",
"express-session": "^1.15.6",
"jsdom": "^11.11.0",
"jsdom-global": "^3.0.2",
"mocha": "^3.3.0",
"sinon": "^2.2.0",
"ts-node": "^3.2.0",
"typescript": "^2.4.2",
"mocha": "^5.2.0",
"protractor": "^5.3.2",
"sinon": "^6.1.0",
"ts-node": "^7.0.0",
"typescript": "^2.9.2",
"velocity": "^0.7.2",
"yoshi": "^2.6.1"
"yoshi": "^3.0.0",
"yoshi-style-dependencies": "^3.0.0"
},

@@ -49,0 +54,0 @@ "yoshi": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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