dce-reactkit 3.11.0 → 3.11.1-beta.tooltip.1
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/cjs/index.js +5 -25
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/client/initClient.d.ts +2 -16
- package/dist/cjs/types/stylesheets/shared.css.d.ts +1 -1
- package/dist/esm/index.js +5 -25
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/client/initClient.d.ts +2 -16
- package/dist/esm/types/stylesheets/shared.css.d.ts +1 -1
- package/dist/index.d.ts +2 -10
- package/package.json +1 -1
- package/src/client/initClient.tsx +11 -49
- package/src/components/AppWrapper.tsx +18 -18
- package/src/components/CheckboxButton.tsx +0 -1
- package/src/components/RadioButton.tsx +0 -1
- package/src/helpers/logClientEvent.tsx +0 -8
- package/src/helpers/visitServerEndpoint.tsx +0 -1
- package/src/stylesheets/shared.css.ts +0 -5
|
@@ -19,12 +19,6 @@ type SendRequestFunction = (opts: {
|
|
|
19
19
|
[x: string]: any;
|
|
20
20
|
};
|
|
21
21
|
}>;
|
|
22
|
-
declare let noServer: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Check if there is no server for this app
|
|
25
|
-
* @author Gabe Abrams
|
|
26
|
-
*/
|
|
27
|
-
export declare const appHasNoServer: () => boolean;
|
|
28
22
|
/**
|
|
29
23
|
* Get the send request function
|
|
30
24
|
* @author Gabe Abrams
|
|
@@ -50,18 +44,10 @@ export declare const isDarkModeOn: () => boolean;
|
|
|
50
44
|
* @param opts object containing all arguments
|
|
51
45
|
* @param opts.sendRequest caccl send request functions
|
|
52
46
|
* @param [opts.sessionExpiredMessage] a custom session expired message
|
|
53
|
-
* @param [opts.darkModeOn] if true, dark mode is enabled
|
|
54
|
-
* @param [opts.noServer] if true, there is no server for this app
|
|
55
47
|
*/
|
|
56
|
-
declare const initClient: (opts:
|
|
48
|
+
declare const initClient: (opts: {
|
|
57
49
|
sendRequest: SendRequestFunction;
|
|
58
50
|
sessionExpiredMessage?: string;
|
|
59
51
|
darkModeOn?: boolean;
|
|
60
|
-
|
|
61
|
-
} | {
|
|
62
|
-
darkModeOn?: boolean;
|
|
63
|
-
noServer: true;
|
|
64
|
-
sendRequest?: undefined;
|
|
65
|
-
sessionExpiredMessage?: undefined;
|
|
66
|
-
})) => void;
|
|
52
|
+
}) => void;
|
|
67
53
|
export default initClient;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Universal stylesheet
|
|
3
3
|
* @author Gabe Abrams
|
|
4
4
|
*/
|
|
5
|
-
declare const shared = "\n/* Button with no style */\n.btn-nostyle {\n border: 0 !important;\n background: transparent !important;\n outline: 0 !important;\n font-size: inherit !important;\n color: inherit !important;\n padding: 0 !important;\n margin: 0 !important;\n}\n\n/* Tooltip on Very Top */\n.tooltip {\n z-index: 9000000000 !important;\n}\n
|
|
5
|
+
declare const shared = "\n/* Button with no style */\n.btn-nostyle {\n border: 0 !important;\n background: transparent !important;\n outline: 0 !important;\n font-size: inherit !important;\n color: inherit !important;\n padding: 0 !important;\n margin: 0 !important;\n}\n\n/* Tooltip on Very Top */\n.tooltip {\n z-index: 9000000000 !important;\n}\n";
|
|
6
6
|
export default shared;
|
package/dist/index.d.ts
CHANGED
|
@@ -810,20 +810,12 @@ type SendRequestFunction = (opts: {
|
|
|
810
810
|
* @param opts object containing all arguments
|
|
811
811
|
* @param opts.sendRequest caccl send request functions
|
|
812
812
|
* @param [opts.sessionExpiredMessage] a custom session expired message
|
|
813
|
-
* @param [opts.darkModeOn] if true, dark mode is enabled
|
|
814
|
-
* @param [opts.noServer] if true, there is no server for this app
|
|
815
813
|
*/
|
|
816
|
-
declare const initClient: (opts:
|
|
814
|
+
declare const initClient: (opts: {
|
|
817
815
|
sendRequest: SendRequestFunction;
|
|
818
816
|
sessionExpiredMessage?: string;
|
|
819
817
|
darkModeOn?: boolean;
|
|
820
|
-
|
|
821
|
-
} | {
|
|
822
|
-
darkModeOn?: boolean;
|
|
823
|
-
noServer: true;
|
|
824
|
-
sendRequest?: undefined;
|
|
825
|
-
sessionExpiredMessage?: undefined;
|
|
826
|
-
})) => void;
|
|
818
|
+
}) => void;
|
|
827
819
|
|
|
828
820
|
/**
|
|
829
821
|
* Shorten text so it fits into a certain number of chars
|
package/package.json
CHANGED
|
@@ -47,18 +47,6 @@ const initialized = new Promise((resolve) => {
|
|
|
47
47
|
onInitialized = resolve;
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
/* ------------ No Server ----------- */
|
|
51
|
-
|
|
52
|
-
let noServer = false;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Check if there is no server for this app
|
|
56
|
-
* @author Gabe Abrams
|
|
57
|
-
*/
|
|
58
|
-
export const appHasNoServer = () => {
|
|
59
|
-
return noServer;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
50
|
/* ---------- Send Request ---------- */
|
|
63
51
|
|
|
64
52
|
let storedSendRequest: SendRequestFunction;
|
|
@@ -131,46 +119,20 @@ export const isDarkModeOn = () => {
|
|
|
131
119
|
* @param opts object containing all arguments
|
|
132
120
|
* @param opts.sendRequest caccl send request functions
|
|
133
121
|
* @param [opts.sessionExpiredMessage] a custom session expired message
|
|
134
|
-
* @param [opts.darkModeOn] if true, dark mode is enabled
|
|
135
|
-
* @param [opts.noServer] if true, there is no server for this app
|
|
136
122
|
*/
|
|
137
123
|
const initClient = (
|
|
138
|
-
opts:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// If true, there is no server for this app
|
|
147
|
-
noServer?: false,
|
|
148
|
-
}
|
|
149
|
-
| {
|
|
150
|
-
// If true, dark mode is enabled
|
|
151
|
-
darkModeOn?: boolean,
|
|
152
|
-
// If true, there is no server for this app
|
|
153
|
-
noServer: true
|
|
154
|
-
// Copy of CACCL's send request function
|
|
155
|
-
sendRequest?: undefined,
|
|
156
|
-
// Custom session expired message
|
|
157
|
-
sessionExpiredMessage?: undefined,
|
|
158
|
-
}
|
|
159
|
-
),
|
|
124
|
+
opts: {
|
|
125
|
+
// Copy of CACCL's send request function
|
|
126
|
+
sendRequest: SendRequestFunction,
|
|
127
|
+
// Custom session expired message
|
|
128
|
+
sessionExpiredMessage?: string,
|
|
129
|
+
// If true, dark mode is enabled
|
|
130
|
+
darkModeOn?: boolean,
|
|
131
|
+
},
|
|
160
132
|
) => {
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
storedSendRequest = async () => {
|
|
165
|
-
throw new Error('Cannot send requests because there is no server');
|
|
166
|
-
};
|
|
167
|
-
} else {
|
|
168
|
-
// Store values
|
|
169
|
-
storedSendRequest = opts.sendRequest;
|
|
170
|
-
sessionExpiredMessage = opts.sessionExpiredMessage;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Handle universal parts
|
|
133
|
+
// Store values
|
|
134
|
+
storedSendRequest = opts.sendRequest;
|
|
135
|
+
sessionExpiredMessage = opts.sessionExpiredMessage;
|
|
174
136
|
darkModeOn = !!opts.darkModeOn;
|
|
175
137
|
|
|
176
138
|
// Mark as initialized
|
|
@@ -608,23 +608,23 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
608
608
|
|
|
609
609
|
// Prompt
|
|
610
610
|
const [promptInfo, setPromptInfoInner] = useState<
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}
|
|
611
|
+
| undefined
|
|
612
|
+
| {
|
|
613
|
+
title: string,
|
|
614
|
+
currentInputFieldText: string,
|
|
615
|
+
opts: {
|
|
616
|
+
textAboveInputField?: string,
|
|
617
|
+
placeholder?: string,
|
|
618
|
+
defaultText?: string,
|
|
619
|
+
confirmButtonText?: string,
|
|
620
|
+
confirmButtonVariant?: Variant,
|
|
621
|
+
cancelButtonText?: string,
|
|
622
|
+
cancelButtonVariant?: Variant,
|
|
623
|
+
minNumChars?: number,
|
|
624
|
+
findValidationError?: (text: string) => string | undefined,
|
|
625
|
+
ariaLabel?: string,
|
|
627
626
|
}
|
|
627
|
+
}
|
|
628
628
|
>(undefined);
|
|
629
629
|
setPromptInfo = setPromptInfoInner;
|
|
630
630
|
|
|
@@ -918,7 +918,7 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
918
918
|
? `
|
|
919
919
|
.tooltip-inner {
|
|
920
920
|
background-color: white;
|
|
921
|
-
color: black;
|
|
921
|
+
color: black !important;
|
|
922
922
|
border: 0.1rem solid black;
|
|
923
923
|
pointer-events: none;
|
|
924
924
|
}
|
|
@@ -931,7 +931,7 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
931
931
|
: `
|
|
932
932
|
.tooltip-inner {
|
|
933
933
|
background-color: black;
|
|
934
|
-
color: white;
|
|
934
|
+
color: white !important;
|
|
935
935
|
border: 0.1rem solid white;
|
|
936
936
|
pointer-events: none;
|
|
937
937
|
}
|
|
@@ -7,9 +7,6 @@ import LogLevel from '../types/LogLevel';
|
|
|
7
7
|
// Import shared functions
|
|
8
8
|
import visitServerEndpoint from './visitServerEndpoint';
|
|
9
9
|
|
|
10
|
-
// Import status
|
|
11
|
-
import { appHasNoServer } from '../client/initClient';
|
|
12
|
-
|
|
13
10
|
/* ------- Metadata Populator ------- */
|
|
14
11
|
|
|
15
12
|
// Type of a metadata populator function
|
|
@@ -39,11 +36,6 @@ export const setClientEventMetadataPopulator = (
|
|
|
39
36
|
* @author Gabe Abrams
|
|
40
37
|
*/
|
|
41
38
|
const logClientEvent: LogFunction = async (opts) => {
|
|
42
|
-
// Don't write to the server if there is none
|
|
43
|
-
if (appHasNoServer()) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
// Populate metadata
|
|
48
40
|
let metadata = (opts.metadata ?? {});
|
|
49
41
|
if (metadataPopulator) {
|
|
@@ -102,7 +102,6 @@ const visitServerEndpoint = async (
|
|
|
102
102
|
params?: { [key in string]: any },
|
|
103
103
|
},
|
|
104
104
|
): Promise<any> => {
|
|
105
|
-
// Set default method
|
|
106
105
|
const method = (opts.method ?? 'GET');
|
|
107
106
|
// Handle stubs
|
|
108
107
|
const stubResponse = stubResponses[method]?.[opts.path];
|