@webority/support-react 0.37.0 → 0.38.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/README.md +3 -0
- package/dist/support-react.js +1 -1335
- package/dist/types/SupportProvider.d.ts +3 -1
- package/dist/types/context.d.ts +8 -1
- package/dist/types/lib/format.d.ts +12 -3
- package/package.json +7 -9
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {import('./client.js').SupportClient} props.client From `createSupportClient(http)`.
|
|
6
|
+
* @param {string} [props.timeZone="Asia/Kolkata"] IANA zone every ticket and message time is shown in.
|
|
6
7
|
* @param {import('react').ReactNode} props.children
|
|
7
8
|
*/
|
|
8
|
-
export default function SupportProvider({ client, children }: {
|
|
9
|
+
export default function SupportProvider({ client, timeZone, children }: {
|
|
9
10
|
client: import('./client.js').SupportClient;
|
|
11
|
+
timeZone?: string;
|
|
10
12
|
children: import('react').ReactNode;
|
|
11
13
|
}): import("react").JSX.Element;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
/** @type {import('react').Context<{ client: import('./client.js').SupportClient, loadConfig: (fresh?: boolean) => Promise<any
|
|
1
|
+
/** @type {import('react').Context<{ client: import('./client.js').SupportClient, loadConfig: (fresh?: boolean) => Promise<any>, timeZone: string } | null>} */
|
|
2
2
|
export declare const SupportContext: import('react').Context<{
|
|
3
3
|
client: import('./client.js').SupportClient;
|
|
4
4
|
loadConfig: (fresh?: boolean) => Promise<any>;
|
|
5
|
+
timeZone: string;
|
|
5
6
|
} | null>;
|
|
6
7
|
/**
|
|
7
8
|
* The support client the nearest SupportProvider holds.
|
|
@@ -9,6 +10,12 @@ export declare const SupportContext: import('react').Context<{
|
|
|
9
10
|
* @returns {import('./client.js').SupportClient}
|
|
10
11
|
*/
|
|
11
12
|
export declare function useSupportClient(): import('./client.js').SupportClient;
|
|
13
|
+
/**
|
|
14
|
+
* The IANA time zone the nearest SupportProvider shows times in.
|
|
15
|
+
*
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
export declare function useSupportTimeZone(): string;
|
|
12
19
|
/**
|
|
13
20
|
* What the customer may send and how to reach support. Loaded once per provider and shared.
|
|
14
21
|
*
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
export declare const DEFAULT_TIME_ZONE = "Asia/Kolkata";
|
|
1
2
|
/**
|
|
2
|
-
* A timestamp in the
|
|
3
|
-
*
|
|
3
|
+
* A timestamp in the product's time zone as "21-Sep-2026, 3:30 PM". Returns a plain hyphen for a
|
|
4
|
+
* missing or unreadable value.
|
|
4
5
|
*
|
|
5
6
|
* @param {string|null|undefined} iso
|
|
7
|
+
* @param {string} [timeZone] An IANA zone name; Asia/Kolkata when omitted.
|
|
6
8
|
* @returns {string}
|
|
7
9
|
*/
|
|
8
|
-
export declare function formatDateTime(iso: string | null | undefined): string;
|
|
10
|
+
export declare function formatDateTime(iso: string | null | undefined, timeZone?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* The short name of a zone as the reader knows it ("IST" for Asia/Kolkata).
|
|
13
|
+
*
|
|
14
|
+
* @param {string} [timeZone]
|
|
15
|
+
* @returns {string}
|
|
16
|
+
*/
|
|
17
|
+
export declare function timeZoneLabel(timeZone?: string): string;
|
|
9
18
|
/**
|
|
10
19
|
* @param {number} bytes
|
|
11
20
|
* @returns {string}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/support-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Webority customer support for React portals: ticket centre, report-an-issue with a page screenshot, and support contact details, built on @webority/ui-react.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -8,13 +8,11 @@
|
|
|
8
8
|
"access": "public",
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
10
10
|
},
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/Webority/webority-ui.git",
|
|
14
|
-
"directory": "packages/support-react"
|
|
15
|
-
},
|
|
16
11
|
"files": [
|
|
17
|
-
"dist"
|
|
12
|
+
"dist",
|
|
13
|
+
"!dist/**/__tests__",
|
|
14
|
+
"!dist/**/*.test.*",
|
|
15
|
+
"!dist/**/*.map"
|
|
18
16
|
],
|
|
19
17
|
"main": "./dist/support-react.js",
|
|
20
18
|
"module": "./dist/support-react.js",
|
|
@@ -32,7 +30,7 @@
|
|
|
32
30
|
"react": "^19.0.0",
|
|
33
31
|
"react-bootstrap": "^2.10.0",
|
|
34
32
|
"react-dom": "^19.0.0",
|
|
35
|
-
"@webority/ui-react": "0.
|
|
33
|
+
"@webority/ui-react": "0.38.0"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
36
|
"@testing-library/dom": "10.4.2",
|
|
@@ -50,7 +48,7 @@
|
|
|
50
48
|
"typescript": "^7.0.2",
|
|
51
49
|
"vite": "^8.0.12",
|
|
52
50
|
"vitest": "5.0.1",
|
|
53
|
-
"@webority/ui-react": "0.
|
|
51
|
+
"@webority/ui-react": "0.38.0"
|
|
54
52
|
},
|
|
55
53
|
"dependencies": {
|
|
56
54
|
"html-to-image": "^1.11.13"
|