UNPKG

zeplin-extension-style-kit

Version:

Models and utilities to generate CSS-like style code in Zeplin extensions.

48 lines (38 loc) 1.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _constants = require("../constants"); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var BackgroundImage = /*#__PURE__*/function () { function BackgroundImage(images) { _classCallCheck(this, BackgroundImage); this.images = images; } _createClass(BackgroundImage, [{ key: "equals", value: function equals(other) { return this.images.length === other.images.length && this.images.every(function (img, index) { return img.equals(other.images[index]); }); } }, { key: "getValue", value: function getValue(params, variables) { return this.images.map(function (img) { return img.toStyleValue(params, variables); }).join(", "); } }, { key: "name", get: function get() { return _constants.STYLE_PROPS.BACKGROUND_IMAGE; } }]); return BackgroundImage; }(); var _default = BackgroundImage; exports.default = _default;