Skip to content

Commit f82adba

Browse files
chore: refine layout and content of the project (#4612)
1 parent 320b3e4 commit f82adba

30 files changed

+662
-549
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 120,
4+
"tabWidth": 4
5+
}

examples-standalone/kendoangular-landing-page/angular.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@
2222
],
2323
"tsConfig": "tsconfig.app.json",
2424
"assets": [
25+
{
26+
"glob": "**/*",
27+
"input": "src/assets/",
28+
"output": "/assets/"
29+
},
2530
{
2631
"glob": "**/*",
2732
"input": "public"
2833
}
2934
],
3035
"styles": [
3136
{
32-
"input": "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue-a11y.scss"
37+
"input": "node_modules/@progress/kendo-theme-default/dist/default-ocean-blue.scss"
3338
},
3439
"src/styles.css"
3540
],
@@ -84,6 +89,11 @@
8489
],
8590
"tsConfig": "tsconfig.spec.json",
8691
"assets": [
92+
{
93+
"glob": "**/*",
94+
"input": "src/assets/",
95+
"output": "/assets/"
96+
},
8797
{
8898
"glob": "**/*",
8999
"input": "public"

examples-standalone/kendoangular-landing-page/src/app/components/conversational-ui/conversational-ui.component.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010
<kendo-aiprompt
1111
class="prompt"
1212
(promptRequest)="onPromptRequest($event)"
13-
(commandExecute)="onCommandExecute($event)"
1413
[promptOutputs]="promptOutputs"
15-
[promptCommands]="commands"
16-
[promptSuggestions]="suggestions"
14+
[promptSuggestions]="promptSuggestions"
1715
[(activeView)]="activeView"
1816
>
1917
<kendo-aiprompt-prompt-view></kendo-aiprompt-prompt-view>
2018
<kendo-aiprompt-output-view></kendo-aiprompt-output-view>
21-
<kendo-aiprompt-command-view></kendo-aiprompt-command-view>
2219
</kendo-aiprompt>
2320
</div>
2421
</div>
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,42 @@
1-
import { CommonModule } from "@angular/common";
2-
import { Component } from "@angular/core";
1+
import { CommonModule } from '@angular/common';
2+
import { Component } from '@angular/core';
33

4-
import { KENDO_BUTTONS } from "@progress/kendo-angular-buttons";
4+
import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
5+
import { guid } from '@progress/kendo-angular-common';
56
import {
6-
CommandExecuteEvent,
77
KENDO_CONVERSATIONALUI,
88
Message,
9-
PromptCommand,
109
PromptOutput,
1110
PromptRequestEvent,
1211
SendMessageEvent,
1312
User,
14-
} from "@progress/kendo-angular-conversational-ui";
15-
import { KENDO_INPUTS } from "@progress/kendo-angular-inputs";
16-
import { KENDO_LAYOUT } from "@progress/kendo-angular-layout";
17-
import {
18-
bellIcon,
19-
eyeIcon,
20-
infoCircleIcon,
21-
questionCircleIcon,
22-
SVGIcon,
23-
warningCircleIcon,
24-
xIcon,
25-
} from "@progress/kendo-svg-icons";
26-
27-
import { from, merge, Observable, Subject } from "rxjs";
28-
import { map, scan } from "rxjs/operators";
29-
import { ChatService } from "./chat.service";
13+
} from '@progress/kendo-angular-conversational-ui';
14+
import { KENDO_INPUTS } from '@progress/kendo-angular-inputs';
15+
import { KENDO_LAYOUT } from '@progress/kendo-angular-layout';
16+
import { eyeIcon, SVGIcon, xIcon } from '@progress/kendo-svg-icons';
17+
import { from, merge, Observable, Subject } from 'rxjs';
18+
import { map, scan } from 'rxjs/operators';
19+
import { defaultResponse, promptData } from '../../data/ai-prompt-data';
20+
import { ChatService } from './chat.service';
3021

3122
@Component({
32-
selector: "app-conversational-ui",
23+
selector: 'app-conversational-ui',
3324
imports: [CommonModule, KENDO_CONVERSATIONALUI, KENDO_BUTTONS, KENDO_INPUTS, KENDO_LAYOUT],
3425
providers: [ChatService],
35-
templateUrl: "./conversational-ui.component.html",
36-
styleUrl: "./conversational-ui.component.css",
26+
templateUrl: './conversational-ui.component.html',
27+
styleUrl: './conversational-ui.component.css',
3728
})
3829
export class ConversationalUiComponent {
39-
public closeIcon: SVGIcon = xIcon;
40-
public eye: SVGIcon = eyeIcon;
4130
public feed: Observable<Message[]>;
42-
31+
public promptOutputs: PromptOutput[] = [];
32+
public activeView: number = 0;
4333
public readonly user: User = {
4434
id: 1,
4535
};
46-
4736
public readonly bot: User = {
4837
id: 0,
4938
};
50-
51-
public promptOutputs: PromptOutput[] = [];
52-
public activeView: number = 0;
53-
public idCounter = 0;
54-
55-
public commands: PromptCommand[] = [
56-
{
57-
text: "Command text 1",
58-
id: 0,
59-
icon: "bell",
60-
svgIcon: bellIcon,
61-
},
62-
{
63-
text: "Command text 2",
64-
id: 1,
65-
icon: "info",
66-
svgIcon: infoCircleIcon,
67-
},
68-
{
69-
text: "Command text 3",
70-
id: 2,
71-
icon: "question",
72-
svgIcon: questionCircleIcon,
73-
},
74-
{
75-
text: "Command text 4",
76-
id: 3,
77-
icon: "warning",
78-
svgIcon: warningCircleIcon,
79-
},
80-
];
81-
82-
public suggestions: string[] = ["Generate out-of-office email template", "Write a LinkedIn post on the importance of work/life balance"];
39+
public promptSuggestions = promptData.map((s) => s.suggestion);
8340

8441
private local: Subject<Message> = new Subject<Message>();
8542

@@ -88,16 +45,16 @@ export class ConversationalUiComponent {
8845
author: this.bot,
8946
suggestedActions: [
9047
{
91-
type: "reply",
92-
value: "Neat!",
48+
type: 'reply',
49+
value: 'Neat!',
9350
},
9451
{
95-
type: "reply",
96-
value: "Thanks, but this is boring.",
52+
type: 'reply',
53+
value: 'Thanks, but this is boring.',
9754
},
9855
],
9956
timestamp: new Date(),
100-
text: "Hello, this is a demo bot. I don`t do much, but I can count symbols!",
57+
text: 'Hello, this is a demo bot. I don`t do much, but I can count symbols!',
10158
};
10259

10360
this.feed = merge(
@@ -135,23 +92,18 @@ export class ConversationalUiComponent {
13592
this.activeView = 1;
13693
}
13794

138-
public onCommandExecute(ev: CommandExecuteEvent): void {
139-
this.createPromptOutput(ev);
140-
this.activeView = 1;
141-
}
95+
private createPromptOutput(ev: PromptRequestEvent): void {
96+
const response = promptData.find((s) => s.suggestion === ev.prompt);
14297

143-
private createPromptOutput(ev: PromptRequestEvent | CommandExecuteEvent): void {
144-
this.idCounter += 1;
145-
const newOutput = {
146-
title: ev.isRetry ? "Retry test title" : "Test title",
147-
id: this.idCounter,
148-
prompt: (ev as PromptRequestEvent).prompt
149-
? (ev as PromptRequestEvent).prompt
150-
: (ev as CommandExecuteEvent).command.text,
151-
output: "Test content",
98+
const output: PromptOutput = {
99+
id: guid(),
100+
title: ev.prompt,
101+
output: response?.response || defaultResponse,
102+
prompt: ev.prompt,
152103
isRetry: ev.isRetry,
153-
commandId: (ev as PromptRequestEvent).prompt ? null : (ev as CommandExecuteEvent).command.id,
154104
};
155-
this.promptOutputs.unshift(newOutput as PromptOutput);
105+
106+
this.promptOutputs.unshift(output);
107+
this.activeView = 1;
156108
}
157109
}

examples-standalone/kendoangular-landing-page/src/app/components/dialogs/dialogs.component.css

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,14 @@
2525
font-size: 20px;
2626
}
2727

28-
.window-content {
29-
padding: 15px;
30-
}
31-
32-
.window-header {
33-
display: flex;
34-
align-items: center;
35-
margin-bottom: 20px;
36-
padding-bottom: 15px;
37-
border-bottom: 1px solid #eee;
28+
kendo-window {
29+
--kendo-window-titlebar-bg: #3f51b5;
30+
--kendo-window-titlebar-text: white;
31+
margin-top: 0;
3832
}
3933

40-
.window-header .k-icon {
41-
font-size: 24px;
42-
margin-right: 10px;
43-
color: #ff6358;
34+
.window-content {
35+
padding: 15px;
4436
}
4537

4638
.success-message,
@@ -57,11 +49,6 @@
5749
border-left-color: #2196f3;
5850
}
5951

60-
kendo-window {
61-
--kendo-window-titlebar-bg: #3f51b5;
62-
--kendo-window-titlebar-text: white;
63-
}
64-
6552
.k-form-field {
6653
margin-bottom: 15px;
6754
}
@@ -75,12 +62,14 @@ fieldset {
7562

7663
legend {
7764
padding: 0 10px;
78-
font-weight: 500;
65+
font-size: 14px;
66+
font-weight: bold;
67+
margin-bottom: 5px;
7968
color: #455a64;
8069
}
8170

8271
.k-actions {
83-
margin-top: 20px;
72+
margin-top: 15px;
8473
}
8574

8675
@media (max-width: 768px) {

examples-standalone/kendoangular-landing-page/src/app/components/dialogs/dialogs.component.html

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ <h4>Kendo Angular Dialog</h4>
3232
title="Complete Your Profile"
3333
[minWidth]="320"
3434
[width]="500"
35-
[height]="590"
36-
[top]="160"
35+
[height]="430"
36+
[top]="80"
3737
[resizable]="true"
3838
[draggable]="true"
3939
(close)="closeWindow()"
4040
>
4141
<div class="window-content">
42-
<div class="window-header">
43-
<span class="k-icon k-i-user"></span>
44-
<p>Please fill in your profile information to continue</p>
45-
</div>
46-
4742
<form class="k-form">
4843
<fieldset>
4944
<legend>Personal Information</legend>
@@ -69,10 +64,6 @@ <h4>Kendo Angular Dialog</h4>
6964
<label>Date of Birth</label>
7065
<kendo-datepicker placeholder="Select your birth date"></kendo-datepicker>
7166
</div>
72-
<div class="k-form-field">
73-
<label>Bio</label>
74-
<kendo-textarea placeholder="Tell us about yourself" [rows]="3"></kendo-textarea>
75-
</div>
7667
</fieldset>
7768

7869
<div class="k-actions k-actions-end">

examples-standalone/kendoangular-landing-page/src/app/components/dialogs/dialogs.component.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import { Component } from "@angular/core";
2-
import { FormsModule } from "@angular/forms";
3-
import { KENDO_BUTTONS } from "@progress/kendo-angular-buttons";
4-
import { KENDO_DATEINPUTS } from "@progress/kendo-angular-dateinputs";
5-
import { KENDO_DIALOGS } from "@progress/kendo-angular-dialog";
6-
import { KENDO_INPUTS } from "@progress/kendo-angular-inputs";
1+
import { Component } from '@angular/core';
2+
import { FormsModule } from '@angular/forms';
3+
import { KENDO_BUTTONS } from '@progress/kendo-angular-buttons';
4+
import { KENDO_DATEINPUTS } from '@progress/kendo-angular-dateinputs';
5+
import { KENDO_DIALOGS } from '@progress/kendo-angular-dialog';
6+
import { KENDO_INPUTS } from '@progress/kendo-angular-inputs';
77

88
@Component({
9-
selector: "app-dialogs",
9+
selector: 'app-dialogs',
1010
imports: [KENDO_DIALOGS, KENDO_BUTTONS, KENDO_INPUTS, KENDO_DATEINPUTS, FormsModule],
11-
templateUrl: "./dialogs.component.html",
12-
styleUrl: "./dialogs.component.css",
11+
templateUrl: './dialogs.component.html',
12+
styleUrl: './dialogs.component.css',
1313
})
1414
export class DialogsComponent {
1515
public windowOpened = true;
1616
public formSubmitted = false;
17-
public firstName = "";
18-
public lastName = "";
17+
public firstName = '';
18+
public lastName = '';
1919
public dialogOpened = false;
20-
public confirmationResult = "";
20+
public confirmationResult = '';
2121

2222
public openWindow(): void {
2323
this.windowOpened = true;
@@ -47,8 +47,8 @@ export class DialogsComponent {
4747

4848
public reset(): void {
4949
this.formSubmitted = false;
50-
this.confirmationResult = "";
51-
this.firstName = "";
52-
this.lastName = "";
50+
this.confirmationResult = '';
51+
this.firstName = '';
52+
this.lastName = '';
5353
}
5454
}

examples-standalone/kendoangular-landing-page/src/app/components/editor/editor.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div style="display: flex; align-items: center; height: 420px">
2-
<kendo-editor [value]="value" style="height: 420px">
2+
<kendo-editor [value]="value" [iframe]="false" style="height: 420px">
33
<kendo-toolbar>
44
<kendo-toolbar-buttongroup>
55
<kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>
@@ -58,7 +58,6 @@
5858
<kendo-toolbar-button kendoEditorMergeCellsButton></kendo-toolbar-button>
5959
<kendo-toolbar-button kendoEditorSplitCellButton></kendo-toolbar-button>
6060
</kendo-toolbar-buttongroup>
61-
<kendo-toolbar-button kendoEditorPrintButton></kendo-toolbar-button>
6261
</kendo-toolbar>
6362
</kendo-editor>
6463
</div>

examples-standalone/kendoangular-landing-page/src/app/components/editor/editor.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import { KENDO_TOOLBAR } from "@progress/kendo-angular-toolbar";
1010
})
1111
export class EditorComponent {
1212
public value = `
13-
<p>
13+
<div style="text-align: center;">
14+
<img src="assets/kendoka.png" alt="Angular Kendoka" title="Kendo Angular" width="63" height="100"/>
15+
</div>
16+
<p>
1417
The Kendo Angular UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />
1518
In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks and lists.
1619
The widget <strong>outputs identical HTML</strong> across all major browsers, follows

0 commit comments

Comments
 (0)