@ms-cloudpack/overlay 0.17.104 → 0.17.106
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/browser-esm/119.chunk.js +1 -1
- package/dist/browser-esm/119.chunk.js.map +1 -1
- package/dist/browser-esm/240.chunk.js +1 -1
- package/dist/browser-esm/240.chunk.js.map +1 -1
- package/dist/browser-esm/464.chunk.js +1 -1
- package/dist/browser-esm/464.chunk.js.map +1 -1
- package/dist/browser-esm/lib/index.js +1 -1
- package/dist/browser-esm/lib/index.js.map +1 -1
- package/lib/components/Button/Button.d.ts +2 -2
- package/lib/components/Button/Button.d.ts.map +1 -1
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/CloudpackProvider/CloudpackProvider.d.ts +2 -3
- package/lib/components/CloudpackProvider/CloudpackProvider.d.ts.map +1 -1
- package/lib/components/CloudpackProvider/CloudpackProvider.js +3 -2
- package/lib/components/CloudpackProvider/CloudpackProvider.js.map +1 -1
- package/lib/components/CloudpackProvider/useStatus.d.ts +1 -7
- package/lib/components/CloudpackProvider/useStatus.d.ts.map +1 -1
- package/lib/components/CloudpackProvider/useStatus.js.map +1 -1
- package/lib/components/CloudpackProvider/useStatusDetails.d.ts +2 -52
- package/lib/components/CloudpackProvider/useStatusDetails.d.ts.map +1 -1
- package/lib/components/CloudpackProvider/useStatusDetails.js.map +1 -1
- package/lib/components/Dialog/Dialog.d.ts +1 -1
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +2 -2
- package/lib/components/Dialog/Dialog.js.map +1 -1
- package/lib/components/ErrorDialog/ErrorDialog.d.ts +1 -1
- package/lib/components/ErrorDialog/ErrorDialog.d.ts.map +1 -1
- package/lib/components/ErrorDialog/ErrorDialog.js +3 -5
- package/lib/components/ErrorDialog/ErrorDialog.js.map +1 -1
- package/lib/components/ErrorDialog/PathError.d.ts +1 -1
- package/lib/components/ErrorDialog/PathError.d.ts.map +1 -1
- package/lib/components/ErrorDialog/PathError.js +4 -8
- package/lib/components/ErrorDialog/PathError.js.map +1 -1
- package/lib/components/ErrorDialog/useErrorEvents.d.ts +4 -3
- package/lib/components/ErrorDialog/useErrorEvents.d.ts.map +1 -1
- package/lib/components/ErrorDialog/useErrorEvents.js +13 -12
- package/lib/components/ErrorDialog/useErrorEvents.js.map +1 -1
- package/lib/components/StatusBadge/StatusBadge.d.ts +1 -1
- package/lib/components/StatusBadge/StatusBadge.d.ts.map +1 -1
- package/lib/components/StatusBadge/StatusBadge.js +6 -4
- package/lib/components/StatusBadge/StatusBadge.js.map +1 -1
- package/lib/components/StatusDialog/Searchbox.d.ts +1 -1
- package/lib/components/StatusDialog/Searchbox.d.ts.map +1 -1
- package/lib/components/StatusDialog/Searchbox.js +2 -2
- package/lib/components/StatusDialog/Searchbox.js.map +1 -1
- package/lib/components/StatusDialog/StatusDialog.d.ts +1 -1
- package/lib/components/StatusDialog/StatusDialog.d.ts.map +1 -1
- package/lib/components/StatusDialog/StatusDialog.js +4 -6
- package/lib/components/StatusDialog/StatusDialog.js.map +1 -1
- package/lib/components/StatusDialog/TaskList.d.ts +1 -1
- package/lib/components/StatusDialog/TaskList.d.ts.map +1 -1
- package/lib/components/StatusDialog/TaskList.js +2 -2
- package/lib/components/StatusDialog/TaskList.js.map +1 -1
- package/lib/components/StatusDialog/TaskResultItem.d.ts +1 -1
- package/lib/components/StatusDialog/TaskResultItem.d.ts.map +1 -1
- package/lib/components/StatusDialog/TaskResultItem.js +2 -2
- package/lib/components/StatusDialog/TaskResultItem.js.map +1 -1
- package/lib/components/StatusDialog/TaskStatus.d.ts +1 -1
- package/lib/components/StatusDialog/TaskStatus.d.ts.map +1 -1
- package/lib/components/StatusDialog/TaskStatus.js +3 -7
- package/lib/components/StatusDialog/TaskStatus.js.map +1 -1
- package/lib/components/StatusOverlay/StatusOverlay.d.ts +1 -1
- package/lib/components/StatusOverlay/StatusOverlay.d.ts.map +1 -1
- package/lib/components/StatusOverlay/StatusOverlay.js +2 -2
- package/lib/components/StatusOverlay/StatusOverlay.js.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/lib/components/ThemeProvider/ThemeProvider.js +2 -2
- package/lib/components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/lib/hooks/preferDarkTheme.d.ts.map +1 -1
- package/lib/hooks/preferDarkTheme.js.map +1 -1
- package/lib/hooks/useDraggable.d.ts.map +1 -1
- package/lib/hooks/useDraggable.js.map +1 -1
- package/lib/hooks/usePageLoadTimeReporter.d.ts.map +1 -1
- package/lib/hooks/usePageLoadTimeReporter.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
3
|
primary?: boolean;
|
|
4
|
-
}
|
|
4
|
+
}>;
|
|
5
5
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAIlG,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './Button.module.css';
|
|
3
|
-
export
|
|
3
|
+
export const Button = (props) => {
|
|
4
4
|
const { primary, ...other } = props;
|
|
5
5
|
const className = primary ? styles.primaryButton : styles.standardButton;
|
|
6
6
|
return React.createElement("button", { ...other, className: className, type: 'button' });
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
8
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAoF,CAAC,KAAK,EAAE,EAAE;IAC/G,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC;IACzE,OAAO,mCAAY,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAI,CAAC;AACrE,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport styles from './Button.module.css';\n\nexport const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { primary?: boolean }> = (props) => {\n const { primary, ...other } = props;\n const className = primary ? styles.primaryButton : styles.standardButton;\n return <button {...other} className={className} type={'button'} />;\n};\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CloudpackClient } from '@ms-cloudpack/api-server/browser';
|
|
3
3
|
export declare const CloudpackContext: React.Context<CloudpackClient>;
|
|
4
|
-
export declare
|
|
4
|
+
export declare const CloudpackProvider: React.FC<React.PropsWithChildren<{
|
|
5
5
|
client: CloudpackClient;
|
|
6
|
-
|
|
7
|
-
}): React.JSX.Element;
|
|
6
|
+
}>>;
|
|
8
7
|
export declare const useCloudpack: () => CloudpackClient;
|
|
9
8
|
//# sourceMappingURL=CloudpackProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudpackProvider.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/CloudpackProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,gBAAgB,gCAAqE,CAAC;AAEnG,
|
|
1
|
+
{"version":3,"file":"CloudpackProvider.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/CloudpackProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,eAAO,MAAM,gBAAgB,gCAAqE,CAAC;AAEnG,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CAG5F,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,eAA+C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { createContext, useContext } from 'react';
|
|
2
2
|
export const CloudpackContext = createContext(null);
|
|
3
|
-
export
|
|
3
|
+
export const CloudpackProvider = (props) => {
|
|
4
|
+
const { client, children } = props;
|
|
4
5
|
return React.createElement(CloudpackContext.Provider, { value: client }, children);
|
|
5
|
-
}
|
|
6
|
+
};
|
|
6
7
|
export const useCloudpack = () => useContext(CloudpackContext);
|
|
7
8
|
//# sourceMappingURL=CloudpackProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudpackProvider.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/CloudpackProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAkB,IAAkC,CAAC,CAAC;AAEnG,MAAM,
|
|
1
|
+
{"version":3,"file":"CloudpackProvider.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/CloudpackProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAkB,IAAkC,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,iBAAiB,GAAmE,CAAC,KAAK,EAAE,EAAE;IACzG,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,OAAO,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,IAAG,QAAQ,CAA6B,CAAC;AAC1F,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAoB,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React, { createContext, useContext } from 'react';\nimport { type CloudpackClient } from '@ms-cloudpack/api-server/browser';\n\nexport const CloudpackContext = createContext<CloudpackClient>(null as unknown as CloudpackClient);\n\nexport const CloudpackProvider: React.FC<React.PropsWithChildren<{ client: CloudpackClient }>> = (props) => {\n const { client, children } = props;\n return <CloudpackContext.Provider value={client}>{children}</CloudpackContext.Provider>;\n};\n\nexport const useCloudpack = (): CloudpackClient => useContext(CloudpackContext);\n"]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { type TaskStats } from '@ms-cloudpack/api-server/browser';
|
|
2
2
|
export type CloudpackStatus = TaskStats;
|
|
3
|
-
export declare const useStatus: () =>
|
|
4
|
-
status: "idle" | "unknown" | "pending";
|
|
5
|
-
remainingTasks: number;
|
|
6
|
-
totalTasks: number;
|
|
7
|
-
totalErrors: number;
|
|
8
|
-
totalWarnings: number;
|
|
9
|
-
};
|
|
3
|
+
export declare const useStatus: () => CloudpackStatus;
|
|
10
4
|
//# sourceMappingURL=useStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatus.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AAUxC,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"useStatus.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC;AAUxC,eAAO,MAAM,SAAS,QAAO,eAiB5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatus.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAkB,MAAM,kCAAkC,CAAC;AAInF,MAAM,aAAa,GAAoB;IACrC,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"useStatus.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAkB,MAAM,kCAAkC,CAAC;AAInF,MAAM,aAAa,GAAoB;IACrC,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAoB,EAAE;IAC7C,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAkB,aAAa,CAAC,CAAC;IAErE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,eAAe,EAAE;YACvE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACf,SAAS,CAAC,IAAuB,CAAC,CAAC;YACrC,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { useCloudpack } from './CloudpackProvider.js';\nimport { taskStatsSource, type TaskStats } from '@ms-cloudpack/api-server/browser';\n\nexport type CloudpackStatus = TaskStats;\n\nconst defaultStatus: CloudpackStatus = {\n status: 'unknown',\n remainingTasks: 0,\n totalTasks: 0,\n totalErrors: 0,\n totalWarnings: 0,\n};\n\nexport const useStatus = (): CloudpackStatus => {\n const cloudpack = useCloudpack();\n const [status, setStatus] = useState<CloudpackStatus>(defaultStatus);\n\n useEffect(() => {\n const subscription = cloudpack?.onDataChanged.subscribe(taskStatsSource, {\n onData: (data) => {\n setStatus(data as CloudpackStatus);\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [cloudpack]);\n\n return status;\n};\n"]}
|
|
@@ -1,53 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
4
|
-
startTime: number;
|
|
5
|
-
status?: "pending" | "complete" | undefined;
|
|
6
|
-
name?: string | undefined;
|
|
7
|
-
inputPath?: string | undefined;
|
|
8
|
-
outputPath?: string | undefined;
|
|
9
|
-
errors?: {
|
|
10
|
-
text: string;
|
|
11
|
-
source: string;
|
|
12
|
-
location?: {
|
|
13
|
-
file: string;
|
|
14
|
-
line?: number | undefined;
|
|
15
|
-
column?: number | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
notes?: {
|
|
18
|
-
text: string;
|
|
19
|
-
location?: {
|
|
20
|
-
file: string;
|
|
21
|
-
line?: number | undefined;
|
|
22
|
-
column?: number | undefined;
|
|
23
|
-
} | undefined;
|
|
24
|
-
}[] | undefined;
|
|
25
|
-
}[] | undefined;
|
|
26
|
-
warnings?: {
|
|
27
|
-
text: string;
|
|
28
|
-
source: string;
|
|
29
|
-
location?: {
|
|
30
|
-
file: string;
|
|
31
|
-
line?: number | undefined;
|
|
32
|
-
column?: number | undefined;
|
|
33
|
-
} | undefined;
|
|
34
|
-
notes?: {
|
|
35
|
-
text: string;
|
|
36
|
-
location?: {
|
|
37
|
-
file: string;
|
|
38
|
-
line?: number | undefined;
|
|
39
|
-
column?: number | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
}[] | undefined;
|
|
42
|
-
}[] | undefined;
|
|
43
|
-
timings?: {
|
|
44
|
-
name: string;
|
|
45
|
-
start: number;
|
|
46
|
-
end?: number | undefined;
|
|
47
|
-
threwException?: boolean | undefined;
|
|
48
|
-
}[] | undefined;
|
|
49
|
-
durationMilliseconds?: number | undefined;
|
|
50
|
-
lastUpdated?: number | undefined;
|
|
51
|
-
}[];
|
|
52
|
-
};
|
|
1
|
+
import { type TaskList } from '@ms-cloudpack/api-server/browser';
|
|
2
|
+
export declare const useStatusDetails: () => TaskList;
|
|
53
3
|
//# sourceMappingURL=useStatusDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatusDetails.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatusDetails.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useStatusDetails.d.ts","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatusDetails.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEjF,eAAO,MAAM,gBAAgB,QAAO,QAiBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStatusDetails.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatusDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAiB,MAAM,kCAAkC,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"useStatusDetails.js","sourceRoot":"","sources":["../../../src/components/CloudpackProvider/useStatusDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAiB,MAAM,kCAAkC,CAAC;AAEjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAa,EAAE;IAC7C,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAW,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,SAAS,EAAE,aAAa,CAAC,SAAS,CAAC,cAAc,EAAE;YACtE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACf,UAAU,CAAC,IAAgB,CAAC,CAAC;YAC/B,CAAC;SACF,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { useCloudpack } from './CloudpackProvider.js';\nimport { taskListSource, type TaskList } from '@ms-cloudpack/api-server/browser';\n\nexport const useStatusDetails = (): TaskList => {\n const cloudpack = useCloudpack();\n const [details, setDetails] = useState<TaskList>({ tasks: [] });\n\n useEffect(() => {\n const subscription = cloudpack?.onDataChanged.subscribe(taskListSource, {\n onData: (data) => {\n setDetails(data as TaskList);\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [cloudpack]);\n\n return details;\n};\n"]}
|
|
@@ -8,5 +8,5 @@ export interface DialogProps {
|
|
|
8
8
|
commands?: React.ReactNode[];
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare const Dialog: React.FC<DialogProps>;
|
|
12
12
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAU,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAU,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmCxC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { default as React, useRef } from 'react';
|
|
|
2
2
|
import styles from './Dialog.module.css';
|
|
3
3
|
import { useDraggable } from '../../hooks/useDraggable.js';
|
|
4
4
|
import CloseIcon from '../../images/dismiss-16-filled.inline.svg';
|
|
5
|
-
export
|
|
5
|
+
export const Dialog = ({ title, id, style, draggable, onClose, commands, children }) => {
|
|
6
6
|
const draggableRef = useRef(null);
|
|
7
7
|
const draggableTargetRef = useRef(null);
|
|
8
8
|
const colorAccent = style === 'error' ? 'rgb(164, 38, 44)' : undefined;
|
|
@@ -20,5 +20,5 @@ export function Dialog({ title, id, style, draggable, onClose, commands, childre
|
|
|
20
20
|
React.createElement("img", { src: CloseIcon, alt: "" })))),
|
|
21
21
|
commands && React.createElement("div", { className: styles.commands }, ...commands),
|
|
22
22
|
children)));
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,SAAS,MAAM,2CAA2C,CAAC;AAYlE,MAAM,
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,SAAS,MAAM,2CAA2C,CAAC;AAYlE,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC5G,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,MAAM,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IAEvD,YAAY,CAAC;QACX,OAAO,EAAE,CAAC,CAAC,SAAS;QACpB,mBAAmB,EAAE,YAAY;QACjC,cAAc,EAAE,kBAAkB;KACnC,CAAC,CAAC;IAEH,OAAO,CACL,6BAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO;QACpC,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;YACtF,6BAAK,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC9B,6BACE,GAAG,EAAE,kBAAkB,EACvB,SAAS,EAAE,MAAM,CAAC,KAAK,EACvB,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,IAErD,KAAK,CACF;gBACL,OAAO,IAAI,CACV,gCAAQ,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,gBAAa,kBAAkB;oBAEpF,6BAAK,GAAG,EAAE,SAAS,EAAE,GAAG,EAAC,EAAE,GAAG,CACvB,CACV,CACG;YACL,QAAQ,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,OAAM,QAAQ,CAAO;YAChE,QAAQ,CACL,CACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { default as React, useRef } from 'react';\nimport styles from './Dialog.module.css';\nimport { useDraggable } from '../../hooks/useDraggable.js';\nimport CloseIcon from '../../images/dismiss-16-filled.inline.svg';\n\nexport interface DialogProps {\n title: string;\n id: string;\n style?: 'default' | 'error';\n draggable?: boolean;\n onClose?: () => void;\n commands?: React.ReactNode[];\n children: React.ReactNode;\n}\n\nexport const Dialog: React.FC<DialogProps> = ({ title, id, style, draggable, onClose, commands, children }) => {\n const draggableRef = useRef<HTMLDivElement>(null);\n const draggableTargetRef = useRef<HTMLDivElement>(null);\n const colorAccent = style === 'error' ? 'rgb(164, 38, 44)' : undefined;\n const cursorDraggable = draggable ? 'move' : undefined;\n\n useDraggable({\n enabled: !!draggable,\n containerElementRef: draggableRef,\n dragElementRef: draggableTargetRef,\n });\n\n return (\n <div id={id} className={styles.overlay}>\n <div ref={draggableRef} className={styles.dialog} style={{ borderTopColor: colorAccent }}>\n <div className={styles.titleArea}>\n <div\n ref={draggableTargetRef}\n className={styles.title}\n style={{ color: colorAccent, cursor: cursorDraggable }}\n >\n {title}\n </div>\n {onClose && (\n <button className={styles.closeButton} onClick={onClose} aria-label=\"Minimize overlay\">\n {/* a close icon is common/universal enough that it doesn't need alt text */}\n <img src={CloseIcon} alt=\"\" />\n </button>\n )}\n </div>\n {commands && <div className={styles.commands}>{...commands}</div>}\n {children}\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -3,6 +3,6 @@ import type { UnsupportedErrorEvent } from './useErrorEvents.js';
|
|
|
3
3
|
export interface ErrorDialogProps {
|
|
4
4
|
unsupported: UnsupportedErrorEvent[];
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const ErrorDialog: React.FC<ErrorDialogProps>;
|
|
7
7
|
export default ErrorDialog;
|
|
8
8
|
//# sourceMappingURL=ErrorDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/ErrorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC;AAKzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC;AAED,
|
|
1
|
+
{"version":3,"file":"ErrorDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/ErrorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC;AAKzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuBlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -5,15 +5,13 @@ import { PathError } from './PathError.js';
|
|
|
5
5
|
import styles from '../StatusDialog/TaskList.module.css';
|
|
6
6
|
import { Dialog } from '../Dialog/Dialog.js';
|
|
7
7
|
import { elementIds } from '../../constants.js';
|
|
8
|
-
export
|
|
8
|
+
export const ErrorDialog = ({ unsupported }) => {
|
|
9
9
|
const cloudpack = useCloudpack();
|
|
10
|
-
const reload = () =>
|
|
11
|
-
void cloudpack.restartAllTasks.mutate();
|
|
12
|
-
};
|
|
10
|
+
const reload = () => void cloudpack.restartAllTasks.mutate();
|
|
13
11
|
return (React.createElement(Dialog, { title: "Found unsupported paths in your project", id: elementIds.errorDialogRoot, style: "error", commands: [
|
|
14
12
|
React.createElement(Button, { primary: true, onClick: reload, key: "1" }, "Restart all tasks"),
|
|
15
13
|
] },
|
|
16
14
|
React.createElement("div", { className: styles.root }, unsupported.map((data, index) => (React.createElement(PathError, { ...data, key: index }))))));
|
|
17
|
-
}
|
|
15
|
+
};
|
|
18
16
|
export default ErrorDialog;
|
|
19
17
|
//# sourceMappingURL=ErrorDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorDialog.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/ErrorDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO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I,EAAE,GAAG,EAAE,KAAK,GAAI,CACpC,CAAC,CACE,CACC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { default as React } from 'react';\nimport { Button } from '../Button/Button.js';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\nimport { PathError } from './PathError.js';\nimport styles from '../StatusDialog/TaskList.module.css';\nimport type { UnsupportedErrorEvent } from './useErrorEvents.js';\nimport { Dialog } from '../Dialog/Dialog.js';\nimport { elementIds } from '../../constants.js';\n\nexport interface ErrorDialogProps {\n unsupported: UnsupportedErrorEvent[];\n}\n\nexport const ErrorDialog: React.FC<ErrorDialogProps> = ({ unsupported }) => {\n const cloudpack = useCloudpack();\n\n const reload = () => void cloudpack.restartAllTasks.mutate();\n\n return (\n <Dialog\n title=\"Found unsupported paths in your project\"\n id={elementIds.errorDialogRoot}\n style=\"error\"\n commands={[\n <Button primary onClick={reload} key=\"1\">\n Restart all tasks\n </Button>,\n ]}\n >\n <div className={styles.root}>\n {unsupported.map((data, index) => (\n <PathError {...data} key={index} />\n ))}\n </div>\n </Dialog>\n );\n};\n\nexport default ErrorDialog;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { UnsupportedErrorEvent } from './useErrorEvents.js';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const PathError: React.FC<UnsupportedErrorEvent>;
|
|
4
4
|
//# sourceMappingURL=PathError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathError.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/PathError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE,
|
|
1
|
+
{"version":3,"file":"PathError.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/PathError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAIjE,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8DrD,CAAC"}
|
|
@@ -5,18 +5,14 @@ import { default as cx } from 'classnames';
|
|
|
5
5
|
import ChevronDownIcon from '../../images/chevrondown-20.inline.svg';
|
|
6
6
|
import { Button } from '../Button/Button.js';
|
|
7
7
|
import { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';
|
|
8
|
-
export
|
|
8
|
+
export const PathError = (props) => {
|
|
9
9
|
const [showContent, setShowContent] = React.useState(false);
|
|
10
10
|
const { packageName, importPath, issuerUrl, fixable } = props;
|
|
11
11
|
const cloudpack = useCloudpack();
|
|
12
12
|
const prettyImportPath = importPath.replace(/^\.\//, '');
|
|
13
13
|
const prettyImportString = `${packageName}${prettyImportPath === '.' ? '' : `/${prettyImportPath}`}`;
|
|
14
|
-
const editConfig = () =>
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
const addOverride = () => {
|
|
18
|
-
void cloudpack.addPackageOverride.mutate({ packageName, importPath, issuerUrl });
|
|
19
|
-
};
|
|
14
|
+
const editConfig = () => void cloudpack.openConfigEditor.mutate();
|
|
15
|
+
const addOverride = () => void cloudpack.addPackageOverride.mutate({ packageName, importPath, issuerUrl });
|
|
20
16
|
return (React.createElement("div", { className: styles.root },
|
|
21
17
|
React.createElement("div", { className: cx(styles.header, styles.error) },
|
|
22
18
|
React.createElement("button", { className: styles.expandButton, onClick: () => setShowContent(!showContent), "aria-label": showContent ? `Minimize ${prettyImportString}` : `Expand ${prettyImportString}` },
|
|
@@ -43,5 +39,5 @@ export function PathError(props) {
|
|
|
43
39
|
: importPath.endsWith('/')
|
|
44
40
|
? `Remove the trailing slash from the import path.`
|
|
45
41
|
: `Import not found on package. Make sure the import path is valid.`)))))));
|
|
46
|
-
}
|
|
42
|
+
};
|
|
47
43
|
//# sourceMappingURL=PathError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathError.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/PathError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uCAAuC,CAAC;AAC3D,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,MAAM,
|
|
1
|
+
{"version":3,"file":"PathError.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/PathError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uCAAuC,CAAC;AAC3D,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,eAAe,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,MAAM,CAAC,MAAM,SAAS,GAAoC,CAAC,KAAK,EAAE,EAAE;IAClE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAU,KAAK,CAAC,CAAC;IACrE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,E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AC,OAAO,EAAE,UAAU,uBAA2B,CAClD;YACN,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO;gBAC5B,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK,cAAe;gBAE3C,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa;oBAClC,6BAAK,SAAS,EAAE,MAAM,CAAC,IAAI,cAAe;oBAC1C,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK,IACzB,UAAU,KAAK,GAAG;wBACjB,CAAC,CAAC,4BAA4B,WAAW,iBAAiB;wBAC1D,CAAC,CAAC,SAAS,UAAU,gCAAgC,WAAW,+CAA+C,CAC7G,CACF;gBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa;oBAClC,6BAAK,SAAS,EAAE,MAAM,CAAC,IAAI,eAAgB;oBAC3C,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK,IACzB,OAAO;wBACN,CAAC,CAAC,iEAAiE,WAAW,kBAAkB,kBAAkB,IAAI;wBACtH,CAAC,CAAC,UAAU,KAAK,GAAG;4BAClB,CAAC,CAAC,sCAAsC;4BACxC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;gCACxB,CAAC,CAAC,iDAAiD;gCACnD,CAAC,CAAC,kEAAkE,CACtE,CACF,CACF,CACL,CACJ,CACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport styles from '../StatusDialog/TaskStatus.module.css';\nimport ErrorIcon from '../../images/error-24.inline.svg';\nimport { default as cx } from 'classnames';\nimport ChevronDownIcon from '../../images/chevrondown-20.inline.svg';\nimport type { UnsupportedErrorEvent } from './useErrorEvents.js';\nimport { Button } from '../Button/Button.js';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\n\nexport const PathError: React.FC<UnsupportedErrorEvent> = (props) => {\n const [showContent, setShowContent] = React.useState<boolean>(false);\n const { packageName, importPath, issuerUrl, fixable } = props;\n const cloudpack = useCloudpack();\n const prettyImportPath = importPath.replace(/^\\.\\//, '');\n const prettyImportString = `${packageName}${prettyImportPath === '.' ? '' : `/${prettyImportPath}`}`;\n\n const editConfig = () => void cloudpack.openConfigEditor.mutate();\n\n const addOverride = () => void cloudpack.addPackageOverride.mutate({ packageName, importPath, issuerUrl });\n\n return (\n <div className={styles.root}>\n <div className={cx(styles.header, styles.error)}>\n <button\n className={styles.expandButton}\n onClick={() => setShowContent(!showContent)}\n aria-label={showContent ? `Minimize ${prettyImportString}` : `Expand ${prettyImportString}`}\n >\n <img\n className={cx(styles.expandIcon, !showContent && styles.collapsed)}\n src={ChevronDownIcon}\n alt=\"Chevron down icon\"\n />\n </button>\n <img className={styles.errorIcon} src={ErrorIcon} alt=\"Error icon\" />\n <div className={styles.title}>{`${prettyImportString}`}</div>\n </div>\n {showContent && (\n <>\n <div className={styles.commands}>\n {fixable && <Button onClick={addOverride}>Add override</Button>}\n <Button onClick={editConfig}>Edit config file</Button>\n </div>\n <div className={styles.content}>\n <div className={styles.title}>Details</div>\n\n <div className={styles.nameValueArea}>\n <div className={styles.name}>Problem</div>\n <div className={styles.value}>\n {importPath === '.'\n ? `An unrecognized package \"${packageName}\" was imported.`\n : `Path \"${importPath}\" was imported from package \"${packageName}\" but was not recognized as an exported path.`}\n </div>\n </div>\n <div className={styles.nameValueArea}>\n <div className={styles.name}>Solution</div>\n <div className={styles.value}>\n {fixable\n ? `Remove the path from the import in your source. (Import from \"${packageName}\" rather than \"${prettyImportString}\")`\n : importPath === '.'\n ? `Make sure the package name is valid.`\n : importPath.endsWith('/')\n ? `Remove the trailing slash from the import path.`\n : `Import not found on package. Make sure the import path is valid.`}\n </div>\n </div>\n </div>\n </>\n )}\n </div>\n );\n};\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
export type ErrorEvents = {
|
|
2
|
+
unsupported: UnsupportedErrorEvent[];
|
|
3
|
+
};
|
|
1
4
|
export type UnsupportedErrorEvent = {
|
|
2
5
|
packageName: string;
|
|
3
6
|
importPath: string;
|
|
4
7
|
issuerUrl?: string;
|
|
5
8
|
fixable?: boolean;
|
|
6
9
|
};
|
|
7
|
-
export declare const useErrorEvents: () =>
|
|
8
|
-
unsupported: UnsupportedErrorEvent[];
|
|
9
|
-
};
|
|
10
|
+
export declare const useErrorEvents: () => ErrorEvents;
|
|
10
11
|
//# sourceMappingURL=useErrorEvents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useErrorEvents.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,qBAAqB,GAAG;
|
|
1
|
+
{"version":3,"file":"useErrorEvents.d.ts","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,WAkEjC,CAAC"}
|
|
@@ -17,19 +17,20 @@ export const useErrorEvents = () => {
|
|
|
17
17
|
const handleUnsupportedError = (message, issuerUrl) => {
|
|
18
18
|
const errorRegex = /[Mm]odule specifier,? ['"](.*?)['"]/;
|
|
19
19
|
const match = message.match(errorRegex);
|
|
20
|
-
if (match) {
|
|
21
|
-
|
|
22
|
-
const { packageName, importPath } = importString;
|
|
23
|
-
(async () => {
|
|
24
|
-
const { fixable } = await cloudpack.validatePackageOverride.query({ packageName, importPath, issuerUrl });
|
|
25
|
-
setErrorEvents((prev) => ({
|
|
26
|
-
...prev,
|
|
27
|
-
unsupported: [...prev.unsupported, { packageName, importPath, issuerUrl: issuerUrl, fixable }],
|
|
28
|
-
}));
|
|
29
|
-
})().catch(() => {
|
|
30
|
-
// no-op
|
|
31
|
-
});
|
|
20
|
+
if (!match) {
|
|
21
|
+
return;
|
|
32
22
|
}
|
|
23
|
+
const importString = parseImportString(match[1]);
|
|
24
|
+
const { packageName, importPath } = importString;
|
|
25
|
+
(async () => {
|
|
26
|
+
const { fixable } = await cloudpack.validatePackageOverride.query({ packageName, importPath, issuerUrl });
|
|
27
|
+
setErrorEvents((prev) => ({
|
|
28
|
+
...prev,
|
|
29
|
+
unsupported: [...prev.unsupported, { packageName, importPath, issuerUrl: issuerUrl, fixable }],
|
|
30
|
+
}));
|
|
31
|
+
})().catch(() => {
|
|
32
|
+
// no-op
|
|
33
|
+
});
|
|
33
34
|
};
|
|
34
35
|
const subscription = cloudpack.onDataChanged.subscribe(errorEntrySource, {
|
|
35
36
|
onData: (data) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useErrorEvents.js","sourceRoot":"","sources":["../../../src/components/ErrorDialog/useErrorEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAYpE,iCAAiC;AACjC,MAAM,cAAc,GAAG,CAAC,KAA4B,EAAyB,EAAE;IAC7E,OAAO,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;AACnG,CAAC,CAAC;AAEF,qDAAqD;AACrD,MAAM,UAAU,GAAG,CAAC,KAA4B,EAAyB,EAAE;IACzE,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,MAAM,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K,MAAM,KAAK,IAAI,UAAU,CAAC,cAAc,EAAE,CAAC;YAC9C,sBAAsB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;QAED,wCAAwC;QACxC,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,CAAC,KAA4B,EAAE,EAAE;YAC7E,UAAU,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,6CAA6C;QAC7C,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAClD,UAAU,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { parseImportString } from '@ms-cloudpack/path-string-parsing';\nimport { useCloudpack } from '../CloudpackProvider/CloudpackProvider.js';\nimport { errorEntrySource } from '@ms-cloudpack/api-server/browser';\n\n// Interface with reason as a record.\ninterface ReasonRecord extends PromiseRejectionEvent {\n readonly reason: Record<string, unknown>;\n}\n\n// Interface with message as a string.\ninterface ReasonString extends ReasonRecord {\n readonly reason: { message: string };\n}\n\n// Verify the reason is a record.\nconst reasonIsRecord = (event: PromiseRejectionEvent): event is ReasonRecord => {\n return typeof event.reason === 'object' && !Array.isArray(event.reason) && event.reason !== null;\n};\n\n// Verify the reason has a message which is a string.\nconst hasMessage = (event: PromiseRejectionEvent): event is ReasonString => {\n return reasonIsRecord(event) && typeof event.reason.message === 'string';\n};\n\nexport type ErrorEvents = {\n unsupported: UnsupportedErrorEvent[];\n};\n\nexport type UnsupportedErrorEvent = {\n packageName: string;\n importPath: string;\n issuerUrl?: string;\n fixable?: boolean;\n};\n\nexport const useErrorEvents = (): ErrorEvents => {\n const [errorEvents, setErrorEvents] = useState<ErrorEvents>({ unsupported: [] });\n const cloudpack = useCloudpack();\n\n useEffect(() => {\n const handleUnsupportedError = (message: string, issuerUrl?: string): void => {\n const errorRegex = /[Mm]odule specifier,? ['\"](.*?)['\"]/;\n const match = message.match(errorRegex);\n\n if (!match) {\n return;\n }\n\n const importString = parseImportString(match[1]);\n const { packageName, importPath } = importString;\n\n (async () => {\n const { fixable } = await cloudpack.validatePackageOverride.query({ packageName, importPath, issuerUrl });\n setErrorEvents((prev) => ({\n ...prev,\n unsupported: [...prev.unsupported, { packageName, importPath, issuerUrl: issuerUrl, fixable }],\n }));\n })().catch(() => {\n // no-op\n });\n };\n\n const subscription = cloudpack.onDataChanged.subscribe(errorEntrySource, {\n onData: (data) => {\n if (data) {\n console.error(data);\n handleUnsupportedError(String(data));\n }\n },\n });\n\n const pageErrors = window.__pageErrors;\n\n pageErrors.unregister();\n\n // Append unsupported paths to the list.\n window.addEventListener('error', (event: ErrorEvent) => {\n handleUnsupportedError(event.message, event.filename);\n });\n\n // Handle errors caught before rendering.\n for (const error of pageErrors.uncaughtErrors) {\n handleUnsupportedError(error.message, error.filename);\n }\n\n // Append unsupported paths to the list.\n window.addEventListener('unhandledrejection', (event: PromiseRejectionEvent) => {\n hasMessage(event) && handleUnsupportedError(event.reason.message);\n });\n\n // Handle rejections caught before rendering.\n for (const error of pageErrors.uncaughtRejections) {\n hasMessage(error) && handleUnsupportedError(error.reason.message);\n }\n\n return () => {\n subscription.unsubscribe();\n };\n }, [cloudpack]);\n\n return errorEvents;\n};\n"]}
|
|
@@ -5,5 +5,5 @@ export interface StatusBadgeProps {
|
|
|
5
5
|
onToggle?: () => void;
|
|
6
6
|
pageLoadTime?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare
|
|
8
|
+
export declare const StatusBadge: React.FC<StatusBadgeProps>;
|
|
9
9
|
//# sourceMappingURL=StatusBadge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,
|
|
1
|
+
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../../src/components/StatusBadge/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAO7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqElD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import styles from './StatusBadge.module.css';
|
|
|
4
4
|
import { default as cx } from 'classnames';
|
|
5
5
|
import { useStatus } from '../CloudpackProvider/useStatus.js';
|
|
6
6
|
import { elementIds } from '../../constants.js';
|
|
7
|
-
export
|
|
7
|
+
export const StatusBadge = ({ inline, onExpand, pageLoadTime }) => {
|
|
8
8
|
const badgeStatusKey = 'cloudpack.badgeStatus';
|
|
9
9
|
const rootElementRef = useRef(null);
|
|
10
10
|
const dragElementRef = useRef(null);
|
|
@@ -45,7 +45,7 @@ export function StatusBadge({ inline, onExpand, pageLoadTime }) {
|
|
|
45
45
|
React.createElement("button", { className: `${styles.button} ${styles.chevron}`, onClick: toggleBadgeVisibility }, isCollapsed ? leftChevron : rightChevron)));
|
|
46
46
|
return inline ? (badge) : (React.createElement("div", { className: styles.fixedOverlay },
|
|
47
47
|
React.createElement("div", { className: styles.contentSurface }, badge)));
|
|
48
|
-
}
|
|
48
|
+
};
|
|
49
49
|
function getStatusString(status) {
|
|
50
50
|
if (status.status === 'pending') {
|
|
51
51
|
return 'Running';
|
|
@@ -55,7 +55,8 @@ function getStatusString(status) {
|
|
|
55
55
|
}
|
|
56
56
|
return status.totalErrors === 0 ? 'Success' : 'Errors';
|
|
57
57
|
}
|
|
58
|
-
function getStatusClassName(
|
|
58
|
+
function getStatusClassName(cpStatus, inline) {
|
|
59
|
+
const { status, totalTasks, totalErrors, totalWarnings } = cpStatus;
|
|
59
60
|
return cx(styles.badge, {
|
|
60
61
|
[styles.inline]: inline,
|
|
61
62
|
[styles.building]: status === 'pending',
|
|
@@ -69,7 +70,8 @@ function getCollapsedClassName(isCollapsed) {
|
|
|
69
70
|
[styles.collapsed]: isCollapsed,
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
|
-
function getStatsString(
|
|
73
|
+
function getStatsString(status) {
|
|
74
|
+
const { totalTasks, remainingTasks, totalErrors, totalWarnings } = status;
|
|
73
75
|
if (totalTasks === 0) {
|
|
74
76
|
return '';
|
|
75
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","sourceRoot":"","sources":["../../../src/components/StatusBadge/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,SAA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WAAW,GAAG,CAAC;QACpD,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,IAAI,WAAW,KAAK,CAAC,IAAI,aAAa,GAAG,CAAC;KAC9E,CAAC,CAAC;AACL,CAAC;AAED,SAAS,qBAAqB,CAAC,WAAoB;IACjD,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;QACtB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,WAAW;KAChC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,MAAuB;IAC7C,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAC1E,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,cAAc,GAAG,CAAC,IAAI,GAAG,cAAc,OAAO,UAAU,gBAAgB;QACxE,cAAc,KAAK,CAAC,IAAI,GAAG,UAAU,kBAAkB;QACvD,WAAW,KAAK,CAAC,IAAI,GAAG,WAAW,QAAQ;QAC3C,WAAW,GAAG,CAAC,IAAI,GAAG,WAAW,SAAS;QAC1C,aAAa,KAAK,CAAC,IAAI,GAAG,aAAa,UAAU;QACjD,aAAa,GAAG,CAAC,IAAI,GAAG,aAAa,WAAW;KACjD;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["import React, { useCallback, useRef, useState } from 'react';\nimport { useDraggable } from '../../hooks/useDraggable.js';\nimport styles from './StatusBadge.module.css';\nimport { default as cx } from 'classnames';\nimport { useStatus, type CloudpackStatus } from '../CloudpackProvider/useStatus.js';\nimport { elementIds } from '../../constants.js';\n\nexport interface StatusBadgeProps {\n inline?: boolean;\n onExpand?: () => void;\n onToggle?: () => void;\n pageLoadTime?: number;\n}\n\nexport const StatusBadge: React.FC<StatusBadgeProps> = ({ inline, onExpand, pageLoadTime }) => {\n const badgeStatusKey = 'cloudpack.badgeStatus';\n\n const rootElementRef = useRef<HTMLDivElement>(null);\n const dragElementRef = useRef<HTMLDivElement>(null);\n const status = useStatus();\n const [isCollapsed, setIsCollapsed] = useState<boolean>(!!localStorage.getItem(badgeStatusKey));\n\n const shouldRender = status.status !== 'unknown';\n\n const toggleBadgeVisibility = useCallback(() => {\n const newCollapsedState = !isCollapsed;\n console.log('Status badge collapsed state:', newCollapsedState);\n setIsCollapsed(newCollapsedState);\n localStorage.setItem(badgeStatusKey, newCollapsedState ? 'collapsed' : '');\n }, [isCollapsed]);\n\n useDraggable({\n // If we're not yet able to render, don't enable dragging yet.\n // Otherwise the event handlers won't be attached when the component renders.\n enabled: shouldRender && !inline,\n containerElementRef: rootElementRef,\n dragElementRef,\n });\n\n if (!shouldRender) {\n return null;\n }\n\n const metric = pageLoadTime ? (\n <span className={styles.metric} title=\"Page Load Time\">\n in {pageLoadTime.toFixed(2)} ms\n </span>\n ) : null;\n\n const leftChevron = '\\u00AB';\n const rightChevron = '\\u00BB';\n const badge = (\n <div\n id={elementIds.statusBadgeRoot}\n ref={rootElementRef}\n className={`${getStatusClassName(status, !!inline)} ${getCollapsedClassName(isCollapsed)}`}\n >\n {!inline && (\n <div ref={dragElementRef} className={styles.gripArea}>\n <div className={styles.grip} />\n <div className={styles.grip} />\n </div>\n )}\n <button className={styles.button} onClick={onExpand} aria-label=\"Expand overlay\">\n <div className={styles.value}>{getStatusString(status)}</div>\n </button>\n <div>\n {getStatsString(status)}\n {metric}\n </div>\n <button className={`${styles.button} ${styles.chevron}`} onClick={toggleBadgeVisibility}>\n {isCollapsed ? leftChevron : rightChevron}\n </button>\n </div>\n );\n\n return inline ? (\n badge\n ) : (\n <div className={styles.fixedOverlay}>\n <div className={styles.contentSurface}>{badge}</div>\n </div>\n );\n};\n\nfunction getStatusString(status: CloudpackStatus): string {\n if (status.status === 'pending') {\n return 'Running';\n }\n\n if (status.totalTasks === 0) {\n return 'Idle';\n }\n\n return status.totalErrors === 0 ? 'Success' : 'Errors';\n}\n\nfunction getStatusClassName(cpStatus: CloudpackStatus, inline: boolean): string {\n const { status, totalTasks, totalErrors, totalWarnings } = cpStatus;\n return cx(styles.badge, {\n [styles.inline]: inline,\n [styles.building]: status === 'pending',\n [styles.success]: status === 'idle' && totalTasks > 0 && totalErrors === 0 && totalWarnings === 0,\n [styles.error]: status === 'idle' && totalErrors > 0,\n [styles.warning]: status === 'idle' && totalErrors === 0 && totalWarnings > 0,\n });\n}\n\nfunction getCollapsedClassName(isCollapsed: boolean): string {\n return cx(styles.badge, {\n [styles.collapsed]: isCollapsed,\n });\n}\n\nfunction getStatsString(status: CloudpackStatus): string {\n const { totalTasks, remainingTasks, totalErrors, totalWarnings } = status;\n if (totalTasks === 0) {\n return '';\n }\n\n return [\n remainingTasks > 0 && `${remainingTasks} of ${totalTasks} tasks pending`,\n remainingTasks === 0 && `${totalTasks} tasks completed`,\n totalErrors === 1 && `${totalErrors} error`,\n totalErrors > 1 && `${totalErrors} errors`,\n totalWarnings === 1 && `${totalWarnings} warning`,\n totalWarnings > 1 && `${totalWarnings} warnings`,\n ]\n .filter(Boolean)\n .join(', ');\n}\n"]}
|
|
@@ -3,5 +3,5 @@ export interface SearchboxProps {
|
|
|
3
3
|
value: string;
|
|
4
4
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
6
|
+
export declare const Searchbox: React.FC<SearchboxProps>;
|
|
7
7
|
//# sourceMappingURL=Searchbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Searchbox.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDialog/Searchbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,
|
|
1
|
+
{"version":3,"file":"Searchbox.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDialog/Searchbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAQ9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styles from './Searchbox.module.css';
|
|
3
|
-
export
|
|
3
|
+
export const Searchbox = ({ value, onChange }) => {
|
|
4
4
|
return (React.createElement(React.Fragment, null, typeof value === 'string' && (React.createElement("input", { type: "text", placeholder: "Search", className: styles.searchbox, onChange: onChange, value: value }))));
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
//# sourceMappingURL=Searchbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Searchbox.js","sourceRoot":"","sources":["../../../src/components/StatusDialog/Searchbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAO5C,MAAM,
|
|
1
|
+
{"version":3,"file":"Searchbox.js","sourceRoot":"","sources":["../../../src/components/StatusDialog/Searchbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAO5C,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAkB,EAAE,EAAE;IACzF,OAAO,CACL,0CACG,OAAO,KAAK,KAAK,QAAQ,IAAI,CAC5B,+BAAO,IAAI,EAAC,MAAM,EAAC,WAAW,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAI,CAC1G,CACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport styles from './Searchbox.module.css';\n\nexport interface SearchboxProps {\n value: string;\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Searchbox: React.FC<SearchboxProps> = ({ value, onChange }: SearchboxProps) => {\n return (\n <>\n {typeof value === 'string' && (\n <input type=\"text\" placeholder=\"Search\" className={styles.searchbox} onChange={onChange} value={value} />\n )}\n </>\n );\n};\n"]}
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
export interface StatusDialogProps {
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
}
|
|
5
|
-
export declare
|
|
5
|
+
export declare const StatusDialog: React.FC<StatusDialogProps>;
|
|
6
6
|
export default StatusDialog;
|
|
7
7
|
//# sourceMappingURL=StatusDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDialog.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDialog/StatusDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAQ3C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,
|
|
1
|
+
{"version":3,"file":"StatusDialog.d.ts","sourceRoot":"","sources":["../../../src/components/StatusDialog/StatusDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAQ3C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiCpD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|