jss-plugin-rule-value-observable
Advanced tools
Comparing version 10.0.0-alpha.22 to 10.0.0-alpha.23
@@ -1,5 +0,1 @@ | ||
var global$1 = (typeof global !== "undefined" ? global : | ||
typeof self !== "undefined" ? self : | ||
typeof window !== "undefined" ? window : {}); | ||
function symbolObservablePonyfill(root) { | ||
@@ -23,2 +19,4 @@ var result; | ||
/* global window */ | ||
var root; | ||
@@ -30,4 +28,4 @@ | ||
root = window; | ||
} else if (typeof global$1 !== 'undefined') { | ||
root = global$1; | ||
} else if (typeof global !== 'undefined') { | ||
root = global; | ||
} else if (typeof module !== 'undefined') { | ||
@@ -1542,5 +1540,8 @@ root = module; | ||
var sheets = new SheetsRegistry(); | ||
var global$1$1 = typeof global$1 !== "undefined" ? global$1 : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}; | ||
/* eslint-disable */ | ||
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 | ||
var globalThis = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); | ||
var ns = '2f1acc6c3a606b082e5eef5e54414ffb'; | ||
if (global$1$1[ns] == null) global$1$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify | ||
if (globalThis[ns] == null) globalThis[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify | ||
// the current version with just one short number and use it for classes generation | ||
@@ -1550,3 +1551,3 @@ // we use a counter. Also it is more accurate, because user can manually reevaluate | ||
var moduleId = global$1$1[ns]++; | ||
var moduleId = globalThis[ns]++; | ||
var maxRules = 1e10; | ||
@@ -2043,3 +2044,3 @@ /** | ||
this.id = instanceCounter++; | ||
this.version = "10.0.0-alpha.22"; | ||
this.version = "10.0.0-alpha.23"; | ||
this.plugins = new PluginsRegistry(); | ||
@@ -2046,0 +2047,0 @@ this.options = { |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jss')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'jss'], factory) : | ||
(global = global || self, factory(global.jssPluginRuleValueObservable = {}, global.jss)); | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jss')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'jss'], factory) : | ||
(global = global || self, factory(global.jssPluginRuleValueObservable = {}, global.jss)); | ||
}(this, function (exports, jss) { 'use strict'; | ||
var global$1 = (typeof global !== "undefined" ? global : | ||
typeof self !== "undefined" ? self : | ||
typeof window !== "undefined" ? window : {}); | ||
function symbolObservablePonyfill(root) { | ||
var result; | ||
var Symbol = root.Symbol; | ||
function symbolObservablePonyfill(root) { | ||
var result; | ||
var Symbol = root.Symbol; | ||
if (typeof Symbol === 'function') { | ||
if (Symbol.observable) { | ||
result = Symbol.observable; | ||
} else { | ||
result = Symbol('observable'); | ||
Symbol.observable = result; | ||
} | ||
} else { | ||
result = '@@observable'; | ||
} | ||
if (typeof Symbol === 'function') { | ||
if (Symbol.observable) { | ||
result = Symbol.observable; | ||
} else { | ||
result = Symbol('observable'); | ||
Symbol.observable = result; | ||
} | ||
} else { | ||
result = '@@observable'; | ||
} | ||
return result; | ||
} | ||
return result; | ||
} | ||
/* global window */ | ||
var root; | ||
var root; | ||
if (typeof self !== 'undefined') { | ||
root = self; | ||
} else if (typeof window !== 'undefined') { | ||
root = window; | ||
} else if (typeof global$1 !== 'undefined') { | ||
root = global$1; | ||
} else if (typeof module !== 'undefined') { | ||
root = module; | ||
} else { | ||
root = Function('return this')(); | ||
} | ||
if (typeof self !== 'undefined') { | ||
root = self; | ||
} else if (typeof window !== 'undefined') { | ||
root = window; | ||
} else if (typeof global !== 'undefined') { | ||
root = global; | ||
} else if (typeof module !== 'undefined') { | ||
root = module; | ||
} else { | ||
root = Function('return this')(); | ||
} | ||
var result = symbolObservablePonyfill(root); | ||
var result = symbolObservablePonyfill(root); | ||
var isObservable = function isObservable(value) { | ||
return value && value[result] && value === value[result](); | ||
}; | ||
var isObservable = function isObservable(value) { | ||
return value && value[result] && value === value[result](); | ||
}; | ||
function observablePlugin(updateOptions) { | ||
return { | ||
onCreateRule: function onCreateRule(name, decl, options) { | ||
if (!isObservable(decl)) return null; // Cast `decl` to `Observable`, since it passed the type guard. | ||
function observablePlugin(updateOptions) { | ||
return { | ||
onCreateRule: function onCreateRule(name, decl, options) { | ||
if (!isObservable(decl)) return null; // Cast `decl` to `Observable`, since it passed the type guard. | ||
var style$ = decl; | ||
var rule = jss.createRule(name, {}, options); // TODO | ||
// Call `stream.subscribe()` returns a subscription, which should be explicitly | ||
// unsubscribed from when we know this sheet is no longer needed. | ||
var style$ = decl; | ||
var rule = jss.createRule(name, {}, options); // TODO | ||
// Call `stream.subscribe()` returns a subscription, which should be explicitly | ||
// unsubscribed from when we know this sheet is no longer needed. | ||
style$.subscribe(function (style) { | ||
for (var prop in style) { | ||
rule.prop(prop, style[prop], updateOptions); | ||
} | ||
}); | ||
return rule; | ||
}, | ||
onProcessRule: function onProcessRule(rule) { | ||
if (rule && rule.type !== 'style') return; | ||
var styleRule = rule; | ||
var style = styleRule.style; | ||
style$.subscribe(function (style) { | ||
for (var prop in style) { | ||
rule.prop(prop, style[prop], updateOptions); | ||
} | ||
}); | ||
return rule; | ||
}, | ||
onProcessRule: function onProcessRule(rule) { | ||
if (rule && rule.type !== 'style') return; | ||
var styleRule = rule; | ||
var style = styleRule.style; | ||
var _loop = function _loop(prop) { | ||
var value = style[prop]; | ||
if (!isObservable(value)) return "continue"; | ||
delete style[prop]; | ||
value.subscribe({ | ||
next: function next(nextValue) { | ||
styleRule.prop(prop, nextValue, updateOptions); | ||
} | ||
}); | ||
}; | ||
var _loop = function _loop(prop) { | ||
var value = style[prop]; | ||
if (!isObservable(value)) return "continue"; | ||
delete style[prop]; | ||
value.subscribe({ | ||
next: function next(nextValue) { | ||
styleRule.prop(prop, nextValue, updateOptions); | ||
} | ||
}); | ||
}; | ||
for (var prop in style) { | ||
var _ret = _loop(prop); | ||
for (var prop in style) { | ||
var _ret = _loop(prop); | ||
if (_ret === "continue") continue; | ||
} | ||
} | ||
}; | ||
} | ||
if (_ret === "continue") continue; | ||
} | ||
} | ||
}; | ||
} | ||
exports.default = observablePlugin; | ||
exports.default = observablePlugin; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); | ||
//# sourceMappingURL=jss-plugin-rule-value-observable.js.map |
@@ -1,1 +0,1 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jss")):"function"==typeof define&&define.amd?define(["exports","jss"],n):n((e=e||self).jssPluginRuleValueObservable={},e.jss)}(this,function(e,n){"use strict";var o="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};var t=function(e){var n,o=e.Symbol;return"function"==typeof o?o.observable?n=o.observable:(n=o("observable"),o.observable=n):n="@@observable",n}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof module?module:Function("return this")()),r=function(e){return e&&e[t]&&e===e[t]()};e.default=function(e){return{onCreateRule:function(o,t,u){if(!r(t))return null;var f=t,i=n.createRule(o,{},u);return f.subscribe(function(n){for(var o in n)i.prop(o,n[o],e)}),i},onProcessRule:function(n){if(!n||"style"===n.type){var o=n,t=o.style,u=function(n){var u=t[n];if(!r(u))return"continue";delete t[n],u.subscribe({next:function(t){o.prop(n,t,e)}})};for(var f in t)u(f)}}}},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("jss")):"function"==typeof define&&define.amd?define(["exports","jss"],n):n((e=e||self).jssPluginRuleValueObservable={},e.jss)}(this,function(e,n){"use strict";var o=function(e){var n,o=e.Symbol;return"function"==typeof o?o.observable?n=o.observable:(n=o("observable"),o.observable=n):n="@@observable",n}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),t=function(e){return e&&e[o]&&e===e[o]()};e.default=function(e){return{onCreateRule:function(o,r,u){if(!t(r))return null;var f=r,i=n.createRule(o,{},u);return f.subscribe(function(n){for(var o in n)i.prop(o,n[o],e)}),i},onProcessRule:function(n){if(!n||"style"===n.type){var o=n,r=o.style,u=function(n){var u=r[n];if(!t(u))return"continue";delete r[n],u.subscribe({next:function(t){o.prop(n,t,e)}})};for(var f in r)u(f)}}}},Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "jss-plugin-rule-value-observable", | ||
"description": "JSS plugin for TC39 Observables support", | ||
"version": "10.0.0-alpha.22", | ||
"version": "10.0.0-alpha.23", | ||
"license": "MIT", | ||
@@ -44,6 +44,6 @@ "homepage": "https://cssinjs.org/", | ||
"@babel/runtime": "^7.3.1", | ||
"jss": "10.0.0-alpha.22", | ||
"jss": "10.0.0-alpha.23", | ||
"symbol-observable": "^1.2.0" | ||
}, | ||
"gitHead": "9427ea592d80acc5e1db33af11950da20ca34c08" | ||
"gitHead": "0b17c5d9717141565e466ea0dafdf3ccbe86df5a" | ||
} |
@@ -12,3 +12,3 @@ # jss-plugin-rule-value-observable | ||
See our website [jss-plugin-rule-value-observable](https://cssinjs.org/jss-plugin-rule-value-observable?v=v10.0.0-alpha.22) for more information. | ||
See our website [jss-plugin-rule-value-observable](https://cssinjs.org/jss-plugin-rule-value-observable?v=v10.0.0-alpha.23) for more information. | ||
@@ -15,0 +15,0 @@ ## Install |
Sorry, the diff of this file is not supported yet
82793
2424
+ Addedcsstype@2.6.21(transitive)
+ Addedjss@10.0.0-alpha.23(transitive)
- Removedjss@10.0.0-alpha.22(transitive)
Updatedjss@10.0.0-alpha.23