ag-common 0.0.424 → 0.0.426

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.
@@ -38,7 +38,8 @@ const useCallOpenApi = (inConfig) => {
38
38
  (0, useGranularHook_1.useGranularEffect)(() => {
39
39
  if (JSON.stringify(config) !== JSON.stringify(inConfig)) {
40
40
  setConfig(inConfig);
41
- setResp(defaultState(inConfig, true));
41
+ setResp(Object.assign(Object.assign({}, defaultState(inConfig, true)), { loading: true }));
42
+ void (0, direct_1.callOpenApi)(inConfig).then((r) => setResp((r2) => (Object.assign(Object.assign(Object.assign({}, r2), r), { loading: false }))));
42
43
  }
43
44
  }, [inConfig], [resp, setResp, config, setConfig]);
44
45
  const reFetch = (0, react_1.useCallback)(() => __awaiter(void 0, void 0, void 0, function* () {
@@ -66,7 +67,7 @@ const useCallOpenApi = (inConfig) => {
66
67
  setResp((d) => (Object.assign(Object.assign({}, d), { loading: true })));
67
68
  void reFetch();
68
69
  }, [config.disabled, reFetch, resp]);
69
- return Object.assign(Object.assign({}, resp), { reFetch, setData: (p) => __awaiter(void 0, void 0, void 0, function* () {
70
+ const ret = Object.assign(Object.assign({}, resp), { reFetch, setData: (p) => __awaiter(void 0, void 0, void 0, function* () {
70
71
  //wipe cache, or might revert
71
72
  yield (0, cached_1.setOpenApiCacheRaw)(config, undefined);
72
73
  //ensure datetime is changed, or might get overwritten
@@ -74,5 +75,6 @@ const useCallOpenApi = (inConfig) => {
74
75
  ? p(x.data)
75
76
  : p })));
76
77
  }) });
78
+ return ret;
77
79
  };
78
80
  exports.useCallOpenApi = useCallOpenApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
+ "version": "0.0.426",
2
3
  "name": "ag-common",
3
- "version": "0.0.424",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",
@@ -8,11 +8,11 @@
8
8
  "license": "ISC",
9
9
  "scripts": {
10
10
  "preinstall": "npx only-allow pnpm",
11
- "format": "npx eslint --ext .ts,.tsx ./src --fix && npx eslint --ext .ts,.tsx ./story --fix",
11
+ "format": "npx eslint --ext .ts,.tsx ./src --fix && npx eslint --ext .ts,.tsx ./stories --fix",
12
12
  "build": "rimraf dist && npm run lint && tsc",
13
13
  "lint": "npx eslint --ext .ts,.tsx ./src",
14
- "start": "cross-env BROWSER=none cross-env NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
15
- "build-storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook -o docs --quiet"
14
+ "start": "cross-env BROWSER=none cross-env storybook dev -p 6006",
15
+ "build-storybook": "storybook build -o docs --quiet"
16
16
  },
17
17
  "dependencies": {
18
18
  "aws-cdk-lib": ">=2",
@@ -27,32 +27,29 @@
27
27
  "react-dom": ">=18",
28
28
  "typescript": ">=5"
29
29
  },
30
- "peerDependencies": {
31
- "@emotion/react": ">=11",
32
- "@emotion/styled": ">=11"
33
- },
34
30
  "devDependencies": {
35
- "@babel/core": "7.21.3",
36
- "@storybook/addon-actions": "6.5.16",
37
- "@storybook/addon-docs": "6.5.16",
38
- "@storybook/addon-essentials": "6.5.16",
39
- "@storybook/addon-interactions": "6.5.16",
40
- "@storybook/addon-links": "6.5.16",
41
- "@storybook/addons": "6.5.16",
42
- "@storybook/react": "6.5.16",
43
- "@storybook/theming": "6.5.16",
44
- "@types/jsonwebtoken": "9.0.1",
45
- "@types/node": "18.15.11",
46
- "@types/react": "18.0.31",
47
- "@types/react-dom": "18.0.11",
31
+ "@babel/core": "7.21.4",
32
+ "@babel/preset-typescript": "^7.21.4",
33
+ "@babel/types": "^7.21.4",
48
34
  "@emotion/react": "11.10.6",
49
35
  "@emotion/styled": "11.10.6",
36
+ "@storybook/addon-actions": "7.0.7",
37
+ "@storybook/addon-docs": "7.0.7",
38
+ "@storybook/addon-essentials": "7.0.7",
39
+ "@storybook/addon-interactions": "7.0.7",
40
+ "@storybook/addon-links": "7.0.7",
41
+ "@storybook/addons": "7.0.7",
42
+ "@storybook/react": "7.0.7",
43
+ "@storybook/react-webpack5": "7.0.7",
44
+ "@storybook/theming": "7.0.7",
45
+ "@types/jsonwebtoken": "9.0.2",
46
+ "@types/node": "18.16.1",
47
+ "@types/react": "18.2.0",
48
+ "@types/react-dom": "18.2.1",
50
49
  "cross-env": "7.0.3",
51
50
  "eslint-config-e7npm": "0.0.9",
52
- "rimraf": "4.4.1"
53
- },
54
- "resolutions": {
55
- "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.f9c48c0.0"
51
+ "rimraf": "5.0.0",
52
+ "storybook": "7.0.7"
56
53
  },
57
54
  "files": [
58
55
  "dist/**/*",