Skip to content

Commit c0b2b90

Browse files
committed
prepare for OS
1 parent 5757156 commit c0b2b90

File tree

10 files changed

+269
-13
lines changed

10 files changed

+269
-13
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Global code owner
2+
* @Simply007
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
### Brief bug description
7+
8+
What went wrong?
9+
10+
### Repro steps
11+
12+
1. Go to '...'
13+
2. Click on '....'
14+
3. Scroll down to '....'
15+
4. See error
16+
17+
### Expected behavior
18+
19+
What is the correct behavior?
20+
21+
### Test environment
22+
23+
- Browser [e.g. chrome, safari]
24+
- Version [e.g. 22]
25+
26+
### Additional context
27+
28+
Add any other context about the problem here.
29+
30+
### Screenshots
31+
32+
Add links to screenshots, if possible.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
5+
---
6+
7+
### Question
8+
9+
What do you want to ask?
10+
11+
### Reference
12+
13+
* URL

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Motivation
2+
3+
Which issue does this fix? Fixes #`issue number`
4+
5+
If no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?
6+
7+
### Checklist
8+
9+
- [ ] Code follows coding conventions held in this repo
10+
- [ ] Automated tests have been added
11+
- [ ] Tests are passing
12+
- [ ] Docs have been updated (if applicable)
13+
- [ ] Temporary settings (e.g. variables used during development and testing) have been reverted to defaults
14+
15+
### How to test
16+
17+
If manual testing is required, what are the steps?

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js LTS
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 'lts/*'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build with Vite
27+
run: npm run build
28+
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/

