@paperbits/styles
Advanced tools
Comparing version 0.1.53 to 0.1.54
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146965
+ Added@paperbits/common@0.1.54(transitive)
- Removed@paperbits/common@0.1.53(transitive)
Updated@paperbits/common@0.1.54