@bbn/bbn 1.0.270 → 1.0.272

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.
@@ -0,0 +1 @@
1
+ export default function defaultWindowBlurFunction(): boolean;
@@ -0,0 +1,4 @@
1
+ export default function defaultWindowBlurFunction() {
2
+ return true;
3
+ }
4
+ ;
@@ -0,0 +1 @@
1
+ export default function defaultWindowFocusFunction(): boolean;
@@ -0,0 +1,4 @@
1
+ export default function defaultWindowFocusFunction() {
2
+ return true;
3
+ }
4
+ ;
package/dist/fn/init.js CHANGED
@@ -94,10 +94,12 @@ export default function init(cfg, force) {
94
94
  }
95
95
  window.onfocus = function () {
96
96
  bbn.env.isFocused = true;
97
+ bbn.fn.defaultWindowFocusFunction();
97
98
  };
98
99
  window.onblur = function () {
99
100
  bbn.env.isFocused = false;
100
101
  bbn.env.timeoff = Math.round(new Date().getTime() / 1000);
102
+ bbn.fn.defaultWindowBlurFunction();
101
103
  };
102
104
  document.addEventListener("focusin", function (e) {
103
105
  if (e.target instanceof HTMLElement &&
@@ -22,6 +22,9 @@ export default function treatForHash(value, fn, depth, level, visited) {
22
22
  else if (value === null) {
23
23
  value = "__BBN_NULL__";
24
24
  }
25
+ else if (value === null) {
26
+ value = "__BBN_NULL__";
27
+ }
25
28
  else if (typeof value === 'function') {
26
29
  value = "__BBN_FUNCTION__" + value.toString();
27
30
  }
@@ -69,7 +72,7 @@ export default function treatForHash(value, fn, depth, level, visited) {
69
72
  }
70
73
  else if (typeof value === 'object') {
71
74
  if (visited.has(value) || (depth && (depth < level))) {
72
- value = "__BBN_OBJECT__" + value.constructor.toString();
75
+ value = "__BBN_OBJECT__" + (value.constructor ? value.constructor.toString() : '');
73
76
  }
74
77
  else {
75
78
  visited.add(value);
package/dist/fn.d.ts CHANGED
@@ -54,6 +54,8 @@ import defaultPostLinkFunction from './fn/default/defaultPostLinkFunction.js';
54
54
  import defaultPreLinkFunction from './fn/default/defaultPreLinkFunction.js';
55
55
  import defaultResizeFunction from './fn/default/defaultResizeFunction.js';
56
56
  import defaultStartLoadingFunction from './fn/default/defaultStartLoadingFunction.js';
57
+ import defaultWindowBlurFunction from './fn/default/defaultWindowBlurFunction.js';
58
+ import defaultWindowFocusFunction from './fn/default/defaultWindowFocusFunction.js';
57
59
  import deleteProp from './fn/object/deleteProp.js';
58
60
  import diffObj from './fn/object/diffObj.js';
59
61
  import dirName from './fn/string/dirName.js';
@@ -290,6 +292,8 @@ declare const _default: {
290
292
  defaultPreLinkFunction: typeof defaultPreLinkFunction;
291
293
  defaultResizeFunction: typeof defaultResizeFunction;
292
294
  defaultStartLoadingFunction: typeof defaultStartLoadingFunction;
295
+ defaultWindowBlurFunction: typeof defaultWindowBlurFunction;
296
+ defaultWindowFocusFunction: typeof defaultWindowFocusFunction;
293
297
  deleteProp: typeof deleteProp;
294
298
  diffObj: typeof diffObj;
295
299
  dirName: typeof dirName;
package/dist/fn.js CHANGED
@@ -54,6 +54,8 @@ import defaultPostLinkFunction from './fn/default/defaultPostLinkFunction.js';
54
54
  import defaultPreLinkFunction from './fn/default/defaultPreLinkFunction.js';
55
55
  import defaultResizeFunction from './fn/default/defaultResizeFunction.js';
56
56
  import defaultStartLoadingFunction from './fn/default/defaultStartLoadingFunction.js';
57
+ import defaultWindowBlurFunction from './fn/default/defaultWindowBlurFunction.js';
58
+ import defaultWindowFocusFunction from './fn/default/defaultWindowFocusFunction.js';
57
59
  import deleteProp from './fn/object/deleteProp.js';
58
60
  import diffObj from './fn/object/diffObj.js';
59
61
  import dirName from './fn/string/dirName.js';
@@ -290,6 +292,8 @@ export default {
290
292
  defaultPreLinkFunction: defaultPreLinkFunction,
291
293
  defaultResizeFunction: defaultResizeFunction,
292
294
  defaultStartLoadingFunction: defaultStartLoadingFunction,
295
+ defaultWindowBlurFunction: defaultWindowBlurFunction,
296
+ defaultWindowFocusFunction: defaultWindowFocusFunction,
293
297
  deleteProp: deleteProp,
294
298
  diffObj: diffObj,
295
299
  dirName: dirName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.270",
3
+ "version": "1.0.272",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",