@zealicsolutions/web-ui 1.0.140-beta.79 → 1.0.140-beta.80

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.
@@ -1,9 +1,39 @@
1
1
  /// <reference types="react" />
2
+ export type RwoContextType = {
3
+ /** The current RWO record ID (from URL) */
4
+ rwoRecordId?: string;
5
+ /** The entity type of the current RWO */
6
+ entityType?: string;
7
+ /** Additional context data */
8
+ customFields?: Record<string, unknown>;
9
+ };
10
+ export type CortexRwoContextType = {
11
+ /** The resolved RWO record ID from the organism/container where action originated */
12
+ rwoRecordId?: string;
13
+ /** The source data model field ID used to resolve the value */
14
+ sourceDataModelFieldId?: string;
15
+ /** Additional resolved data */
16
+ resolvedData?: Record<string, unknown>;
17
+ };
18
+ export type OpenAIChatOptions = {
19
+ /** Optional override for cortexAgentId */
20
+ cortexAgentId?: string;
21
+ /**
22
+ * Cortex RWO context - resolved from the organism/container where button is located.
23
+ * This is populated by the button action based on sourceDataModelFieldId.
24
+ */
25
+ cortexRwoContext?: CortexRwoContextType;
26
+ };
2
27
  export type WebpageContextType = {
3
28
  webpageId?: string;
4
29
  webpageName?: string;
5
30
  withAISupport?: boolean;
6
31
  cortexAgentId?: string;
32
+ /**
33
+ * Current RWO context for the webpage.
34
+ * Includes rwoRecordId from URL when present.
35
+ */
36
+ rwoContext?: RwoContextType;
7
37
  /**
8
38
  * Optional callback that indicates whether AI is available for the current webpage.
9
39
  * When not provided, consumers can fall back to checking `withAISupport`.
@@ -13,11 +43,6 @@ export type WebpageContextType = {
13
43
  * Optional callback to open AI chat for this webpage.
14
44
  * The host application can decide what payload to support here.
15
45
  */
16
- openAIChat?: (options?: {
17
- organismId?: string;
18
- recordId?: string;
19
- entityType?: string;
20
- customFields?: Record<string, unknown>;
21
- }) => void | Promise<void>;
46
+ openAIChat?: (options?: OpenAIChatOptions) => void | Promise<void>;
22
47
  };
23
48
  export declare const WebpageContext: React.Context<WebpageContextType | undefined>;