@springtree/eva-sdk-core-settings 1.2.0 → 2.0.2
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 +51 -0
- package/lib/eva-sdk-core-settings.d.ts +2 -1
- package/lib/eva-sdk-core-settings.d.ts.map +1 -1
- package/lib/eva-sdk-core-settings.es5.js +12 -7
- package/lib/eva-sdk-core-settings.es5.js.map +1 -1
- package/lib/eva-sdk-core-settings.js +10 -6
- package/lib/eva-sdk-core-settings.js.map +1 -1
- package/lib/eva-sdk-core-settings.umd.js +19 -11
- package/lib/eva-sdk-core-settings.umd.js.map +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,57 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 2.0.2 (2021-11-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @springtree/eva-sdk-core-settings
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 2.0.1 (2021-09-23)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **settings:** create client version const ([62a4d42](https://github.com/springtreesolutions/eva-sdk-repo/commit/62a4d42306c4bf5ac2a34c0d27dbb12c6d4fef60))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# 2.0.0 (2021-07-02)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* **setting:** correct handler parameters ([3f85dd0](https://github.com/springtreesolutions/eva-sdk-repo/commit/3f85dd01c75ca227b303eeec92b50d31ffe30017))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **change-event:** replaced event-target with pubsub-js ([120a7d7](https://github.com/springtreesolutions/eva-sdk-repo/commit/120a7d7139afe42fbcf0dc669da0ffd19bf917f0))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### BREAKING CHANGES
|
|
39
|
+
|
|
40
|
+
* **change-event:** need to install new peer dependency
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [1.2.1](https://github.com/springtreesolutions/eva-sdk-repo/compare/@springtree/eva-sdk-core-settings@1.2.0...@springtree/eva-sdk-core-settings@1.2.1) (2021-06-11)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* **settings:** add event target polyfill ([6f71360](https://github.com/springtreesolutions/eva-sdk-repo/commit/6f713604cb9e375e5e69d6e6e7a234f4a7a66755))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
6
57
|
# 1.2.0 (2021-06-10)
|
|
7
58
|
|
|
8
59
|
|
|
@@ -18,7 +18,7 @@ export interface ISettingsChange {
|
|
|
18
18
|
* @export
|
|
19
19
|
* @class SettingsManager
|
|
20
20
|
*/
|
|
21
|
-
export declare class SettingsManager
|
|
21
|
+
export declare class SettingsManager {
|
|
22
22
|
/**
|
|
23
23
|
* The actual settings data
|
|
24
24
|
*
|
|
@@ -68,6 +68,7 @@ export interface IEvaCoreSettings {
|
|
|
68
68
|
appName: string;
|
|
69
69
|
appVersion: string;
|
|
70
70
|
}
|
|
71
|
+
export declare const SDK_CLIENT_VERSION = "2.0.0";
|
|
71
72
|
export declare const SETTINGS_GROUP_NAME = "evaCore";
|
|
72
73
|
/**
|
|
73
74
|
* Retrieves the core SDK setting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eva-sdk-core-settings.d.ts","sourceRoot":"","sources":["../src/eva-sdk-core-settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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ubsub-js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* The settings manager wraps a collection of settings and provides
|
|
3
5
|
* methods to register and retrieve groups of settings
|
|
@@ -6,9 +8,8 @@
|
|
|
6
8
|
* @export
|
|
7
9
|
* @class SettingsManager
|
|
8
10
|
*/
|
|
9
|
-
class SettingsManager
|
|
11
|
+
class SettingsManager {
|
|
10
12
|
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
13
|
/**
|
|
13
14
|
* The actual settings data
|
|
14
15
|
*
|
|
@@ -65,17 +66,21 @@ class SettingsManager extends EventTarget {
|
|
|
65
66
|
new: setting,
|
|
66
67
|
};
|
|
67
68
|
// Only emit the setting change when it has actually changed
|
|
69
|
+
// We will emit the setting change using the group and name scope
|
|
70
|
+
// so subscribers can focus on a certain group of settings
|
|
68
71
|
//
|
|
69
72
|
if (currentValue !== setting) {
|
|
70
|
-
|
|
73
|
+
pubsubJs.publish(`eva.setting.${change.group}.${change.name}`, change);
|
|
71
74
|
}
|
|
72
75
|
return change;
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
const settings = new SettingsManager();
|
|
76
|
-
//
|
|
79
|
+
// This is more of an SDK family version.
|
|
80
|
+
// Because this new SDK is modular it makes no sense to emit a single package
|
|
81
|
+
// version here
|
|
77
82
|
//
|
|
78
|
-
const
|
|
83
|
+
const SDK_CLIENT_VERSION = '2.0.0';
|
|
79
84
|
// Register the default settings
|
|
80
85
|
//
|
|
81
86
|
const SETTINGS_GROUP_NAME = 'evaCore';
|
|
@@ -84,7 +89,7 @@ const SETTINGS_GROUP_NAME = 'evaCore';
|
|
|
84
89
|
const defaultSettings = {
|
|
85
90
|
language: 'en-EN',
|
|
86
91
|
clientName: 'eva-sdk-core',
|
|
87
|
-
clientVersion:
|
|
92
|
+
clientVersion: SDK_CLIENT_VERSION,
|
|
88
93
|
appName: 'UNKNOWN',
|
|
89
94
|
appVersion: '0.0.0',
|
|
90
95
|
};
|
|
@@ -110,5 +115,5 @@ function setCoreSetting(settingName, setting) {
|
|
|
110
115
|
return settings.set(SETTINGS_GROUP_NAME, settingName, setting);
|
|
111
116
|
}
|
|
112
117
|
|
|
113
|
-
export { SETTINGS_GROUP_NAME, SettingsManager, getCoreSettings, setCoreSetting, settings };
|
|
118
|
+
export { SDK_CLIENT_VERSION, SETTINGS_GROUP_NAME, SettingsManager, getCoreSettings, setCoreSetting, settings };
|
|
114
119
|
//# sourceMappingURL=eva-sdk-core-settings.es5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eva-sdk-core-settings.es5.js","sources":[
|
|
1
|
+
{"version":3,"file":"eva-sdk-core-settings.es5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import pubsubJs from 'pubsub-js';
|
|
1
2
|
/**
|
|
2
3
|
* The settings manager wraps a collection of settings and provides
|
|
3
4
|
* methods to register and retrieve groups of settings
|
|
@@ -6,9 +7,8 @@
|
|
|
6
7
|
* @export
|
|
7
8
|
* @class SettingsManager
|
|
8
9
|
*/
|
|
9
|
-
export class SettingsManager
|
|
10
|
+
export class SettingsManager {
|
|
10
11
|
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
12
|
/**
|
|
13
13
|
* The actual settings data
|
|
14
14
|
*
|
|
@@ -65,17 +65,21 @@ export class SettingsManager extends EventTarget {
|
|
|
65
65
|
new: setting,
|
|
66
66
|
};
|
|
67
67
|
// Only emit the setting change when it has actually changed
|
|
68
|
+
// We will emit the setting change using the group and name scope
|
|
69
|
+
// so subscribers can focus on a certain group of settings
|
|
68
70
|
//
|
|
69
71
|
if (currentValue !== setting) {
|
|
70
|
-
|
|
72
|
+
pubsubJs.publish(`eva.setting.${change.group}.${change.name}`, change);
|
|
71
73
|
}
|
|
72
74
|
return change;
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
export const settings = new SettingsManager();
|
|
76
|
-
//
|
|
78
|
+
// This is more of an SDK family version.
|
|
79
|
+
// Because this new SDK is modular it makes no sense to emit a single package
|
|
80
|
+
// version here
|
|
77
81
|
//
|
|
78
|
-
const
|
|
82
|
+
export const SDK_CLIENT_VERSION = '2.0.0';
|
|
79
83
|
// Register the default settings
|
|
80
84
|
//
|
|
81
85
|
export const SETTINGS_GROUP_NAME = 'evaCore';
|
|
@@ -84,7 +88,7 @@ export const SETTINGS_GROUP_NAME = 'evaCore';
|
|
|
84
88
|
const defaultSettings = {
|
|
85
89
|
language: 'en-EN',
|
|
86
90
|
clientName: 'eva-sdk-core',
|
|
87
|
-
clientVersion:
|
|
91
|
+
clientVersion: SDK_CLIENT_VERSION,
|
|
88
92
|
appName: 'UNKNOWN',
|
|
89
93
|
appVersion: '0.0.0',
|
|
90
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eva-sdk-core-settings.js","sourceRoot":"","sources":["../src/eva-sdk-core-settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eva-sdk-core-settings.js","sourceRoot":"","sources":["../src/eva-sdk-core-settings.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAejC;;;;;;;GAOG;AACH,MAAM,OAAO,eAAe;IAA5B;QAEE;;;;;WAKG;QACK,aAAQ,GAA+B,EAAE,CAAC;IAiEpD,CAAC;IA/DC;;;;;OAKG;IACI,QAAQ,CAAC,SAAiB,EAAE,iBAAsB,EAAE;QACzD,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,wCAAwC,SAAS,EAAE,CAAC,CAAC;SACtE;QAED,sCAAsC;QACtC,EAAE;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAA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C;AAE7C,0BAA0B;AAC1B,EAAE;AACF,MAAM,eAAe,GAAqB;IACxC,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,cAAc;IAC1B,aAAa,EAAE,kBAAkB;IACjC,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,OAAO;CACpB,CAAC;AACF,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,WAAmC,EAAE,OAAiD;IACnH,OAAO,QAAQ,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.evaSdkCoreSettings = {}));
|
|
5
|
-
}(this, (function (exports) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('pubsub-js')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'pubsub-js'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.evaSdkCoreSettings = {}, global.pubsubJs));
|
|
5
|
+
})(this, (function (exports, pubsubJs) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var pubsubJs__default = /*#__PURE__*/_interopDefaultLegacy(pubsubJs);
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* The settings manager wraps a collection of settings and provides
|
|
@@ -12,9 +16,8 @@
|
|
|
12
16
|
* @export
|
|
13
17
|
* @class SettingsManager
|
|
14
18
|
*/
|
|
15
|
-
class SettingsManager
|
|
19
|
+
class SettingsManager {
|
|
16
20
|
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
21
|
/**
|
|
19
22
|
* The actual settings data
|
|
20
23
|
*
|
|
@@ -71,17 +74,21 @@
|
|
|
71
74
|
new: setting,
|
|
72
75
|
};
|
|
73
76
|
// Only emit the setting change when it has actually changed
|
|
77
|
+
// We will emit the setting change using the group and name scope
|
|
78
|
+
// so subscribers can focus on a certain group of settings
|
|
74
79
|
//
|
|
75
80
|
if (currentValue !== setting) {
|
|
76
|
-
|
|
81
|
+
pubsubJs__default["default"].publish(`eva.setting.${change.group}.${change.name}`, change);
|
|
77
82
|
}
|
|
78
83
|
return change;
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
const settings = new SettingsManager();
|
|
82
|
-
//
|
|
87
|
+
// This is more of an SDK family version.
|
|
88
|
+
// Because this new SDK is modular it makes no sense to emit a single package
|
|
89
|
+
// version here
|
|
83
90
|
//
|
|
84
|
-
const
|
|
91
|
+
const SDK_CLIENT_VERSION = '2.0.0';
|
|
85
92
|
// Register the default settings
|
|
86
93
|
//
|
|
87
94
|
const SETTINGS_GROUP_NAME = 'evaCore';
|
|
@@ -90,7 +97,7 @@
|
|
|
90
97
|
const defaultSettings = {
|
|
91
98
|
language: 'en-EN',
|
|
92
99
|
clientName: 'eva-sdk-core',
|
|
93
|
-
clientVersion:
|
|
100
|
+
clientVersion: SDK_CLIENT_VERSION,
|
|
94
101
|
appName: 'UNKNOWN',
|
|
95
102
|
appVersion: '0.0.0',
|
|
96
103
|
};
|
|
@@ -116,6 +123,7 @@
|
|
|
116
123
|
return settings.set(SETTINGS_GROUP_NAME, settingName, setting);
|
|
117
124
|
}
|
|
118
125
|
|
|
126
|
+
exports.SDK_CLIENT_VERSION = SDK_CLIENT_VERSION;
|
|
119
127
|
exports.SETTINGS_GROUP_NAME = SETTINGS_GROUP_NAME;
|
|
120
128
|
exports.SettingsManager = SettingsManager;
|
|
121
129
|
exports.getCoreSettings = getCoreSettings;
|
|
@@ -124,5 +132,5 @@
|
|
|
124
132
|
|
|
125
133
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
126
134
|
|
|
127
|
-
}))
|
|
135
|
+
}));
|
|
128
136
|
//# sourceMappingURL=eva-sdk-core-settings.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eva-sdk-core-settings.umd.js","sources":[
|
|
1
|
+
{"version":3,"file":"eva-sdk-core-settings.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springtree/eva-sdk-core-settings",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "The shared settings repository implementation for the EVA SDK",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "SpringTree <info@springtree.nl>",
|
|
@@ -22,5 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"typings": "lib/eva-sdk-core-settings.d.ts",
|
|
24
24
|
"private": false,
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "6424b18cbe6f14c3e21cb59971e8bf88d2c3f9e7",
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"pubsub-js": "^1.9.4"
|
|
28
|
+
}
|
|
26
29
|
}
|