@ant-design/cssinjs
Advanced tools
Comparing version 0.0.0-alpha.40 to 0.0.0-alpha.41
@@ -13,5 +13,3 @@ import * as React from 'react'; | ||
Array.from(styles).forEach(function (style) { | ||
var _style$CSS_IN_JS_INST; | ||
(_style$CSS_IN_JS_INST = style[CSS_IN_JS_INSTANCE]) !== null && _style$CSS_IN_JS_INST !== void 0 ? _style$CSS_IN_JS_INST : style[CSS_IN_JS_INSTANCE] = CSS_IN_JS_INSTANCE_ID; | ||
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || CSS_IN_JS_INSTANCE_ID; | ||
document.head.appendChild(style); | ||
@@ -18,0 +16,0 @@ }); // Deduplicate of moved styles |
@@ -26,3 +26,3 @@ import * as React from 'react'; | ||
export declare let animationStatistics: Record<string, boolean>; | ||
export declare const parseStyle: (interpolation: CSSInterpolation, hashId?: string, path?: string, root?: boolean, injectHash?: boolean) => string; | ||
export declare const parseStyle: (interpolation: CSSInterpolation, hashId?: string | undefined, path?: string | undefined, root?: boolean, injectHash?: boolean) => string; | ||
/** | ||
@@ -29,0 +29,0 @@ * Register a style to the global style sheet. |
@@ -178,2 +178,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
// Clear animation statistics | ||
animationStatistics = {}; | ||
@@ -183,8 +184,11 @@ | ||
var style = updateCSS(styleStr, styleId, { | ||
mark: ATTR_MARK | ||
mark: ATTR_MARK, | ||
prepend: true | ||
}); | ||
style[CSS_IN_JS_INSTANCE] = CSS_IN_JS_INSTANCE_ID; // Used for `useCacheToken` to remove on batch when token removed | ||
// Used for `useCacheToken` to remove on batch when token removed | ||
style.setAttribute(ATTR_TOKEN, tokenKey); // Dev usage to find which cache path made this easily | ||
// Dev usage to find which cache path made this easily | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -191,0 +195,0 @@ style.setAttribute(ATTR_DEV_CACHE_PATH, fullPath.join('|')); |
@@ -5,3 +5,3 @@ "use strict"; | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
@@ -68,6 +68,2 @@ Object.defineProperty(exports, "__esModule", { | ||
var _theme = require("./theme"); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var _theme = require("./theme"); |
@@ -5,3 +5,3 @@ "use strict"; | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
@@ -19,6 +19,2 @@ Object.defineProperty(exports, "__esModule", { | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var ATTR_TOKEN = 'data-token-hash'; | ||
@@ -40,5 +36,3 @@ exports.ATTR_TOKEN = ATTR_TOKEN; | ||
Array.from(styles).forEach(function (style) { | ||
var _style$CSS_IN_JS_INST; | ||
(_style$CSS_IN_JS_INST = style[CSS_IN_JS_INSTANCE]) !== null && _style$CSS_IN_JS_INST !== void 0 ? _style$CSS_IN_JS_INST : style[CSS_IN_JS_INSTANCE] = CSS_IN_JS_INSTANCE_ID; | ||
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || CSS_IN_JS_INSTANCE_ID; | ||
document.head.appendChild(style); | ||
@@ -45,0 +39,0 @@ }); // Deduplicate of moved styles |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -26,6 +26,2 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var EMPTY_OVERRIDE = {}; // Generate different prefix to make user selector break in production env. | ||
@@ -32,0 +28,0 @@ // This helps developer not to do style override directly on the hash id. |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -20,6 +20,2 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function useClientCache(prefix, keyPath, cacheFn, onCacheRemove) { | ||
@@ -26,0 +22,0 @@ var _React$useContext = React.useContext(_StyleContext.default), |
@@ -26,3 +26,3 @@ import * as React from 'react'; | ||
export declare let animationStatistics: Record<string, boolean>; | ||
export declare const parseStyle: (interpolation: CSSInterpolation, hashId?: string, path?: string, root?: boolean, injectHash?: boolean) => string; | ||
export declare const parseStyle: (interpolation: CSSInterpolation, hashId?: string | undefined, path?: string | undefined, root?: boolean, injectHash?: boolean) => string; | ||
/** | ||
@@ -29,0 +29,0 @@ * Register a style to the global style sheet. |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof3 = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -43,6 +43,2 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
// @ts-ignore | ||
@@ -216,2 +212,3 @@ var isClientSide = (0, _canUseDom.default)(); | ||
// Clear animation statistics | ||
exports.animationStatistics = animationStatistics = {}; | ||
@@ -221,8 +218,11 @@ | ||
var style = (0, _dynamicCSS.updateCSS)(styleStr, styleId, { | ||
mark: _StyleContext.ATTR_MARK | ||
mark: _StyleContext.ATTR_MARK, | ||
prepend: true | ||
}); | ||
style[_StyleContext.CSS_IN_JS_INSTANCE] = _StyleContext.CSS_IN_JS_INSTANCE_ID; // Used for `useCacheToken` to remove on batch when token removed | ||
// Used for `useCacheToken` to remove on batch when token removed | ||
style.setAttribute(_StyleContext.ATTR_TOKEN, tokenKey); // Dev usage to find which cache path made this easily | ||
// Dev usage to find which cache path made this easily | ||
if (process.env.NODE_ENV !== 'production') { | ||
@@ -229,0 +229,0 @@ style.setAttribute(_StyleContext.ATTR_DEV_CACHE_PATH, fullPath.join('|')); |
{ | ||
"name": "@ant-design/cssinjs", | ||
"version": "0.0.0-alpha.40", | ||
"version": "0.0.0-alpha.41", | ||
"description": "Component level cssinjs resolution for antd", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
90156
1966