@uifabric/merge-styles
Advanced tools
Comparing version 6.0.2 to 6.1.0
@@ -5,2 +5,16 @@ { | ||
{ | ||
"version": "6.1.0", | ||
"tag": "@uifabric/merge-styles_v6.1.0", | ||
"date": "Thu, 07 Jun 2018 03:29:26 GMT", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"author": "David Zearing <dzearing@microsoft.com>", | ||
"commit": "58b0ef8cd0468cbd5cfab04267f2f4143444f919", | ||
"comment": "Minor changes to improve server side rendering." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "6.0.2", | ||
@@ -7,0 +21,0 @@ "tag": "@uifabric/merge-styles_v6.0.2", |
# Change Log - @uifabric/merge-styles | ||
This log was last generated on Tue, 05 Jun 2018 00:44:30 GMT and should not be manually modified. | ||
This log was last generated on Thu, 07 Jun 2018 03:29:26 GMT and should not be manually modified. | ||
## 6.1.0 | ||
Thu, 07 Jun 2018 03:29:26 GMT | ||
### Minor changes | ||
- Minor changes to improve server side rendering. | ||
## 6.0.2 | ||
@@ -6,0 +13,0 @@ Tue, 05 Jun 2018 00:44:30 GMT |
@@ -75,2 +75,193 @@ var MergeStyles = | ||
/***/ "../../common/temp/node_modules/process/browser.js": | ||
/***/ (function(module, exports) { | ||
// shim for using process in browser | ||
var process = module.exports = {}; | ||
// cached from whatever global is present so that test runners that stub it | ||
// don't break things. But we need to wrap it in a try catch in case it is | ||
// wrapped in strict mode code which doesn't define any globals. It's inside a | ||
// function because try/catches deoptimize in certain engines. | ||
var cachedSetTimeout; | ||
var cachedClearTimeout; | ||
function defaultSetTimout() { | ||
throw new Error('setTimeout has not been defined'); | ||
} | ||
function defaultClearTimeout () { | ||
throw new Error('clearTimeout has not been defined'); | ||
} | ||
(function () { | ||
try { | ||
if (typeof setTimeout === 'function') { | ||
cachedSetTimeout = setTimeout; | ||
} else { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
} catch (e) { | ||
cachedSetTimeout = defaultSetTimout; | ||
} | ||
try { | ||
if (typeof clearTimeout === 'function') { | ||
cachedClearTimeout = clearTimeout; | ||
} else { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} catch (e) { | ||
cachedClearTimeout = defaultClearTimeout; | ||
} | ||
} ()) | ||
function runTimeout(fun) { | ||
if (cachedSetTimeout === setTimeout) { | ||
//normal enviroments in sane situations | ||
return setTimeout(fun, 0); | ||
} | ||
// if setTimeout wasn't available but was latter defined | ||
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | ||
cachedSetTimeout = setTimeout; | ||
return setTimeout(fun, 0); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedSetTimeout(fun, 0); | ||
} catch(e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedSetTimeout.call(null, fun, 0); | ||
} catch(e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | ||
return cachedSetTimeout.call(this, fun, 0); | ||
} | ||
} | ||
} | ||
function runClearTimeout(marker) { | ||
if (cachedClearTimeout === clearTimeout) { | ||
//normal enviroments in sane situations | ||
return clearTimeout(marker); | ||
} | ||
// if clearTimeout wasn't available but was latter defined | ||
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | ||
cachedClearTimeout = clearTimeout; | ||
return clearTimeout(marker); | ||
} | ||
try { | ||
// when when somebody has screwed with setTimeout but no I.E. maddness | ||
return cachedClearTimeout(marker); | ||
} catch (e){ | ||
try { | ||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | ||
return cachedClearTimeout.call(null, marker); | ||
} catch (e){ | ||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | ||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | ||
return cachedClearTimeout.call(this, marker); | ||
} | ||
} | ||
} | ||
var queue = []; | ||
var draining = false; | ||
var currentQueue; | ||
var queueIndex = -1; | ||
function cleanUpNextTick() { | ||
if (!draining || !currentQueue) { | ||
return; | ||
} | ||
draining = false; | ||
if (currentQueue.length) { | ||
queue = currentQueue.concat(queue); | ||
} else { | ||
queueIndex = -1; | ||
} | ||
if (queue.length) { | ||
drainQueue(); | ||
} | ||
} | ||
function drainQueue() { | ||
if (draining) { | ||
return; | ||
} | ||
var timeout = runTimeout(cleanUpNextTick); | ||
draining = true; | ||
var len = queue.length; | ||
while(len) { | ||
currentQueue = queue; | ||
queue = []; | ||
while (++queueIndex < len) { | ||
if (currentQueue) { | ||
currentQueue[queueIndex].run(); | ||
} | ||
} | ||
queueIndex = -1; | ||
len = queue.length; | ||
} | ||
currentQueue = null; | ||
draining = false; | ||
runClearTimeout(timeout); | ||
} | ||
process.nextTick = function (fun) { | ||
var args = new Array(arguments.length - 1); | ||
if (arguments.length > 1) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
} | ||
queue.push(new Item(fun, args)); | ||
if (queue.length === 1 && !draining) { | ||
runTimeout(drainQueue); | ||
} | ||
}; | ||
// v8 likes predictible objects | ||
function Item(fun, array) { | ||
this.fun = fun; | ||
this.array = array; | ||
} | ||
Item.prototype.run = function () { | ||
this.fun.apply(null, this.array); | ||
}; | ||
process.title = 'browser'; | ||
process.browser = true; | ||
process.env = {}; | ||
process.argv = []; | ||
process.version = ''; // empty string to avoid regexp issues | ||
process.versions = {}; | ||
function noop() {} | ||
process.on = noop; | ||
process.addListener = noop; | ||
process.once = noop; | ||
process.off = noop; | ||
process.removeListener = noop; | ||
process.removeAllListeners = noop; | ||
process.emit = noop; | ||
process.prependListener = noop; | ||
process.prependOnceListener = noop; | ||
process.listeners = function (name) { return [] } | ||
process.binding = function (name) { | ||
throw new Error('process.binding is not supported'); | ||
}; | ||
process.cwd = function () { return '/' }; | ||
process.chdir = function (dir) { | ||
throw new Error('process.chdir is not supported'); | ||
}; | ||
process.umask = function() { return 0; }; | ||
/***/ }), | ||
/***/ "../../common/temp/node_modules/tslib/tslib.es6.js": | ||
@@ -289,3 +480,3 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectionMode", function() { return InjectionMode; }); | ||
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectionMode", function() { return InjectionMode; }); | ||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Stylesheet", function() { return Stylesheet; }); | ||
@@ -315,2 +506,4 @@ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../common/temp/node_modules/tslib/tslib.es6.js"); | ||
var STYLESHEET_SETTING = '__stylesheet__'; | ||
// tslint:disable-next-line:no-any | ||
var _fileScopedGlobal = {}; | ||
var _stylesheet; | ||
@@ -327,8 +520,10 @@ /** | ||
this._rules = []; | ||
this._preservedRules = []; | ||
this._rulesToInsert = []; | ||
this._counter = 0; | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks = []; | ||
// tslint:disable-next-line:no-any | ||
this._classNameToArgs = {}; | ||
this._config = tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css' }, config); | ||
this._config = tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css', namespace: undefined }, config); | ||
} | ||
@@ -340,8 +535,8 @@ /** | ||
// tslint:disable-next-line:no-any | ||
var win = typeof window !== 'undefined' ? window : {}; | ||
_stylesheet = win[STYLESHEET_SETTING]; | ||
var global = typeof window !== 'undefined' ? window : typeof process !== 'undefined' ? process : _fileScopedGlobal; | ||
_stylesheet = global[STYLESHEET_SETTING]; | ||
if (!_stylesheet) { | ||
// tslint:disable-next-line:no-string-literal | ||
var fabricConfig = (win && win['FabricConfig']) || {}; | ||
_stylesheet = win[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
var fabricConfig = (global && global['FabricConfig']) || {}; | ||
_stylesheet = global[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
} | ||
@@ -357,2 +552,10 @@ return _stylesheet; | ||
/** | ||
* Configures a reset callback. | ||
* | ||
* @param callback - A callback which will be called when the Stylesheet is reset. | ||
*/ | ||
Stylesheet.prototype.onReset = function (callback) { | ||
this._onResetCallbacks.push(callback); | ||
}; | ||
/** | ||
* Generates a unique classname. | ||
@@ -363,4 +566,5 @@ * | ||
Stylesheet.prototype.getClassName = function (displayName) { | ||
var namespace = this._config.namespace; | ||
var prefix = displayName || this._config.defaultPrefix; | ||
return prefix + "-" + this._counter++; | ||
return "" + (namespace ? namespace + '-' : '') + prefix + "-" + this._counter++; | ||
}; | ||
@@ -391,18 +595,22 @@ /** | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.args; | ||
return (entry && entry.args); | ||
}; | ||
/** | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
Stylesheet.prototype.insertedRulesFromClassName = function (className) { | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.rules; | ||
return (entry && entry.rules); | ||
}; | ||
/** | ||
* Inserts a css rule into the stylesheet. | ||
* @param preserve - Preserves the rule beyond a reset boundary. | ||
*/ | ||
Stylesheet.prototype.insertRule = function (rule) { | ||
Stylesheet.prototype.insertRule = function (rule, preserve) { | ||
var injectionMode = this._config.injectionMode; | ||
var element = injectionMode !== 0 /* none */ ? this._getStyleElement() : undefined; | ||
if (preserve) { | ||
this._preservedRules.push(rule); | ||
} | ||
if (element) { | ||
@@ -437,4 +645,4 @@ switch (this._config.injectionMode) { | ||
*/ | ||
Stylesheet.prototype.getRules = function () { | ||
return (this._rules.join('') || '') + (this._rulesToInsert.join('') || ''); | ||
Stylesheet.prototype.getRules = function (includePreservedRules) { | ||
return (includePreservedRules ? this._preservedRules.join('') : '') + this._rules.join('') + this._rulesToInsert.join(''); | ||
}; | ||
@@ -451,2 +659,3 @@ /** | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks.forEach(function (callback) { return callback(); }); | ||
}; | ||
@@ -485,2 +694,3 @@ // Forces the regeneration of incoming styles without totally resetting the stylesheet. | ||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../../common/temp/node_modules/process/browser.js"))) | ||
@@ -604,3 +814,3 @@ /***/ }), | ||
function fontFace(font) { | ||
_Stylesheet__WEBPACK_IMPORTED_MODULE_0__["Stylesheet"].getInstance().insertRule("@font-face{" + Object(_styleToClassName__WEBPACK_IMPORTED_MODULE_1__["serializeRuleEntries"])(font) + "}"); | ||
_Stylesheet__WEBPACK_IMPORTED_MODULE_0__["Stylesheet"].getInstance().insertRule("@font-face{" + Object(_styleToClassName__WEBPACK_IMPORTED_MODULE_1__["serializeRuleEntries"])(font) + "}", true); | ||
} | ||
@@ -717,3 +927,3 @@ | ||
var rules = rulesArray.join(''); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}"); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}", true); | ||
stylesheet.cacheClassName(name, rules, [], ['keyframes', rules]); | ||
@@ -720,0 +930,0 @@ return name; |
@@ -1,2 +0,2 @@ | ||
var MergeStyles=function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t); | ||
var MergeStyles=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return r}),n.d(t,"b",function(){return a});var r,i=n(1);!function(e){e[e.none=0]="none",e[e.insertNode=1]="insertNode",e[e.appendChild=2]="appendChild"}(r||(r={}));var s,o={},a=function(){function t(e){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=i.a({injectionMode:1,defaultPrefix:"css",namespace:void 0},e)}return t.getInstance=function(){var n="undefined"!=typeof window?window:void 0!==e?e:o;if(!(s=n.__stylesheet__)){var r=n&&n.FabricConfig||{};s=n.__stylesheet__=new t(r.mergeStyles)}return s},t.prototype.setConfig=function(e){this._config=i.a({},this._config,e)},t.prototype.onReset=function(e){this._onResetCallbacks.push(e)},t.prototype.getClassName=function(e){var t=this._config.namespace,n=e||this._config.defaultPrefix;return(t?t+"-":"")+n+"-"+this._counter++},t.prototype.cacheClassName=function(e,t,n,r){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:n,rules:r}},t.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},t.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},t.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},t.prototype.insertRule=function(e,t){var n=0!==this._config.injectionMode?this._getStyleElement():void 0;if(t&&this._preservedRules.push(e),n)switch(this._config.injectionMode){case 1:var r=n.sheet;try{r.insertRule(e,r.cssRules.length)}catch(e){}break;case 2:n.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},t.prototype.getRules=function(e){return(e?this._preservedRules.join(""):"")+this._rules.join("")+this._rulesToInsert.join("")},t.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach(function(e){return e()})},t.prototype.resetKeys=function(){this._keyToClassName={}},t.prototype._getStyleElement=function(){var e=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),window.requestAnimationFrame(function(){e._styleElement=void 0})),this._styleElement},t.prototype._createStyleElement=function(){var e=document.createElement("style");return e.setAttribute("data-merge-styles","true"),e.type="text/css",this._lastStyleElement&&this._lastStyleElement.nextElementSibling?document.head.insertBefore(e,this._lastStyleElement.nextElementSibling):document.head.appendChild(e),this._lastStyleElement=e,e},t}()}).call(this,n(3))},function(e,t,n){"use strict";n.d(t,"a",function(){return r}); | ||
/*! ***************************************************************************** | ||
@@ -16,3 +16,3 @@ Copyright (c) Microsoft Corporation. All rights reserved. | ||
***************************************************************************** */ | ||
Object.setPrototypeOf||Array;var n,s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e};!function(e){e[e.none=0]="none",e[e.insertNode=1]="insertNode",e[e.appendChild=2]="appendChild"}(n||(n={}));var i,o,a=function(){function e(e){this._rules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._classNameToArgs={},this._config=s({injectionMode:1,defaultPrefix:"css"},e)}return e.getInstance=function(){var t="undefined"!=typeof window?window:{};if(!(i=t.__stylesheet__)){var r=t&&t.FabricConfig||{};i=t.__stylesheet__=new e(r.mergeStyles)}return i},e.prototype.setConfig=function(e){this._config=s({},this._config,e)},e.prototype.getClassName=function(e){return(e||this._config.defaultPrefix)+"-"+this._counter++},e.prototype.cacheClassName=function(e,t,r,n){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:r,rules:n}},e.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},e.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},e.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},e.prototype.insertRule=function(e){var t=0!==this._config.injectionMode?this._getStyleElement():void 0;if(t)switch(this._config.injectionMode){case 1:var r=t.sheet;try{r.insertRule(e,r.cssRules.length)}catch(e){}break;case 2:t.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},e.prototype.getRules=function(){return(this._rules.join("")||"")+(this._rulesToInsert.join("")||"")},e.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={}},e.prototype.resetKeys=function(){this._keyToClassName={}},e.prototype._getStyleElement=function(){var e=this;return this._styleElement||"undefined"==typeof document||(this._styleElement=this._createStyleElement(),window.requestAnimationFrame(function(){e._styleElement=void 0})),this._styleElement},e.prototype._createStyleElement=function(){var e=document.createElement("style");return e.setAttribute("data-merge-styles","true"),e.type="text/css",this._lastStyleElement&&this._lastStyleElement.nextElementSibling?document.head.insertBefore(e,this._lastStyleElement.nextElementSibling):document.head.appendChild(e),this._lastStyleElement=e,e},e}();var l={"user-select":1};function f(e,t){var r=function(){if(!o){var e="undefined"!=typeof document?document:void 0,t="undefined"!=typeof navigator?navigator:void 0,r=t?t.userAgent.toLowerCase():void 0;o=e?{isWebkit:!!(e&&"WebkitAppearance"in e.documentElement.style),isMoz:!!(r&&r.indexOf("firefox")>-1),isOpera:!!(r&&r.indexOf("opera")>-1),isMs:!(!t||!/rv:11.0/i.test(t.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return o}(),n=e[t];if(l[n]){var s=e[t+1];l[n]&&(r.isWebkit&&e.push("-webkit-"+n,s),r.isMoz&&e.push("-moz-"+n,s),r.isMs&&e.push("-ms-"+n,s),r.isOpera&&e.push("-o-"+n,s))}}var u=["column-count","font-weight","flex-basis","flex","flex-grow","flex-shrink","fill-opacity","opacity","order","z-index","zoom"];function c(e,t){var r=e[t],n=e[t+1];if("number"==typeof n){var s=-1===u.indexOf(r)?"px":"";e[t+1]=""+n+s}}var p,d="left",h="right",v="@noflip",g=((p={})[d]=h,p[h]=d,p),y={"w-resize":"e-resize","sw-resize":"se-resize","nw-resize":"ne-resize"},m=N();function _(e){m!==e&&(a.getInstance().resetKeys(),m=e)}function N(){return void 0===m&&(m="undefined"!=typeof document&&!!document.documentElement&&"rtl"===document.documentElement.getAttribute("dir")),m}function x(e,t){if(N()){var r=e[t];if(!r)return;var n=e[t+1];if("string"==typeof n&&n.indexOf(v)>=0)e[t+1]=n.replace(/\s*(?:\/\*\s*)?\@noflip\b(?:\s*\*\/)?\s*?/g,"");else if(r.indexOf(d)>=0)e[t]=r.replace(d,h);else if(r.indexOf(h)>=0)e[t]=r.replace(h,d);else if(String(n).indexOf(d)>=0)e[t+1]=n.replace(d,h);else if(String(n).indexOf(h)>=0)e[t+1]=n.replace(h,d);else if(g[r])e[t]=g[r];else if(y[n])e[t+1]=y[n];else switch(r){case"margin":case"padding":e[t+1]=function(e){if("string"==typeof e){var t=e.split(" ");if(4===t.length)return t[0]+" "+t[3]+" "+t[2]+" "+t[1]}return e}(n);break;case"box-shadow":e[t+1]=function(e,t){var r=e.split(" "),n=parseInt(r[t],10);return r[0]=r[0].replace(String(n),String(-1*n)),r.join(" ")}(n,0)}}}var O="displayName";function b(e,t,r){var n="string"==typeof r?r.split(" "):[r];e[t+"Top"]=n[0],e[t+"Right"]=n[1]||n[0],e[t+"Bottom"]=n[2]||n[0],e[t+"Left"]=n[3]||n[1]||n[0]}function w(e){if(!e)return"";var t,r,n=[];for(var s in e)e.hasOwnProperty(s)&&s!==O&&void 0!==e[s]&&n.push(s,e[s]);for(var i=0;i<n.length;i+=2)(t=n)[r=i]=t[r].replace(/([A-Z])/g,"-$1").toLowerCase(),c(n,i),x(n,i),f(n,i);for(i=1;i<n.length;i+=4)n.splice(i,1,":",n[i],";");return n.join("")}function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=function e(t,r,n){void 0===r&&(r={__order:[]}),void 0===n&&(n="&");var s=a.getInstance(),i=r[n];i||(i={},r[n]=i,r.__order.push(n));for(var o=0,l=t;o<l.length;o++){var f=l[o];if("string"==typeof f){var u=s.argsFromClassName(f);u&&e(u,r,n)}else if(Array.isArray(f))e(f,r,n);else for(var c in f)if("selectors"===c){var p=f.selectors;for(var d in p)if(p.hasOwnProperty(d)){var h=p[d];0===d.indexOf(":global(")?d=d.replace(/:global\(|\)$/g,""):0===d.indexOf("@media")?d=d+"{"+n:0===d.indexOf(":")?d=n+d:d.indexOf("&")<0&&(d=n+" "+d),e([h],r,d)}}else"margin"===c||"padding"===c?b(i,c,f[c]):i[c]=f[c]}return r}(e),n=function(e){for(var t=[],r=!1,n=0,s=e.__order;n<s.length;n++){var i=s[n];t.push(i);var o=e[i];for(var a in o)o.hasOwnProperty(a)&&void 0!==o[a]&&(r=!0,t.push(a,o[a]))}return r?t.join(""):void 0}(r);if(n){var s=a.getInstance(),i={className:s.classNameFromKey(n),key:n,args:e};if(!i.className){i.className=s.getClassName(function(e){var t=e&&e["&"];return t?t.displayName:void 0}(r));for(var o=[],l=0,f=r.__order;l<f.length;l++){var u=f[l];o.push(u,w(r[u]))}i.rulesToInsert=o}return i}}function j(e,t){var r=a.getInstance(),n=e.className,s=e.key,i=e.args,o=e.rulesToInsert;if(o){for(var l=0;l<o.length;l+=2){var f=o[l+1];if(f){var u=o[l],c=(u=u.replace(/(&)|\$([\w-]+)\b/g,function(r,n,s){return n?"."+e.className:s?"."+(t&&t[s]||s):""}))+"{"+f+"}"+(0===u.indexOf("@media")?"}":"");r.insertRule(c)}}r.cacheClassName(n,s,i,o)}}function A(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=[],n=[],s=a.getInstance();return function e(t){for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a)if("string"==typeof a)if(a.indexOf(" ")>=0)e(a.split(" "));else{var l=s.argsFromClassName(a);l?e(l):-1===r.indexOf(a)&&r.push(a)}else Array.isArray(a)?e(a):"object"==typeof a&&n.push(a)}}(e),{classes:r,objects:n}}function S(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=A(e),n=r.classes,s=r.objects;return s.length&&n.push(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=C.apply(void 0,e);return r?(j(r),r.className):""}(s)),n.join(" ")}function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0,s=e;n<s.length;n++){var i=s[n];if(i)for(var o in i)if(i.hasOwnProperty(o)){var a=r[o],l=i[o];r[o]=void 0===a?l:(Array.isArray(a)?a:[a]).concat(Array.isArray(l)?l:[l])}}return r}function k(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={},n={},s=e[0];if(s){e.length>1&&(s=E.apply(void 0,e));var i=[];for(var o in s)if(s.hasOwnProperty(o)){var a=A(s[o]),l=a.classes,f=C({displayName:o},a.objects);i.push(f),f&&(n[o]=f.className,r[o]=l.concat([f.className]).join(" "))}for(var u=0,c=i;u<c.length;u++){(f=c[u])&&j(f,n)}}return r}function T(e){a.getInstance().insertRule("@font-face{"+w(e)+"}")}function I(e){var t=a.getInstance(),r=t.getClassName(),n=[];for(var s in e)e.hasOwnProperty(s)&&n.push(s,"{",w(e[s]),"}");var i=n.join("");return t.insertRule("@keyframes "+r+"{"+i+"}"),t.cacheClassName(r,i,[],["keyframes",i]),r}r.d(t,"mergeStyles",function(){return S}),r.d(t,"mergeStyleSets",function(){return k}),r.d(t,"concatStyleSets",function(){return E}),r.d(t,"fontFace",function(){return T}),r.d(t,"keyframes",function(){return I}),r.d(t,"InjectionMode",function(){return n}),r.d(t,"Stylesheet",function(){return a}),r.d(t,"setRTL",function(){return _})}]); | ||
Object.setPrototypeOf||Array;var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}},function(e,t,n){"use strict";n.r(t);var r,i=n(0);var s={"user-select":1};function o(e,t){var n=function(){if(!r){var e="undefined"!=typeof document?document:void 0,t="undefined"!=typeof navigator?navigator:void 0,n=t?t.userAgent.toLowerCase():void 0;r=e?{isWebkit:!!(e&&"WebkitAppearance"in e.documentElement.style),isMoz:!!(n&&n.indexOf("firefox")>-1),isOpera:!!(n&&n.indexOf("opera")>-1),isMs:!(!t||!/rv:11.0/i.test(t.userAgent)&&!/Edge\/\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return r}(),i=e[t];if(s[i]){var o=e[t+1];s[i]&&(n.isWebkit&&e.push("-webkit-"+i,o),n.isMoz&&e.push("-moz-"+i,o),n.isMs&&e.push("-ms-"+i,o),n.isOpera&&e.push("-o-"+i,o))}}var a=["column-count","font-weight","flex-basis","flex","flex-grow","flex-shrink","fill-opacity","opacity","order","z-index","zoom"];function u(e,t){var n=e[t],r=e[t+1];if("number"==typeof r){var i=-1===a.indexOf(n)?"px":"";e[t+1]=""+r+i}}var c,l="left",f="right",p="@noflip",h=((c={})[l]=f,c[f]=l,c),d={"w-resize":"e-resize","sw-resize":"se-resize","nw-resize":"ne-resize"},v=g();function m(e){v!==e&&(i.b.getInstance().resetKeys(),v=e)}function g(){return void 0===v&&(v="undefined"!=typeof document&&!!document.documentElement&&"rtl"===document.documentElement.getAttribute("dir")),v}function y(e,t){if(g()){var n=e[t];if(!n)return;var r=e[t+1];if("string"==typeof r&&r.indexOf(p)>=0)e[t+1]=r.replace(/\s*(?:\/\*\s*)?\@noflip\b(?:\s*\*\/)?\s*?/g,"");else if(n.indexOf(l)>=0)e[t]=n.replace(l,f);else if(n.indexOf(f)>=0)e[t]=n.replace(f,l);else if(String(r).indexOf(l)>=0)e[t+1]=r.replace(l,f);else if(String(r).indexOf(f)>=0)e[t+1]=r.replace(f,l);else if(h[n])e[t]=h[n];else if(d[r])e[t+1]=d[r];else switch(n){case"margin":case"padding":e[t+1]=function(e){if("string"==typeof e){var t=e.split(" ");if(4===t.length)return t[0]+" "+t[3]+" "+t[2]+" "+t[1]}return e}(r);break;case"box-shadow":e[t+1]=function(e,t){var n=e.split(" "),r=parseInt(n[t],10);return n[0]=n[0].replace(String(r),String(-1*r)),n.join(" ")}(r,0)}}}var _="displayName";function b(e,t,n){var r="string"==typeof n?n.split(" "):[n];e[t+"Top"]=r[0],e[t+"Right"]=r[1]||r[0],e[t+"Bottom"]=r[2]||r[0],e[t+"Left"]=r[3]||r[1]||r[0]}function w(e){if(!e)return"";var t,n,r=[];for(var i in e)e.hasOwnProperty(i)&&i!==_&&void 0!==e[i]&&r.push(i,e[i]);for(var s=0;s<r.length;s+=2)(t=r)[n=s]=t[n].replace(/([A-Z])/g,"-$1").toLowerCase(),u(r,s),y(r,s),o(r,s);for(s=1;s<r.length;s+=4)r.splice(s,1,":",r[s],";");return r.join("")}function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function e(t,n,r){void 0===n&&(n={__order:[]}),void 0===r&&(r="&");var s=i.b.getInstance(),o=n[r];o||(o={},n[r]=o,n.__order.push(r));for(var a=0,u=t;a<u.length;a++){var c=u[a];if("string"==typeof c){var l=s.argsFromClassName(c);l&&e(l,n,r)}else if(Array.isArray(c))e(c,n,r);else for(var f in c)if("selectors"===f){var p=c.selectors;for(var h in p)if(p.hasOwnProperty(h)){var d=p[h];0===h.indexOf(":global(")?h=h.replace(/:global\(|\)$/g,""):0===h.indexOf("@media")?h=h+"{"+r:0===h.indexOf(":")?h=r+h:h.indexOf("&")<0&&(h=r+" "+h),e([d],n,h)}}else"margin"===f||"padding"===f?b(o,f,c[f]):o[f]=c[f]}return n}(e),r=function(e){for(var t=[],n=!1,r=0,i=e.__order;r<i.length;r++){var s=i[r];t.push(s);var o=e[s];for(var a in o)o.hasOwnProperty(a)&&void 0!==o[a]&&(n=!0,t.push(a,o[a]))}return n?t.join(""):void 0}(n);if(r){var s=i.b.getInstance(),o={className:s.classNameFromKey(r),key:r,args:e};if(!o.className){o.className=s.getClassName(function(e){var t=e&&e["&"];return t?t.displayName:void 0}(n));for(var a=[],u=0,c=n.__order;u<c.length;u++){var l=c[u];a.push(l,w(n[l]))}o.rulesToInsert=a}return o}}function N(e,t){var n=i.b.getInstance(),r=e.className,s=e.key,o=e.args,a=e.rulesToInsert;if(a){for(var u=0;u<a.length;u+=2){var c=a[u+1];if(c){var l=a[u],f=(l=l.replace(/(&)|\$([\w-]+)\b/g,function(n,r,i){return r?"."+e.className:i?"."+(t&&t[i]||i):""}))+"{"+c+"}"+(0===l.indexOf("@media")?"}":"");n.insertRule(f)}}n.cacheClassName(r,s,o,a)}}function T(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[],r=[],s=i.b.getInstance();return function e(t){for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a)if("string"==typeof a)if(a.indexOf(" ")>=0)e(a.split(" "));else{var u=s.argsFromClassName(a);u?e(u):-1===n.indexOf(a)&&n.push(a)}else Array.isArray(a)?e(a):"object"==typeof a&&r.push(a)}}(e),{classes:n,objects:r}}function O(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=T(e),r=n.classes,i=n.objects;return i.length&&r.push(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=x.apply(void 0,e);return n?(N(n),n.className):""}(i)),r.join(" ")}function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},r=0,i=e;r<i.length;r++){var s=i[r];if(s)for(var o in s)if(s.hasOwnProperty(o)){var a=n[o],u=s[o];n[o]=void 0===a?u:(Array.isArray(a)?a:[a]).concat(Array.isArray(u)?u:[u])}}return n}function A(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n={},r={},i=e[0];if(i){e.length>1&&(i=C.apply(void 0,e));var s=[];for(var o in i)if(i.hasOwnProperty(o)){var a=T(i[o]),u=a.classes,c=x({displayName:o},a.objects);s.push(c),c&&(r[o]=c.className,n[o]=u.concat([c.className]).join(" "))}for(var l=0,f=s;l<f.length;l++){(c=f[l])&&N(c,r)}}return n}function E(e){i.b.getInstance().insertRule("@font-face{"+w(e)+"}",!0)}function j(e){var t=i.b.getInstance(),n=t.getClassName(),r=[];for(var s in e)e.hasOwnProperty(s)&&r.push(s,"{",w(e[s]),"}");var o=r.join("");return t.insertRule("@keyframes "+n+"{"+o+"}",!0),t.cacheClassName(n,o,[],["keyframes",o]),n}n.d(t,"mergeStyles",function(){return O}),n.d(t,"mergeStyleSets",function(){return A}),n.d(t,"concatStyleSets",function(){return C}),n.d(t,"fontFace",function(){return E}),n.d(t,"keyframes",function(){return j}),n.d(t,"InjectionMode",function(){return i.a}),n.d(t,"Stylesheet",function(){return i.b}),n.d(t,"setRTL",function(){return m})},function(e,t){var n,r,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}]); | ||
//# sourceMappingURL=merge-styles.min.js.map |
@@ -7,5 +7,5 @@ { | ||
"version": "4.7.0", | ||
"hash": "d29c62904ed3df8fdb73", | ||
"time": 1573, | ||
"builtAt": 1528158787113, | ||
"hash": "6191da76078c5855b2ca", | ||
"time": 1362, | ||
"builtAt": 1528341387534, | ||
"publicPath": "", | ||
@@ -22,3 +22,3 @@ "outputPath": "D:\\a\\1\\s\\packages\\merge-styles\\dist", | ||
"name": "merge-styles.min.js", | ||
"size": 9743, | ||
"size": 11963, | ||
"chunks": [ | ||
@@ -67,7 +67,113 @@ 0 | ||
"id": 0, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js 99bf6bb01f3ee7902b489eae7332df9d", | ||
"name": "./lib/index.js + 14 modules", | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"name": "./lib/Stylesheet.js", | ||
"index": 3, | ||
"index2": 2, | ||
"size": 7721, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [ | ||
0 | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"issuerId": null, | ||
"issuerName": "./lib/index.js", | ||
"issuerPath": [ | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"name": "./lib/index.js" | ||
} | ||
], | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"assets": [ | ||
], | ||
"usedExports": [ | ||
"InjectionMode", | ||
"Stylesheet" | ||
], | ||
"providedExports": [ | ||
"InjectionMode", | ||
"Stylesheet" | ||
], | ||
"optimizationBailout": [ | ||
"ModuleConcatenation bailout: Module uses injected variables (process)" | ||
], | ||
"depth": 1, | ||
"parsedSrc": "function(e,t,n){\"use strict\";(function(e){n.d(t,\"a\",function(){return r}),n.d(t,\"b\",function(){return a});var r,i=n(1);!function(e){e[e.none=0]=\"none\",e[e.insertNode=1]=\"insertNode\",e[e.appendChild=2]=\"appendChild\"}(r||(r={}));var s,o={},a=function(){function t(e){this._rules=[],this._preservedRules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._onResetCallbacks=[],this._classNameToArgs={},this._config=i.a({injectionMode:1,defaultPrefix:\"css\",namespace:void 0},e)}return t.getInstance=function(){var n=\"undefined\"!=typeof window?window:void 0!==e?e:o;if(!(s=n.__stylesheet__)){var r=n&&n.FabricConfig||{};s=n.__stylesheet__=new t(r.mergeStyles)}return s},t.prototype.setConfig=function(e){this._config=i.a({},this._config,e)},t.prototype.onReset=function(e){this._onResetCallbacks.push(e)},t.prototype.getClassName=function(e){var t=this._config.namespace,n=e||this._config.defaultPrefix;return(t?t+\"-\":\"\")+n+\"-\"+this._counter++},t.prototype.cacheClassName=function(e,t,n,r){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:n,rules:r}},t.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},t.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},t.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},t.prototype.insertRule=function(e,t){var n=0!==this._config.injectionMode?this._getStyleElement():void 0;if(t&&this._preservedRules.push(e),n)switch(this._config.injectionMode){case 1:var r=n.sheet;try{r.insertRule(e,r.cssRules.length)}catch(e){}break;case 2:n.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},t.prototype.getRules=function(e){return(e?this._preservedRules.join(\"\"):\"\")+this._rules.join(\"\")+this._rulesToInsert.join(\"\")},t.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={},this._onResetCallbacks.forEach(function(e){return e()})},t.prototype.resetKeys=function(){this._keyToClassName={}},t.prototype._getStyleElement=function(){var e=this;return this._styleElement||\"undefined\"==typeof document||(this._styleElement=this._createStyleElement(),window.requestAnimationFrame(function(){e._styleElement=void 0})),this._styleElement},t.prototype._createStyleElement=function(){var e=document.createElement(\"style\");return e.setAttribute(\"data-merge-styles\",\"true\"),e.type=\"text/css\",this._lastStyleElement&&this._lastStyleElement.nextElementSibling?document.head.insertBefore(e,this._lastStyleElement.nextElementSibling):document.head.appendChild(e),this._lastStyleElement=e,e},t}()}).call(this,n(3))}" | ||
}, | ||
{ | ||
"id": 1, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\common\\temp\\node_modules\\tslib\\tslib.es6.js", | ||
"name": "D:/a/1/s/common/temp/node_modules/tslib/tslib.es6.js", | ||
"index": 5, | ||
"index2": 1, | ||
"size": 8863, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [ | ||
0 | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"issuerId": 0, | ||
"issuerName": "./lib/Stylesheet.js", | ||
"issuerPath": [ | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"name": "./lib/index.js" | ||
}, | ||
{ | ||
"id": 0, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"name": "./lib/Stylesheet.js" | ||
} | ||
], | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"assets": [ | ||
], | ||
"usedExports": [ | ||
"__assign" | ||
], | ||
"providedExports": [ | ||
"__extends", | ||
"__assign", | ||
"__rest", | ||
"__decorate", | ||
"__param", | ||
"__metadata", | ||
"__awaiter", | ||
"__generator", | ||
"__exportStar", | ||
"__values", | ||
"__read", | ||
"__spread", | ||
"__await", | ||
"__asyncGenerator", | ||
"__asyncDelegator", | ||
"__asyncValues", | ||
"__makeTemplateObject", | ||
"__importStar", | ||
"__importDefault" | ||
], | ||
"optimizationBailout": [ | ||
], | ||
"depth": 2, | ||
"parsedSrc": "function(e,t,n){\"use strict\";n.d(t,\"a\",function(){return r});\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nObject.setPrototypeOf||Array;var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}}" | ||
}, | ||
{ | ||
"id": 2, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js 15278a0eca825d6e6b1e17aa9903a43d", | ||
"name": "./lib/index.js + 12 modules", | ||
"index": 0, | ||
"index2": 14, | ||
"size": 35633, | ||
"index2": 15, | ||
"size": 19969, | ||
"cacheable": true, | ||
@@ -101,2 +207,3 @@ "built": true, | ||
"optimizationBailout": [ | ||
"ModuleConcatenation bailout: Cannot concat with ./lib/Stylesheet.js (<- Module uses injected variables (process))" | ||
], | ||
@@ -107,7 +214,7 @@ "depth": 0, | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\mergeStyles.js", | ||
"name": "./lib/mergeStyles.js", | ||
"index": 1, | ||
"index2": 9, | ||
"size": 579, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\concatStyleSets.js", | ||
"name": "./lib/concatStyleSets.js", | ||
"index": 13, | ||
"index2": 11, | ||
"size": 1093, | ||
"cacheable": true, | ||
@@ -135,6 +242,6 @@ "built": true, | ||
"usedExports": [ | ||
"mergeStyles" | ||
"concatStyleSets" | ||
], | ||
"providedExports": [ | ||
"mergeStyles" | ||
"concatStyleSets" | ||
], | ||
@@ -150,3 +257,3 @@ "optimizationBailout": [ | ||
"index": 0, | ||
"index2": 14, | ||
"index2": 15, | ||
"size": 345, | ||
@@ -188,5 +295,5 @@ "cacheable": true, | ||
"name": "./lib/fontFace.js", | ||
"index": 13, | ||
"index2": 12, | ||
"size": 282, | ||
"index": 14, | ||
"index2": 13, | ||
"size": 288, | ||
"cacheable": true, | ||
@@ -225,7 +332,7 @@ "built": true, | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\mergeStyleSets.js", | ||
"name": "./lib/mergeStyleSets.js", | ||
"index": 11, | ||
"index2": 11, | ||
"size": 1707, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\transforms\\rtlifyRules.js", | ||
"name": "./lib/transforms/rtlifyRules.js", | ||
"index": 9, | ||
"index2": 6, | ||
"size": 3146, | ||
"cacheable": true, | ||
@@ -253,6 +360,9 @@ "built": true, | ||
"usedExports": [ | ||
"mergeStyleSets" | ||
"setRTL", | ||
"rtlifyRules" | ||
], | ||
"providedExports": [ | ||
"mergeStyleSets" | ||
"setRTL", | ||
"getRTL", | ||
"rtlifyRules" | ||
], | ||
@@ -265,7 +375,7 @@ "optimizationBailout": [ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\concatStyleSets.js", | ||
"name": "./lib/concatStyleSets.js", | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\mergeStyleSets.js", | ||
"name": "./lib/mergeStyleSets.js", | ||
"index": 12, | ||
"index2": 10, | ||
"size": 1093, | ||
"index2": 12, | ||
"size": 1707, | ||
"cacheable": true, | ||
@@ -293,6 +403,6 @@ "built": true, | ||
"usedExports": [ | ||
"concatStyleSets" | ||
"mergeStyleSets" | ||
], | ||
"providedExports": [ | ||
"concatStyleSets" | ||
"mergeStyleSets" | ||
], | ||
@@ -305,7 +415,7 @@ "optimizationBailout": [ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\transforms\\rtlifyRules.js", | ||
"name": "./lib/transforms/rtlifyRules.js", | ||
"index": 8, | ||
"index2": 5, | ||
"size": 3146, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\mergeStyles.js", | ||
"name": "./lib/mergeStyles.js", | ||
"index": 1, | ||
"index2": 10, | ||
"size": 579, | ||
"cacheable": true, | ||
@@ -333,9 +443,6 @@ "built": true, | ||
"usedExports": [ | ||
"setRTL", | ||
"rtlifyRules" | ||
"mergeStyles" | ||
], | ||
"providedExports": [ | ||
"setRTL", | ||
"getRTL", | ||
"rtlifyRules" | ||
"mergeStyles" | ||
], | ||
@@ -348,47 +455,7 @@ "optimizationBailout": [ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"name": "./lib/Stylesheet.js", | ||
"index": 3, | ||
"index2": 1, | ||
"size": 6818, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [ | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"issuerId": null, | ||
"issuerName": "./lib/index.js", | ||
"issuerPath": [ | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"name": "./lib/index.js" | ||
} | ||
], | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"assets": [ | ||
], | ||
"usedExports": [ | ||
"InjectionMode", | ||
"Stylesheet" | ||
], | ||
"providedExports": [ | ||
"InjectionMode", | ||
"Stylesheet" | ||
], | ||
"optimizationBailout": [ | ||
], | ||
"depth": 1 | ||
}, | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\keyframes.js", | ||
"name": "./lib/keyframes.js", | ||
"index": 14, | ||
"index2": 13, | ||
"size": 704, | ||
"index": 15, | ||
"index2": 14, | ||
"size": 710, | ||
"cacheable": true, | ||
@@ -427,7 +494,7 @@ "built": true, | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\extractStyleParts.js", | ||
"name": "./lib/extractStyleParts.js", | ||
"index": 2, | ||
"index2": 2, | ||
"size": 1695, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\styleToClassName.js", | ||
"name": "./lib/styleToClassName.js", | ||
"index": 6, | ||
"index2": 9, | ||
"size": 7753, | ||
"cacheable": true, | ||
@@ -460,6 +527,12 @@ "built": true, | ||
"usedExports": [ | ||
"extractStyleParts" | ||
"serializeRuleEntries", | ||
"styleToRegistration", | ||
"applyRegistration", | ||
"styleToClassName" | ||
], | ||
"providedExports": [ | ||
"extractStyleParts" | ||
"serializeRuleEntries", | ||
"styleToRegistration", | ||
"applyRegistration", | ||
"styleToClassName" | ||
], | ||
@@ -472,7 +545,7 @@ "optimizationBailout": [ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\common\\temp\\node_modules\\tslib\\tslib.es6.js", | ||
"name": "D:/a/1/s/common/temp/node_modules/tslib/tslib.es6.js", | ||
"index": 4, | ||
"index2": 0, | ||
"size": 8863, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\extractStyleParts.js", | ||
"name": "./lib/extractStyleParts.js", | ||
"index": 2, | ||
"index2": 3, | ||
"size": 1695, | ||
"cacheable": true, | ||
@@ -484,63 +557,2 @@ "built": true, | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"issuerId": null, | ||
"issuerName": "./lib/Stylesheet.js", | ||
"issuerPath": [ | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"name": "./lib/index.js" | ||
}, | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"name": "./lib/Stylesheet.js" | ||
} | ||
], | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"assets": [ | ||
], | ||
"usedExports": [ | ||
"__assign" | ||
], | ||
"providedExports": [ | ||
"__extends", | ||
"__assign", | ||
"__rest", | ||
"__decorate", | ||
"__param", | ||
"__metadata", | ||
"__awaiter", | ||
"__generator", | ||
"__exportStar", | ||
"__values", | ||
"__read", | ||
"__spread", | ||
"__await", | ||
"__asyncGenerator", | ||
"__asyncDelegator", | ||
"__asyncValues", | ||
"__makeTemplateObject", | ||
"__importStar", | ||
"__importDefault" | ||
], | ||
"optimizationBailout": [ | ||
], | ||
"depth": 2 | ||
}, | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\styleToClassName.js", | ||
"name": "./lib/styleToClassName.js", | ||
"index": 5, | ||
"index2": 8, | ||
"size": 7753, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [ | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\mergeStyles.js", | ||
@@ -567,12 +579,6 @@ "issuerId": null, | ||
"usedExports": [ | ||
"serializeRuleEntries", | ||
"styleToRegistration", | ||
"applyRegistration", | ||
"styleToClassName" | ||
"extractStyleParts" | ||
], | ||
"providedExports": [ | ||
"serializeRuleEntries", | ||
"styleToRegistration", | ||
"applyRegistration", | ||
"styleToClassName" | ||
"extractStyleParts" | ||
], | ||
@@ -587,4 +593,4 @@ "optimizationBailout": [ | ||
"name": "./lib/transforms/provideUnits.js", | ||
"index": 7, | ||
"index2": 4, | ||
"index": 8, | ||
"index2": 5, | ||
"size": 525, | ||
@@ -636,4 +642,4 @@ "cacheable": true, | ||
"name": "./lib/transforms/prefixRules.js", | ||
"index": 9, | ||
"index2": 7, | ||
"index": 10, | ||
"index2": 8, | ||
"size": 828, | ||
@@ -685,4 +691,4 @@ "cacheable": true, | ||
"name": "./lib/transforms/kebabRules.js", | ||
"index": 6, | ||
"index2": 3, | ||
"index": 7, | ||
"index2": 4, | ||
"size": 134, | ||
@@ -734,4 +740,4 @@ "cacheable": true, | ||
"name": "./lib/getVendorSettings.js", | ||
"index": 10, | ||
"index2": 6, | ||
"index": 11, | ||
"index2": 7, | ||
"size": 1161, | ||
@@ -787,3 +793,45 @@ "cacheable": true, | ||
"filteredModules": 0, | ||
"parsedSrc": "function(e,t,r){\"use strict\";r.r(t);\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nObject.setPrototypeOf||Array;var n,s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e};!function(e){e[e.none=0]=\"none\",e[e.insertNode=1]=\"insertNode\",e[e.appendChild=2]=\"appendChild\"}(n||(n={}));var i,o,a=function(){function e(e){this._rules=[],this._rulesToInsert=[],this._counter=0,this._keyToClassName={},this._classNameToArgs={},this._config=s({injectionMode:1,defaultPrefix:\"css\"},e)}return e.getInstance=function(){var t=\"undefined\"!=typeof window?window:{};if(!(i=t.__stylesheet__)){var r=t&&t.FabricConfig||{};i=t.__stylesheet__=new e(r.mergeStyles)}return i},e.prototype.setConfig=function(e){this._config=s({},this._config,e)},e.prototype.getClassName=function(e){return(e||this._config.defaultPrefix)+\"-\"+this._counter++},e.prototype.cacheClassName=function(e,t,r,n){this._keyToClassName[t]=e,this._classNameToArgs[e]={args:r,rules:n}},e.prototype.classNameFromKey=function(e){return this._keyToClassName[e]},e.prototype.argsFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.args},e.prototype.insertedRulesFromClassName=function(e){var t=this._classNameToArgs[e];return t&&t.rules},e.prototype.insertRule=function(e){var t=0!==this._config.injectionMode?this._getStyleElement():void 0;if(t)switch(this._config.injectionMode){case 1:var r=t.sheet;try{r.insertRule(e,r.cssRules.length)}catch(e){}break;case 2:t.appendChild(document.createTextNode(e))}else this._rules.push(e);this._config.onInsertRule&&this._config.onInsertRule(e)},e.prototype.getRules=function(){return(this._rules.join(\"\")||\"\")+(this._rulesToInsert.join(\"\")||\"\")},e.prototype.reset=function(){this._rules=[],this._rulesToInsert=[],this._counter=0,this._classNameToArgs={},this._keyToClassName={}},e.prototype.resetKeys=function(){this._keyToClassName={}},e.prototype._getStyleElement=function(){var e=this;return this._styleElement||\"undefined\"==typeof document||(this._styleElement=this._createStyleElement(),window.requestAnimationFrame(function(){e._styleElement=void 0})),this._styleElement},e.prototype._createStyleElement=function(){var e=document.createElement(\"style\");return e.setAttribute(\"data-merge-styles\",\"true\"),e.type=\"text/css\",this._lastStyleElement&&this._lastStyleElement.nextElementSibling?document.head.insertBefore(e,this._lastStyleElement.nextElementSibling):document.head.appendChild(e),this._lastStyleElement=e,e},e}();var l={\"user-select\":1};function f(e,t){var r=function(){if(!o){var e=\"undefined\"!=typeof document?document:void 0,t=\"undefined\"!=typeof navigator?navigator:void 0,r=t?t.userAgent.toLowerCase():void 0;o=e?{isWebkit:!!(e&&\"WebkitAppearance\"in e.documentElement.style),isMoz:!!(r&&r.indexOf(\"firefox\")>-1),isOpera:!!(r&&r.indexOf(\"opera\")>-1),isMs:!(!t||!/rv:11.0/i.test(t.userAgent)&&!/Edge\\/\\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return o}(),n=e[t];if(l[n]){var s=e[t+1];l[n]&&(r.isWebkit&&e.push(\"-webkit-\"+n,s),r.isMoz&&e.push(\"-moz-\"+n,s),r.isMs&&e.push(\"-ms-\"+n,s),r.isOpera&&e.push(\"-o-\"+n,s))}}var u=[\"column-count\",\"font-weight\",\"flex-basis\",\"flex\",\"flex-grow\",\"flex-shrink\",\"fill-opacity\",\"opacity\",\"order\",\"z-index\",\"zoom\"];function c(e,t){var r=e[t],n=e[t+1];if(\"number\"==typeof n){var s=-1===u.indexOf(r)?\"px\":\"\";e[t+1]=\"\"+n+s}}var p,d=\"left\",h=\"right\",v=\"@noflip\",g=((p={})[d]=h,p[h]=d,p),y={\"w-resize\":\"e-resize\",\"sw-resize\":\"se-resize\",\"nw-resize\":\"ne-resize\"},m=N();function _(e){m!==e&&(a.getInstance().resetKeys(),m=e)}function N(){return void 0===m&&(m=\"undefined\"!=typeof document&&!!document.documentElement&&\"rtl\"===document.documentElement.getAttribute(\"dir\")),m}function x(e,t){if(N()){var r=e[t];if(!r)return;var n=e[t+1];if(\"string\"==typeof n&&n.indexOf(v)>=0)e[t+1]=n.replace(/\\s*(?:\\/\\*\\s*)?\\@noflip\\b(?:\\s*\\*\\/)?\\s*?/g,\"\");else if(r.indexOf(d)>=0)e[t]=r.replace(d,h);else if(r.indexOf(h)>=0)e[t]=r.replace(h,d);else if(String(n).indexOf(d)>=0)e[t+1]=n.replace(d,h);else if(String(n).indexOf(h)>=0)e[t+1]=n.replace(h,d);else if(g[r])e[t]=g[r];else if(y[n])e[t+1]=y[n];else switch(r){case\"margin\":case\"padding\":e[t+1]=function(e){if(\"string\"==typeof e){var t=e.split(\" \");if(4===t.length)return t[0]+\" \"+t[3]+\" \"+t[2]+\" \"+t[1]}return e}(n);break;case\"box-shadow\":e[t+1]=function(e,t){var r=e.split(\" \"),n=parseInt(r[t],10);return r[0]=r[0].replace(String(n),String(-1*n)),r.join(\" \")}(n,0)}}}var O=\"displayName\";function b(e,t,r){var n=\"string\"==typeof r?r.split(\" \"):[r];e[t+\"Top\"]=n[0],e[t+\"Right\"]=n[1]||n[0],e[t+\"Bottom\"]=n[2]||n[0],e[t+\"Left\"]=n[3]||n[1]||n[0]}function w(e){if(!e)return\"\";var t,r,n=[];for(var s in e)e.hasOwnProperty(s)&&s!==O&&void 0!==e[s]&&n.push(s,e[s]);for(var i=0;i<n.length;i+=2)(t=n)[r=i]=t[r].replace(/([A-Z])/g,\"-$1\").toLowerCase(),c(n,i),x(n,i),f(n,i);for(i=1;i<n.length;i+=4)n.splice(i,1,\":\",n[i],\";\");return n.join(\"\")}function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=function e(t,r,n){void 0===r&&(r={__order:[]}),void 0===n&&(n=\"&\");var s=a.getInstance(),i=r[n];i||(i={},r[n]=i,r.__order.push(n));for(var o=0,l=t;o<l.length;o++){var f=l[o];if(\"string\"==typeof f){var u=s.argsFromClassName(f);u&&e(u,r,n)}else if(Array.isArray(f))e(f,r,n);else for(var c in f)if(\"selectors\"===c){var p=f.selectors;for(var d in p)if(p.hasOwnProperty(d)){var h=p[d];0===d.indexOf(\":global(\")?d=d.replace(/:global\\(|\\)$/g,\"\"):0===d.indexOf(\"@media\")?d=d+\"{\"+n:0===d.indexOf(\":\")?d=n+d:d.indexOf(\"&\")<0&&(d=n+\" \"+d),e([h],r,d)}}else\"margin\"===c||\"padding\"===c?b(i,c,f[c]):i[c]=f[c]}return r}(e),n=function(e){for(var t=[],r=!1,n=0,s=e.__order;n<s.length;n++){var i=s[n];t.push(i);var o=e[i];for(var a in o)o.hasOwnProperty(a)&&void 0!==o[a]&&(r=!0,t.push(a,o[a]))}return r?t.join(\"\"):void 0}(r);if(n){var s=a.getInstance(),i={className:s.classNameFromKey(n),key:n,args:e};if(!i.className){i.className=s.getClassName(function(e){var t=e&&e[\"&\"];return t?t.displayName:void 0}(r));for(var o=[],l=0,f=r.__order;l<f.length;l++){var u=f[l];o.push(u,w(r[u]))}i.rulesToInsert=o}return i}}function j(e,t){var r=a.getInstance(),n=e.className,s=e.key,i=e.args,o=e.rulesToInsert;if(o){for(var l=0;l<o.length;l+=2){var f=o[l+1];if(f){var u=o[l],c=(u=u.replace(/(&)|\\$([\\w-]+)\\b/g,function(r,n,s){return n?\".\"+e.className:s?\".\"+(t&&t[s]||s):\"\"}))+\"{\"+f+\"}\"+(0===u.indexOf(\"@media\")?\"}\":\"\");r.insertRule(c)}}r.cacheClassName(n,s,i,o)}}function A(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=[],n=[],s=a.getInstance();return function e(t){for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a)if(\"string\"==typeof a)if(a.indexOf(\" \")>=0)e(a.split(\" \"));else{var l=s.argsFromClassName(a);l?e(l):-1===r.indexOf(a)&&r.push(a)}else Array.isArray(a)?e(a):\"object\"==typeof a&&n.push(a)}}(e),{classes:r,objects:n}}function S(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=A(e),n=r.classes,s=r.objects;return s.length&&n.push(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=C.apply(void 0,e);return r?(j(r),r.className):\"\"}(s)),n.join(\" \")}function E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0,s=e;n<s.length;n++){var i=s[n];if(i)for(var o in i)if(i.hasOwnProperty(o)){var a=r[o],l=i[o];r[o]=void 0===a?l:(Array.isArray(a)?a:[a]).concat(Array.isArray(l)?l:[l])}}return r}function k(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r={},n={},s=e[0];if(s){e.length>1&&(s=E.apply(void 0,e));var i=[];for(var o in s)if(s.hasOwnProperty(o)){var a=A(s[o]),l=a.classes,f=C({displayName:o},a.objects);i.push(f),f&&(n[o]=f.className,r[o]=l.concat([f.className]).join(\" \"))}for(var u=0,c=i;u<c.length;u++){(f=c[u])&&j(f,n)}}return r}function T(e){a.getInstance().insertRule(\"@font-face{\"+w(e)+\"}\")}function I(e){var t=a.getInstance(),r=t.getClassName(),n=[];for(var s in e)e.hasOwnProperty(s)&&n.push(s,\"{\",w(e[s]),\"}\");var i=n.join(\"\");return t.insertRule(\"@keyframes \"+r+\"{\"+i+\"}\"),t.cacheClassName(r,i,[],[\"keyframes\",i]),r}r.d(t,\"mergeStyles\",function(){return S}),r.d(t,\"mergeStyleSets\",function(){return k}),r.d(t,\"concatStyleSets\",function(){return E}),r.d(t,\"fontFace\",function(){return T}),r.d(t,\"keyframes\",function(){return I}),r.d(t,\"InjectionMode\",function(){return n}),r.d(t,\"Stylesheet\",function(){return a}),r.d(t,\"setRTL\",function(){return _})}" | ||
"parsedSrc": "function(e,t,n){\"use strict\";n.r(t);var r,i=n(0);var s={\"user-select\":1};function o(e,t){var n=function(){if(!r){var e=\"undefined\"!=typeof document?document:void 0,t=\"undefined\"!=typeof navigator?navigator:void 0,n=t?t.userAgent.toLowerCase():void 0;r=e?{isWebkit:!!(e&&\"WebkitAppearance\"in e.documentElement.style),isMoz:!!(n&&n.indexOf(\"firefox\")>-1),isOpera:!!(n&&n.indexOf(\"opera\")>-1),isMs:!(!t||!/rv:11.0/i.test(t.userAgent)&&!/Edge\\/\\d./i.test(navigator.userAgent))}:{isWebkit:!0,isMoz:!0,isOpera:!0,isMs:!0}}return r}(),i=e[t];if(s[i]){var o=e[t+1];s[i]&&(n.isWebkit&&e.push(\"-webkit-\"+i,o),n.isMoz&&e.push(\"-moz-\"+i,o),n.isMs&&e.push(\"-ms-\"+i,o),n.isOpera&&e.push(\"-o-\"+i,o))}}var a=[\"column-count\",\"font-weight\",\"flex-basis\",\"flex\",\"flex-grow\",\"flex-shrink\",\"fill-opacity\",\"opacity\",\"order\",\"z-index\",\"zoom\"];function u(e,t){var n=e[t],r=e[t+1];if(\"number\"==typeof r){var i=-1===a.indexOf(n)?\"px\":\"\";e[t+1]=\"\"+r+i}}var c,l=\"left\",f=\"right\",p=\"@noflip\",h=((c={})[l]=f,c[f]=l,c),d={\"w-resize\":\"e-resize\",\"sw-resize\":\"se-resize\",\"nw-resize\":\"ne-resize\"},v=g();function m(e){v!==e&&(i.b.getInstance().resetKeys(),v=e)}function g(){return void 0===v&&(v=\"undefined\"!=typeof document&&!!document.documentElement&&\"rtl\"===document.documentElement.getAttribute(\"dir\")),v}function y(e,t){if(g()){var n=e[t];if(!n)return;var r=e[t+1];if(\"string\"==typeof r&&r.indexOf(p)>=0)e[t+1]=r.replace(/\\s*(?:\\/\\*\\s*)?\\@noflip\\b(?:\\s*\\*\\/)?\\s*?/g,\"\");else if(n.indexOf(l)>=0)e[t]=n.replace(l,f);else if(n.indexOf(f)>=0)e[t]=n.replace(f,l);else if(String(r).indexOf(l)>=0)e[t+1]=r.replace(l,f);else if(String(r).indexOf(f)>=0)e[t+1]=r.replace(f,l);else if(h[n])e[t]=h[n];else if(d[r])e[t+1]=d[r];else switch(n){case\"margin\":case\"padding\":e[t+1]=function(e){if(\"string\"==typeof e){var t=e.split(\" \");if(4===t.length)return t[0]+\" \"+t[3]+\" \"+t[2]+\" \"+t[1]}return e}(r);break;case\"box-shadow\":e[t+1]=function(e,t){var n=e.split(\" \"),r=parseInt(n[t],10);return n[0]=n[0].replace(String(r),String(-1*r)),n.join(\" \")}(r,0)}}}var _=\"displayName\";function b(e,t,n){var r=\"string\"==typeof n?n.split(\" \"):[n];e[t+\"Top\"]=r[0],e[t+\"Right\"]=r[1]||r[0],e[t+\"Bottom\"]=r[2]||r[0],e[t+\"Left\"]=r[3]||r[1]||r[0]}function w(e){if(!e)return\"\";var t,n,r=[];for(var i in e)e.hasOwnProperty(i)&&i!==_&&void 0!==e[i]&&r.push(i,e[i]);for(var s=0;s<r.length;s+=2)(t=r)[n=s]=t[n].replace(/([A-Z])/g,\"-$1\").toLowerCase(),u(r,s),y(r,s),o(r,s);for(s=1;s<r.length;s+=4)r.splice(s,1,\":\",r[s],\";\");return r.join(\"\")}function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function e(t,n,r){void 0===n&&(n={__order:[]}),void 0===r&&(r=\"&\");var s=i.b.getInstance(),o=n[r];o||(o={},n[r]=o,n.__order.push(r));for(var a=0,u=t;a<u.length;a++){var c=u[a];if(\"string\"==typeof c){var l=s.argsFromClassName(c);l&&e(l,n,r)}else if(Array.isArray(c))e(c,n,r);else for(var f in c)if(\"selectors\"===f){var p=c.selectors;for(var h in p)if(p.hasOwnProperty(h)){var d=p[h];0===h.indexOf(\":global(\")?h=h.replace(/:global\\(|\\)$/g,\"\"):0===h.indexOf(\"@media\")?h=h+\"{\"+r:0===h.indexOf(\":\")?h=r+h:h.indexOf(\"&\")<0&&(h=r+\" \"+h),e([d],n,h)}}else\"margin\"===f||\"padding\"===f?b(o,f,c[f]):o[f]=c[f]}return n}(e),r=function(e){for(var t=[],n=!1,r=0,i=e.__order;r<i.length;r++){var s=i[r];t.push(s);var o=e[s];for(var a in o)o.hasOwnProperty(a)&&void 0!==o[a]&&(n=!0,t.push(a,o[a]))}return n?t.join(\"\"):void 0}(n);if(r){var s=i.b.getInstance(),o={className:s.classNameFromKey(r),key:r,args:e};if(!o.className){o.className=s.getClassName(function(e){var t=e&&e[\"&\"];return t?t.displayName:void 0}(n));for(var a=[],u=0,c=n.__order;u<c.length;u++){var l=c[u];a.push(l,w(n[l]))}o.rulesToInsert=a}return o}}function N(e,t){var n=i.b.getInstance(),r=e.className,s=e.key,o=e.args,a=e.rulesToInsert;if(a){for(var u=0;u<a.length;u+=2){var c=a[u+1];if(c){var l=a[u],f=(l=l.replace(/(&)|\\$([\\w-]+)\\b/g,function(n,r,i){return r?\".\"+e.className:i?\".\"+(t&&t[i]||i):\"\"}))+\"{\"+c+\"}\"+(0===l.indexOf(\"@media\")?\"}\":\"\");n.insertRule(f)}}n.cacheClassName(r,s,o,a)}}function T(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=[],r=[],s=i.b.getInstance();return function e(t){for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a)if(\"string\"==typeof a)if(a.indexOf(\" \")>=0)e(a.split(\" \"));else{var u=s.argsFromClassName(a);u?e(u):-1===n.indexOf(a)&&n.push(a)}else Array.isArray(a)?e(a):\"object\"==typeof a&&r.push(a)}}(e),{classes:n,objects:r}}function O(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=T(e),r=n.classes,i=n.objects;return i.length&&r.push(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=x.apply(void 0,e);return n?(N(n),n.className):\"\"}(i)),r.join(\" \")}function C(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},r=0,i=e;r<i.length;r++){var s=i[r];if(s)for(var o in s)if(s.hasOwnProperty(o)){var a=n[o],u=s[o];n[o]=void 0===a?u:(Array.isArray(a)?a:[a]).concat(Array.isArray(u)?u:[u])}}return n}function A(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n={},r={},i=e[0];if(i){e.length>1&&(i=C.apply(void 0,e));var s=[];for(var o in i)if(i.hasOwnProperty(o)){var a=T(i[o]),u=a.classes,c=x({displayName:o},a.objects);s.push(c),c&&(r[o]=c.className,n[o]=u.concat([c.className]).join(\" \"))}for(var l=0,f=s;l<f.length;l++){(c=f[l])&&N(c,r)}}return n}function E(e){i.b.getInstance().insertRule(\"@font-face{\"+w(e)+\"}\",!0)}function j(e){var t=i.b.getInstance(),n=t.getClassName(),r=[];for(var s in e)e.hasOwnProperty(s)&&r.push(s,\"{\",w(e[s]),\"}\");var o=r.join(\"\");return t.insertRule(\"@keyframes \"+n+\"{\"+o+\"}\",!0),t.cacheClassName(n,o,[],[\"keyframes\",o]),n}n.d(t,\"mergeStyles\",function(){return O}),n.d(t,\"mergeStyleSets\",function(){return A}),n.d(t,\"concatStyleSets\",function(){return C}),n.d(t,\"fontFace\",function(){return E}),n.d(t,\"keyframes\",function(){return j}),n.d(t,\"InjectionMode\",function(){return i.a}),n.d(t,\"Stylesheet\",function(){return i.b}),n.d(t,\"setRTL\",function(){return m})}" | ||
}, | ||
{ | ||
"id": 3, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\common\\temp\\node_modules\\process\\browser.js", | ||
"name": "D:/a/1/s/common/temp/node_modules/process/browser.js", | ||
"index": 4, | ||
"index2": 0, | ||
"size": 5418, | ||
"cacheable": true, | ||
"built": true, | ||
"optional": false, | ||
"prefetched": false, | ||
"chunks": [ | ||
0 | ||
], | ||
"issuer": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"issuerId": 0, | ||
"issuerName": "./lib/Stylesheet.js", | ||
"issuerPath": [ | ||
{ | ||
"id": null, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\index.js", | ||
"name": "./lib/index.js" | ||
}, | ||
{ | ||
"id": 0, | ||
"identifier": "D:\\a\\1\\s\\scripts\\node_modules\\source-map-loader\\index.js!D:\\a\\1\\s\\packages\\merge-styles\\lib\\Stylesheet.js", | ||
"name": "./lib/Stylesheet.js" | ||
} | ||
], | ||
"failed": false, | ||
"errors": 0, | ||
"warnings": 0, | ||
"assets": [ | ||
], | ||
"usedExports": true, | ||
"providedExports": null, | ||
"optimizationBailout": [ | ||
"ModuleConcatenation bailout: Module is not an ECMAScript module" | ||
], | ||
"depth": 2, | ||
"parsedSrc": "function(e,t){var n,r,i=e.exports={};function s(){throw new Error(\"setTimeout has not been defined\")}function o(){throw new Error(\"clearTimeout has not been defined\")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r=\"function\"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var u,c=[],l=!1,f=-1;function p(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=a(p);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||a(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title=\"browser\",i.browser=!0,i.env={},i.argv=[],i.version=\"\",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error(\"process.binding is not supported\")},i.cwd=function(){return\"/\"},i.chdir=function(e){throw new Error(\"process.chdir is not supported\")},i.umask=function(){return 0}}" | ||
} | ||
@@ -790,0 +838,0 @@ ], |
@@ -10,5 +10,5 @@ "use strict"; | ||
function fontFace(font) { | ||
Stylesheet_1.Stylesheet.getInstance().insertRule("@font-face{" + styleToClassName_1.serializeRuleEntries(font) + "}"); | ||
Stylesheet_1.Stylesheet.getInstance().insertRule("@font-face{" + styleToClassName_1.serializeRuleEntries(font) + "}", true); | ||
} | ||
exports.fontFace = fontFace; | ||
//# sourceMappingURL=fontFace.js.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
var rules = rulesArray.join(''); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}"); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}", true); | ||
stylesheet.cacheClassName(name, rules, [], ['keyframes', rules]); | ||
@@ -23,0 +23,0 @@ return name; |
@@ -1,4 +0,9 @@ | ||
export declare function renderStatic(onRender: () => string): { | ||
/** | ||
* Renders a given string and returns both html and css needed for the html. | ||
* @param onRender - Function that returns a string. | ||
* @param namespace - Optional namespace to prepend to css classnames to avoid collisions. | ||
*/ | ||
export declare function renderStatic(onRender: () => string, namespace?: string): { | ||
html: string; | ||
css: string; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Stylesheet_1 = require("./Stylesheet"); | ||
function renderStatic(onRender) { | ||
/** | ||
* Renders a given string and returns both html and css needed for the html. | ||
* @param onRender - Function that returns a string. | ||
* @param namespace - Optional namespace to prepend to css classnames to avoid collisions. | ||
*/ | ||
function renderStatic(onRender, namespace) { | ||
var stylesheet = Stylesheet_1.Stylesheet.getInstance(); | ||
stylesheet.setConfig({ | ||
injectionMode: 0 /* none */ | ||
injectionMode: 0 /* none */, | ||
namespace: namespace | ||
}); | ||
@@ -12,3 +18,3 @@ stylesheet.reset(); | ||
html: onRender(), | ||
css: stylesheet.getRules() | ||
css: stylesheet.getRules(true) | ||
}; | ||
@@ -15,0 +21,0 @@ } |
@@ -32,5 +32,13 @@ import { IStyle } from './IStyle'; | ||
/** | ||
* Falls back to "css". | ||
* Default 'displayName' to use for a className. | ||
* @default 'css' | ||
*/ | ||
defaultPrefix?: string; | ||
/** | ||
* Default 'namespace' to attach before the className. | ||
*/ | ||
namespace?: string; | ||
/** | ||
* Callback executed when a rule is inserted. | ||
*/ | ||
onInsertRule?: (rule: string) => void; | ||
@@ -49,2 +57,3 @@ } | ||
private _rules; | ||
private _preservedRules; | ||
private _config; | ||
@@ -54,2 +63,3 @@ private _rulesToInsert; | ||
private _keyToClassName; | ||
private _onResetCallbacks; | ||
private _classNameToArgs; | ||
@@ -66,2 +76,8 @@ /** | ||
/** | ||
* Configures a reset callback. | ||
* | ||
* @param callback - A callback which will be called when the Stylesheet is reset. | ||
*/ | ||
onReset(callback: () => void): void; | ||
/** | ||
* Generates a unique classname. | ||
@@ -88,10 +104,11 @@ * | ||
/** | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
insertedRulesFromClassName(className: string): string[] | undefined; | ||
/** | ||
* Inserts a css rule into the stylesheet. | ||
* @param preserve - Preserves the rule beyond a reset boundary. | ||
*/ | ||
insertRule(rule: string): void; | ||
insertRule(rule: string, preserve?: boolean): void; | ||
/** | ||
@@ -101,3 +118,3 @@ * Gets all rules registered with the stylesheet; only valid when | ||
*/ | ||
getRules(): string; | ||
getRules(includePreservedRules?: boolean): string; | ||
/** | ||
@@ -104,0 +121,0 @@ * Resets the internal state of the stylesheet. Only used in server |
@@ -25,2 +25,4 @@ "use strict"; | ||
var STYLESHEET_SETTING = '__stylesheet__'; | ||
// tslint:disable-next-line:no-any | ||
var _fileScopedGlobal = {}; | ||
var _stylesheet; | ||
@@ -37,8 +39,10 @@ /** | ||
this._rules = []; | ||
this._preservedRules = []; | ||
this._rulesToInsert = []; | ||
this._counter = 0; | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks = []; | ||
// tslint:disable-next-line:no-any | ||
this._classNameToArgs = {}; | ||
this._config = tslib_1.__assign({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css' }, config); | ||
this._config = tslib_1.__assign({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css', namespace: undefined }, config); | ||
} | ||
@@ -50,8 +54,8 @@ /** | ||
// tslint:disable-next-line:no-any | ||
var win = typeof window !== 'undefined' ? window : {}; | ||
_stylesheet = win[STYLESHEET_SETTING]; | ||
var global = typeof window !== 'undefined' ? window : typeof process !== 'undefined' ? process : _fileScopedGlobal; | ||
_stylesheet = global[STYLESHEET_SETTING]; | ||
if (!_stylesheet) { | ||
// tslint:disable-next-line:no-string-literal | ||
var fabricConfig = (win && win['FabricConfig']) || {}; | ||
_stylesheet = win[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
var fabricConfig = (global && global['FabricConfig']) || {}; | ||
_stylesheet = global[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
} | ||
@@ -67,2 +71,10 @@ return _stylesheet; | ||
/** | ||
* Configures a reset callback. | ||
* | ||
* @param callback - A callback which will be called when the Stylesheet is reset. | ||
*/ | ||
Stylesheet.prototype.onReset = function (callback) { | ||
this._onResetCallbacks.push(callback); | ||
}; | ||
/** | ||
* Generates a unique classname. | ||
@@ -73,4 +85,5 @@ * | ||
Stylesheet.prototype.getClassName = function (displayName) { | ||
var namespace = this._config.namespace; | ||
var prefix = displayName || this._config.defaultPrefix; | ||
return prefix + "-" + this._counter++; | ||
return "" + (namespace ? namespace + '-' : '') + prefix + "-" + this._counter++; | ||
}; | ||
@@ -101,18 +114,22 @@ /** | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.args; | ||
return (entry && entry.args); | ||
}; | ||
/** | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
Stylesheet.prototype.insertedRulesFromClassName = function (className) { | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.rules; | ||
return (entry && entry.rules); | ||
}; | ||
/** | ||
* Inserts a css rule into the stylesheet. | ||
* @param preserve - Preserves the rule beyond a reset boundary. | ||
*/ | ||
Stylesheet.prototype.insertRule = function (rule) { | ||
Stylesheet.prototype.insertRule = function (rule, preserve) { | ||
var injectionMode = this._config.injectionMode; | ||
var element = injectionMode !== 0 /* none */ ? this._getStyleElement() : undefined; | ||
if (preserve) { | ||
this._preservedRules.push(rule); | ||
} | ||
if (element) { | ||
@@ -147,4 +164,4 @@ switch (this._config.injectionMode) { | ||
*/ | ||
Stylesheet.prototype.getRules = function () { | ||
return (this._rules.join('') || '') + (this._rulesToInsert.join('') || ''); | ||
Stylesheet.prototype.getRules = function (includePreservedRules) { | ||
return (includePreservedRules ? this._preservedRules.join('') : '') + this._rules.join('') + this._rulesToInsert.join(''); | ||
}; | ||
@@ -161,2 +178,3 @@ /** | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks.forEach(function (callback) { return callback(); }); | ||
}; | ||
@@ -163,0 +181,0 @@ // Forces the regeneration of incoming styles without totally resetting the stylesheet. |
@@ -8,4 +8,4 @@ import { Stylesheet } from './Stylesheet'; | ||
export function fontFace(font) { | ||
Stylesheet.getInstance().insertRule("@font-face{" + serializeRuleEntries(font) + "}"); | ||
Stylesheet.getInstance().insertRule("@font-face{" + serializeRuleEntries(font) + "}", true); | ||
} | ||
//# sourceMappingURL=fontFace.js.map |
@@ -18,3 +18,3 @@ import { Stylesheet } from './Stylesheet'; | ||
var rules = rulesArray.join(''); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}"); | ||
stylesheet.insertRule("@keyframes " + name + "{" + rules + "}", true); | ||
stylesheet.cacheClassName(name, rules, [], ['keyframes', rules]); | ||
@@ -21,0 +21,0 @@ return name; |
@@ -1,4 +0,9 @@ | ||
export declare function renderStatic(onRender: () => string): { | ||
/** | ||
* Renders a given string and returns both html and css needed for the html. | ||
* @param onRender - Function that returns a string. | ||
* @param namespace - Optional namespace to prepend to css classnames to avoid collisions. | ||
*/ | ||
export declare function renderStatic(onRender: () => string, namespace?: string): { | ||
html: string; | ||
css: string; | ||
}; |
import { Stylesheet } from './Stylesheet'; | ||
export function renderStatic(onRender) { | ||
/** | ||
* Renders a given string and returns both html and css needed for the html. | ||
* @param onRender - Function that returns a string. | ||
* @param namespace - Optional namespace to prepend to css classnames to avoid collisions. | ||
*/ | ||
export function renderStatic(onRender, namespace) { | ||
var stylesheet = Stylesheet.getInstance(); | ||
stylesheet.setConfig({ | ||
injectionMode: 0 /* none */ | ||
injectionMode: 0 /* none */, | ||
namespace: namespace | ||
}); | ||
@@ -10,5 +16,5 @@ stylesheet.reset(); | ||
html: onRender(), | ||
css: stylesheet.getRules() | ||
css: stylesheet.getRules(true) | ||
}; | ||
} | ||
//# sourceMappingURL=server.js.map |
@@ -32,5 +32,13 @@ import { IStyle } from './IStyle'; | ||
/** | ||
* Falls back to "css". | ||
* Default 'displayName' to use for a className. | ||
* @default 'css' | ||
*/ | ||
defaultPrefix?: string; | ||
/** | ||
* Default 'namespace' to attach before the className. | ||
*/ | ||
namespace?: string; | ||
/** | ||
* Callback executed when a rule is inserted. | ||
*/ | ||
onInsertRule?: (rule: string) => void; | ||
@@ -49,2 +57,3 @@ } | ||
private _rules; | ||
private _preservedRules; | ||
private _config; | ||
@@ -54,2 +63,3 @@ private _rulesToInsert; | ||
private _keyToClassName; | ||
private _onResetCallbacks; | ||
private _classNameToArgs; | ||
@@ -66,2 +76,8 @@ /** | ||
/** | ||
* Configures a reset callback. | ||
* | ||
* @param callback - A callback which will be called when the Stylesheet is reset. | ||
*/ | ||
onReset(callback: () => void): void; | ||
/** | ||
* Generates a unique classname. | ||
@@ -88,10 +104,11 @@ * | ||
/** | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
insertedRulesFromClassName(className: string): string[] | undefined; | ||
/** | ||
* Inserts a css rule into the stylesheet. | ||
* @param preserve - Preserves the rule beyond a reset boundary. | ||
*/ | ||
insertRule(rule: string): void; | ||
insertRule(rule: string, preserve?: boolean): void; | ||
/** | ||
@@ -101,3 +118,3 @@ * Gets all rules registered with the stylesheet; only valid when | ||
*/ | ||
getRules(): string; | ||
getRules(includePreservedRules?: boolean): string; | ||
/** | ||
@@ -104,0 +121,0 @@ * Resets the internal state of the stylesheet. Only used in server |
@@ -23,2 +23,4 @@ import * as tslib_1 from "tslib"; | ||
var STYLESHEET_SETTING = '__stylesheet__'; | ||
// tslint:disable-next-line:no-any | ||
var _fileScopedGlobal = {}; | ||
var _stylesheet; | ||
@@ -35,8 +37,10 @@ /** | ||
this._rules = []; | ||
this._preservedRules = []; | ||
this._rulesToInsert = []; | ||
this._counter = 0; | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks = []; | ||
// tslint:disable-next-line:no-any | ||
this._classNameToArgs = {}; | ||
this._config = tslib_1.__assign({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css' }, config); | ||
this._config = tslib_1.__assign({ injectionMode: 1 /* insertNode */, defaultPrefix: 'css', namespace: undefined }, config); | ||
} | ||
@@ -48,8 +52,8 @@ /** | ||
// tslint:disable-next-line:no-any | ||
var win = typeof window !== 'undefined' ? window : {}; | ||
_stylesheet = win[STYLESHEET_SETTING]; | ||
var global = typeof window !== 'undefined' ? window : typeof process !== 'undefined' ? process : _fileScopedGlobal; | ||
_stylesheet = global[STYLESHEET_SETTING]; | ||
if (!_stylesheet) { | ||
// tslint:disable-next-line:no-string-literal | ||
var fabricConfig = (win && win['FabricConfig']) || {}; | ||
_stylesheet = win[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
var fabricConfig = (global && global['FabricConfig']) || {}; | ||
_stylesheet = global[STYLESHEET_SETTING] = new Stylesheet(fabricConfig.mergeStyles); | ||
} | ||
@@ -65,2 +69,10 @@ return _stylesheet; | ||
/** | ||
* Configures a reset callback. | ||
* | ||
* @param callback - A callback which will be called when the Stylesheet is reset. | ||
*/ | ||
Stylesheet.prototype.onReset = function (callback) { | ||
this._onResetCallbacks.push(callback); | ||
}; | ||
/** | ||
* Generates a unique classname. | ||
@@ -71,4 +83,5 @@ * | ||
Stylesheet.prototype.getClassName = function (displayName) { | ||
var namespace = this._config.namespace; | ||
var prefix = displayName || this._config.defaultPrefix; | ||
return prefix + "-" + this._counter++; | ||
return "" + (namespace ? namespace + '-' : '') + prefix + "-" + this._counter++; | ||
}; | ||
@@ -99,18 +112,22 @@ /** | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.args; | ||
return (entry && entry.args); | ||
}; | ||
/** | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
* Gets the arguments associated with a given classname which was | ||
* previously registered using cacheClassName. | ||
*/ | ||
Stylesheet.prototype.insertedRulesFromClassName = function (className) { | ||
var entry = this._classNameToArgs[className]; | ||
return entry && entry.rules; | ||
return (entry && entry.rules); | ||
}; | ||
/** | ||
* Inserts a css rule into the stylesheet. | ||
* @param preserve - Preserves the rule beyond a reset boundary. | ||
*/ | ||
Stylesheet.prototype.insertRule = function (rule) { | ||
Stylesheet.prototype.insertRule = function (rule, preserve) { | ||
var injectionMode = this._config.injectionMode; | ||
var element = injectionMode !== 0 /* none */ ? this._getStyleElement() : undefined; | ||
if (preserve) { | ||
this._preservedRules.push(rule); | ||
} | ||
if (element) { | ||
@@ -145,4 +162,4 @@ switch (this._config.injectionMode) { | ||
*/ | ||
Stylesheet.prototype.getRules = function () { | ||
return (this._rules.join('') || '') + (this._rulesToInsert.join('') || ''); | ||
Stylesheet.prototype.getRules = function (includePreservedRules) { | ||
return (includePreservedRules ? this._preservedRules.join('') : '') + this._rules.join('') + this._rulesToInsert.join(''); | ||
}; | ||
@@ -159,2 +176,3 @@ /** | ||
this._keyToClassName = {}; | ||
this._onResetCallbacks.forEach(function (callback) { return callback(); }); | ||
}; | ||
@@ -161,0 +179,0 @@ // Forces the regeneration of incoming styles without totally resetting the stylesheet. |
@@ -5,4 +5,4 @@ { | ||
"packages/merge-styles/.npmrc": "825c83e09df4dad076d980d1236c532d689edf75", | ||
"packages/merge-styles/CHANGELOG.json": "e4dc7cb664dc6f990f303fd8b5f4e1dbd3a4f498", | ||
"packages/merge-styles/CHANGELOG.md": "2cb2d48f37963e92951078ad34b3428022813cd6", | ||
"packages/merge-styles/CHANGELOG.json": "dcbd24bddcb74db4501d4877aeeab07065f6a437", | ||
"packages/merge-styles/CHANGELOG.md": "177c9055865f44dd6be55e75291481ab5bb08bdb", | ||
"packages/merge-styles/LICENSE": "310f6231e35c591f17680ffd2f5d4daea754e1f6", | ||
@@ -13,3 +13,3 @@ "packages/merge-styles/README.md": "fc32e85be9982fed863717c73e5dcbe5c3d35725", | ||
"packages/merge-styles/jest.config.js": "a92c71220a900a5366be5af2cb98d273f3b697d4", | ||
"packages/merge-styles/package.json": "e8a02ea9e3102ea92aa6da5a1b0fdae0447c6ec6", | ||
"packages/merge-styles/package.json": "0c32c15cff8c093cef99446d4d9016c7c989e883", | ||
"packages/merge-styles/src/IRawStyleBase.ts": "42ccb532e6d9203dbab932451819f7d79efa57e2", | ||
@@ -19,3 +19,3 @@ "packages/merge-styles/src/IStyle.ts": "5fc3c158746f44f7d69088e45475408ced71f853", | ||
"packages/merge-styles/src/Stylesheet.test.ts": "a294d43b1c057d2ef56b97a1f7ab04eb09fddba3", | ||
"packages/merge-styles/src/Stylesheet.ts": "9476ee232da03dce5943591cf00f045a956ffad7", | ||
"packages/merge-styles/src/Stylesheet.ts": "67548df09398cdac4b81fdb6eecebde83f103106", | ||
"packages/merge-styles/src/concatStyleSets.test.ts": "f075d311b047cfa6f38da4229231dedc6983dbbe", | ||
@@ -26,7 +26,7 @@ "packages/merge-styles/src/concatStyleSets.ts": "7230dd7306bc74b6e5d1758ba47a214d14b4a7a6", | ||
"packages/merge-styles/src/fontFace.test.ts": "690ef5f2fabe00eab6365eb3528e941bbbf94ade", | ||
"packages/merge-styles/src/fontFace.ts": "fb00ddf59023cf3d1b0fe6039d292a32b25ed264", | ||
"packages/merge-styles/src/fontFace.ts": "2f9ec39fa48027394cc8b980f5d4846f0cc26849", | ||
"packages/merge-styles/src/getVendorSettings.ts": "a2d1b63ea5451022d485727acfd73b8ea5b9d6e8", | ||
"packages/merge-styles/src/index.ts": "c5401019fed3dd2794ec8b18d09f7bb7a631955b", | ||
"packages/merge-styles/src/keyframes.test.ts": "cc0f5cfde42251d029343deab79ef837eb3a0e23", | ||
"packages/merge-styles/src/keyframes.ts": "6f9102b57d14e0f8deac7853dee45f1fa47b45b8", | ||
"packages/merge-styles/src/keyframes.ts": "fd3b44147f00371cf0a00561cb082194ade91ade", | ||
"packages/merge-styles/src/mergeStyleSets.test.ts": "ee1c2b66c5f47a356972908c6c7b3b27961d9aef", | ||
@@ -36,4 +36,4 @@ "packages/merge-styles/src/mergeStyleSets.ts": "17e5043c0e5d26fc6858460a28dbd718dd3160a0", | ||
"packages/merge-styles/src/mergeStyles.ts": "65e06274fe18171fa482210a33d0eab90c87c465", | ||
"packages/merge-styles/src/server.test.ts": "f4fd998cb4e9ff95fa51b20caee115dc62fdb202", | ||
"packages/merge-styles/src/server.ts": "3c8a801b6d1452aea4659c943c6c0ffb91012f89", | ||
"packages/merge-styles/src/server.test.ts": "adbe206de933483d26bc894eb3441fdc198b1cc0", | ||
"packages/merge-styles/src/server.ts": "57f4ab40156c607416313490e7ebed0bf31d4b7d", | ||
"packages/merge-styles/src/styleToClassName.test.ts": "3618f400a2b4f939d256b4d50e35790315d67660", | ||
@@ -52,5 +52,5 @@ "packages/merge-styles/src/styleToClassName.ts": "0a9aa8f04cda47db6f9fe695a15aa35d1f7e50ae", | ||
"packages/merge-styles/webpack.config.js": "bfc856505c9975fb4ea67c35061bfaebe0916add", | ||
"common/config/rush/npm-shrinkwrap.json": "27915d6002c5b48f48da9c3b654d4611c576ba5e" | ||
"common/config/rush/npm-shrinkwrap.json": "cd342bb54e735d63b5ee17d4174f6d61f506382b" | ||
}, | ||
"arguments": "node ../../scripts/build.js --production" | ||
} |
{ | ||
"name": "@uifabric/merge-styles", | ||
"version": "6.0.2", | ||
"version": "6.1.0", | ||
"description": "Office UI Fabric style loading utilities.", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
699121
0
8211