@memberjunction/ng-skip-chat 2.36.1 → 2.37.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/README.md +97 -2
- package/dist/lib/artifacts/skip-artifact-viewer.component.d.ts +78 -0
- package/dist/lib/artifacts/skip-artifact-viewer.component.d.ts.map +1 -0
- package/dist/lib/artifacts/skip-artifact-viewer.component.js +520 -0
- package/dist/lib/artifacts/skip-artifact-viewer.component.js.map +1 -0
- package/dist/lib/artifacts/skip-artifacts-counter.component.d.ts +25 -0
- package/dist/lib/artifacts/skip-artifacts-counter.component.d.ts.map +1 -0
- package/dist/lib/artifacts/skip-artifacts-counter.component.js +253 -0
- package/dist/lib/artifacts/skip-artifacts-counter.component.js.map +1 -0
- package/dist/lib/module.d.ts +23 -20
- package/dist/lib/module.d.ts.map +1 -1
- package/dist/lib/module.js +19 -4
- package/dist/lib/module.js.map +1 -1
- package/dist/lib/skip-chat/skip-chat.component.d.ts +45 -1
- package/dist/lib/skip-chat/skip-chat.component.d.ts.map +1 -1
- package/dist/lib/skip-chat/skip-chat.component.js +239 -116
- package/dist/lib/skip-chat/skip-chat.component.js.map +1 -1
- package/dist/lib/skip-single-message/skip-single-message.component.d.ts +33 -1
- package/dist/lib/skip-single-message/skip-single-message.component.d.ts.map +1 -1
- package/dist/lib/skip-single-message/skip-single-message.component.js +160 -38
- package/dist/lib/skip-single-message/skip-single-message.component.js.map +1 -1
- package/dist/lib/split-panel/skip-split-panel.component.d.ts +41 -0
- package/dist/lib/split-panel/skip-split-panel.component.d.ts.map +1 -0
- package/dist/lib/split-panel/skip-split-panel.component.js +135 -0
- package/dist/lib/split-panel/skip-split-panel.component.js.map +1 -0
- package/dist/public-api.d.ts +3 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +3 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ An Angular component package for integrating the Skip AI assistant into MemberJu
|
|
|
8
8
|
- **Dynamic Report Rendering**: Displays AI-generated reports, charts, and data visualizations
|
|
9
9
|
- **Conversation Management**: Create, save, rename, and delete conversations
|
|
10
10
|
- **Message Controls**: Edit, delete, and rate messages
|
|
11
|
+
- **Inline Artifacts**: View and interact with AI-generated artifacts directly within messages
|
|
11
12
|
- **Welcome Experience**: Configurable welcome screen with suggested prompts
|
|
12
13
|
- **Sharing Capabilities**: Share conversations with other users or roles
|
|
13
14
|
- **Data Context Integration**: Link conversations with data contexts for contextual understanding
|
|
@@ -183,6 +184,76 @@ export class AnalyticsDashboardComponent implements OnInit {
|
|
|
183
184
|
}
|
|
184
185
|
```
|
|
185
186
|
|
|
187
|
+
## Inline Artifacts Support
|
|
188
|
+
|
|
189
|
+
Skip Chat provides an intuitive way to work with AI-generated artifacts directly within the conversation flow. Artifacts are standalone content pieces created during AI conversations, such as:
|
|
190
|
+
|
|
191
|
+
- Code snippets
|
|
192
|
+
- Data analyses and visualizations
|
|
193
|
+
- Documents and reports
|
|
194
|
+
- SQL queries
|
|
195
|
+
- JSON data structures
|
|
196
|
+
- Markdown content
|
|
197
|
+
- Plain text notes
|
|
198
|
+
|
|
199
|
+
### Artifact Display Design
|
|
200
|
+
|
|
201
|
+
Artifacts are integrated directly into the conversation with a contextual, streamlined approach:
|
|
202
|
+
|
|
203
|
+
1. **Inline Indicators**: When a message has a linked artifact (as indicated by ArtifactID in the ConversationDetailEntity), a visual indicator/box appears within that message
|
|
204
|
+
|
|
205
|
+
2. **Split-Panel View**: Clicking on an artifact indicator dynamically splits the screen:
|
|
206
|
+
- Left panel: Continues displaying the conversation messages
|
|
207
|
+
- Right panel: Shows the selected artifact's content
|
|
208
|
+
- Draggable splitter between panels for customizing the view ratio
|
|
209
|
+
|
|
210
|
+
3. **Artifact Creation Flow**: Skip can request artifact creation or versioning during analysis completion (SkipAPIAnalysisComplete)
|
|
211
|
+
|
|
212
|
+
### Artifact-Message Relationship
|
|
213
|
+
|
|
214
|
+
Each `ConversationDetailEntity` can have:
|
|
215
|
+
- `ArtifactID`: Links to the specific artifact created or referenced by this message
|
|
216
|
+
- `ArtifactVersionID`: Tracks which version of the artifact is associated with this message
|
|
217
|
+
|
|
218
|
+
### Artifact Components
|
|
219
|
+
|
|
220
|
+
The package includes specialized components for artifact handling:
|
|
221
|
+
|
|
222
|
+
- **SkipMessageArtifactIndicatorComponent**: Displays the artifact indicator within messages
|
|
223
|
+
- **SkipArtifactViewerComponent**: Renders artifact content in the right panel
|
|
224
|
+
- **SkipSplitPanelComponent**: Manages the split-panel layout with draggable divider
|
|
225
|
+
|
|
226
|
+
### Artifact Events
|
|
227
|
+
|
|
228
|
+
The Skip Chat components provide event emitters for artifact interactions:
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
// Listen for artifact events
|
|
232
|
+
<skip-chat
|
|
233
|
+
(ArtifactSelected)="handleArtifactSelected($event)"
|
|
234
|
+
(ArtifactViewed)="handleArtifactViewed($event)">
|
|
235
|
+
</skip-chat>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Handle artifact events in your component:
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
import { SkipAPIArtifact } from '@memberjunction/skip-types';
|
|
242
|
+
|
|
243
|
+
@Component({...})
|
|
244
|
+
export class MyComponent {
|
|
245
|
+
handleArtifactSelected(artifact: SkipAPIArtifact) {
|
|
246
|
+
console.log(`Selected artifact: ${artifact.name}`);
|
|
247
|
+
// Custom handling of artifact selection
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
handleArtifactViewed(artifact: SkipAPIArtifact) {
|
|
251
|
+
console.log(`Viewing artifact: ${artifact.name}`);
|
|
252
|
+
// Custom handling for artifact viewing
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
186
257
|
## API Reference
|
|
187
258
|
|
|
188
259
|
### SkipChatComponent
|
|
@@ -215,12 +286,16 @@ The main component for the Skip chat interface.
|
|
|
215
286
|
- `WelcomeQuestions`: ChatWelcomeQuestion[] - Array of welcome questions/prompts
|
|
216
287
|
- `AutoLoad`: boolean - Whether to automatically load data (default: true)
|
|
217
288
|
- `VerboseLogging`: boolean - Whether to enable verbose logging (default: false)
|
|
289
|
+
- `EnableArtifactSplitView`: boolean - Whether to enable split-panel viewing for artifacts (default: true)
|
|
290
|
+
- `DefaultSplitRatio`: number - Default ratio for split panels when viewing artifacts (0-1, default: 0.6)
|
|
218
291
|
|
|
219
292
|
#### Outputs
|
|
220
293
|
|
|
221
294
|
- `NavigateToMatchingReport`: EventEmitter<string> - Emitted when a matching report is clicked
|
|
222
295
|
- `ConversationSelected`: EventEmitter<string> - Emitted when a conversation is selected
|
|
223
296
|
- `NewReportCreated`: EventEmitter<string> - Emitted when a new report is created
|
|
297
|
+
- `ArtifactSelected`: EventEmitter<SkipAPIArtifact> - Emitted when an artifact is selected
|
|
298
|
+
- `ArtifactViewed`: EventEmitter<SkipAPIArtifact> - Emitted when an artifact is viewed
|
|
224
299
|
|
|
225
300
|
#### Methods
|
|
226
301
|
|
|
@@ -231,6 +306,7 @@ The main component for the Skip chat interface.
|
|
|
231
306
|
- `sendPrompt(val: string)`: Sends a prompt to Skip AI
|
|
232
307
|
- `sendSkipMessage()`: Sends the current message in the input box
|
|
233
308
|
- `FlipEmbeddedConversationState()`: Toggles the inclusion of linked conversations
|
|
309
|
+
- `ViewArtifact(artifactId: string)`: Opens an artifact in the split panel view
|
|
234
310
|
|
|
235
311
|
### SkipSingleMessageComponent
|
|
236
312
|
|
|
@@ -257,6 +333,23 @@ Component for rendering a single message in the conversation.
|
|
|
257
333
|
- `NewReportCreated`: EventEmitter<string> - Emitted when a new report is created
|
|
258
334
|
- `EditMessageRequested`: EventEmitter<ConversationDetailEntity> - Emitted when message edit is requested
|
|
259
335
|
- `DeleteMessageRequested`: EventEmitter<ConversationDetailEntity> - Emitted when message delete is requested
|
|
336
|
+
- `ArtifactSelected`: EventEmitter<SkipAPIArtifact> - Emitted when an artifact indicator is selected
|
|
337
|
+
|
|
338
|
+
### SkipSplitPanelComponent
|
|
339
|
+
|
|
340
|
+
Component for managing the split-panel layout.
|
|
341
|
+
|
|
342
|
+
#### Inputs
|
|
343
|
+
|
|
344
|
+
- `SplitRatio`: number - Ratio for dividing the panels (0-1, default: 0.6)
|
|
345
|
+
- `MinLeftPanelWidth`: string - Minimum width for left panel (default: '30%')
|
|
346
|
+
- `MinRightPanelWidth`: string - Minimum width for right panel (default: '30%')
|
|
347
|
+
- `LeftPanelContent`: TemplateRef<any> - Template for left panel content
|
|
348
|
+
- `RightPanelContent`: TemplateRef<any> - Template for right panel content
|
|
349
|
+
|
|
350
|
+
#### Outputs
|
|
351
|
+
|
|
352
|
+
- `SplitRatioChanged`: EventEmitter<number> - Emitted when split ratio changes via drag
|
|
260
353
|
|
|
261
354
|
### Dynamic Report Components
|
|
262
355
|
|
|
@@ -273,8 +366,10 @@ The package includes several components for rendering dynamic reports:
|
|
|
273
366
|
1. **Initialization**: Load existing conversations or create a new one
|
|
274
367
|
2. **User Input**: User enters a message or selects a suggested prompt
|
|
275
368
|
3. **AI Processing**: Skip processes the request and generates a response
|
|
276
|
-
4. **
|
|
277
|
-
5. **
|
|
369
|
+
4. **Artifact Creation**: Skip can generate artifacts during response processing
|
|
370
|
+
5. **Artifact Viewing**: Users can view artifacts in the split-panel interface
|
|
371
|
+
6. **Report Generation**: For data analysis requests, Skip generates dynamic reports
|
|
372
|
+
7. **Follow-up**: Skip suggests follow-up questions and provides interaction with the data
|
|
278
373
|
|
|
279
374
|
## Styling
|
|
280
375
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges, ViewContainerRef, AfterViewInit, ComponentFactoryResolver, Injector, EventEmitter, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { DataContext } from '@memberjunction/data-context';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
4
|
+
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
5
|
+
import { DrillDownInfo } from '../drill-down-info';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class SkipArtifactViewerComponent extends BaseAngularComponent implements OnInit, OnChanges, AfterViewInit {
|
|
8
|
+
private notificationService;
|
|
9
|
+
private componentFactoryResolver;
|
|
10
|
+
private cdRef;
|
|
11
|
+
private injector;
|
|
12
|
+
ArtifactID: string;
|
|
13
|
+
ArtifactVersionID: string;
|
|
14
|
+
DataContext: DataContext | null;
|
|
15
|
+
reportContainer: ViewContainerRef;
|
|
16
|
+
/**
|
|
17
|
+
* Event emitted when the user clicks on a matching report and the application needs to handle the navigation
|
|
18
|
+
*/
|
|
19
|
+
NavigateToMatchingReport: EventEmitter<string>;
|
|
20
|
+
/**
|
|
21
|
+
* This event fires whenever a new report is created.
|
|
22
|
+
*/
|
|
23
|
+
NewReportCreated: EventEmitter<string>;
|
|
24
|
+
/**
|
|
25
|
+
* This event fires whenever a drill down is requested within a given report.
|
|
26
|
+
*/
|
|
27
|
+
DrillDownEvent: EventEmitter<DrillDownInfo>;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
artifact: any;
|
|
30
|
+
artifactVersion: any;
|
|
31
|
+
artifactType: any;
|
|
32
|
+
contentType: string;
|
|
33
|
+
displayContent: any;
|
|
34
|
+
error: string | null;
|
|
35
|
+
artifactVersions: any[];
|
|
36
|
+
selectedVersionId: string;
|
|
37
|
+
private reportComponentRef;
|
|
38
|
+
private conversationDetailRecord;
|
|
39
|
+
constructor(notificationService: MJNotificationService, componentFactoryResolver: ComponentFactoryResolver, cdRef: ChangeDetectorRef, injector: Injector);
|
|
40
|
+
ngOnInit(): void;
|
|
41
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
42
|
+
ngAfterViewInit(): void;
|
|
43
|
+
private loadArtifact;
|
|
44
|
+
/**
|
|
45
|
+
* Loads all versions of the current artifact for the dropdown
|
|
46
|
+
*/
|
|
47
|
+
private loadArtifactVersions;
|
|
48
|
+
/**
|
|
49
|
+
* Loads a specific artifact version by ID
|
|
50
|
+
*/
|
|
51
|
+
private loadSpecificArtifactVersion;
|
|
52
|
+
/**
|
|
53
|
+
* Called when the user selects a different version from the dropdown
|
|
54
|
+
*/
|
|
55
|
+
onVersionChange(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Creates the report component using the current artifact version Configuration
|
|
58
|
+
*/
|
|
59
|
+
private createReportComponent;
|
|
60
|
+
/**
|
|
61
|
+
* Loads the conversation detail record associated with this artifact
|
|
62
|
+
*/
|
|
63
|
+
private loadConversationDetail;
|
|
64
|
+
/**
|
|
65
|
+
* Destroys the current report component if it exists
|
|
66
|
+
*/
|
|
67
|
+
private destroyReportComponent;
|
|
68
|
+
get artifactTitle(): string;
|
|
69
|
+
get artifactTypeName(): string;
|
|
70
|
+
get isJson(): boolean;
|
|
71
|
+
get isMarkdown(): boolean;
|
|
72
|
+
get isCode(): boolean;
|
|
73
|
+
get isHtml(): boolean;
|
|
74
|
+
get isPlainText(): boolean;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SkipArtifactViewerComponent, never>;
|
|
76
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SkipArtifactViewerComponent, "skip-artifact-viewer", never, { "ArtifactID": { "alias": "ArtifactID"; "required": false; }; "ArtifactVersionID": { "alias": "ArtifactVersionID"; "required": false; }; "DataContext": { "alias": "DataContext"; "required": false; }; }, { "NavigateToMatchingReport": "NavigateToMatchingReport"; "NewReportCreated": "NewReportCreated"; "DrillDownEvent": "DrillDownEvent"; }, never, never, false, never>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=skip-artifact-viewer.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-artifact-viewer.component.d.ts","sourceRoot":"","sources":["../../../src/lib/artifacts/skip-artifact-viewer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,MAAM,EAAE,SAAS,EAAE,aAAa,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