@eintrek/erp-shell 0.1.50 → 0.1.52
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/help/help-api.d.ts +35 -0
- package/dist/help/help-button.d.ts +8 -0
- package/dist/help/help-context.d.ts +37 -0
- package/dist/help/help-dialog.d.ts +13 -0
- package/dist/help/help-store.d.ts +22 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +1363 -913
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1367 -909
- package/dist/index.js.map +1 -1
- package/dist/lib/plan-features.d.ts +7 -1
- package/dist/navigation/app-layout-shell.d.ts +11 -1
- package/dist/version.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HelpAppId } from "./help-store";
|
|
2
|
+
import type { HelpContext } from "./help-context";
|
|
3
|
+
export declare function helpApiBase(app: HelpAppId | "other"): string;
|
|
4
|
+
export type HelpKind = "help" | "problem" | "feedback";
|
|
5
|
+
export interface HelpSent {
|
|
6
|
+
id: string;
|
|
7
|
+
ref: string;
|
|
8
|
+
status: string;
|
|
9
|
+
created_at: string;
|
|
10
|
+
}
|
|
11
|
+
export interface MyHelpMessage {
|
|
12
|
+
id: string;
|
|
13
|
+
ref: string;
|
|
14
|
+
app: string;
|
|
15
|
+
kind: HelpKind;
|
|
16
|
+
message: string;
|
|
17
|
+
status: "new" | "answered" | "closed";
|
|
18
|
+
created_at: string;
|
|
19
|
+
replies: Array<{
|
|
20
|
+
body: string;
|
|
21
|
+
created_at: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
/** A failure the dialog shows as is. */
|
|
25
|
+
export declare class HelpSendError extends Error {
|
|
26
|
+
readonly status?: number | undefined;
|
|
27
|
+
constructor(message: string, status?: number | undefined);
|
|
28
|
+
}
|
|
29
|
+
export declare function sendHelpMessage(input: {
|
|
30
|
+
app: HelpAppId | "other";
|
|
31
|
+
kind: HelpKind;
|
|
32
|
+
message: string;
|
|
33
|
+
context: HelpContext;
|
|
34
|
+
}): Promise<HelpSent>;
|
|
35
|
+
export declare function listMyHelpMessages(app: HelpAppId | "other"): Promise<MyHelpMessage[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface HelpButtonProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* The ช่วยเหลือ button in the top bar. Drawn in the header's ink (the
|
|
6
|
+
* --header-* variables of the workspace chrome, white on the brand chrome).
|
|
7
|
+
*/
|
|
8
|
+
export declare function HelpButton({ className }: HelpButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type HelpAppId } from "./help-store";
|
|
2
|
+
/** What the dialog attaches to a message, as platform-api keeps it. */
|
|
3
|
+
export interface HelpContext {
|
|
4
|
+
page_url?: string;
|
|
5
|
+
page_title?: string;
|
|
6
|
+
org_code?: string;
|
|
7
|
+
app_version?: string;
|
|
8
|
+
shell_version?: string;
|
|
9
|
+
browser?: string;
|
|
10
|
+
platform?: string;
|
|
11
|
+
screen?: string;
|
|
12
|
+
viewport?: string;
|
|
13
|
+
language?: string;
|
|
14
|
+
time_zone?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const HELP_APP_LABEL: Record<HelpAppId | "other", string>;
|
|
17
|
+
/**
|
|
18
|
+
* Which app this page is: what the host said, what the app declared to the
|
|
19
|
+
* app switcher, then the production sub-domain, then the app URLs the build
|
|
20
|
+
* was given (local development). "other" when none of them tells.
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectHelpApp(explicit?: HelpAppId | null): HelpAppId | "other";
|
|
23
|
+
/** "Chrome 141" and "macOS" from a user agent — enough to reproduce. */
|
|
24
|
+
export declare function describeBrowser(ua: string): {
|
|
25
|
+
browser: string;
|
|
26
|
+
platform: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The deployed build: NEXT_PUBLIC_APP_VERSION when the app sets one, else
|
|
30
|
+
* the Next build id in the page's own script paths (the build time, as every
|
|
31
|
+
* app's generateBuildId writes it).
|
|
32
|
+
*/
|
|
33
|
+
export declare function readAppVersion(): string;
|
|
34
|
+
/** Everything attached to a message, read at the moment it is sent. */
|
|
35
|
+
export declare function collectHelpContext(orgCode?: string | null): HelpContext;
|
|
36
|
+
/** The short line under the form, "ข้อมูลที่แนบ: …". */
|
|
37
|
+
export declare function describeAttached(app: HelpAppId | "other", ctx: HelpContext, email?: string | null): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HelpAppId } from "./help-store";
|
|
2
|
+
export interface HelpDialogHostProps {
|
|
3
|
+
/** Which app this is; detected when omitted (see detectHelpApp). */
|
|
4
|
+
app?: HelpAppId | null;
|
|
5
|
+
/** Organisation code from the route, attached to the message. */
|
|
6
|
+
orgCode?: string | null;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The ช่วยเหลือ dialog. AppLayoutShell mounts one; the top-bar button and
|
|
10
|
+
* the user menu open it with openHelp(). It sends to platform-api, which
|
|
11
|
+
* puts the message in the back office's queue on admin.antniti.com.
|
|
12
|
+
*/
|
|
13
|
+
export declare function HelpDialogHost({ app, orgCode }: HelpDialogHostProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ช่วยเหลือ dialog's open state, shared by everything that can open it:
|
|
3
|
+
* the top-bar button (AppLayoutShell) and the user menu (NavUser), which
|
|
4
|
+
* live in different subtrees. A tiny external store rather than a context so
|
|
5
|
+
* NavUser works the same whether or not it sits under the layout.
|
|
6
|
+
*/
|
|
7
|
+
export type HelpAppId = "platform" | "accounx" | "invenx" | "plannex" | "peoplx";
|
|
8
|
+
/** Opens the dialog — a no-op when no layout has mounted one. */
|
|
9
|
+
export declare function openHelp(): void;
|
|
10
|
+
export declare function closeHelp(): void;
|
|
11
|
+
/** Called by the dialog host on mount; returns its unmount. */
|
|
12
|
+
export declare function registerHelpHost(): () => void;
|
|
13
|
+
export declare function useHelpOpen(): boolean;
|
|
14
|
+
/** True while a dialog host is mounted, i.e. the ช่วยเหลือ entry works. */
|
|
15
|
+
export declare function useHelpAvailable(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Every app names itself when it builds its app-switcher links
|
|
18
|
+
* (buildSystemLinks({ activeApp })); the dialog reads that to say which app
|
|
19
|
+
* a message came from without each app passing it again.
|
|
20
|
+
*/
|
|
21
|
+
export declare function declareHelpApp(app: HelpAppId): void;
|
|
22
|
+
export declare function declaredHelpApp(): HelpAppId | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export { AppLayoutShell, type AppLayoutShellProps, type AppLayoutShellOrganizati
|
|
|
24
24
|
export { type ShellChrome, type WorkspaceHeaderTone, WORKSPACE_HEADER_VARS, WORKSPACE_LIGHT_HEADER_VARS, } from "./navigation/chrome";
|
|
25
25
|
export { WorkspaceBrand, type WorkspaceBrandProps } from "./navigation/workspace-brand";
|
|
26
26
|
export { SidebarHelpCard, SidebarHelpLink, type SidebarHelpCardProps, type SidebarHelpLinkProps, } from "./navigation/sidebar-help-card";
|
|
27
|
+
export { HelpButton, type HelpButtonProps } from "./help/help-button";
|
|
28
|
+
export { HelpDialogHost, type HelpDialogHostProps } from "./help/help-dialog";
|
|
29
|
+
export { openHelp, closeHelp, type HelpAppId } from "./help/help-store";
|
|
30
|
+
export { describeBrowser, describeAttached, detectHelpApp, type HelpContext, } from "./help/help-context";
|
|
31
|
+
export { SHELL_VERSION } from "./version";
|
|
27
32
|
export { AccessDenied, type AccessDeniedProps } from "./auth/access-denied";
|
|
28
33
|
export { EmployeeRequiredGate, EMPLOYEE_RECORD_REQUIRED, EMPLOYEE_RECORD_REQUIRED_EVENT, EMPLOYEE_RECORD_OK_EVENT, } from "./auth/employee-required-gate";
|
|
29
34
|
export { PermissionGateShell, type PermissionGateShellProps, type PermissionGateSkeletonVariant, } from "./auth/permission-gate-shell";
|