@ng-web-apis/common
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -51,3 +51,8 @@ (function (global, factory) { | ||
var CSS = new core.InjectionToken('An abstraction over window.CSS object', { | ||
factory: function () { return core.inject(WINDOW).CSS; }, | ||
factory: function () { | ||
return core.inject(WINDOW).CSS || { | ||
escape: function (v) { return v; }, | ||
supports: function () { return false; }, | ||
}; | ||
}, | ||
}); | ||
@@ -54,0 +59,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("@ng-web-apis/common",["exports","rxjs","rxjs/operators","@angular/common","@angular/core"],e):e((n["ng-web-apis"]=n["ng-web-apis"]||{},n["ng-web-apis"].common={}),n.rxjs,n.rxjs.operators,n.ng.common,n.ng.core)}(this,function(n,e,o,r,t){"use strict";var i=new t.InjectionToken("An abstraction over global window object",{factory:function(){var n=t.inject(r.DOCUMENT).defaultView;if(!n)throw new Error("Window is not available");return n}}),a=new t.InjectionToken("An abstraction over window.performance object",{factory:function(){return t.inject(i).performance}}),c=new t.InjectionToken("Shared Observable based on `window.requestAnimationFrame`",{factory:function(){var n=t.inject(a);return e.of(0,e.animationFrameScheduler).pipe(o.repeat(),o.map(function(){return n.now()}),o.share())}}),u=new t.InjectionToken("An abstraction over window.CSS object",{factory:function(){return t.inject(i).CSS}}),s=new t.InjectionToken("An abstraction over window.localStorage object",{factory:function(){return t.inject(i).localStorage}}),f=new t.InjectionToken("An abstraction over window.location object",{factory:function(){return t.inject(i).location}}),w=new t.InjectionToken("An abstraction over window.navigator object",{factory:function(){return t.inject(i).navigator}}),j=new t.InjectionToken("An abstraction over window.navigator.userAgent object",{factory:function(){return t.inject(w).userAgent}});n.ANIMATION_FRAME=c,n.CSS=u,n.LOCAL_STORAGE=s,n.LOCATION=f,n.NAVIGATOR=w,n.PERFORMANCE=a,n.USER_AGENT=j,n.WINDOW=i,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("rxjs"),require("rxjs/operators"),require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("@ng-web-apis/common",["exports","rxjs","rxjs/operators","@angular/common","@angular/core"],e):e((n["ng-web-apis"]=n["ng-web-apis"]||{},n["ng-web-apis"].common={}),n.rxjs,n.rxjs.operators,n.ng.common,n.ng.core)}(this,function(n,e,o,r,t){"use strict";var i=new t.InjectionToken("An abstraction over global window object",{factory:function(){var n=t.inject(r.DOCUMENT).defaultView;if(!n)throw new Error("Window is not available");return n}}),a=new t.InjectionToken("An abstraction over window.performance object",{factory:function(){return t.inject(i).performance}}),c=new t.InjectionToken("Shared Observable based on `window.requestAnimationFrame`",{factory:function(){var n=t.inject(a);return e.of(0,e.animationFrameScheduler).pipe(o.repeat(),o.map(function(){return n.now()}),o.share())}}),u=new t.InjectionToken("An abstraction over window.CSS object",{factory:function(){return t.inject(i).CSS||{escape:function(n){return n},supports:function(){return!1}}}}),s=new t.InjectionToken("An abstraction over window.localStorage object",{factory:function(){return t.inject(i).localStorage}}),f=new t.InjectionToken("An abstraction over window.location object",{factory:function(){return t.inject(i).location}}),w=new t.InjectionToken("An abstraction over window.navigator object",{factory:function(){return t.inject(i).navigator}}),j=new t.InjectionToken("An abstraction over window.navigator.userAgent object",{factory:function(){return t.inject(w).userAgent}});n.ANIMATION_FRAME=c,n.CSS=u,n.LOCAL_STORAGE=s,n.LOCATION=f,n.NAVIGATOR=w,n.PERFORMANCE=a,n.USER_AGENT=j,n.WINDOW=i,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ng-web-apis-common.umd.min.js.map |
@@ -9,4 +9,7 @@ /** | ||
export const CSS = new InjectionToken('An abstraction over window.CSS object', { | ||
factory: () => inject(WINDOW).CSS, | ||
factory: () => inject(WINDOW).CSS || { | ||
escape: v => v, | ||
supports: () => false, | ||
}, | ||
}); | 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+9,9 @@ /** | ||
export var CSS = new InjectionToken('An abstraction over window.CSS object', { | ||
factory: function () { return inject(WINDOW).CSS; }, | ||
factory: function () { | ||
return inject(WINDOW).CSS || { | ||
escape: function (v) { return v; }, | ||
supports: function () { return false; }, | ||
}; | ||
}, | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3NzLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5nLXdlYi1hcGlzL2NvbW1vbi8iLCJzb3VyY2VzIjpbInRva2Vucy9jc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBQyxNQUFNLEVBQUUsY0FBYyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3JELE9BQU8sRUFBQyxNQUFNLEVBQUMsTUFBTSxVQUFVLENBQUM7O0FBUWhDLE1BQU0sS0FBTyxHQUFHLEdBQUcsSUFBSSxjQUFjLENBQU0sdUNBQXVDLEVBQUU7SUFDaEYsT0FBTyxFQUFFLGNBQU0sT0FBQSxNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsR0FBRyxFQUFsQixDQUFrQjtDQUNwQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtpbmplY3QsIEluamVjdGlvblRva2VufSBmcm9tICdAYW5ndWxhci9jb3JlJztcclxuaW1wb3J0IHtXSU5ET1d9IGZyb20gJy4vd2luZG93JztcclxuXHJcbmRlY2xhcmUgZ2xvYmFsIHtcclxuICAgIGludGVyZmFjZSBXaW5kb3cge1xyXG4gICAgICAgIENTUzogQ1NTO1xyXG4gICAgfVxyXG59XHJcblxyXG5leHBvcnQgY29uc3QgQ1NTID0gbmV3IEluamVjdGlvblRva2VuPENTUz4oJ0FuIGFic3RyYWN0aW9uIG92ZXIgd2luZG93LkNTUyBvYmplY3QnLCB7XHJcbiAgICBmYWN0b3J5OiAoKSA9PiBpbmplY3QoV0lORE9XKS5DU1MsXH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5ET1cpLkNTUyB8fCB7XHJcbiAgICAgICAgICAgIGVzY2FwZTogdiA9PiB2LFxyXG4gICAgICAgICAgICBzdXBwb3J0czogKCkgPT4gZmFsc2UsXHJcbiAgICAgICAgfSxcclxufSk7XHJcbiJdfQ== |
@@ -50,3 +50,6 @@ import { animationFrameScheduler, of } from 'rxjs'; | ||
const CSS = new InjectionToken('An abstraction over window.CSS object', { | ||
factory: () => inject(WINDOW).CSS, | ||
factory: () => inject(WINDOW).CSS || { | ||
escape: v => v, | ||
supports: () => false, | ||
}, | ||
}); | ||
@@ -53,0 +56,0 @@ |
@@ -50,3 +50,8 @@ import { animationFrameScheduler, of } from 'rxjs'; | ||
var CSS = new InjectionToken('An abstraction over window.CSS object', { | ||
factory: function () { return inject(WINDOW).CSS; }, | ||
factory: function () { | ||
return inject(WINDOW).CSS || { | ||
escape: function (v) { return v; }, | ||
supports: function () { return false; }, | ||
}; | ||
}, | ||
}); | ||
@@ -53,0 +58,0 @@ |
{ | ||
"name": "@ng-web-apis/common", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": ">=6.0.0", |
@@ -17,4 +17,4 @@ # Common utils for Web APIs | ||
- `ANIMATION_FRAME` — shared Observable based on `window.requestAnimationFrame` | ||
- `CSS` — provides access to `window.CSS` object | ||
- `CSS` — provides access to `window.CSS` object or mock object if it's not available (i.e. in IE) | ||
- `LOCATION` — provides access to `window.location` object | ||
- `LOCAL_STORAGE` — provides access to `window.localStorage` object |
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
76440
571