@npm-zenwork/tax-remittance-ui 0.14.3 → 0.14.4

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.
@@ -16,11 +16,12 @@ interface EmbeddedContextValue {
16
16
  }
17
17
  interface EmbeddedContextProviderProps {
18
18
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
19
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
19
20
  enabledPayments?: PaymentType[];
20
21
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
21
22
  userName?: string;
22
23
  children: ReactNode;
23
24
  }
24
- export declare function EmbeddedContextProvider({ onOrganizationCreated, enabledPayments, onPaymentRequired, userName, children, }: EmbeddedContextProviderProps): import("react").JSX.Element;
25
+ export declare function EmbeddedContextProvider({ onOrganizationCreated, onEntitiesChanged, enabledPayments, onPaymentRequired, userName, children, }: EmbeddedContextProviderProps): import("react").JSX.Element;
25
26
  export declare function useEmbeddedContext(): EmbeddedContextValue;
26
27
  export {};
@@ -11,6 +11,8 @@ export interface EmbeddedWidgetBaseProps {
11
11
  theme?: TaxRemittanceTheme;
12
12
  onSessionExpired?: () => void;
13
13
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
14
+ /** Called whenever the entity list's contents change — created, edited, or status toggled. */
15
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
14
16
  onNavigate?: (routeKey: EmbeddedRouteKey, pathname: string) => void;
15
17
  onPaymentRequired?: (info: PaymentRequiredInfo) => void;
16
18
  /** Called whenever the widget's active entity changes, from either the host or the widget. */
@@ -34,4 +36,4 @@ export interface EmbeddedWidgetBaseProps {
34
36
  *
35
37
  * Children should be a <Routes> element with the widget-specific route tree.
36
38
  */
37
- export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onNavigate, onPaymentRequired, onEntityChange, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
39
+ export declare function EmbeddedWidgetBase({ appKey, accessToken, apiBaseUrl, theme, onSessionExpired, onOrganizationCreated, onEntitiesChanged, onNavigate, onPaymentRequired, onEntityChange, navigateFnRef, selectEntityFnRef, enabledPayments, userName, children, }: EmbeddedWidgetBaseProps): import("react").JSX.Element;
@@ -71,6 +71,17 @@ export interface TaxRemittanceEmbeddedProps {
71
71
  * Called immediately after a new organization/entity is created inside the widget.
72
72
  */
73
73
  onOrganizationCreated?: (org: EntityDetailsResponse) => void;
74
+ /**
75
+ * Called whenever the entity list's contents change inside the widget — an entity
76
+ * created, edited, or its status toggled Active/Inactive. Receives the full updated
77
+ * list.
78
+ *
79
+ * Use this if the host keeps its own copy of the entities (a header switcher backed
80
+ * by its own store, say). `onOrganizationCreated` only fires for entities that are
81
+ * new, so without this a host's copy goes stale after a status change until the page
82
+ * is reloaded.
83
+ */
84
+ onEntitiesChanged?: (entities: EntityDetailsResponse[]) => void;
74
85
  /**
75
86
  * Called every time the widget's internal route changes.
76
87
  * Use this to keep the host app's sidebar selection in sync with the widget.