@dereekb/browser 1.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -4
- package/README.md +1 -1
- package/package.json +14 -2
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/index.js +3 -3
- package/src/lib/index.js.map +1 -1
- package/src/lib/service.d.ts +3 -1
- package/src/lib/service.js +15 -3
- package/src/lib/service.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
-
# [
|
|
5
|
+
# [3.0.0](https://github.com/dereekb/dbx-components/compare/v2.1.0...v3.0.0) (2022-05-13)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
# [
|
|
9
|
+
# [2.1.0](https://github.com/dereekb/dbx-components/compare/v2.0.0...v2.1.0) (2022-03-17)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# [2.0.0](https://github.com/dereekb/dbx-components/compare/v1.2.0...v2.0.0) (2022-03-13)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.2.0](https://github.com/dereekb/dbx-components/compare/v1.1.0...v1.2.0) (2022-03-04)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# [1.1.0](https://github.com/dereekb/dbx-components/compare/v1.0.0...v1.1.0) (2022-03-02)
|
|
10
22
|
|
|
11
23
|
|
|
12
24
|
|
|
@@ -15,8 +27,8 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
|
|
|
15
27
|
|
|
16
28
|
### Features
|
|
17
29
|
|
|
18
|
-
* added vh100 functionality ([10b86b4](https://github.com/dereekb/
|
|
19
|
-
* segment analytics ([b81d5a6](https://github.com/dereekb/
|
|
30
|
+
* added vh100 functionality ([10b86b4](https://github.com/dereekb/dbx-components/commit/10b86b42fb6653c338212b32d7f3555109747787))
|
|
31
|
+
* segment analytics ([b81d5a6](https://github.com/dereekb/dbx-components/commit/b81d5a6a70ecf3bc35852d441cfd79e91e5dcb51))
|
|
20
32
|
|
|
21
33
|
|
|
22
34
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@dereekb/browser
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
-
The sources for this package are in the main [@dereekb/
|
|
4
|
+
The sources for this package are in the main [@dereekb/dbx-components](https://github.com/dereekb/dbx-components) repo. Please file issues and pull requests against that repo.
|
|
5
5
|
|
|
6
6
|
License: MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/browser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"typings": "./src/index.d.ts"
|
|
6
|
+
"typings": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {},
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@dereekb/util": "3.0.0",
|
|
10
|
+
"make-error": "^1.3.0",
|
|
11
|
+
"extra-set": "^2.2.11",
|
|
12
|
+
"change-case": "^4.1.2",
|
|
13
|
+
"@dereekb/rxjs": "3.0.0",
|
|
14
|
+
"rxjs": "^7.0.0",
|
|
15
|
+
"ms": "^3.0.0-canary.1",
|
|
16
|
+
"@angular/core": "^13.0.0",
|
|
17
|
+
"tslib": "^2.0.0"
|
|
18
|
+
}
|
|
7
19
|
}
|
package/src/index.js
CHANGED
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/browser/src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/browser/src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAsB"}
|
package/src/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
tslib_1.__exportStar(require("./service"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./vh100"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./window"), exports);
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/browser/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/browser/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,kDAAwB;AACxB,mDAAyB"}
|
package/src/lib/service.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
2
3
|
/**
|
|
3
4
|
* Used for loading services in the browser that are imported from other scripts, such as Facebook, Segment, Stripe, etc.
|
|
4
5
|
*/
|
|
5
|
-
export declare abstract class AbstractAsyncWindowLoadedService<T> {
|
|
6
|
+
export declare abstract class AbstractAsyncWindowLoadedService<T> implements OnDestroy {
|
|
6
7
|
private _windowKey;
|
|
7
8
|
private _callbackKey?;
|
|
8
9
|
private _serviceName;
|
|
@@ -14,6 +15,7 @@ export declare abstract class AbstractAsyncWindowLoadedService<T> {
|
|
|
14
15
|
* @param _callbackKey Optional key attached to window that is a function that is executed when the setup is complete.
|
|
15
16
|
*/
|
|
16
17
|
constructor(_windowKey: string, _callbackKey?: string | undefined, _serviceName?: string, preload?: boolean);
|
|
18
|
+
ngOnDestroy(): void;
|
|
17
19
|
getService(): Promise<T>;
|
|
18
20
|
protected loadService(): Promise<T>;
|
|
19
21
|
protected _onLoadServiceFailure(): Promise<T> | void;
|
package/src/lib/service.js
CHANGED
|
@@ -4,10 +4,11 @@ exports.AbstractAsyncWindowLoadedService = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const rxjs_1 = require("@dereekb/rxjs");
|
|
6
6
|
const rxjs_2 = require("rxjs");
|
|
7
|
+
const core_1 = require("@angular/core");
|
|
7
8
|
/**
|
|
8
9
|
* Used for loading services in the browser that are imported from other scripts, such as Facebook, Segment, Stripe, etc.
|
|
9
10
|
*/
|
|
10
|
-
class AbstractAsyncWindowLoadedService {
|
|
11
|
+
let AbstractAsyncWindowLoadedService = class AbstractAsyncWindowLoadedService {
|
|
11
12
|
/**
|
|
12
13
|
* @param _windowKey Key that is attached to the window for the object that is the service when finished loading.
|
|
13
14
|
* @param _callbackKey Optional key attached to window that is a function that is executed when the setup is complete.
|
|
@@ -24,6 +25,9 @@ class AbstractAsyncWindowLoadedService {
|
|
|
24
25
|
setTimeout(() => this.loadService().catch());
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
ngOnDestroy() {
|
|
29
|
+
this._loading.complete();
|
|
30
|
+
}
|
|
27
31
|
getService() {
|
|
28
32
|
return (0, rxjs_2.firstValueFrom)(this.service$);
|
|
29
33
|
}
|
|
@@ -71,7 +75,7 @@ class AbstractAsyncWindowLoadedService {
|
|
|
71
75
|
_onLoadServiceFailure() {
|
|
72
76
|
}
|
|
73
77
|
completeLoadingService() {
|
|
74
|
-
return
|
|
78
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
75
79
|
yield this._prepareCompleteLoadingService();
|
|
76
80
|
const service = window[this._windowKey];
|
|
77
81
|
if (!service) {
|
|
@@ -88,6 +92,14 @@ class AbstractAsyncWindowLoadedService {
|
|
|
88
92
|
_initService(service) {
|
|
89
93
|
return Promise.resolve(service);
|
|
90
94
|
}
|
|
91
|
-
}
|
|
95
|
+
};
|
|
96
|
+
AbstractAsyncWindowLoadedService = tslib_1.__decorate([
|
|
97
|
+
(0, core_1.Injectable)(),
|
|
98
|
+
tslib_1.__param(0, (0, core_1.Inject)(null)),
|
|
99
|
+
tslib_1.__param(1, (0, core_1.Inject)(null)),
|
|
100
|
+
tslib_1.__param(2, (0, core_1.Inject)(null)),
|
|
101
|
+
tslib_1.__param(3, (0, core_1.Inject)(null)),
|
|
102
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, Boolean])
|
|
103
|
+
], AbstractAsyncWindowLoadedService);
|
|
92
104
|
exports.AbstractAsyncWindowLoadedService = AbstractAsyncWindowLoadedService;
|
|
93
105
|
//# sourceMappingURL=service.js.map
|
package/src/lib/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../packages/browser/src/lib/service.ts"],"names":[],"mappings":";;;;AACA,wCAAsD;AACtD,+
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../../packages/browser/src/lib/service.ts"],"names":[],"mappings":";;;;AACA,wCAAsD;AACtD,+BAAiG;AACjG,wCAAwE;AAExE;;GAEG;AAEH,IAAsB,gCAAgC,GAAtD,MAAsB,gCAAgC;IAOpD;;;OAGG;IACH,YACwB,UAAkB,EAClB,YAAqB,EACrB,eAAuB,UAAU,EACzC,UAAmB,IAAI;QAHf,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAS;QACrB,iBAAY,GAAZ,YAAY,CAAqB;QAZjD,aAAQ,GAAG,IAAI,sBAAe,CAAoB,SAAS,CAAC,CAAC;QAE5D,aAAQ,GAA2B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAA,eAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,IAAA,kBAAW,GAAE,EAAE,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC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