Skip to content

Commit b4bfab4

Browse files
committed
Sync with Kendo UI Professional
1 parent 8e47614 commit b4bfab4

File tree

23 files changed

+331
-33
lines changed

23 files changed

+331
-33
lines changed
33.7 KB
Loading
80.7 KB
Loading
68.7 KB
Loading
-28.2 KB
Loading

docs-aspnet/html-helpers/data-management/filemanager/toolbar.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,76 @@ You can also add the custom command to the ContextMenu of the FileManager
114114
```
115115
{% endif %}
116116

117+
## Overflow
118+
119+
The built-in toolbar provides properties for customizing its overflow behavior and appearance.
120+
121+
The following example demonstrates how to modify the default overflow settings of the toolbar through the `Oveflow()` configuration.
122+
123+
```Razor
124+
@(Html.Kendo().FileManager().Name("filemanager")
125+
.DataSource(ds =>
126+
{
127+
...
128+
);
129+
})
130+
.UploadUrl("Upload", "FileManagerData")
131+
.Toolbar(tb => tb.Items(items =>
132+
{
133+
items.Add("createFolder");
134+
items.Add("upload");
135+
items.Add("sortField");
136+
items.Add("changeView");
137+
items.Add("spacer");
138+
items.Add("details");
139+
items.Add("search");
140+
})
141+
.Overflow(o => o
142+
.Mode(ToolBarOverflowMode.Scroll)
143+
.ScrollButtons(ScrollButtonsType.Auto)
144+
.ScrollButtonsPosition(ScrollButtonsPositionType.Start)
145+
.ScrollDistance(50))
146+
)
147+
.ContextMenu(context => context.Items(items => items.Add("rename")))
148+
)
149+
```
150+
{% if site.core %}
151+
```TagHelper
152+
<kendo-filemanager name="filemanager" upload-url="@Url.Action("Upload", "FileManagerData")">
153+
<filemanager-datasource>
154+
...
155+
</filemanager-datasource>
156+
<toolbar enabled="true">
157+
<items>
158+
<item name="createFolder">
159+
</item>
160+
<item name="upload">
161+
</item>
162+
<item name="sortField">
163+
</item>
164+
<item name="changeView">
165+
</item>
166+
<item name="spacer">
167+
</item>
168+
<item name="details">
169+
</item>
170+
<item name="search">
171+
</item>
172+
</items>
173+
<overflow mode="ToolBarOverflowMode.Scroll" scroll-buttons="ScrollButtonsType.Auto" scroll-buttons-position="ScrollButtonsPositionType.Start" scroll-distance="50" />
174+
</toolbar>
175+
<context-menu enabled="true">
176+
<items>
177+
<item name="rename">
178+
</item>
179+
</items>
180+
</context-menu>
181+
</kendo-filemanager>
182+
```
183+
{% endif %}
184+
185+
For more information on the available overflow options, refer to the [Appearance documentation of the ToolBar component]({% slug toolbar_appearance %}).
186+
117187
## See Also
118188

119189
* [Overview of {{ site.product }} FileManager]({% slug htmlhelpers_filemanager_aspnetcore_overview %})
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: AI Integration
3+
page_title: AI Integration
4+
description: "Learn how to utilize the AI Prompt integration in the Telerik UI Editor component for {{ site.framework }}."
5+
slug: htmlhelpers_editor_ai_integration_aspnetcore
6+
position: 5
7+
---
8+
9+
# AI Integration
10+
11+
The Editor features AI integration through the [AIPrompt]({% slug htmlhelpers_overview_aiprompt %}) component, enabling a smarter and more efficient content creation experience.
12+
13+
You can enable the functionality by using the `AI()` configuration and specifying the endpoint that will request an answer from the desired LLM service. For that, use the `Service()` method and pass the respective Action and Controller.
14+
15+
The following example demonstrates the basic AI configuration for the Editor.
16+
17+
```HtmlHelper
18+
@(Html.Kendo().Editor()
19+
.Name("editor")
20+
.AI(ai => ai
21+
.AIPrompt(true)
22+
.Service(s => s.Url("AIChatCompletion", "AIPrompt"))
23+
.InlineAIPrompt(true)
24+
.Commands(c =>
25+
{
26+
c.Add().Id("rewrite").Text("Rewrite").Icon("arrow-rotate-cw").Prompt(@<text>function(context) {return `Rewrite the selected text while preserving its original meaning and intent. Selected Text: ${context}` }</text>);
27+
c.Add().Id("fix-spelling").Text("Fix spelling").Icon("spell-checker").Prompt(@<text>function(context) {return `Correct any spelling, grammar, or punctuation mistakes in the selected text while preserving its original meaning and intent. Selected Text: ${context}` }</text>);
28+
c.Add().Id("change-tone-neutral").Text("Change to neutral tone").Icon("tell-a-friend").Prompt(@<text>function(context) {return `Adjust the tone of the following text to be more neutral while preserving its original meaning and intent. Selected Text: ${context}` }</text>);
29+
c.Add().Id("change-tone-friendly").Text("Change to friendly tone").Icon("tell-a-friend").Prompt(@<text>function(context) {return `Adjust the tone of the following text to be more friendly while preserving its original meaning and intent. Selected Text: ${context}` }</text>);
30+
31+
c.Add().Id("adjust-length-shorten").Text("Shorten Length").Icon("col-resize").Prompt(@<text>function(context) {return `Shorten the following text while preserving its original meaning and intent. Selected Text: ${context}` }</text>);
32+
})
33+
34+
)
35+
)
36+
```
37+
{% if site.core %}
38+
```TagHelper
39+
<kendo-editor name="editor">
40+
<ai ai-prompt="true" inline-ai-prompt="true">
41+
<service action="AIChatCompletion" controller="AIPrompt" />
42+
<commands>
43+
<command id="rewrite" text="Rewrite" icon="arrow-rotate-cw" prompt="function(context) {return `Rewrite the selected text while preserving its original meaning and intent. Selected Text: ${context}` }"></command>
44+
<command id="fix-spelling" text="Fix spelling" icon="spell-checker" prompt="function(context) {return `Correct any spelling, grammar, or punctuation mistakes in the selected text while preserving its original meaning and intent. Selected Text: ${context}` }"></command>
45+
<command id="change-tone-neutral" text="Change to neutral tone" icon="tell-a-friend" prompt="function(context) {return `Adjust the tone of the following text to be more neutral while preserving its original meaning and intent. Selected Text: ${context}` }"></command>
46+
<command id="change-tone-friendly" text="Change to friendly tone" icon="tell-a-friend" prompt="function(context) {return `Adjust the tone of the following text to be more friendly while preserving its original meaning and intent. Selected Text: ${context}` }"></command>
47+
<command id="adjust-length-shorten" text="Shorten Length" icon="col-resize" prompt="function(context) {return `Shorten the following text while preserving its original meaning and intent. Selected Text: ${context}` }"></command>
48+
</commands>
49+
</pane>
50+
</ai>
51+
</kendo-editor>
52+
```
53+
{% endif %}
54+
```C#
55+
[HttpPost]
56+
[RateLimit(10, 60)]
57+
public async Task<IActionResult> AIChatCompletion()
58+
{
59+
try
60+
{
61+
var aiServiceUrl = "Link to LLM service";
62+
var forwardedRequest = new HttpRequestMessage(HttpMethod.Post, aiServiceUrl);
63+
64+
// pass the key for using the LLM service
65+
forwardedRequest.Headers.Add("X-Api-Key", _configuration["AI:ApiKey"]);
66+
67+
using (var requestStream = new StreamReader(Request.Body))
68+
{
69+
var body = await requestStream.ReadToEndAsync();
70+
forwardedRequest.Content = new StringContent(body, System.Text.Encoding.UTF8, Request.ContentType);
71+
}
72+
73+
var response = await _httpClient.SendAsync(forwardedRequest);
74+
var responseContent = await response.Content.ReadAsStringAsync();
75+
76+
77+
return new ContentResult
78+
{
79+
Content = responseContent,
80+
ContentType = "application/json",
81+
StatusCode = (int)response.StatusCode
82+
};
83+
}
84+
catch (System.Exception e)
85+
{
86+
87+
return new ContentResult
88+
{
89+
Content = e.Message,
90+
ContentType = "application/json",
91+
StatusCode = 200
92+
};
93+
}
94+
}
95+
```
96+
For a live example, visit the [AI Integration Demo of the Editor](https://demos.telerik.com/{{ site.platform }}/editor/ai-integration).
97+
## See Also
98+
99+
* [AI Integration in Editor for {{ site.framework }} (Demo)](https://demos.telerik.com/{{ site.platform }}/editor/ai-integration)
100+
* [Server-Side API of the Editor](/api/editor)
101+
{% if site.core %}* [Server-Side API of the Editor TagHelper](/api/taghelpers/editor){% endif %}

docs-aspnet/html-helpers/editors/editor/crud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: CRUD Operations
33
page_title: CRUD Operations
44
description: "Learn how to use the create, read, update, and delete CRUD operations with the Telerik UI Editor component for {{ site.framework }}."
55
slug: htmlhelpers_crud_editor_aspnetcore
6-
position: 8
6+
position: 9
77
---
88

99
# CRUD Operations

docs-aspnet/html-helpers/editors/editor/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Events
33
page_title: Events
44
description: "Learn how to handle the events of the Telerik UI Editor component for {{ site.framework }}."
55
slug: events_editor_aspnetcore
6-
position: 14
6+
position: 15
77
---
88

99
# Events

docs-aspnet/html-helpers/editors/editor/format-painter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Format Painter
33
page_title: Editor Format Painter
44
description: "Learn about the format painter of the Telerik UI Editor component for {{ site.framework }}."
55
slug: htmlhelpers_editor_format_painter_aspnetcore
6-
position: 11
6+
position: 12
77
---
88

99
# Format Painter

docs-aspnet/html-helpers/editors/editor/formatting-marks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Formatting Marks
33
page_title: Formatting Marks
44
description: "Learn about the Formatting Marks functionality of the Telerik UI Editor component for {{ site.framework }}."
55
slug: htmlhelpers_editor_formattingmarks_aspnetcore
6-
position: 13
6+
position: 14
77
---
88

99
# Formatting Marks

0 commit comments

Comments
 (0)