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

@paperbits/styles

Package Overview
Dependencies
Maintainers
2
Versions
605
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.576 to 0.1.577

4

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

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

"dependencies": {
"@paperbits/common": "0.1.576",
"@paperbits/common": "0.1.577",
"@simonwep/pickr": "^1.7.4",

@@ -22,0 +22,0 @@ "jss": "^10.4.0",

@@ -0,2 +1,4 @@

import * as Utils from "@paperbits/common";
import { MimeTypes } from "@paperbits/common";
import { ISettingsProvider } from "@paperbits/common/configuration";
import { Attributes } from "@paperbits/common/html";

@@ -14,7 +16,17 @@ import { IBlobStorage } from "@paperbits/common/persistence";

private localStyleBuilder: StyleBuilder;
private subresourceIntegrityEnabled: boolean;
constructor(outputBlobStorage: IBlobStorage) {
constructor(
private readonly settingsProvider: ISettingsProvider,
outputBlobStorage: IBlobStorage
) {
this.localStyleBuilder = new StyleBuilder(outputBlobStorage);
}
private initialize = Utils.debounce(this.loadSettings.bind(this));
private async loadSettings(): Promise<void> {
this.subresourceIntegrityEnabled = !!await this.settingsProvider.getSetting<boolean>("features/subresourceIntegrity");
}
private appendStyleLink(document: Document, href: string, integrity: string): void {

@@ -24,3 +36,3 @@ const element: HTMLStyleElement = document.createElement("link");

if (integrity) {
if (this.subresourceIntegrityEnabled && integrity) {
element.setAttribute(Attributes.Integrity, integrity);

@@ -36,2 +48,4 @@ }

public async apply(document: Document, page: HtmlPage): Promise<void> {
await this.initialize();
const styleManager: StyleManager = page.bindingContext?.styleManager;

@@ -38,0 +52,0 @@

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