fela-plugin-embedded
Advanced tools
Comparing version 11.7.0 to 12.0.0-rc.0
@@ -1,6 +0,10 @@ | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _excluded = ["fontFamily", "src"]; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
import arrayReduce from 'fast-loops/lib/arrayReduce'; | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
import { arrayReduce } from 'fast-loops'; | ||
import isPlainObject from 'isobject'; | ||
@@ -15,9 +19,9 @@ | ||
src = fontFace.src, | ||
otherProps = _objectWithoutProperties(fontFace, ['fontFamily', 'src']); | ||
otherProps = _objectWithoutProperties(fontFace, _excluded); | ||
if (typeof fontFamily === 'string' && Array.isArray(src)) { | ||
return renderer.renderFont(fontFamily, src, otherProps); | ||
} | ||
} // TODO: warning - invalid font data | ||
// TODO: warning - invalid font data | ||
return undefined; | ||
@@ -30,3 +34,3 @@ } | ||
if (property === 'fontFace' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
if (property === 'fontFace' && _typeof(value) === 'object') { | ||
if (Array.isArray(value)) { | ||
@@ -45,4 +49,5 @@ style.fontFamily = arrayReduce(value, function (fontFamilyList, fontFace) { | ||
} | ||
delete style.fontFace; | ||
} else if (property === 'animationName' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
} else if (property === 'animationName' && _typeof(value) === 'object') { | ||
if (Array.isArray(value)) { | ||
@@ -49,0 +54,0 @@ style[property] = value.map(function (frame) { |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -6,16 +6,17 @@ Object.defineProperty(exports, "__esModule", { | ||
}); | ||
exports["default"] = void 0; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _fastLoops = require("fast-loops"); | ||
var _arrayReduce = require('fast-loops/lib/arrayReduce'); | ||
var _isobject = _interopRequireDefault(require("isobject")); | ||
var _arrayReduce2 = _interopRequireDefault(_arrayReduce); | ||
var _excluded = ["fontFamily", "src"]; | ||
var _isobject = require('isobject'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var _isobject2 = _interopRequireDefault(_isobject); | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | ||
@@ -29,9 +30,9 @@ function renderFontFace(fontFace, renderer) { | ||
src = fontFace.src, | ||
otherProps = _objectWithoutProperties(fontFace, ['fontFamily', 'src']); | ||
otherProps = _objectWithoutProperties(fontFace, _excluded); | ||
if (typeof fontFamily === 'string' && Array.isArray(src)) { | ||
return renderer.renderFont(fontFamily, src, otherProps); | ||
} | ||
} // TODO: warning - invalid font data | ||
// TODO: warning - invalid font data | ||
return undefined; | ||
@@ -44,5 +45,5 @@ } | ||
if (property === 'fontFace' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
if (property === 'fontFace' && _typeof(value) === 'object') { | ||
if (Array.isArray(value)) { | ||
style.fontFamily = (0, _arrayReduce2.default)(value, function (fontFamilyList, fontFace) { | ||
style.fontFamily = (0, _fastLoops.arrayReduce)(value, function (fontFamilyList, fontFace) { | ||
var fontFamily = renderFontFace(fontFace, renderer); | ||
@@ -59,4 +60,5 @@ | ||
} | ||
delete style.fontFace; | ||
} else if (property === 'animationName' && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') { | ||
} else if (property === 'animationName' && _typeof(value) === 'object') { | ||
if (Array.isArray(value)) { | ||
@@ -73,3 +75,3 @@ style[property] = value.map(function (frame) { | ||
} | ||
} else if ((0, _isobject2.default)(value)) { | ||
} else if ((0, _isobject["default"])(value)) { | ||
embedded(value, type, renderer, props); | ||
@@ -86,4 +88,6 @@ } | ||
exports.default = function () { | ||
var _default = function _default() { | ||
return embedded; | ||
}; | ||
}; | ||
exports["default"] = _default; |
{ | ||
"name": "fela-plugin-embedded", | ||
"version": "11.7.0", | ||
"version": "12.0.0-rc.0", | ||
"description": "Fela plugin that resolves embedded keyframes and font faces", | ||
@@ -13,4 +13,18 @@ "main": "lib/index.js", | ||
"lib/**", | ||
"es/**" | ||
"es/**", | ||
"umd/**" | ||
], | ||
"scripts": { | ||
"setup": "yarn build", | ||
"clean": "rimraf lib es coverage", | ||
"build": "yarn clean && yarn build:es && yarn build:lib", | ||
"build:es": "babel src --out-dir es --ignore **/__tests__", | ||
"build:lib": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__", | ||
"build:umd": "webpack --config webpack.config.js", | ||
"watch": "npm run watch:lib & npm run watch:es", | ||
"watch:lib": "BABEL_ENV=commonjs babel src -d lib -w", | ||
"watch:es": "babel src -d es -w", | ||
"test": "jest --config=jest.config.js", | ||
"coverage": "yarn test --coverage" | ||
}, | ||
"repository": "https://github.com/robinweser/fela/", | ||
@@ -30,6 +44,21 @@ "keywords": [ | ||
"devDependencies": { | ||
"fela": "^11.7.0", | ||
"fela-tools": "^11.7.0" | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/node": "^7.13.0", | ||
"@babel/plugin-transform-modules-commonjs": "^7.5.0", | ||
"@babel/polyfill": "^7.7.0", | ||
"@babel/preset-env": "^7.5.5", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-jest": "^26.6.0", | ||
"babel-loader": "^8.2.3", | ||
"clean-webpack-plugin": "^3.0.0", | ||
"cross-env": "^6.0.3", | ||
"fela": "^12.0.0-rc.0", | ||
"fela-tools": "^12.0.0-rc.0", | ||
"jest": "^26.6.0", | ||
"rimraf": "^3.0.0", | ||
"webpack": "^4.41.6", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
"gitHead": "e067b284984d3dbfc259fcbffde9bb50679fda9b" | ||
"gitHead": "00f02f410f17a7693479ea3349bb3a9f223359af" | ||
} |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14306
6
137
17
2