ag-common 0.0.35 → 0.0.39

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.
@@ -23,3 +23,4 @@ export declare function toTitleCase(str: string): string;
23
23
  * @returns
24
24
  */
25
25
  export declare function replaceRemove(str: string, ...params: string[]): string;
26
+ export declare function containsInsensitive(str: string, ...args: string[]): boolean;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceRemove = exports.toTitleCase = exports.niceUrl = exports.truncate = exports.trim = exports.trimSide = exports.csvJSON = void 0;
3
+ exports.containsInsensitive = exports.replaceRemove = exports.toTitleCase = exports.niceUrl = exports.truncate = exports.trim = exports.trimSide = exports.csvJSON = void 0;
4
4
  const csvJSON = (csv) => {
5
5
  const lines = csv.split('\n');
6
6
  const result = [];
@@ -109,3 +109,11 @@ function replaceRemove(str, ...params) {
109
109
  return ret;
110
110
  }
111
111
  exports.replaceRemove = replaceRemove;
112
+ function containsInsensitive(str, ...args) {
113
+ if (!str || !args) {
114
+ return false;
115
+ }
116
+ const l = str.toLowerCase();
117
+ return !!args.find((a) => l.includes(a));
118
+ }
119
+ exports.containsInsensitive = containsInsensitive;
@@ -9,7 +9,12 @@ const clearLocalStorageItem = (key) => {
9
9
  if (typeof window === 'undefined') {
10
10
  return;
11
11
  }
12
- window.localStorage.removeItem(key);
12
+ try {
13
+ window.localStorage.removeItem(key);
14
+ }
15
+ catch (e) {
16
+ (0, log_1.warn)('error clearing local storage:', e);
17
+ }
13
18
  };
14
19
  exports.clearLocalStorageItem = clearLocalStorageItem;
15
20
  const clearAllLocalStorage = (except) => {
@@ -43,6 +48,7 @@ const setLocalStorageItem = (key, value, ttl) => {
43
48
  }
44
49
  catch (e) {
45
50
  (0, log_1.error)(`set LS error:${key}-${e}`);
51
+ (0, exports.clearLocalStorageItem)(key);
46
52
  }
47
53
  };
48
54
  exports.setLocalStorageItem = setLocalStorageItem;
@@ -11,3 +11,4 @@ export declare const noDrag: {
11
11
  onDragStart: React.DragEventHandler<HTMLDivElement>;
12
12
  onTouchStart: React.TouchEventHandler<HTMLDivElement>;
13
13
  };
14
+ export declare const FullScreenPage: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.noDrag = exports.Card = exports.FadeBottom = exports.CssTransparentBlock = exports.NoTextSelect = exports.DropShadow = void 0;
22
+ exports.FullScreenPage = exports.noDrag = exports.Card = exports.FadeBottom = exports.CssTransparentBlock = exports.NoTextSelect = exports.DropShadow = void 0;
23
23
  const styled_components_1 = __importStar(require("styled-components"));
24
24
  const colours_1 = require("./colours");
25
25
  const DropShadow = (outline) => (0, styled_components_1.css) `
@@ -92,3 +92,12 @@ exports.noDrag = {
92
92
  e.stopPropagation();
93
93
  },
94
94
  };
95
+ exports.FullScreenPage = styled_components_1.default.div `
96
+ display: flex;
97
+ width: 100%;
98
+ flex-grow: 1;
99
+ flex-flow: column;
100
+ overflow: hidden;
101
+ align-content: flex-start;
102
+ align-items: flex-start;
103
+ `;
@@ -5,17 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SOA = exports.SOCenter = exports.SOP = exports.SOB = exports.SOBR = exports.SOBase = void 0;
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
+ const common_1 = require("./common");
8
9
  const media_1 = require("./media");
9
- const FullScreenPage = styled_components_1.default.div `
10
- display: flex;
11
- width: 100%;
12
- flex-grow: 1;
13
- flex-flow: column;
14
- overflow: hidden;
15
- align-content: flex-start;
16
- align-items: flex-start;
17
- `;
18
- exports.SOBase = (0, styled_components_1.default)(FullScreenPage) `
10
+ exports.SOBase = (0, styled_components_1.default)(common_1.FullScreenPage) `
19
11
  > h1,
20
12
  h2,
21
13
  > p {
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.35",
3
+ "version": "0.0.39",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",
7
7
  "repository": "github:andreigec/ag-common",
8
8
  "license": "ISC",
9
+ "scripts": {
10
+ "build": "rimraf dist && yarn checklint && tsc",
11
+ "fix": "./node_modules/.bin/eslint --fix './src/**/*.ts' './src/**/*.tsx'",
12
+ "checklint": "npx eslint --ext .ts,.tsx ./src",
13
+ "start": "tsc --watch"
14
+ },
9
15
  "dependencies": {
10
- "styled-components": "5.3.3",
16
+ "aws-cdk-lib": "2.4.0",
17
+ "aws-sdk": "2.1052.0",
11
18
  "axios": "0.24.0",
12
- "typescript": "4.5.4",
19
+ "constructs": "10.0.27",
20
+ "jsonwebtoken": "8.5.1",
21
+ "jwks-rsa": "2.0.5",
13
22
  "openapi-request-validator": "10.0.0",
14
- "aws-sdk": "2.1048.0",
15
- "aws-cdk-lib": "2.3.0",
16
- "constructs": "10.0.17",
17
23
  "react": "17.0.2",
18
24
  "react-dom": "17.0.2",
19
- "react-hot-toast": "2.1.1",
20
- "jsonwebtoken": "8.5.1",
21
- "jwks-rsa": "2.0.5"
25
+ "react-hot-toast": "2.2.0",
26
+ "styled-components": "5.3.3",
27
+ "typescript": "4.5.4"
22
28
  },
23
29
  "devDependencies": {
24
- "@typescript-eslint/eslint-plugin": "5.8.1",
25
- "@typescript-eslint/parser": "5.8.1",
26
- "prettier": "2.5.1",
27
- "@types/node": "17.0.5",
30
+ "@types/jsonwebtoken": "8.5.6",
31
+ "@types/node": "17.0.8",
28
32
  "@types/react": "17.0.38",
29
33
  "@types/react-dom": "17.0.11",
30
34
  "@types/styled-components": "5.1.19",
31
- "eslint": "8.5.0",
35
+ "@typescript-eslint/eslint-plugin": "5.9.0",
36
+ "@typescript-eslint/parser": "5.9.0",
37
+ "eslint": "8.6.0",
32
38
  "eslint-config-airbnb-typescript": "16.1.0",
33
39
  "eslint-config-prettier": "8.3.0",
34
40
  "eslint-config-react-app": "7.0.0",
35
- "eslint-plugin-import": "2.25.3",
41
+ "eslint-plugin-import": "2.25.4",
36
42
  "eslint-plugin-jsx-a11y": "6.5.1",
37
43
  "eslint-plugin-prettier": "4.0.0",
38
44
  "eslint-plugin-react": "7.28.0",
39
45
  "eslint-plugin-react-hooks": "4.3.0",
46
+ "prettier": "2.5.1",
40
47
  "rimraf": "3.0.2",
41
- "typescript-styled-plugin": "0.18.2",
42
- "@types/jsonwebtoken": "8.5.6"
43
- },
44
- "scripts": {
45
- "build": "rimraf dist && yarn checklint && tsc",
46
- "fix": "./node_modules/.bin/eslint --fix './src/**/*.ts' './src/**/*.tsx'",
47
- "checklint": "npx eslint --ext .ts,.tsx ./src",
48
- "start": "tsc --watch"
48
+ "typescript-styled-plugin": "0.18.2"
49
49
  },
50
50
  "files": [
51
51
  "dist/**/*",