@hitachivantara/app-shell-services 1.1.1 → 1.1.3
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/dist/bundles/app-shell-services.esm.js +17 -2065
- package/dist/esm/hooks/Hooks.js +2 -3
- package/dist/esm/providers/ServiceManagerProvider.js +1 -1
- package/dist/esm/utils/isEqual.js +28 -0
- package/package.json +5 -8
- package/dist/esm/_virtual/_cloneBuffer.js +0 -4
- package/dist/esm/_virtual/_commonjsHelpers.js +0 -8
- package/dist/esm/_virtual/_nodeUtil.js +0 -4
- package/dist/esm/_virtual/cloneDeep.js +0 -7
- package/dist/esm/_virtual/isBuffer.js +0 -4
- package/dist/esm/_virtual/isEqual.js +0 -7
package/dist/esm/hooks/Hooks.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useCallback, useRef } from "react";
|
|
2
|
-
import
|
|
3
|
-
import isEqual from "../_virtual/isEqual.js";
|
|
2
|
+
import { isEqual } from "../utils/isEqual.js";
|
|
4
3
|
import { useAsync } from "./useAsync.js";
|
|
5
4
|
import { useServicesContext } from "./useServicesContext.js";
|
|
6
5
|
function useDeepMemo(value) {
|
|
7
6
|
const ref = useRef();
|
|
8
7
|
if (!isEqual(value, ref.current)) {
|
|
9
|
-
ref.current =
|
|
8
|
+
ref.current = structuredClone(value);
|
|
10
9
|
}
|
|
11
10
|
return ref.current;
|
|
12
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo, createElement
|
|
1
|
+
import { createContext, useMemo, createElement } from "react";
|
|
2
2
|
import { createServiceReference } from "../utils/serviceReference.js";
|
|
3
3
|
function createServiceReferenceMap(services = {}) {
|
|
4
4
|
return Object.entries(services).reduce(
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function isEqual(a, b) {
|
|
2
|
+
if (a === b) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (a == null || b == null || typeof a !== typeof b || typeof a !== "object" || Array.isArray(a) !== Array.isArray(b)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
9
|
+
if (a.length !== b.length) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return a.every((item, index) => isEqual(item, b[index]));
|
|
13
|
+
}
|
|
14
|
+
const keysA = Object.keys(a);
|
|
15
|
+
const keysB = Object.keys(b);
|
|
16
|
+
if (keysA.length !== keysB.length) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
return keysA.every(
|
|
20
|
+
(key) => isEqual(
|
|
21
|
+
a[key],
|
|
22
|
+
b[key]
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
isEqual
|
|
28
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-services",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Hitachi Vantara UI Kit Team",
|
|
7
7
|
"description": "AppShell Services",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/pentaho/hv-uikit-react",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
13
|
+
"url": "git+https://github.com/pentaho/hv-uikit-react.git",
|
|
14
14
|
"directory": "packages/app-shell-services"
|
|
15
15
|
},
|
|
16
|
-
"bugs": "https://github.com/
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"lodash-es": "^4.17.21"
|
|
19
|
-
},
|
|
16
|
+
"bugs": "https://github.com/pentaho/hv-uikit-react/issues",
|
|
20
17
|
"peerDependencies": {
|
|
21
18
|
"react": "^18.2.0"
|
|
22
19
|
},
|
|
@@ -36,7 +33,7 @@
|
|
|
36
33
|
"access": "public",
|
|
37
34
|
"directory": "package"
|
|
38
35
|
},
|
|
39
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "e34acd74656ecb0ad2c31d6afaed30a00d58a8ca",
|
|
40
37
|
"types": "./dist/types/index.d.ts",
|
|
41
38
|
"module": "dist/esm/index.js"
|
|
42
39
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
-
function getDefaultExportFromCjs(x) {
|
|
3
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
commonjsGlobal,
|
|
7
|
-
getDefaultExportFromCjs
|
|
8
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as requireCloneDeep } from "../node_modules/lodash/cloneDeep.js";
|
|
3
|
-
var cloneDeepExports = requireCloneDeep();
|
|
4
|
-
const cloneDeep = /* @__PURE__ */ getDefaultExportFromCjs(cloneDeepExports);
|
|
5
|
-
export {
|
|
6
|
-
cloneDeep as default
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { getDefaultExportFromCjs } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as requireIsEqual } from "../node_modules/lodash/isEqual.js";
|
|
3
|
-
var isEqualExports = requireIsEqual();
|
|
4
|
-
const isEqual = /* @__PURE__ */ getDefaultExportFromCjs(isEqualExports);
|
|
5
|
-
export {
|
|
6
|
-
isEqual as default
|
|
7
|
-
};
|