Socket
Socket
Sign inDemoInstall

@paperbits/styles

Package Overview
Dependencies
Maintainers
2
Versions
594
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paperbits/styles - npm Package Compare versions

Comparing version 0.1.53 to 0.1.54

4

package.json
{
"name": "@paperbits/styles",
"version": "0.1.53",
"version": "0.1.54",
"description": "Paperbits style editors.",

@@ -19,3 +19,3 @@ "author": "Paperbits",

"dependencies": {
"@paperbits/common": "0.1.53",
"@paperbits/common": "0.1.54",
"cropperjs": "^1.4.0",

@@ -22,0 +22,0 @@ "google-maps": "^3.2.1",

@@ -0,3 +1,4 @@

import * as Utils from "@paperbits/common/utils";
import { IMediaService } from "@paperbits/common/media";
import { IPermalinkResolver } from "@paperbits/common/permalinks";
import { StylePlugin } from "./stylePlugin";

@@ -12,3 +13,3 @@ import { StyleService } from "../";

private readonly styleService: StyleService,
private readonly mediaService: IMediaService
private readonly mediaPermalinkResolver: IPermalinkResolver
) {

@@ -40,5 +41,5 @@ super();

for (const image of backgroundContract.images) {
const media = await this.mediaService.getMediaByKey(image.sourceKey);
const imageUrl = await this.mediaPermalinkResolver.getUrlByTargetKey(image.sourceKey);
if (!media) {
if (!imageUrl) {
console.warn(`Unable to set background image. Media with source key ${image.sourceKey} not found.`);

@@ -48,3 +49,3 @@ continue;

backgroundImage.push(`url("${media.downloadUrl}")`);
backgroundImage.push(`url("${imageUrl}")`);
backgroundPosition.push(image.position || "unset");

@@ -51,0 +52,0 @@ backgroundSize.push(image.size || "unset");

import * as Utils from "@paperbits/common/utils";
import { StyleService } from "./styleService";
import { Bag } from "@paperbits/common";
import { IMediaService } from "@paperbits/common/media";
import { IPermalinkResolver } from "@paperbits/common/permalinks";
import { BreakpointValues } from "@paperbits/common/styles/breakpoints";

@@ -39,3 +39,3 @@ import {

private readonly styleService: StyleService,
private readonly mediaService: IMediaService,
private readonly mediaPermalinkResolver: IPermalinkResolver,
) {

@@ -67,3 +67,3 @@ this.plugins = {};

this.plugins["borderRadius"] = new BorderRadiusStylePlugin();
this.plugins["background"] = new BackgroundStylePlugin(this.styleService, this.mediaService);
this.plugins["background"] = new BackgroundStylePlugin(this.styleService, this.mediaPermalinkResolver);
this.plugins["shadow"] = new ShadowStylePlugin(themeContract);

@@ -70,0 +70,0 @@ this.plugins["animation"] = new AnimationStylePlugin(themeContract);

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