@decafhub/decaf-react-webapp 0.0.14 → 0.1.0
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 +49 -0
- package/dist/components/Breadcrumb.d.ts +16 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/DocumentationButton.d.ts +3 -0
- package/dist/components/DocumentationButton.d.ts.map +1 -0
- package/dist/components/Error.d.ts +5 -3
- package/dist/components/Error.d.ts.map +1 -1
- package/dist/components/Layout.d.ts +16 -17
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +2 -2
- package/dist/components/Menu.d.ts +9 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/PageAbout.d.ts +8 -8
- package/dist/components/PageAbout.d.ts.map +1 -1
- package/dist/components/PageLayout.d.ts +10 -0
- package/dist/components/PageLayout.d.ts.map +1 -0
- package/dist/components/PageScroller.d.ts +2 -2
- package/dist/components/PageScroller.d.ts.map +1 -1
- package/dist/components/Screenshotter.d.ts +5 -5
- package/dist/components/Screenshotter.d.ts.map +1 -1
- package/dist/components/ThemeSwitcher.d.ts +7 -7
- package/dist/components/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/UserProfileDropdown.d.ts +3 -0
- package/dist/components/UserProfileDropdown.d.ts.map +1 -0
- package/dist/components/VersionSelector.d.ts +11 -11
- package/dist/components/VersionSelector.d.ts.map +1 -1
- package/dist/components/ZendeskWidget.d.ts +8 -8
- package/dist/components/ZendeskWidget.d.ts.map +1 -1
- package/dist/index.d.ts +7 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +3 -3
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/machinery/-plausible.d.ts +2 -0
- package/dist/machinery/-plausible.d.ts.map +1 -0
- package/dist/machinery/index.d.ts +91 -0
- package/dist/machinery/index.d.ts.map +1 -0
- package/dist/style.d.ts +4 -4
- package/dist/style.d.ts.map +1 -1
- package/dist/theme/-styles.d.ts +7 -0
- package/dist/theme/-styles.d.ts.map +1 -0
- package/dist/theme/-theme-context.d.ts +7 -0
- package/dist/theme/-theme-context.d.ts.map +1 -0
- package/dist/theme/-theme-hooks.d.ts +2 -0
- package/dist/theme/-theme-hooks.d.ts.map +1 -0
- package/dist/theme/-theme-provider.d.ts +9 -0
- package/dist/theme/-theme-provider.d.ts.map +1 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme.d.ts +17 -17
- package/dist/theme.d.ts.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +58 -24
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.spec.d.ts +2 -0
- package/dist/utils.spec.d.ts.map +1 -0
- package/package.json +40 -35
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface BaseDecafMenuItem {
|
|
3
|
+
label: any;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
children?: DecafMenuItem[];
|
|
6
|
+
}
|
|
7
|
+
export type DecafMenuItem = BaseDecafMenuItem & ({
|
|
8
|
+
to?: string;
|
|
9
|
+
} | {
|
|
10
|
+
href?: string;
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,CAAC;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,25 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* );
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { DecafClient } from '@decafhub/decaf-client';
|
|
2
|
+
import Decimal from 'decimal.js';
|
|
3
|
+
/**
|
|
4
|
+
* This hook is used to calculate the remaining height of an element.
|
|
5
|
+
* It takes into account the footer height and padding.
|
|
6
|
+
*
|
|
7
|
+
* @param elementId the id of the element to calculate the available height.
|
|
8
|
+
* @returns the remaining height of the element.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRemaningHeight(elementId: string): number;
|
|
11
|
+
/**
|
|
12
|
+
* This hook is used to calculate the max possible height of a table.
|
|
13
|
+
* It is used to set the height of the table to make it scrollable
|
|
14
|
+
* when the content is too large.
|
|
15
|
+
* @param elementId the id of the element that contains the table.
|
|
16
|
+
* @param bottomSpace extra space to be added to the bottom of the table container.
|
|
17
|
+
* @returns the max height of the table.
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* const maxHeight = useTableMaxHeight('table-container', 50);
|
|
21
|
+
* return (
|
|
22
|
+
* <Table
|
|
23
|
+
{...tableProps}
|
|
24
|
+
id={'table-container'}
|
|
25
|
+
scroll={{
|
|
26
|
+
x: 'max-content',
|
|
27
|
+
y: maxHeight,
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
**/
|
|
33
|
+
export declare function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number;
|
|
34
|
+
export declare function lightenDarkenColor(col: string, amt: number): string;
|
|
35
|
+
export declare function logout(client: DecafClient, fromAll?: boolean): void;
|
|
36
|
+
export declare function getGravatarUrl(email: string): Promise<string | undefined>;
|
|
37
|
+
export type BooleanMap<T> = {
|
|
38
|
+
True: T;
|
|
39
|
+
False: T;
|
|
40
|
+
};
|
|
41
|
+
export declare function booleanMap<T>(map: BooleanMap<T>): (x: boolean) => T;
|
|
42
|
+
export type NullableBooleanMap<T> = {
|
|
43
|
+
Null: T;
|
|
44
|
+
} & BooleanMap<T>;
|
|
45
|
+
export declare function nullableBooleanMap<T>(map: NullableBooleanMap<T>): (x?: boolean | undefined | null) => T;
|
|
46
|
+
export declare enum Direction {
|
|
47
|
+
Short = -1,
|
|
48
|
+
Square = 0,
|
|
49
|
+
Long = 1
|
|
50
|
+
}
|
|
51
|
+
export declare function toDirection(x: number | Decimal | Direction): Direction;
|
|
52
|
+
export type DirectionMap<T> = {
|
|
53
|
+
Short: T;
|
|
54
|
+
Square: T;
|
|
55
|
+
Long: T;
|
|
56
|
+
};
|
|
57
|
+
export declare function directionMap<T>(map: DirectionMap<T>): (x: number | Decimal | Direction) => T;
|
|
58
|
+
export declare function setAtKey<T>(array: T[], items: T[], key: keyof T): T[];
|
|
25
59
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,OAAO,M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AC,CAAC;IAAC,MAAM,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC;AAE/D,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,KAAK,CAAC,CAW5F;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAcrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.spec.d.ts","sourceRoot":"","sources":["../src/utils.spec.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decafhub/decaf-react-webapp",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"decafhub",
|
|
6
6
|
"react"
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"private": false,
|
|
25
25
|
"scripts": {
|
|
26
26
|
"start": "microbundle --jsx React.createElement --jsxFragment React.Fragment --watch",
|
|
27
|
-
"build": "
|
|
27
|
+
"build": "microbundle --jsx React.createElement --jsxFragment React.Fragment",
|
|
28
28
|
"test": "jest --coverage",
|
|
29
29
|
"make:docs": "typedoc",
|
|
30
|
-
"prepare": "
|
|
30
|
+
"prepare": "husky install"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=16"
|
|
@@ -35,39 +35,44 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@ant-design/icons": "^5",
|
|
37
37
|
"@decafhub/decaf-client": "^0.3",
|
|
38
|
-
"@decafhub/decaf-react": "^0.
|
|
39
|
-
"antd": "^5",
|
|
40
|
-
"react": "^
|
|
41
|
-
"react-dom": "^
|
|
38
|
+
"@decafhub/decaf-react": "^0.2",
|
|
39
|
+
"antd": "^5.4",
|
|
40
|
+
"react": "^18",
|
|
41
|
+
"react-dom": "^18",
|
|
42
42
|
"react-router-dom": "^6"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@emotion/react": "^11.10.
|
|
46
|
-
"@emotion/styled": "^11.10.
|
|
47
|
-
"
|
|
45
|
+
"@emotion/react": "^11.10.6",
|
|
46
|
+
"@emotion/styled": "^11.10.6",
|
|
47
|
+
"@tanem/react-nprogress": "^5.0.35",
|
|
48
|
+
"decimal.js": "^10.4.3",
|
|
49
|
+
"html2canvas": "^1.4.1",
|
|
50
|
+
"js-cookie": "^3.0.5",
|
|
51
|
+
"md5": "^2.3.0"
|
|
48
52
|
},
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@ant-design/icons": "^5.0.1",
|
|
51
|
-
"@commitlint/cli": "^17.
|
|
52
|
-
"@commitlint/config-conventional": "^17.
|
|
53
|
-
"@decafhub/decaf-client": "^0.3.
|
|
54
|
-
"@decafhub/decaf-react": "^0.
|
|
55
|
+
"@commitlint/cli": "^17.6.1",
|
|
56
|
+
"@commitlint/config-conventional": "^17.6.1",
|
|
57
|
+
"@decafhub/decaf-client": "^0.3.2",
|
|
58
|
+
"@decafhub/decaf-react": "^0.2.0",
|
|
55
59
|
"@testing-library/jest-dom": "^5.16.5",
|
|
56
|
-
"@testing-library/react": "^
|
|
57
|
-
"@types/jest": "^29.
|
|
58
|
-
"@types/js-cookie": "^3.0.
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/
|
|
61
|
-
"@types/react
|
|
62
|
-
"@
|
|
63
|
-
"@typescript-eslint/
|
|
64
|
-
"
|
|
60
|
+
"@testing-library/react": "^14.0.0",
|
|
61
|
+
"@types/jest": "^29.5.1",
|
|
62
|
+
"@types/js-cookie": "^3.0.3",
|
|
63
|
+
"@types/md5": "^2.3.2",
|
|
64
|
+
"@types/node": "^18.16.1",
|
|
65
|
+
"@types/react": "^18.2.0",
|
|
66
|
+
"@types/react-dom": "^18.2.1",
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^5.59.1",
|
|
68
|
+
"@typescript-eslint/parser": "^5.59.1",
|
|
69
|
+
"antd": "^5.4.6",
|
|
65
70
|
"cross-env": "^7.0.3",
|
|
66
|
-
"eslint": "^8.
|
|
67
|
-
"eslint-config-prettier": "^8.
|
|
71
|
+
"eslint": "^8.39.0",
|
|
72
|
+
"eslint-config-prettier": "^8.8.0",
|
|
68
73
|
"eslint-config-standard": "^17.0.0",
|
|
69
74
|
"eslint-plugin-import": "^2.27.5",
|
|
70
|
-
"eslint-plugin-n": "^15.
|
|
75
|
+
"eslint-plugin-n": "^15.7.0",
|
|
71
76
|
"eslint-plugin-prettier": "^4.2.1",
|
|
72
77
|
"eslint-plugin-promise": "^6.1.1",
|
|
73
78
|
"eslint-plugin-react": "^7.32.2",
|
|
@@ -75,18 +80,18 @@
|
|
|
75
80
|
"eslint-plugin-standard": "^5.0.0",
|
|
76
81
|
"husky": "^8.0.3",
|
|
77
82
|
"identity-obj-proxy": "^3.0.0",
|
|
78
|
-
"jest": "^29.
|
|
79
|
-
"jest-environment-jsdom": "^29.
|
|
80
|
-
"lint-staged": "^13.
|
|
83
|
+
"jest": "^29.5.0",
|
|
84
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
85
|
+
"lint-staged": "^13.2.2",
|
|
81
86
|
"microbundle": "^0.15.1",
|
|
82
|
-
"postcss": "^8.4.
|
|
83
|
-
"prettier": "^2.8.
|
|
87
|
+
"postcss": "^8.4.23",
|
|
88
|
+
"prettier": "^2.8.8",
|
|
84
89
|
"react": "^18.2.0",
|
|
85
90
|
"react-dom": "^18.2.0",
|
|
86
|
-
"react-router-dom": "^6.
|
|
87
|
-
"ts-jest": "^29.0
|
|
88
|
-
"typedoc": "^0.
|
|
89
|
-
"typescript": "^
|
|
91
|
+
"react-router-dom": "^6.10.0",
|
|
92
|
+
"ts-jest": "^29.1.0",
|
|
93
|
+
"typedoc": "^0.24.6",
|
|
94
|
+
"typescript": "^5.0.4"
|
|
90
95
|
},
|
|
91
96
|
"lint-staged": {
|
|
92
97
|
"src/**/*.{ts,tsx}": [
|