@corti/embedded-web 0.1.0-alpha.1
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/LICENSE +21 -0
- package/README.md +273 -0
- package/dist/CortiEmbedded.d.ts +102 -0
- package/dist/CortiEmbedded.js +452 -0
- package/dist/CortiEmbedded.js.map +1 -0
- package/dist/bundle.js +96 -0
- package/dist/corti-embedded.d.ts +1 -0
- package/dist/corti-embedded.js +5 -0
- package/dist/corti-embedded.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/internal-types.d.ts +231 -0
- package/dist/internal-types.js +2 -0
- package/dist/internal-types.js.map +1 -0
- package/dist/public-types.d.ts +238 -0
- package/dist/public-types.js +2 -0
- package/dist/public-types.js.map +1 -0
- package/dist/react/CortiEmbeddedReact.d.ts +25 -0
- package/dist/react/CortiEmbeddedReact.js +28 -0
- package/dist/react/CortiEmbeddedReact.js.map +1 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -0
- package/dist/styles/base.d.ts +4 -0
- package/dist/styles/base.js +10 -0
- package/dist/styles/base.js.map +1 -0
- package/dist/styles/container-styles.d.ts +1 -0
- package/dist/styles/container-styles.js +35 -0
- package/dist/styles/container-styles.js.map +1 -0
- package/dist/styles/theme.d.ts +2 -0
- package/dist/styles/theme.js +101 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/PostMessageHandler.d.ts +119 -0
- package/dist/utils/PostMessageHandler.js +353 -0
- package/dist/utils/PostMessageHandler.js.map +1 -0
- package/dist/utils/baseUrl.d.ts +1 -0
- package/dist/utils/baseUrl.js +25 -0
- package/dist/utils/baseUrl.js.map +1 -0
- package/dist/utils/embedUrl.d.ts +2 -0
- package/dist/utils/embedUrl.js +23 -0
- package/dist/utils/embedUrl.js.map +1 -0
- package/dist/utils/errorFormatter.d.ts +10 -0
- package/dist/utils/errorFormatter.js +163 -0
- package/dist/utils/errorFormatter.js.map +1 -0
- package/dist/web-bundle.js +89 -0
- package/dist/web-index.d.ts +3 -0
- package/dist/web-index.js +3 -0
- package/dist/web-index.js.map +1 -0
- package/package.json +129 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import type { Corti } from '@corti/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Authentication credentials for Assistant
|
|
4
|
+
*/
|
|
5
|
+
export interface AuthCredentials {
|
|
6
|
+
access_token: string;
|
|
7
|
+
token_type: string;
|
|
8
|
+
expires_at?: number | null;
|
|
9
|
+
expires_in?: number | null;
|
|
10
|
+
refresh_expires_in?: number | null;
|
|
11
|
+
refresh_token?: string;
|
|
12
|
+
id_token?: string;
|
|
13
|
+
'not-before-policy'?: number | null;
|
|
14
|
+
session_state?: string;
|
|
15
|
+
scope?: string;
|
|
16
|
+
profile?: {
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
sub: string;
|
|
20
|
+
};
|
|
21
|
+
mode: 'stateless' | 'stateful';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* User information returned from authentication
|
|
25
|
+
*/
|
|
26
|
+
export interface User {
|
|
27
|
+
id: string;
|
|
28
|
+
email: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Details of a created interaction
|
|
32
|
+
*/
|
|
33
|
+
export interface InteractionDetails {
|
|
34
|
+
id: string;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Interaction payload
|
|
39
|
+
*/
|
|
40
|
+
export interface InteractionPayload {
|
|
41
|
+
assignedUserId: Corti.InteractionsCreateRequest['assignedUserId'];
|
|
42
|
+
encounter: {
|
|
43
|
+
identifier: Corti.InteractionsCreateRequest['encounter']['identifier'];
|
|
44
|
+
status: Corti.InteractionsCreateRequest['encounter']['status'];
|
|
45
|
+
type: Corti.InteractionsCreateRequest['encounter']['type'];
|
|
46
|
+
period: Corti.InteractionsCreateRequest['encounter']['period'];
|
|
47
|
+
title?: string;
|
|
48
|
+
};
|
|
49
|
+
patient: Corti.InteractionsCreateRequest['patient'];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Fact used to provide additional information for the interaction context
|
|
53
|
+
*/
|
|
54
|
+
export interface Fact {
|
|
55
|
+
text: Corti.FactsCreateInput['text'];
|
|
56
|
+
group: Corti.FactsCreateInput['group'];
|
|
57
|
+
source?: Corti.FactsCreateInput['source'];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Session configuration options
|
|
61
|
+
*/
|
|
62
|
+
export interface SessionConfig {
|
|
63
|
+
defaultLanguage?: string;
|
|
64
|
+
defaultOutputLanguage?: string;
|
|
65
|
+
defaultTemplateKey?: string;
|
|
66
|
+
defaultMode?: 'virtual' | 'in-person';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Status information about the embedded component
|
|
70
|
+
*/
|
|
71
|
+
export interface ComponentStatus {
|
|
72
|
+
ready: boolean;
|
|
73
|
+
auth: {
|
|
74
|
+
authenticated: boolean;
|
|
75
|
+
user?: User;
|
|
76
|
+
};
|
|
77
|
+
currentUrl?: string;
|
|
78
|
+
interaction?: {
|
|
79
|
+
encounter: Corti.InteractionsEncounterResponse;
|
|
80
|
+
documents: Corti.DocumentsListResponse['data'];
|
|
81
|
+
facts: Corti.FactsListResponse['facts'];
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
interface AppearanceConfig {
|
|
85
|
+
primaryColor: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface FeaturesConfig {
|
|
88
|
+
interactionTitle: boolean;
|
|
89
|
+
aiChat: boolean;
|
|
90
|
+
documentFeedback: boolean;
|
|
91
|
+
navigation: boolean;
|
|
92
|
+
virtualMode: boolean;
|
|
93
|
+
}
|
|
94
|
+
interface LocaleConfig {
|
|
95
|
+
interfaceLanguage: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Configuration options for the embedded component
|
|
99
|
+
*/
|
|
100
|
+
export interface ConfigureAppPayload {
|
|
101
|
+
appearance?: Partial<AppearanceConfig>;
|
|
102
|
+
features?: Partial<FeaturesConfig>;
|
|
103
|
+
locale?: Partial<LocaleConfig>;
|
|
104
|
+
}
|
|
105
|
+
export interface ConfigureAppResponsePayload {
|
|
106
|
+
appearance: AppearanceConfig;
|
|
107
|
+
features: FeaturesConfig;
|
|
108
|
+
locale: LocaleConfig;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Event data types for component events
|
|
112
|
+
*/
|
|
113
|
+
export interface EmbeddedEventData {
|
|
114
|
+
ready: undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Limited access - NOT IMPLEMENTED
|
|
117
|
+
*/
|
|
118
|
+
'auth-changed': {
|
|
119
|
+
user: User;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Limited access - NOT IMPLEMENTED
|
|
123
|
+
*/
|
|
124
|
+
'interaction-created': {
|
|
125
|
+
interaction: InteractionDetails;
|
|
126
|
+
};
|
|
127
|
+
'recording-started': undefined;
|
|
128
|
+
'recording-stopped': undefined;
|
|
129
|
+
'document-generated': {
|
|
130
|
+
document: Corti.DocumentsGetResponse;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Emitted after manual updates and changes made through dictation as well as re-generating the document
|
|
134
|
+
*/
|
|
135
|
+
'document-updated': {
|
|
136
|
+
document: Corti.DocumentsGetResponse;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Emitted when a document is "pushed" to the host EHR system from the Assistant interface
|
|
140
|
+
*/
|
|
141
|
+
'document-synced': {
|
|
142
|
+
document: Corti.DocumentsGetResponse;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Limited access - NOT IMPLEMENTED
|
|
146
|
+
*/
|
|
147
|
+
'navigation-changed': {
|
|
148
|
+
path: string;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Emitted when usage data is returned following a request that consumed credits
|
|
152
|
+
*/
|
|
153
|
+
usage: {
|
|
154
|
+
creditsConsumed: number;
|
|
155
|
+
};
|
|
156
|
+
error: {
|
|
157
|
+
message: string;
|
|
158
|
+
code?: string;
|
|
159
|
+
details?: unknown;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Event listener function type
|
|
164
|
+
*/
|
|
165
|
+
export type EventListener<T = unknown> = (data: T) => void;
|
|
166
|
+
/**
|
|
167
|
+
* Public API interface for the Corti Embedded component
|
|
168
|
+
*/
|
|
169
|
+
export interface CortiEmbeddedAPI {
|
|
170
|
+
/**
|
|
171
|
+
* Authenticate with the Corti system
|
|
172
|
+
* @param credentials Authentication credentials
|
|
173
|
+
* @returns Promise resolving to user information
|
|
174
|
+
*/
|
|
175
|
+
auth(credentials: AuthCredentials): Promise<User>;
|
|
176
|
+
/**
|
|
177
|
+
* Create a new interaction
|
|
178
|
+
* @param encounter Encounter request data
|
|
179
|
+
* @returns Promise resolving to interaction details
|
|
180
|
+
*/
|
|
181
|
+
createInteraction(encounter: InteractionPayload): Promise<InteractionDetails>;
|
|
182
|
+
/**
|
|
183
|
+
* Configure the current session
|
|
184
|
+
* @param config Session configuration
|
|
185
|
+
* @returns Promise that resolves when configuration is complete
|
|
186
|
+
*/
|
|
187
|
+
configureSession(config: SessionConfig): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Add facts to the current session
|
|
190
|
+
* @param facts Array of facts to add
|
|
191
|
+
* @returns Promise that resolves when facts are added
|
|
192
|
+
*/
|
|
193
|
+
addFacts(facts: Fact[]): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Navigate to a specific path within the embedded UI
|
|
196
|
+
* @param path Path to navigate to
|
|
197
|
+
* @returns Promise that resolves when navigation is complete
|
|
198
|
+
*/
|
|
199
|
+
navigate(path: string): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Start recording
|
|
202
|
+
* @returns Promise that resolves when recording starts
|
|
203
|
+
*/
|
|
204
|
+
startRecording(): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Stop recording
|
|
207
|
+
* @returns Promise that resolves when recording stops
|
|
208
|
+
*/
|
|
209
|
+
stopRecording(): Promise<void>;
|
|
210
|
+
/**
|
|
211
|
+
* Get current component status
|
|
212
|
+
* @returns Promise resolving to current status
|
|
213
|
+
*/
|
|
214
|
+
getStatus(): Promise<ComponentStatus>;
|
|
215
|
+
/**
|
|
216
|
+
* Configure the application
|
|
217
|
+
* @param config Application configuration
|
|
218
|
+
* @returns Promise that resolves when configuration is applied
|
|
219
|
+
*/
|
|
220
|
+
configure(config: ConfigureAppPayload): Promise<ConfigureAppResponsePayload>;
|
|
221
|
+
/**
|
|
222
|
+
* Set authentication credentials without triggering auth flow
|
|
223
|
+
* @param credentials Authentication credentials to store
|
|
224
|
+
* @returns Promise that resolves when credentials are set
|
|
225
|
+
*/
|
|
226
|
+
setCredentials(credentials: {
|
|
227
|
+
password: string;
|
|
228
|
+
}): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Show the embedded UI
|
|
231
|
+
*/
|
|
232
|
+
show(): void;
|
|
233
|
+
/**
|
|
234
|
+
* Hide the embedded UI
|
|
235
|
+
*/
|
|
236
|
+
hide(): void;
|
|
237
|
+
}
|
|
238
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-types.js","sourceRoot":"","sources":["../src/public-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Corti } from '@corti/sdk';\n\n/**\n * Authentication credentials for Assistant\n */\nexport interface AuthCredentials {\n access_token: string;\n token_type: string;\n expires_at?: number | null;\n expires_in?: number | null;\n refresh_expires_in?: number | null;\n refresh_token?: string;\n id_token?: string;\n 'not-before-policy'?: number | null;\n session_state?: string;\n scope?: string;\n profile?: {\n name: string;\n email: string;\n sub: string;\n };\n mode: 'stateless' | 'stateful';\n}\n\n/**\n * User information returned from authentication\n */\nexport interface User {\n id: string;\n email: string;\n}\n\n/**\n * Details of a created interaction\n */\nexport interface InteractionDetails {\n id: string;\n createdAt: string;\n}\n\n/**\n * Interaction payload\n */\nexport interface InteractionPayload {\n assignedUserId: Corti.InteractionsCreateRequest['assignedUserId'];\n encounter: {\n identifier: Corti.InteractionsCreateRequest['encounter']['identifier'];\n status: Corti.InteractionsCreateRequest['encounter']['status'];\n type: Corti.InteractionsCreateRequest['encounter']['type'];\n period: Corti.InteractionsCreateRequest['encounter']['period'];\n title?: string;\n };\n patient: Corti.InteractionsCreateRequest['patient'];\n}\n\n/**\n * Fact used to provide additional information for the interaction context\n */\nexport interface Fact {\n text: Corti.FactsCreateInput['text'];\n group: Corti.FactsCreateInput['group'];\n source?: Corti.FactsCreateInput['source'];\n}\n\n/**\n * Session configuration options\n */\nexport interface SessionConfig {\n defaultLanguage?: string;\n defaultOutputLanguage?: string;\n defaultTemplateKey?: string;\n defaultMode?: 'virtual' | 'in-person';\n}\n\n/**\n * Status information about the embedded component\n */\nexport interface ComponentStatus {\n ready: boolean;\n auth: {\n authenticated: boolean;\n user?: User;\n };\n currentUrl?: string;\n interaction?: {\n encounter: Corti.InteractionsEncounterResponse;\n documents: Corti.DocumentsListResponse['data'];\n facts: Corti.FactsListResponse['facts'];\n };\n}\n\ninterface AppearanceConfig {\n primaryColor: string | null;\n}\n\ninterface FeaturesConfig {\n interactionTitle: boolean;\n aiChat: boolean;\n documentFeedback: boolean;\n navigation: boolean;\n virtualMode: boolean;\n}\n\ninterface LocaleConfig {\n interfaceLanguage: string;\n}\n\n/**\n * Configuration options for the embedded component\n */\nexport interface ConfigureAppPayload {\n appearance?: Partial<AppearanceConfig>;\n features?: Partial<FeaturesConfig>;\n locale?: Partial<LocaleConfig>;\n}\n\nexport interface ConfigureAppResponsePayload {\n appearance: AppearanceConfig;\n features: FeaturesConfig;\n locale: LocaleConfig;\n}\n\n/**\n * Event data types for component events\n */\nexport interface EmbeddedEventData {\n ready: undefined;\n /**\n * Limited access - NOT IMPLEMENTED\n */\n 'auth-changed': {\n user: User;\n };\n /**\n * Limited access - NOT IMPLEMENTED\n */\n 'interaction-created': {\n interaction: InteractionDetails;\n };\n 'recording-started': undefined;\n 'recording-stopped': undefined;\n 'document-generated': {\n document: Corti.DocumentsGetResponse;\n };\n /**\n * Emitted after manual updates and changes made through dictation as well as re-generating the document\n */\n 'document-updated': {\n document: Corti.DocumentsGetResponse;\n };\n /**\n * Emitted when a document is \"pushed\" to the host EHR system from the Assistant interface\n */\n 'document-synced': {\n document: Corti.DocumentsGetResponse;\n };\n /**\n * Limited access - NOT IMPLEMENTED\n */\n 'navigation-changed': {\n // TODO: Implement navigation change event in CA\n path: string;\n };\n /**\n * Emitted when usage data is returned following a request that consumed credits\n */\n usage: {\n creditsConsumed: number;\n };\n error: {\n message: string;\n code?: string; // TODO: ensure that code is a valid error code and we have a mapping to error messages\n details?: unknown;\n };\n}\n\n/**\n * Event listener function type\n */\nexport type EventListener<T = unknown> = (data: T) => void;\n\n/**\n * Public API interface for the Corti Embedded component\n */\nexport interface CortiEmbeddedAPI {\n /**\n * Authenticate with the Corti system\n * @param credentials Authentication credentials\n * @returns Promise resolving to user information\n */\n auth(credentials: AuthCredentials): Promise<User>;\n\n /**\n * Create a new interaction\n * @param encounter Encounter request data\n * @returns Promise resolving to interaction details\n */\n createInteraction(encounter: InteractionPayload): Promise<InteractionDetails>;\n\n /**\n * Configure the current session\n * @param config Session configuration\n * @returns Promise that resolves when configuration is complete\n */\n configureSession(config: SessionConfig): Promise<void>;\n\n /**\n * Add facts to the current session\n * @param facts Array of facts to add\n * @returns Promise that resolves when facts are added\n */\n addFacts(facts: Fact[]): Promise<void>;\n\n /**\n * Navigate to a specific path within the embedded UI\n * @param path Path to navigate to\n * @returns Promise that resolves when navigation is complete\n */\n navigate(path: string): Promise<void>;\n\n /**\n * Start recording\n * @returns Promise that resolves when recording starts\n */\n startRecording(): Promise<void>;\n\n /**\n * Stop recording\n * @returns Promise that resolves when recording stops\n */\n stopRecording(): Promise<void>;\n\n /**\n * Get current component status\n * @returns Promise resolving to current status\n */\n getStatus(): Promise<ComponentStatus>;\n\n /**\n * Configure the application\n * @param config Application configuration\n * @returns Promise that resolves when configuration is applied\n */\n configure(config: ConfigureAppPayload): Promise<ConfigureAppResponsePayload>;\n\n /**\n * Set authentication credentials without triggering auth flow\n * @param credentials Authentication credentials to store\n * @returns Promise that resolves when credentials are set\n */\n setCredentials(credentials: { password: string }): Promise<void>;\n\n /**\n * Show the embedded UI\n */\n show(): void;\n\n /**\n * Hide the embedded UI\n */\n hide(): void;\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CortiEmbedded } from '../CortiEmbedded.js';
|
|
3
|
+
import type { CortiEmbeddedAPI, EmbeddedEventData } from '../public-types.js';
|
|
4
|
+
export interface CortiEmbeddedReactProps {
|
|
5
|
+
baseURL: string;
|
|
6
|
+
visibility?: 'visible' | 'hidden';
|
|
7
|
+
onReady?: (event: CustomEvent<EmbeddedEventData['ready']>) => void;
|
|
8
|
+
/** LIMITED ACCESS - not implemented */
|
|
9
|
+
onAuthChanged?: (event: CustomEvent<EmbeddedEventData['auth-changed']>) => void;
|
|
10
|
+
/** LIMITED ACCESS - not implemented */
|
|
11
|
+
onInteractionCreated?: (event: CustomEvent<EmbeddedEventData['interaction-created']>) => void;
|
|
12
|
+
onRecordingStarted?: (event: CustomEvent<EmbeddedEventData['recording-started']>) => void;
|
|
13
|
+
onRecordingStopped?: (event: CustomEvent<EmbeddedEventData['recording-stopped']>) => void;
|
|
14
|
+
onDocumentGenerated?: (event: CustomEvent<EmbeddedEventData['document-generated']>) => void;
|
|
15
|
+
onDocumentUpdated?: (event: CustomEvent<EmbeddedEventData['document-updated']>) => void;
|
|
16
|
+
/** LIMITED ACCESS - not implemented */
|
|
17
|
+
onNavigationChanged?: (event: CustomEvent<EmbeddedEventData['navigation-changed']>) => void;
|
|
18
|
+
onError?: (event: CustomEvent<EmbeddedEventData['error']>) => void;
|
|
19
|
+
onUsage?: (event: CustomEvent<EmbeddedEventData['usage']>) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
}
|
|
23
|
+
export type CortiEmbeddedReactRef = CortiEmbedded & CortiEmbeddedAPI;
|
|
24
|
+
export * from '../public-types.js';
|
|
25
|
+
export declare const CortiEmbeddedReact: React.ForwardRefExoticComponent<CortiEmbeddedReactProps & React.RefAttributes<CortiEmbeddedReactRef>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createComponent } from '@lit/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CortiEmbedded } from '../CortiEmbedded.js';
|
|
4
|
+
const BaseCortiEmbeddedElement = createComponent({
|
|
5
|
+
tagName: 'corti-embedded',
|
|
6
|
+
elementClass: CortiEmbedded,
|
|
7
|
+
react: React,
|
|
8
|
+
events: {
|
|
9
|
+
onReady: 'ready',
|
|
10
|
+
onAuthChanged: 'auth-changed',
|
|
11
|
+
onInteractionCreated: 'interaction-created',
|
|
12
|
+
onRecordingStarted: 'recording-started',
|
|
13
|
+
onRecordingStopped: 'recording-stopped',
|
|
14
|
+
onDocumentGenerated: 'document-generated',
|
|
15
|
+
onDocumentUpdated: 'document-updated',
|
|
16
|
+
onNavigationChanged: 'navigation-changed',
|
|
17
|
+
onError: 'error',
|
|
18
|
+
onUsage: 'usage',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
// Export public types
|
|
22
|
+
export * from '../public-types.js';
|
|
23
|
+
export const CortiEmbeddedReact = React.forwardRef((props, ref) => React.createElement(BaseCortiEmbeddedElement, {
|
|
24
|
+
ref,
|
|
25
|
+
...props,
|
|
26
|
+
}));
|
|
27
|
+
CortiEmbeddedReact.displayName = 'CortiEmbeddedReact';
|
|
28
|
+
//# sourceMappingURL=CortiEmbeddedReact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CortiEmbeddedReact.js","sourceRoot":"","sources":["../../src/react/CortiEmbeddedReact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,MAAM,wBAAwB,GAAG,eAAe,CAAC;IAC/C,OAAO,EAAE,gBAAgB;IACzB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,OAAO,EAAE,OAAO;QAChB,aAAa,EAAE,cAAc;QAC7B,oBAAoB,EAAE,qBAAqB;QAC3C,kBAAkB,EAAE,mBAAmB;QACvC,kBAAkB,EAAE,mBAAmB;QACvC,mBAAmB,EAAE,oBAAoB;QACzC,iBAAiB,EAAE,kBAAkB;QACrC,mBAAmB,EAAE,oBAAoB;QACzC,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,OAAO;KACjB;CACF,CAAC,CAAC;AA0CH,sBAAsB;AACtB,cAAc,oBAAoB,CAAC;AAEnC,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGhD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CACf,KAAK,CAAC,aAAa,CAAC,wBAA+B,EAAE;IACnD,GAAG;IACH,GAAG,KAAK;CACT,CAAC,CACH,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["import { createComponent } from '@lit/react';\nimport * as React from 'react';\nimport { CortiEmbedded } from '../CortiEmbedded.js';\nimport type { CortiEmbeddedAPI, EmbeddedEventData } from '../public-types.js';\n\nconst BaseCortiEmbeddedElement = createComponent({\n tagName: 'corti-embedded',\n elementClass: CortiEmbedded,\n react: React,\n events: {\n onReady: 'ready',\n onAuthChanged: 'auth-changed',\n onInteractionCreated: 'interaction-created',\n onRecordingStarted: 'recording-started',\n onRecordingStopped: 'recording-stopped',\n onDocumentGenerated: 'document-generated',\n onDocumentUpdated: 'document-updated',\n onNavigationChanged: 'navigation-changed',\n onError: 'error',\n onUsage: 'usage',\n },\n});\n\n// Props interface\nexport interface CortiEmbeddedReactProps {\n baseURL: string;\n visibility?: 'visible' | 'hidden';\n\n // Event handlers\n onReady?: (event: CustomEvent<EmbeddedEventData['ready']>) => void;\n /** LIMITED ACCESS - not implemented */\n onAuthChanged?: (\n event: CustomEvent<EmbeddedEventData['auth-changed']>,\n ) => void;\n /** LIMITED ACCESS - not implemented */\n onInteractionCreated?: (\n event: CustomEvent<EmbeddedEventData['interaction-created']>,\n ) => void;\n onRecordingStarted?: (\n event: CustomEvent<EmbeddedEventData['recording-started']>,\n ) => void;\n onRecordingStopped?: (\n event: CustomEvent<EmbeddedEventData['recording-stopped']>,\n ) => void;\n onDocumentGenerated?: (\n event: CustomEvent<EmbeddedEventData['document-generated']>,\n ) => void;\n onDocumentUpdated?: (\n event: CustomEvent<EmbeddedEventData['document-updated']>,\n ) => void;\n /** LIMITED ACCESS - not implemented */\n onNavigationChanged?: (\n event: CustomEvent<EmbeddedEventData['navigation-changed']>,\n ) => void;\n onError?: (event: CustomEvent<EmbeddedEventData['error']>) => void;\n onUsage?: (event: CustomEvent<EmbeddedEventData['usage']>) => void;\n\n // Additional props\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport type CortiEmbeddedReactRef = CortiEmbedded & CortiEmbeddedAPI;\n// Export public types\nexport * from '../public-types.js';\n\nexport const CortiEmbeddedReact = React.forwardRef<\n CortiEmbeddedReactRef,\n CortiEmbeddedReactProps\n>((props, ref) =>\n React.createElement(BaseCortiEmbeddedElement as any, {\n ref,\n ...props,\n }),\n);\n\nCortiEmbeddedReact.displayName = 'CortiEmbeddedReact';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './CortiEmbeddedReact.js';\nexport type {\n CortiEmbeddedReactProps,\n CortiEmbeddedReactRef,\n} from './CortiEmbeddedReact.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/styles/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;CAI5B,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * Base styles to be applied to all components within the application.\n */\nexport const baseStyles = css`\n * {\n box-sizing: border-box;\n }\n`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const containerStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
// Main container styles for the Corti Agent component
|
|
3
|
+
export const containerStyles = css `
|
|
4
|
+
:host {
|
|
5
|
+
/* Make the component fill its container completely */
|
|
6
|
+
display: block;
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
width: 100%;
|
|
13
|
+
height: 100%;
|
|
14
|
+
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
background-color: transparent;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Handle visibility state */
|
|
22
|
+
:host([visibility='hidden']) {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Ensure iframe fills the entire component */
|
|
27
|
+
iframe {
|
|
28
|
+
width: 100% !important;
|
|
29
|
+
height: 100% !important;
|
|
30
|
+
border: none !important;
|
|
31
|
+
margin: 0 !important;
|
|
32
|
+
padding: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
//# sourceMappingURL=container-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-styles.js","sourceRoot":"","sources":["../../src/styles/container-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,sDAAsD;AACtD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BjC,CAAC","sourcesContent":["import { css } from 'lit';\n\n// Main container styles for the Corti Agent component\nexport const containerStyles = css`\n :host {\n /* Make the component fill its container completely */\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n\n margin: 0;\n padding: 0;\n background-color: transparent;\n overflow: hidden;\n }\n\n /* Handle visibility state */\n :host([visibility='hidden']) {\n display: none;\n }\n\n /* Ensure iframe fills the entire component */\n iframe {\n width: 100% !important;\n height: 100% !important;\n border: none !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n`;\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
const ThemeStyles = css `
|
|
3
|
+
:host {
|
|
4
|
+
color-scheme: light dark;
|
|
5
|
+
/* Component Defaults */
|
|
6
|
+
--component-font-family: 'Segoe UI', Roboto, sans-serif;
|
|
7
|
+
|
|
8
|
+
/* Plain (Default) Colors */
|
|
9
|
+
--plain-bg-color: light-dark(#f5f5f5, #3a3a3a);
|
|
10
|
+
--plain-border-color: light-dark(
|
|
11
|
+
rgba(0, 0, 0, 0.08),
|
|
12
|
+
rgba(255, 255, 255, 0.1)
|
|
13
|
+
);
|
|
14
|
+
--plain-active-color: light-dark(#f0f0f0, #393939);
|
|
15
|
+
--plain-text-color: light-dark(#333, #eee);
|
|
16
|
+
|
|
17
|
+
/* Accent Colors */
|
|
18
|
+
--accent-bg-color: light-dark(#232323, #ffffff);
|
|
19
|
+
--accent-border-color: light-dark(#1a1a1a, #f5f5f5);
|
|
20
|
+
--accent-active-color: light-dark(#3a3a3a, #f5f5f5);
|
|
21
|
+
--accent-text-color: light-dark(#fff, #333);
|
|
22
|
+
|
|
23
|
+
/* User Colors (Same as Plain) */
|
|
24
|
+
--msg-user-bg-color: var(--plain-bg-color);
|
|
25
|
+
--msg-user-border-color: var(--plain-border-color);
|
|
26
|
+
--msg-user-active-color: var(--plain-active-color);
|
|
27
|
+
--msg-user-text-color: var(--plain-text-color);
|
|
28
|
+
|
|
29
|
+
/* Response Colors */
|
|
30
|
+
--msg-agent-bg-color: transparent;
|
|
31
|
+
--msg-agent-border-color: light-dark(
|
|
32
|
+
rgba(0, 0, 0, 0.05),
|
|
33
|
+
rgba(255, 255, 255, 0.08)
|
|
34
|
+
);
|
|
35
|
+
--msg-agent-active-color: light-dark(
|
|
36
|
+
rgba(0, 0, 0, 0.02),
|
|
37
|
+
rgba(255, 255, 255, 0.05)
|
|
38
|
+
);
|
|
39
|
+
--msg-agent-text-color: var(--plain-text-color);
|
|
40
|
+
|
|
41
|
+
/* Success Colors */
|
|
42
|
+
--success-bg-color: light-dark(
|
|
43
|
+
rgba(34, 197, 94, 0.1),
|
|
44
|
+
rgba(34, 197, 94, 0.2)
|
|
45
|
+
);
|
|
46
|
+
--success-border-color: light-dark(
|
|
47
|
+
rgba(34, 197, 94, 0.2),
|
|
48
|
+
rgba(34, 197, 94, 0.3)
|
|
49
|
+
);
|
|
50
|
+
--success-active-color: light-dark(
|
|
51
|
+
rgba(34, 197, 94, 0.15),
|
|
52
|
+
rgba(34, 197, 94, 0.25)
|
|
53
|
+
);
|
|
54
|
+
--success-text-color: light-dark(#22c55e, #4ade80);
|
|
55
|
+
|
|
56
|
+
/* Info Colors */
|
|
57
|
+
--info-bg-color: light-dark(
|
|
58
|
+
rgba(59, 130, 246, 0.1),
|
|
59
|
+
rgba(59, 130, 246, 0.2)
|
|
60
|
+
);
|
|
61
|
+
--info-border-color: light-dark(
|
|
62
|
+
rgba(59, 130, 246, 0.2),
|
|
63
|
+
rgba(59, 130, 246, 0.3)
|
|
64
|
+
);
|
|
65
|
+
--info-active-color: light-dark(
|
|
66
|
+
rgba(59, 130, 246, 0.15),
|
|
67
|
+
rgba(59, 130, 246, 0.25)
|
|
68
|
+
);
|
|
69
|
+
--info-text-color: light-dark(#3b82f6, #60a5fa);
|
|
70
|
+
|
|
71
|
+
/* Error Colors */
|
|
72
|
+
--error-bg-color: light-dark(
|
|
73
|
+
rgba(239, 68, 68, 0.1),
|
|
74
|
+
rgba(239, 68, 68, 0.2)
|
|
75
|
+
);
|
|
76
|
+
--error-border-color: light-dark(
|
|
77
|
+
rgba(239, 68, 68, 0.2),
|
|
78
|
+
rgba(239, 68, 68, 0.3)
|
|
79
|
+
);
|
|
80
|
+
--error-active-color: light-dark(
|
|
81
|
+
rgba(239, 68, 68, 0.15),
|
|
82
|
+
rgba(239, 68, 68, 0.25)
|
|
83
|
+
);
|
|
84
|
+
--error-text-color: light-dark(#ef4444, #f87171);
|
|
85
|
+
|
|
86
|
+
/* Layout defaults */
|
|
87
|
+
--base-background: light-dark(#fff, #222);
|
|
88
|
+
--card-padding: 8px;
|
|
89
|
+
--card-border-radius: 12px;
|
|
90
|
+
--card-inner-border-radius: 8px;
|
|
91
|
+
--card-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host {
|
|
95
|
+
/* Apply base font and color directly to the host */
|
|
96
|
+
font-family: var(--component-font-family);
|
|
97
|
+
color: var(--plain-text-color);
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
export default ThemeStyles;
|
|
101
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/styles/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiGtB,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { css } from 'lit';\n\nconst ThemeStyles = css`\n :host {\n color-scheme: light dark;\n /* Component Defaults */\n --component-font-family: 'Segoe UI', Roboto, sans-serif;\n\n /* Plain (Default) Colors */\n --plain-bg-color: light-dark(#f5f5f5, #3a3a3a);\n --plain-border-color: light-dark(\n rgba(0, 0, 0, 0.08),\n rgba(255, 255, 255, 0.1)\n );\n --plain-active-color: light-dark(#f0f0f0, #393939);\n --plain-text-color: light-dark(#333, #eee);\n\n /* Accent Colors */\n --accent-bg-color: light-dark(#232323, #ffffff);\n --accent-border-color: light-dark(#1a1a1a, #f5f5f5);\n --accent-active-color: light-dark(#3a3a3a, #f5f5f5);\n --accent-text-color: light-dark(#fff, #333);\n\n /* User Colors (Same as Plain) */\n --msg-user-bg-color: var(--plain-bg-color);\n --msg-user-border-color: var(--plain-border-color);\n --msg-user-active-color: var(--plain-active-color);\n --msg-user-text-color: var(--plain-text-color);\n\n /* Response Colors */\n --msg-agent-bg-color: transparent;\n --msg-agent-border-color: light-dark(\n rgba(0, 0, 0, 0.05),\n rgba(255, 255, 255, 0.08)\n );\n --msg-agent-active-color: light-dark(\n rgba(0, 0, 0, 0.02),\n rgba(255, 255, 255, 0.05)\n );\n --msg-agent-text-color: var(--plain-text-color);\n\n /* Success Colors */\n --success-bg-color: light-dark(\n rgba(34, 197, 94, 0.1),\n rgba(34, 197, 94, 0.2)\n );\n --success-border-color: light-dark(\n rgba(34, 197, 94, 0.2),\n rgba(34, 197, 94, 0.3)\n );\n --success-active-color: light-dark(\n rgba(34, 197, 94, 0.15),\n rgba(34, 197, 94, 0.25)\n );\n --success-text-color: light-dark(#22c55e, #4ade80);\n\n /* Info Colors */\n --info-bg-color: light-dark(\n rgba(59, 130, 246, 0.1),\n rgba(59, 130, 246, 0.2)\n );\n --info-border-color: light-dark(\n rgba(59, 130, 246, 0.2),\n rgba(59, 130, 246, 0.3)\n );\n --info-active-color: light-dark(\n rgba(59, 130, 246, 0.15),\n rgba(59, 130, 246, 0.25)\n );\n --info-text-color: light-dark(#3b82f6, #60a5fa);\n\n /* Error Colors */\n --error-bg-color: light-dark(\n rgba(239, 68, 68, 0.1),\n rgba(239, 68, 68, 0.2)\n );\n --error-border-color: light-dark(\n rgba(239, 68, 68, 0.2),\n rgba(239, 68, 68, 0.3)\n );\n --error-active-color: light-dark(\n rgba(239, 68, 68, 0.15),\n rgba(239, 68, 68, 0.25)\n );\n --error-text-color: light-dark(#ef4444, #f87171);\n\n /* Layout defaults */\n --base-background: light-dark(#fff, #222);\n --card-padding: 8px;\n --card-border-radius: 12px;\n --card-inner-border-radius: 8px;\n --card-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);\n }\n\n :host {\n /* Apply base font and color directly to the host */\n font-family: var(--component-font-family);\n color: var(--plain-text-color);\n }\n`;\n\nexport default ThemeStyles;\n"]}
|