LICENSE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Software License Agreement
2+
3+
Copyright (c) 2014-2025, CKSource Holding sp. z o.o. All rights reserved.
4+
5+
Code samples in this repository are licensed under the terms of the MIT License (see Appendix A):
6+
7+
http://en.wikipedia.org/wiki/MIT_License
8+
9+
Please bear in mind that while these code samples are available under MIT License, the CKEditor 5 software [is licensed differently](https://github.com/ckeditor/ckeditor5/blob/stable/LICENSE.md).
10+
11+
## Trademarks
12+
13+
CKEditor is a trademark of CKSource Holding sp. z o.o. All other brand
14+
and product names are trademarks, registered trademarks or service
15+
marks of their respective holders.
16+
17+
---
18+
19+
## Appendix A: The MIT License
20+
21+
The MIT License (MIT)
22+
23+
Copyright (c) 2014-2023, CKSource Holding sp. z o.o.
24+
25+
Permission is hereby granted, free of charge, to any person obtaining a copy
26+
of this software and associated documentation files (the "Software"), to deal
27+
in the Software without restriction, including without limitation the rights
28+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29+
copies of the Software, and to permit persons to whom the Software is
30+
furnished to do so, subject to the following conditions:
31+
32+
The above copyright notice and this permission notice shall be included in
33+
all copies or substantial portions of the Software.
34+
35+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
41+
THE SOFTWARE.

README.md

Lines changed: 118 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,125 @@
1-
# React + Vite
1+
# CKEditor AI Webinar Showcase
22

3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3+
A sample React-based application demonstrating CKEditor AI features. This interactive demo showcases AI-powered editing capabilities including AI Chat, Quick Actions, and Review Mode in a real-world content management interface.
44

5-
Currently, two official plugins are available:
5+
## Getting Started
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
### Prerequisites
98

10-
## React Compiler
9+
- Node.js
10+
- npm or yarn
11+
- [CKEditor trial/premium license](https://portal.ckeditor.com/signup)
1112

12-
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13+
### Installation
1314

14-
## Expanding the ESLint configuration
15+
1. **Install dependencies:**
1516

16-
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
17+
```sh
18+
npm install
19+
```
20+
21+
2. **Configure environment variables:**
22+
23+
- Copy `.env.example` to `.env`
24+
- Fill in your CKEditor credentials from the [CKEditor Portal](https://portal.ckeditor.com/):
25+
- `VITE_CKEDITOR_LICENSE_KEY`
26+
- `VITE_CKEDITOR_CLOUD_SERVICES_TOKEN_URL`
27+
28+
3. **Start the development server:**
29+
30+
```bash
31+
npm run dev
32+
```
33+
34+
4. **Open your browser at `http://localhost:5173` 🎉**
35+
36+
## About CKEditor AI
37+
38+
This demo showcases [CKEditor AI](https://ckeditor.com/ckeditor-ai), a suite of AI-powered features that enhance content creation and editing. Main focus is to demonstrate configuration and customization capabilities of following features:
39+
40+
- **AI Chat**: Conversational AI assistant integrated into the editor for content generation, editing, and questions
41+
- **AI Quick Actions**: Context-aware shortcuts for common AI operations (summarize, rephrase, translate, etc.)
42+
- **AI Review Mode**: Comprehensive content analysis with suggestions for improvements
43+
44+
## Interactive Tasks
45+
46+
The codebase includes **5 hands-on tasks** to explore CKEditor AI customization. Each task is marked with comments
47+
48+
```js
49+
// 📌 Task ...
50+
```
51+
52+
in `src/components/ContentField.jsx`.
53+
54+
Complete them sequentially for the best learning experience.
55+
56+
### 📌 Task 1: Integrate AI Sidebar to the Editor
57+
58+
Move the AI interface from an overlay popup to the right sidebar for a more integrated experience.
59+
60+
**Steps:**
61+
62+
1. Import `useSidebar` import and use it to get a reference to the sidebar element
63+
2. Comment out the `toggleAi` button in toolbar since you won't need it anymore
64+
3. Update AI container config from `type: 'overlay'` to `type: 'sidebar'` and provide the sidebar container reference
65+
4. Remove the placeholder span in `RightSidebar.jsx` and ensure the AI chat is rendered in the whole sidebar container
66+
67+
**Expected Result:** AI chat appears integrated in the right sidebar; no overlay popup; toggle button removed from toolbar.
68+
69+
---
70+
71+
### 📌 Task 2: Custom Model Selection
72+
73+
Enable AI model selection dropdown with specified model options.
74+
75+
**Steps:** Uncomment the model configuration block
76+
77+
**Expected Result:** Model selector dropdown in AI chat interface contains only specified models, not all of them.
78+
79+
---
80+
81+
### 📌 Task 3: Custom Context Sources
82+
83+
Add custom knowledge source group that AI can reference when generating content.
84+
85+
**Steps:** Uncomment the `sources` array in context configuration.
86+
87+
**Included Sources in one source group:**
88+
89+
- **"Email Guidelines"** - Web resource with email writing standards
90+
- **"Content Creation Guidelines"** - Web resource with content best practices
91+
92+
**Expected Result:** New "Internal Guidelines" section appears in AI context menu; AI can cite and follow these guidelines when generating content.
93+
94+
---
95+
96+
### 📌 Task 4: Custom Quick Actions
97+
98+
Add custom AI commands to the quick actions menu.
99+
100+
**Steps:** Uncomment the `extraCommands` array in quick actions configuration.
101+
102+
**Example Actions:**
103+
104+
- **"Ask expert AI about this"** (CHAT type) - Opens AI chat with expert analysis prompt for non-technical explanations
105+
- **"Enhance by links"** (ACTION type) - Automatically adds relevant hyperlinks to selected text
106+
107+
**Expected Result:** Custom actions appear in quick actions menu (both toolbar and balloon menu).
108+
109+
---
110+
111+
### 📌 Task 5: Custom Translation in Review Mode
112+
113+
Specify language options for AI-powered translation.
114+
115+
**Steps:** Uncomment the `translations` in review mode configuration.
116+
117+
**Expected Result:** Only Polish and Czech appear in the translation dropdown in AI Review Mode.
118+
119+
### Learn More
120+
121+
- [CKEditor AI Overview](https://ckeditor.com/ckeditor-ai)
122+
- [Get Trial License](https://portal.ckeditor.com/signup/)
123+
- [CKEditor Builder](https://ckeditor.com/ckeditor-5/builder/)
124+
- [CKEditor AI Documentation](https://ckeditor.com/docs/ckeditor5/latest/features/ai/ckeditor-ai-overview.html)
125+
- [CKEditor AI demo](https://ckeditor.com/ckeditor-5/capabilities/ai-features/)

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"name": "ckeditor-ai-webinar-showcase",
3-
"private": true,
4-
"version": "0.0.0",
2+
"name": "devrel-ckeditor-ai-showcase-react",
3+
"version": "0.0.1",
54
"type": "module",
65
"scripts": {
76
"dev": "vite",

src/components/ContentField.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ import {
8585
import 'ckeditor5/ckeditor5.css';
8686
import 'ckeditor5-premium-features/ckeditor5-premium-features.css';
8787

88+
// 📌 Task 1: Integrate AI Sidebar to the Editor - uncomment import
8889
// import { useSidebar } from '../contexts/useSidebar';
8990

9091
// ✏️ removed: import './App.css'; - using only default styles
@@ -100,6 +101,7 @@ export default function ContentField({
100101
onChange,
101102
}) {
102103

104+
// 📌 Task 1: Integrate AI Sidebar to the Editor - load the reference to the Sidebar container ref
103105
// const { sidebarElement } = useSidebar();
104106
const editorContainerRef = useRef(null);
105107
const editorMenuBarRef = useRef(null);
@@ -126,6 +128,7 @@ export default function ContentField({
126128
'redo',
127129
'|',
128130
// ⭐ TOOLBAR BUTTONS CONFIGURATION
131+
// 📌 Task 1: Integrate AI Sidebar to the Editor - comment toggleAI button in the app
129132
'toggleAi',
130133
'aiQuickActions',
131134
'|',
@@ -249,6 +252,8 @@ export default function ContentField({
249252
// ⭐ AI CONFIG
250253
ai: {
251254
container: {
255+
// 📌 Task 1: Integrate AI Sidebar to the Editor:
256+
// comment type and side and uncomment the rest of the block
252257
type: 'overlay',
253258
side: 'right'
254259
// type: 'sidebar',
@@ -258,6 +263,7 @@ export default function ContentField({
258263
},
259264
chat: {
260265
models: {
266+
// 📌 Task 2: Custom model selection - uncomment the block
261267
// defaultModelId: 'auto',
262268
// modelSelectorAlwaysVisible: true,
263269
// displayedModels: ['claude-4-5-sonnet', 'auto', 'claude-4-5-haiku', 'gpt-mini']
@@ -272,6 +278,7 @@ export default function ContentField({
272278
files: {
273279
enabled: true
274280
},
281+
// 📌 Task 3: Custom context sources - uncomment the block
275282
// sources: [
276283
// {
277284
// id: "guidelines",
@@ -300,6 +307,7 @@ export default function ContentField({
300307
}
301308
},
302309
quickActions: {
310+
// 📌 Task 4: Custom quick actions - uncomment the block
303311
// extraCommands: [
304312
// // An action that opens the AI Chat interface for interactive conversations.
305313
// {
@@ -319,6 +327,7 @@ export default function ContentField({
319327
// ],
320328
},
321329
reviewMode: {
330+
// 📌 Task 5: Custom translation in review mode - uncomment the block
322331
// translations: [
323332
// {
324333
// id: 'polish',
@@ -337,7 +346,7 @@ export default function ContentField({
337346
tokenUrl: CLOUD_SERVICES_TOKEN_URL
338347
},
339348
collaboration: {
340-
// ✏️ TOOLBAR BUTTONS CONFIGURATION
349+
// ✏️ Identification of the document
341350
channelId: contentKey
342351
},
343352
fontFamily: {

src/components/RightSidebar.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ const RightSidebar = () => {
8484
<div className="sidebar-section-content" style={{ display: expandedSections['ai-chat'] ? 'flex' : 'none', padding: 0 }}>
8585
<div ref={registerSidebarElement} id="ai-sidebar-container" style={{ width: '100%', height: '100%' }}>
8686
{/* CKEditor AI interface will be rendered here */}
87+
{/* // 📌 Task 1: Integrate AI Sidebar to the Editor - remove the placeholder span below*/}
8788
<span style={{ margin: '10px', padding: '10px', border: '1px dashed #ccc', fontSize: '13px', color: '#888' }}>CKEditor AI Chat interface placeholder</span>
8889
</div>
8990
</div>

0 commit comments

Comments
 (0)