Skip to content

Commit

Permalink
Update imports paths in documentation snippets.
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsobol committed Mar 5, 2025
1 parent a97beec commit f9b0f2f
Show file tree
Hide file tree
Showing 309 changed files with 3,006 additions and 2,592 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ module.exports = {
},
{
files: [ '**/docs/**/*.js' ],
env: {
browser: true
},
rules: {
'ckeditor5-rules/ckeditor-imports': 'off'
}
Expand Down
Empty file.
10 changes: 0 additions & 10 deletions docs/_snippets/build-balloon-block-source.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_snippets/build-balloon-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
CloudServices
} from 'ckeditor5';

export default class BalloonBlockEditor extends BalloonEditorBase {
export class BalloonBlockEditor extends BalloonEditorBase {
static builtinPlugins = [
Essentials,
CKFinderUploadAdapter,
Expand Down
Empty file.
10 changes: 0 additions & 10 deletions docs/_snippets/build-balloon-source.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/_snippets/build-balloon.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
CloudServices
} from 'ckeditor5';

export default class BalloonEditor extends BalloonEditorBase {
export class BalloonEditor extends BalloonEditorBase {
static builtinPlugins = [
Essentials,
Paragraph,
Expand Down
Empty file.
15 changes: 0 additions & 15 deletions docs/_snippets/build-classic-source.js

This file was deleted.

13 changes: 9 additions & 4 deletions docs/_snippets/build-classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ import {
Table,
TableToolbar,
TextTransformation,
CloudServices
CloudServices,
AutoImage,
ImageInsert,
Bookmark
} from 'ckeditor5';

export default class ClassicEditor extends ClassicEditorBase {
export class ClassicEditor extends ClassicEditorBase {
static builtinPlugins = [
Essentials,
Autoformat,
Expand All @@ -56,7 +59,10 @@ export default class ClassicEditor extends ClassicEditorBase {
PictureEditing,
Table,
TableToolbar,
TextTransformation
TextTransformation,
AutoImage,
ImageInsert,
Bookmark
];

static defaultConfig = {
Expand Down Expand Up @@ -86,7 +92,6 @@ export default class ClassicEditor extends ClassicEditorBase {
'mergeTableCells'
]
},
// This value must be kept in sync with the language defined in webpack.config.js.
language: 'en'
};
}
10 changes: 1 addition & 9 deletions docs/_snippets/build-decoupled-document.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/*
* This is a JavaScript version of CKEditor 5 Decoupled Document build.
* It is used for all snippets used in the documentation to avoid importing a build source from the `src/` directory.
* See: https://github.com/ckeditor/ckeditor5/issues/13552 to learn why it is a problem.
*/

// The editor creator to use.
import {
DecoupledEditor as DecoupledEditorBase,
Essentials,
Expand Down Expand Up @@ -48,7 +41,7 @@ import {
CloudServices
} from 'ckeditor5';

export default class DecoupledEditor extends DecoupledEditorBase {
export class DecoupledEditor extends DecoupledEditorBase {
static builtinPlugins = [
Essentials,
Alignment,
Expand Down Expand Up @@ -123,7 +116,6 @@ export default class DecoupledEditor extends DecoupledEditorBase {
reversed: true
}
},
// This value must be kept in sync with the language defined in webpack.config.js.
language: 'en'
};
}
Empty file.
10 changes: 0 additions & 10 deletions docs/_snippets/build-inline-source.js

This file was deleted.

33 changes: 28 additions & 5 deletions docs/_snippets/build-inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@
*/

import {
InlineEditor as InlineEditorBase, Essentials, CKFinderUploadAdapter, Autoformat, Bold,
Italic, BlockQuote, CKBox, CKFinder, EasyImage, Heading, Image, ImageCaption, ImageStyle,
ImageToolbar, ImageUpload, PictureEditing, Indent, Link, List, MediaEmbed, Paragraph,
PasteFromOffice, Table, TableToolbar, TextTransformation, CloudServices
InlineEditor as InlineEditorBase,
Essentials,
CKFinderUploadAdapter,
Autoformat,
Bold,
Italic,
BlockQuote,
CKBox,
CKFinder,
EasyImage,
Heading,
Image,
ImageCaption,
ImageStyle,
ImageToolbar,
ImageUpload,
PictureEditing,
Indent,
Link,
List,
MediaEmbed,
Paragraph,
PasteFromOffice,
Table,
TableToolbar,
TextTransformation,
CloudServices
} from 'ckeditor5';

export default class InlineEditor extends InlineEditorBase {
export class InlineEditor extends InlineEditorBase {
static builtinPlugins = [
Essentials,
CKFinderUploadAdapter,
Expand Down
Empty file.
10 changes: 0 additions & 10 deletions docs/_snippets/build-multi-root-source.js

This file was deleted.

33 changes: 28 additions & 5 deletions docs/_snippets/build-multi-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,36 @@
*/

import {
MultiRootEditor as MultiRootEditorBase, Essentials, CKFinderUploadAdapter, Autoformat,
Bold, Italic, BlockQuote, CKBox, CKFinder, EasyImage, Heading, Image, ImageCaption,
ImageStyle, ImageToolbar, ImageUpload, PictureEditing, Indent, Link, List, MediaEmbed,
Paragraph, PasteFromOffice, Table, TableToolbar, TextTransformation, CloudServices
MultiRootEditor as MultiRootEditorBase,
Essentials,
CKFinderUploadAdapter,
Autoformat,
Bold,
Italic,
BlockQuote,
CKBox,
CKFinder,
EasyImage,
Heading,
Image,
ImageCaption,
ImageStyle,
ImageToolbar,
ImageUpload,
PictureEditing,
Indent,
Link,
List,
MediaEmbed,
Paragraph,
PasteFromOffice,
Table,
TableToolbar,
TextTransformation,
CloudServices
} from 'ckeditor5';

export default class MultiRootEditor extends MultiRootEditorBase {
export class MultiRootEditor extends MultiRootEditorBase {
static builtinPlugins = [
Essentials,
CKFinderUploadAdapter,
Expand Down
10 changes: 6 additions & 4 deletions docs/_snippets/examples/balloon-block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals BalloonBlockEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
import {
CS_CONFIG,
BalloonBlockEditor,
getViewportTopOffsetConfig
} from '@snippets/index.js';

BalloonBlockEditor
.create( document.querySelector( '#snippet-balloon-block-editor' ), {
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
top: getViewportTopOffsetConfig()
}
}
} )
Expand Down
10 changes: 6 additions & 4 deletions docs/_snippets/examples/balloon-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals BalloonEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
import {
CS_CONFIG,
BalloonEditor,
getViewportTopOffsetConfig
} from '@snippets/index.js';

BalloonEditor
.create( document.querySelector( '#snippet-balloon-editor' ), {
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
top: getViewportTopOffsetConfig()
}
}
} )
Expand Down
19 changes: 11 additions & 8 deletions docs/_snippets/examples/bottom-toolbar-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals console, window, document */

import {
Plugin, IconFontColor, Font, Indent, List, Alignment, Autoformat, BlockQuote, DropdownView,
ToolbarView, createDropdown, EasyImage, Essentials, Heading, HorizontalLine, Image,
ImageInsert, ImageCaption, ImageStyle, ImageToolbar, ImageUpload, ImageResize, Link,
MediaEmbed, Paragraph, RemoveFormat, Bold, Italic, Strikethrough, Superscript, Subscript,
Underline, Table, TableToolbar
} from 'ckeditor5';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';

import DecoupledEditor from '../build-decoupled-document.js';
import {
CS_CONFIG,
DecoupledEditor,
attachTourBalloon,
findToolbarItem
} from '@snippets/index.js';

class FormattingOptions extends Plugin {
/**
Expand Down Expand Up @@ -203,9 +204,11 @@ DecoupledEditor
overrideTooltipPositions( editor.ui.view.toolbar );
overrideTooltipPositions( editor.plugins.get( 'FormattingOptions' ).toolbarView );

window.attachTourBalloon( {
target: window.findToolbarItem( editor.ui.view.toolbar,
item => item.label && item.label === 'Formatting options' ),
attachTourBalloon( {
target: findToolbarItem(
editor.ui.view.toolbar,
item => item.label && item.label === 'Formatting options'
),
text: 'Click to open formatting options.',
editor,
tippyOptions: {
Expand Down
6 changes: 2 additions & 4 deletions docs/_snippets/examples/classic-editor-short.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
import { CS_CONFIG, ClassicEditor, getViewportTopOffsetConfig } from '@snippets/index.js';

ClassicEditor
.create( document.querySelector( '#snippet-classic-editor-short' ), {
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
top: getViewportTopOffsetConfig()
}
}
} )
Expand Down
10 changes: 6 additions & 4 deletions docs/_snippets/examples/classic-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';
import {
CS_CONFIG,
ClassicEditor,
getViewportTopOffsetConfig
} from '@snippets/index.js';

ClassicEditor
.create( document.querySelector( '#snippet-classic-editor' ), {
Expand All @@ -21,7 +23,7 @@ ClassicEditor
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
top: getViewportTopOffsetConfig()
}
}
} )
Expand Down
12 changes: 6 additions & 6 deletions docs/_snippets/examples/document-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/

/* globals console, window, document */

import { TableColumnResize } from 'ckeditor5';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config.js';

import DecoupledEditor from '../build-decoupled-document.js';
import {
CS_CONFIG,
DecoupledEditor,
getViewportTopOffsetConfig
} from '@snippets/index.js';

DecoupledEditor
.create( document.querySelector( '.document-editor__editable' ), {
Expand All @@ -27,7 +27,7 @@ DecoupledEditor
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
top: getViewportTopOffsetConfig()
}
}
} )
Expand Down
Loading

0 comments on commit f9b0f2f

Please sign in to comment.