@npm-zenwork/tax-remittance-ui 0.1.0 → 0.1.2
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/components/onboarding/CreateEntityCard.d.ts +1 -0
- package/dist/embedded/EmbeddedContext.d.ts +1 -0
- package/dist/embedded/EmbeddedWidgetBase.d.ts +2 -1
- package/dist/embedded/EntityGate.d.ts +0 -9
- package/dist/embedded/TaxRemittanceEmbedded.d.ts +3 -1
- package/dist/embedded/pages/EmbeddedCreateEntityPage.d.ts +2 -2
- package/dist/embedded/pages/EmbeddedEntityFormPage.d.ts +1 -5
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3163 -3153
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.d.ts +1 -1
- package/package.json +2 -1
|
@@ -3,6 +3,7 @@ import { EntityDetailsResponse } from '../types/entity';
|
|
|
3
3
|
interface EmbeddedContextValue {
|
|
4
4
|
entities: EntityDetailsResponse[];
|
|
5
5
|
isLoading: boolean;
|
|
6
|
+
isError: boolean;
|
|
6
7
|
selectedEntity: EntityDetailsResponse | null;
|
|
7
8
|
setSelectedEntityId: (id: number) => void;
|
|
8
9
|
refetchEntities: () => Promise<void>;
|
|
@@ -12,6 +12,7 @@ export interface EmbeddedWidgetBaseProps {
|
|
|
12
12
|
onOrganizationCreated?: (org: EntityDetailsResponse) => void;
|
|
13
13
|
onNavigate?: (routeKey: EmbeddedRouteKey, pathname: string) => void;
|
|
14
14
|
navigateFnRef: MutableRefObject<((path: string) => void) | null>;
|
|
15
|
+
selectEntityFnRef: MutableRefObject<((id: number) => void) | null>;
|
|
15
16
|
/** The <Routes> subtree specific to this widget. */
|
|
16
17
|
children: ReactNode;
|
|
17
18
|
}
|
|
@@ -25,4 +26,4 @@ export interface EmbeddedWidgetBaseProps {
|
|
|
25
26
|
*
|
|
26
27
|
* Children should be a <Routes> element with the widget-specific route tree.
|
|
27
28
|
*/
|
|
28
|
-
export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, navigateFnRef, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
|
|
29
|
+
export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, navigateFnRef, selectEntityFnRef, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gate route at "/".
|
|
3
|
-
* Reads entity state from EmbeddedContextProvider (which wraps the whole route tree)
|
|
4
|
-
* and redirects the user to the right starting screen:
|
|
5
|
-
*
|
|
6
|
-
* Loading → spinner
|
|
7
|
-
* No entities → /create-entity
|
|
8
|
-
* Has entities → /dashboard
|
|
9
|
-
*/
|
|
10
1
|
export declare function EntityGate(): import("react").JSX.Element | null;
|
|
@@ -5,7 +5,7 @@ export type { TaxRemittanceTheme };
|
|
|
5
5
|
* The top-level section the widget is currently showing.
|
|
6
6
|
* Returned by `onNavigate` so the host can highlight the correct sidebar item.
|
|
7
7
|
*/
|
|
8
|
-
export type EmbeddedRouteKey = 'dashboard' | 'payments' | 'tax-forms' | 'settings' | 'create-entity' | 'other';
|
|
8
|
+
export type EmbeddedRouteKey = 'dashboard' | 'payments' | 'tax-forms' | 'settings' | 'create-entity' | 'create-entity-form' | 'other';
|
|
9
9
|
/**
|
|
10
10
|
* Imperative handle exposed via `ref` on `TaxRemittanceEmbedded`.
|
|
11
11
|
* Lets the host app navigate the widget to a specific internal path
|
|
@@ -17,6 +17,8 @@ export type EmbeddedRouteKey = 'dashboard' | 'payments' | 'tax-forms' | 'setting
|
|
|
17
17
|
*/
|
|
18
18
|
export interface TaxRemittanceEmbeddedHandle {
|
|
19
19
|
navigate: (path: string) => void;
|
|
20
|
+
/** Switch the active entity context inside the widget. */
|
|
21
|
+
selectEntity: (id: number) => void;
|
|
20
22
|
}
|
|
21
23
|
export interface TaxRemittanceEmbeddedProps {
|
|
22
24
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Embedded version of the Create Entity landing page.
|
|
3
3
|
* No SignOutButton, no full-screen shell — just the card in a centered container.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* "Create Entity" navigates to the dedicated form page; Cancel on the form
|
|
5
|
+
* returns here via state.from.
|
|
6
6
|
*/
|
|
7
7
|
export declare function EmbeddedCreateEntityPage(): import("react").JSX.Element;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Embedded version of the Entity Form page.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* After the form submits successfully, EntityForm navigates to the return path
|
|
6
|
-
* set by EmbeddedCreateEntityPage (state.from = '/dashboard'), and
|
|
7
|
-
* EmbeddedContextProvider detects the new entity and fires onOrganizationCreated.
|
|
3
|
+
* Top-left Back returns to the create-entity card (or state.from).
|
|
8
4
|
*/
|
|
9
5
|
export declare function EmbeddedEntityFormPage(): import("react").JSX.Element;
|