@emotion/sheet
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -1,2 +0,25 @@ | ||
export * from '../types' | ||
export { default } from '../types' | ||
export type Options = { | ||
nonce?: string; | ||
key: string; | ||
container: Node; | ||
speedy?: boolean; | ||
prepend?: boolean; | ||
insertionPoint?: HTMLElement; | ||
}; | ||
export declare class StyleSheet { | ||
isSpeedy: boolean; | ||
ctr: number; | ||
tags: HTMLStyleElement[]; | ||
container: Node; | ||
key: string; | ||
nonce: string | undefined; | ||
prepend: boolean | undefined; | ||
before: Element | null; | ||
insertionPoint: HTMLElement | undefined; | ||
private _alreadyInsertedOrderInsensitiveRule; | ||
constructor(options: Options); | ||
private _insertTag; | ||
hydrate(nodes: HTMLStyleElement[]): void; | ||
insert(rule: string): void; | ||
flush(): void; | ||
} |
@@ -23,6 +23,4 @@ /* | ||
*/ | ||
// $FlowFixMe | ||
function sheetForTag(tag) { | ||
if (tag.sheet) { | ||
// $FlowFixMe | ||
return tag.sheet; | ||
@@ -36,6 +34,9 @@ } // this weirdness brought to you by firefox | ||
if (document.styleSheets[i].ownerNode === tag) { | ||
// $FlowFixMe | ||
return document.styleSheets[i]; | ||
} | ||
} | ||
} // this function should always return with a value | ||
// TS can't understand it though so we make it stop complaining here | ||
return undefined; | ||
} | ||
@@ -118,2 +119,3 @@ | ||
} | ||
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; | ||
@@ -142,5 +144,6 @@ } | ||
_proto.flush = function flush() { | ||
// $FlowFixMe | ||
this.tags.forEach(function (tag) { | ||
return tag.parentNode && tag.parentNode.removeChild(tag); | ||
var _tag$parentNode; | ||
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); | ||
}); | ||
@@ -147,0 +150,0 @@ this.tags = []; |
@@ -27,6 +27,4 @@ 'use strict'; | ||
*/ | ||
// $FlowFixMe | ||
function sheetForTag(tag) { | ||
if (tag.sheet) { | ||
// $FlowFixMe | ||
return tag.sheet; | ||
@@ -40,6 +38,9 @@ } // this weirdness brought to you by firefox | ||
if (document.styleSheets[i].ownerNode === tag) { | ||
// $FlowFixMe | ||
return document.styleSheets[i]; | ||
} | ||
} | ||
} // this function should always return with a value | ||
// TS can't understand it though so we make it stop complaining here | ||
return undefined; | ||
} | ||
@@ -122,2 +123,3 @@ | ||
} | ||
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; | ||
@@ -146,5 +148,6 @@ } | ||
_proto.flush = function flush() { | ||
// $FlowFixMe | ||
this.tags.forEach(function (tag) { | ||
return tag.parentNode && tag.parentNode.removeChild(tag); | ||
var _tag$parentNode; | ||
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); | ||
}); | ||
@@ -151,0 +154,0 @@ this.tags = []; |
@@ -27,6 +27,4 @@ 'use strict'; | ||
*/ | ||
// $FlowFixMe | ||
function sheetForTag(tag) { | ||
if (tag.sheet) { | ||
// $FlowFixMe | ||
return tag.sheet; | ||
@@ -40,6 +38,9 @@ } // this weirdness brought to you by firefox | ||
if (document.styleSheets[i].ownerNode === tag) { | ||
// $FlowFixMe | ||
return document.styleSheets[i]; | ||
} | ||
} | ||
} // this function should always return with a value | ||
// TS can't understand it though so we make it stop complaining here | ||
return undefined; | ||
} | ||
@@ -130,5 +131,6 @@ | ||
_proto.flush = function flush() { | ||
// $FlowFixMe | ||
this.tags.forEach(function (tag) { | ||
return tag.parentNode && tag.parentNode.removeChild(tag); | ||
var _tag$parentNode; | ||
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); | ||
}); | ||
@@ -135,0 +137,0 @@ this.tags = []; |
@@ -23,6 +23,4 @@ /* | ||
*/ | ||
// $FlowFixMe | ||
function sheetForTag(tag) { | ||
if (tag.sheet) { | ||
// $FlowFixMe | ||
return tag.sheet; | ||
@@ -36,6 +34,9 @@ } // this weirdness brought to you by firefox | ||
if (document.styleSheets[i].ownerNode === tag) { | ||
// $FlowFixMe | ||
return document.styleSheets[i]; | ||
} | ||
} | ||
} // this function should always return with a value | ||
// TS can't understand it though so we make it stop complaining here | ||
return undefined; | ||
} | ||
@@ -118,2 +119,3 @@ | ||
} | ||
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; | ||
@@ -142,5 +144,6 @@ } | ||
_proto.flush = function flush() { | ||
// $FlowFixMe | ||
this.tags.forEach(function (tag) { | ||
return tag.parentNode && tag.parentNode.removeChild(tag); | ||
var _tag$parentNode; | ||
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag); | ||
}); | ||
@@ -147,0 +150,0 @@ this.tags = []; |
{ | ||
"name": "@emotion/sheet", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "emotion's stylesheet", | ||
@@ -10,2 +10,3 @@ "main": "dist/emotion-sheet.cjs.js", | ||
}, | ||
"types": "dist/emotion-sheet.cjs.d.ts", | ||
"exports": { | ||
@@ -22,3 +23,2 @@ ".": { | ||
}, | ||
"types": "types/index.d.ts", | ||
"license": "MIT", | ||
@@ -34,8 +34,7 @@ "scripts": { | ||
"src", | ||
"dist", | ||
"types/*.d.ts" | ||
"dist" | ||
], | ||
"devDependencies": { | ||
"@definitelytyped/dtslint": "0.0.112", | ||
"typescript": "^4.5.5" | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -42,0 +41,0 @@ "preconstruct": { |
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
30744
15
645