@ckeditor/ckeditor5-media-embed 41.3.0-alpha.4 → 41.3.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/package.json +3 -4
- package/dist/content-index.css +0 -10
- package/dist/editor-index.css +0 -50
- package/dist/index.css +0 -148
- package/dist/index.css.map +0 -1
- package/dist/translations/ar.d.ts +0 -8
- package/dist/translations/ar.js +0 -5
- package/dist/translations/az.d.ts +0 -8
- package/dist/translations/az.js +0 -5
- package/dist/translations/bg.d.ts +0 -8
- package/dist/translations/bg.js +0 -5
- package/dist/translations/bn.d.ts +0 -8
- package/dist/translations/bn.js +0 -5
- package/dist/translations/ca.d.ts +0 -8
- package/dist/translations/ca.js +0 -5
- package/dist/translations/cs.d.ts +0 -8
- package/dist/translations/cs.js +0 -5
- package/dist/translations/da.d.ts +0 -8
- package/dist/translations/da.js +0 -5
- package/dist/translations/de-ch.d.ts +0 -8
- package/dist/translations/de-ch.js +0 -5
- package/dist/translations/de.d.ts +0 -8
- package/dist/translations/de.js +0 -5
- package/dist/translations/el.d.ts +0 -8
- package/dist/translations/el.js +0 -5
- package/dist/translations/en-au.d.ts +0 -8
- package/dist/translations/en-au.js +0 -5
- package/dist/translations/en-gb.d.ts +0 -8
- package/dist/translations/en-gb.js +0 -5
- package/dist/translations/en.d.ts +0 -8
- package/dist/translations/en.js +0 -5
- package/dist/translations/es.d.ts +0 -8
- package/dist/translations/es.js +0 -5
- package/dist/translations/et.d.ts +0 -8
- package/dist/translations/et.js +0 -5
- package/dist/translations/fa.d.ts +0 -8
- package/dist/translations/fa.js +0 -5
- package/dist/translations/fi.d.ts +0 -8
- package/dist/translations/fi.js +0 -5
- package/dist/translations/fr.d.ts +0 -8
- package/dist/translations/fr.js +0 -5
- package/dist/translations/gl.d.ts +0 -8
- package/dist/translations/gl.js +0 -5
- package/dist/translations/he.d.ts +0 -8
- package/dist/translations/he.js +0 -5
- package/dist/translations/hi.d.ts +0 -8
- package/dist/translations/hi.js +0 -5
- package/dist/translations/hr.d.ts +0 -8
- package/dist/translations/hr.js +0 -5
- package/dist/translations/hu.d.ts +0 -8
- package/dist/translations/hu.js +0 -5
- package/dist/translations/id.d.ts +0 -8
- package/dist/translations/id.js +0 -5
- package/dist/translations/it.d.ts +0 -8
- package/dist/translations/it.js +0 -5
- package/dist/translations/ja.d.ts +0 -8
- package/dist/translations/ja.js +0 -5
- package/dist/translations/ko.d.ts +0 -8
- package/dist/translations/ko.js +0 -5
- package/dist/translations/ku.d.ts +0 -8
- package/dist/translations/ku.js +0 -5
- package/dist/translations/lt.d.ts +0 -8
- package/dist/translations/lt.js +0 -5
- package/dist/translations/lv.d.ts +0 -8
- package/dist/translations/lv.js +0 -5
- package/dist/translations/ms.d.ts +0 -8
- package/dist/translations/ms.js +0 -5
- package/dist/translations/ne.d.ts +0 -8
- package/dist/translations/ne.js +0 -5
- package/dist/translations/nl.d.ts +0 -8
- package/dist/translations/nl.js +0 -5
- package/dist/translations/no.d.ts +0 -8
- package/dist/translations/no.js +0 -5
- package/dist/translations/pl.d.ts +0 -8
- package/dist/translations/pl.js +0 -5
- package/dist/translations/pt-br.d.ts +0 -8
- package/dist/translations/pt-br.js +0 -5
- package/dist/translations/pt.d.ts +0 -8
- package/dist/translations/pt.js +0 -5
- package/dist/translations/ro.d.ts +0 -8
- package/dist/translations/ro.js +0 -5
- package/dist/translations/ru.d.ts +0 -8
- package/dist/translations/ru.js +0 -5
- package/dist/translations/sk.d.ts +0 -8
- package/dist/translations/sk.js +0 -5
- package/dist/translations/sq.d.ts +0 -8
- package/dist/translations/sq.js +0 -5
- package/dist/translations/sr-latn.d.ts +0 -8
- package/dist/translations/sr-latn.js +0 -5
- package/dist/translations/sr.d.ts +0 -8
- package/dist/translations/sr.js +0 -5
- package/dist/translations/sv.d.ts +0 -8
- package/dist/translations/sv.js +0 -5
- package/dist/translations/th.d.ts +0 -8
- package/dist/translations/th.js +0 -5
- package/dist/translations/tk.d.ts +0 -8
- package/dist/translations/tk.js +0 -5
- package/dist/translations/tr.d.ts +0 -8
- package/dist/translations/tr.js +0 -5
- package/dist/translations/uk.d.ts +0 -8
- package/dist/translations/uk.js +0 -5
- package/dist/translations/ur.d.ts +0 -8
- package/dist/translations/ur.js +0 -5
- package/dist/translations/uz.d.ts +0 -8
- package/dist/translations/uz.js +0 -5
- package/dist/translations/vi.d.ts +0 -8
- package/dist/translations/vi.js +0 -5
- package/dist/translations/zh-cn.d.ts +0 -8
- package/dist/translations/zh-cn.js +0 -5
- package/dist/translations/zh.d.ts +0 -8
- package/dist/translations/zh.js +0 -5
- package/dist/types/augmentation.d.ts +0 -29
- package/dist/types/automediaembed.d.ts +0 -55
- package/dist/types/converters.d.ts +0 -42
- package/dist/types/index.d.ts +0 -19
- package/dist/types/mediaembed.d.ts +0 -38
- package/dist/types/mediaembedcommand.d.ts +0 -40
- package/dist/types/mediaembedconfig.d.ts +0 -282
- package/dist/types/mediaembedediting.d.ts +0 -35
- package/dist/types/mediaembedtoolbar.d.ts +0 -34
- package/dist/types/mediaembedui.d.ts +0 -31
- package/dist/types/mediaregistry.d.ts +0 -70
- package/dist/types/ui/mediaformview.d.ts +0 -119
- package/dist/types/utils.d.ts +0 -71
@@ -1,5 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
export default {"zh-cn":{"dictionary":{"media widget":"媒体小部件","Media URL":"媒体URL","Paste the media URL in the input.":"在输入中粘贴媒体URL","Tip: Paste the URL into the content to embed faster.":"提示:将URL粘贴到内容中可更快地嵌入","The URL must not be empty.":"URL不可以为空。","This media URL is not supported.":"不支持此媒体URL。","Insert media":"插入媒体","Media toolbar":"媒体工具栏","Open media in new tab":"在新标签页打开媒体"},getPluralForm(n){return 0;}}}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
|
6
|
-
import type { Translations } from 'ckeditor5';
|
7
|
-
declare const translations: Translations;
|
8
|
-
export default translations;
|
package/dist/translations/zh.js
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
export default {"zh":{"dictionary":{"media widget":"影音小工具","Media URL":"影音網址","Paste the media URL in the input.":"在輸入框貼上影音網址。","Tip: Paste the URL into the content to embed faster.":"提示:在內容貼上網址更快崁入。","The URL must not be empty.":"網址不能空白。","This media URL is not supported.":"不支援此影音網址。","Insert media":"插入影音","Media toolbar":"影音工具","Open media in new tab":"在新分頁打開媒體"},getPluralForm(n){return 0;}}}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
import type { MediaEmbedConfig, AutoMediaEmbed, MediaEmbed, MediaEmbedEditing, MediaEmbedToolbar, MediaEmbedUI, MediaEmbedCommand } from './index.js';
|
10
|
-
declare module '@ckeditor/ckeditor5-core' {
|
11
|
-
interface EditorConfig {
|
12
|
-
/**
|
13
|
-
* The configuration of the {@link module:media-embed/mediaembed~MediaEmbed} feature.
|
14
|
-
*
|
15
|
-
* Read more in {@link module:media-embed/mediaembedconfig~MediaEmbedConfig}.
|
16
|
-
*/
|
17
|
-
mediaEmbed?: MediaEmbedConfig;
|
18
|
-
}
|
19
|
-
interface PluginsMap {
|
20
|
-
[AutoMediaEmbed.pluginName]: AutoMediaEmbed;
|
21
|
-
[MediaEmbed.pluginName]: MediaEmbed;
|
22
|
-
[MediaEmbedEditing.pluginName]: MediaEmbedEditing;
|
23
|
-
[MediaEmbedToolbar.pluginName]: MediaEmbedToolbar;
|
24
|
-
[MediaEmbedUI.pluginName]: MediaEmbedUI;
|
25
|
-
}
|
26
|
-
interface CommandsMap {
|
27
|
-
mediaEmbed: MediaEmbedCommand;
|
28
|
-
}
|
29
|
-
}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed/automediaembed
|
11
|
-
*/
|
12
|
-
import { type Editor, Plugin } from 'ckeditor5/src/core.js';
|
13
|
-
import { Clipboard } from 'ckeditor5/src/clipboard.js';
|
14
|
-
import { Delete } from 'ckeditor5/src/typing.js';
|
15
|
-
import { Undo } from 'ckeditor5/src/undo.js';
|
16
|
-
/**
|
17
|
-
* The auto-media embed plugin. It recognizes media links in the pasted content and embeds
|
18
|
-
* them shortly after they are injected into the document.
|
19
|
-
*/
|
20
|
-
export default class AutoMediaEmbed extends Plugin {
|
21
|
-
/**
|
22
|
-
* @inheritDoc
|
23
|
-
*/
|
24
|
-
static get requires(): readonly [typeof Clipboard, typeof Delete, typeof Undo];
|
25
|
-
/**
|
26
|
-
* @inheritDoc
|
27
|
-
*/
|
28
|
-
static get pluginName(): "AutoMediaEmbed";
|
29
|
-
/**
|
30
|
-
* The paste–to–embed `setTimeout` ID. Stored as a property to allow
|
31
|
-
* cleaning of the timeout.
|
32
|
-
*/
|
33
|
-
private _timeoutId;
|
34
|
-
/**
|
35
|
-
* The position where the `<media>` element will be inserted after the timeout,
|
36
|
-
* determined each time the new content is pasted into the document.
|
37
|
-
*/
|
38
|
-
private _positionToInsert;
|
39
|
-
/**
|
40
|
-
* @inheritDoc
|
41
|
-
*/
|
42
|
-
constructor(editor: Editor);
|
43
|
-
/**
|
44
|
-
* @inheritDoc
|
45
|
-
*/
|
46
|
-
init(): void;
|
47
|
-
/**
|
48
|
-
* Analyzes the part of the document between provided positions in search for a URL representing media.
|
49
|
-
* When the URL is found, it is automatically converted into media.
|
50
|
-
*
|
51
|
-
* @param leftPosition Left position of the selection.
|
52
|
-
* @param rightPosition Right position of the selection.
|
53
|
-
*/
|
54
|
-
private _embedMediaBetweenPositions;
|
55
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
import type { DowncastDispatcher } from 'ckeditor5/src/engine.js';
|
10
|
-
import type MediaRegistry from './mediaregistry.js';
|
11
|
-
import type { MediaOptions } from './utils.js';
|
12
|
-
/**
|
13
|
-
* Returns a function that converts the model "url" attribute to the view representation.
|
14
|
-
*
|
15
|
-
* Depending on the configuration, the view representation can be "semantic" (for the data pipeline):
|
16
|
-
*
|
17
|
-
* ```html
|
18
|
-
* <figure class="media">
|
19
|
-
* <oembed url="foo"></oembed>
|
20
|
-
* </figure>
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* or "non-semantic" (for the editing view pipeline):
|
24
|
-
*
|
25
|
-
* ```html
|
26
|
-
* <figure class="media">
|
27
|
-
* <div data-oembed-url="foo">[ non-semantic media preview for "foo" ]</div>
|
28
|
-
* </figure>
|
29
|
-
* ```
|
30
|
-
*
|
31
|
-
* **Note:** Changing the model "url" attribute replaces the entire content of the
|
32
|
-
* `<figure>` in the view.
|
33
|
-
*
|
34
|
-
* @param registry The registry providing
|
35
|
-
* the media and their content.
|
36
|
-
* @param options options object with following properties:
|
37
|
-
* - elementName When set, overrides the default element name for semantic media embeds.
|
38
|
-
* - renderMediaPreview When `true`, the converter will create the view in the non-semantic form.
|
39
|
-
* - renderForEditingView When `true`, the converter will create a view specific for the
|
40
|
-
* editing pipeline (e.g. including CSS classes, content placeholders).
|
41
|
-
*/
|
42
|
-
export declare function modelToViewUrlAttributeConverter(registry: MediaRegistry, options: MediaOptions): (dispatcher: DowncastDispatcher) => void;
|
package/dist/types/index.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed
|
11
|
-
*/
|
12
|
-
export { default as MediaEmbed } from './mediaembed.js';
|
13
|
-
export { default as MediaEmbedEditing } from './mediaembedediting.js';
|
14
|
-
export { default as MediaEmbedUI } from './mediaembedui.js';
|
15
|
-
export { default as AutoMediaEmbed } from './automediaembed.js';
|
16
|
-
export { default as MediaEmbedToolbar } from './mediaembedtoolbar.js';
|
17
|
-
export type { MediaEmbedConfig } from './mediaembedconfig.js';
|
18
|
-
export type { default as MediaEmbedCommand } from './mediaembedcommand.js';
|
19
|
-
import './augmentation.js';
|
@@ -1,38 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed/mediaembed
|
11
|
-
*/
|
12
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
13
|
-
import { Widget } from 'ckeditor5/src/widget.js';
|
14
|
-
import MediaEmbedEditing from './mediaembedediting.js';
|
15
|
-
import AutoMediaEmbed from './automediaembed.js';
|
16
|
-
import MediaEmbedUI from './mediaembedui.js';
|
17
|
-
import '../theme/mediaembed.css';
|
18
|
-
/**
|
19
|
-
* The media embed plugin.
|
20
|
-
*
|
21
|
-
* For a detailed overview, check the {@glink features/media-embed Media Embed feature documentation}.
|
22
|
-
*
|
23
|
-
* This is a "glue" plugin which loads the following plugins:
|
24
|
-
*
|
25
|
-
* * The {@link module:media-embed/mediaembedediting~MediaEmbedEditing media embed editing feature},
|
26
|
-
* * The {@link module:media-embed/mediaembedui~MediaEmbedUI media embed UI feature} and
|
27
|
-
* * The {@link module:media-embed/automediaembed~AutoMediaEmbed auto-media embed feature}.
|
28
|
-
*/
|
29
|
-
export default class MediaEmbed extends Plugin {
|
30
|
-
/**
|
31
|
-
* @inheritDoc
|
32
|
-
*/
|
33
|
-
static get requires(): readonly [typeof MediaEmbedEditing, typeof MediaEmbedUI, typeof AutoMediaEmbed, typeof Widget];
|
34
|
-
/**
|
35
|
-
* @inheritDoc
|
36
|
-
*/
|
37
|
-
static get pluginName(): "MediaEmbed";
|
38
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
import { Command } from 'ckeditor5/src/core.js';
|
10
|
-
/**
|
11
|
-
* The insert media command.
|
12
|
-
*
|
13
|
-
* The command is registered by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} as `'mediaEmbed'`.
|
14
|
-
*
|
15
|
-
* To insert media at the current selection, execute the command and specify the URL:
|
16
|
-
*
|
17
|
-
* ```ts
|
18
|
-
* editor.execute( 'mediaEmbed', 'http://url.to.the/media' );
|
19
|
-
* ```
|
20
|
-
*/
|
21
|
-
export default class MediaEmbedCommand extends Command {
|
22
|
-
/**
|
23
|
-
* Media url.
|
24
|
-
*/
|
25
|
-
value: string | undefined;
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
refresh(): void;
|
30
|
-
/**
|
31
|
-
* Executes the command, which either:
|
32
|
-
*
|
33
|
-
* * updates the URL of the selected media,
|
34
|
-
* * inserts the new media into the editor and puts the selection around it.
|
35
|
-
*
|
36
|
-
* @fires execute
|
37
|
-
* @param url The URL of the media.
|
38
|
-
*/
|
39
|
-
execute(url: string): void;
|
40
|
-
}
|
@@ -1,282 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
import type { ToolbarConfigItem } from 'ckeditor5/src/core.js';
|
10
|
-
import type { ArrayOrItem } from 'ckeditor5/src/utils.js';
|
11
|
-
/**
|
12
|
-
* @module media-embed/mediaembedconfig
|
13
|
-
*/
|
14
|
-
/**
|
15
|
-
* The configuration of the media embed features.
|
16
|
-
*
|
17
|
-
* Read more about {@glink features/media-embed#configuration configuring the media embed feature}.
|
18
|
-
*
|
19
|
-
* ```ts
|
20
|
-
* ClassicEditor
|
21
|
-
* .create( editorElement, {
|
22
|
-
* mediaEmbed: ... // Media embed feature options.
|
23
|
-
* } )
|
24
|
-
* .then( ... )
|
25
|
-
* .catch( ... );
|
26
|
-
* ```
|
27
|
-
*
|
28
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
29
|
-
*/
|
30
|
-
export interface MediaEmbedConfig {
|
31
|
-
/**
|
32
|
-
* The default media providers supported by the editor.
|
33
|
-
*
|
34
|
-
* The names of providers with rendering functions (previews):
|
35
|
-
*
|
36
|
-
* * "dailymotion",
|
37
|
-
* * "spotify",
|
38
|
-
* * "youtube",
|
39
|
-
* * "vimeo"
|
40
|
-
*
|
41
|
-
* The names of providers without rendering functions:
|
42
|
-
*
|
43
|
-
* * "instagram",
|
44
|
-
* * "twitter",
|
45
|
-
* * "googleMaps",
|
46
|
-
* * "flickr",
|
47
|
-
* * "facebook"
|
48
|
-
*
|
49
|
-
* See the {@link module:media-embed/mediaembedconfig~MediaEmbedProvider provider syntax} to learn more about
|
50
|
-
* different kinds of media and media providers.
|
51
|
-
*
|
52
|
-
* **Note**: The default media provider configuration may not support all possible media URLs,
|
53
|
-
* only the most common are included.
|
54
|
-
*
|
55
|
-
* Media without rendering functions are always represented in the data using the "semantic" markup. See
|
56
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#previewsInData `config.mediaEmbed.previewsInData`} to
|
57
|
-
* learn more about possible data outputs.
|
58
|
-
*
|
59
|
-
* The priority of media providers corresponds to the order of configuration. The first provider
|
60
|
-
* to match the URL is always used, even if there are other providers that support a particular URL.
|
61
|
-
* The URL is never matched against the remaining providers.
|
62
|
-
*
|
63
|
-
* To discard **all** default media providers, simply override this configuration with your own
|
64
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedProvider definitions}:
|
65
|
-
*
|
66
|
-
* ```ts
|
67
|
-
* ClassicEditor
|
68
|
-
* .create( editorElement, {
|
69
|
-
* plugins: [ MediaEmbed, ... ],
|
70
|
-
* mediaEmbed: {
|
71
|
-
* providers: [
|
72
|
-
* {
|
73
|
-
* name: 'myProvider',
|
74
|
-
* url: /^example\.com\/media\/(\w+)/,
|
75
|
-
* html: match => '...'
|
76
|
-
* },
|
77
|
-
* ...
|
78
|
-
* ]
|
79
|
-
* }
|
80
|
-
* } )
|
81
|
-
* .then( ... )
|
82
|
-
* .catch( ... );
|
83
|
-
* ```
|
84
|
-
*
|
85
|
-
* You can take inspiration from the default configuration of this feature which you can find in:
|
86
|
-
* https://github.com/ckeditor/ckeditor5-media-embed/blob/master/src/mediaembedediting.js
|
87
|
-
*
|
88
|
-
* To **extend** the list of default providers, use
|
89
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#extraProviders `config.mediaEmbed.extraProviders`}.
|
90
|
-
*
|
91
|
-
* To **remove** certain providers, use
|
92
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#removeProviders `config.mediaEmbed.removeProviders`}.
|
93
|
-
*/
|
94
|
-
providers?: Array<MediaEmbedProvider>;
|
95
|
-
/**
|
96
|
-
* The additional media providers supported by the editor. This configuration helps extend the default
|
97
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#providers}.
|
98
|
-
*
|
99
|
-
* ```ts
|
100
|
-
* ClassicEditor
|
101
|
-
* .create( editorElement, {
|
102
|
-
* plugins: [ MediaEmbed, ... ],
|
103
|
-
* mediaEmbed: {
|
104
|
-
* extraProviders: [
|
105
|
-
* {
|
106
|
-
* name: 'extraProvider',
|
107
|
-
* url: /^example\.com\/media\/(\w+)/,
|
108
|
-
* html: match => '...'
|
109
|
-
* },
|
110
|
-
* ...
|
111
|
-
* ]
|
112
|
-
* }
|
113
|
-
* } )
|
114
|
-
* .then( ... )
|
115
|
-
* .catch( ... );
|
116
|
-
* ```
|
117
|
-
*
|
118
|
-
* See the {@link module:media-embed/mediaembedconfig~MediaEmbedProvider provider syntax} to learn more.
|
119
|
-
*/
|
120
|
-
extraProviders?: Array<MediaEmbedProvider>;
|
121
|
-
/**
|
122
|
-
* The list of media providers that should not be used despite being available in
|
123
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#providers `config.mediaEmbed.providers`} and
|
124
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#extraProviders `config.mediaEmbed.extraProviders`}
|
125
|
-
*
|
126
|
-
* ```ts
|
127
|
-
* mediaEmbed: {
|
128
|
-
* removeProviders: [ 'youtube', 'twitter' ]
|
129
|
-
* }
|
130
|
-
* ```
|
131
|
-
*/
|
132
|
-
removeProviders?: Array<string>;
|
133
|
-
/**
|
134
|
-
* Overrides the element name used for "semantic" data.
|
135
|
-
*
|
136
|
-
* This is not relevant if
|
137
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#previewsInData `config.mediaEmbed.previewsInData`} is set to `true`.
|
138
|
-
*
|
139
|
-
* When not set, the feature produces the `<oembed>` tag:
|
140
|
-
*
|
141
|
-
* ```html
|
142
|
-
* <figure class="media">
|
143
|
-
* <oembed url="https://url"></oembed>
|
144
|
-
* </figure>
|
145
|
-
* ```
|
146
|
-
*
|
147
|
-
* To override the element name with, for instance, the `o-embed` name:
|
148
|
-
*
|
149
|
-
* ```ts
|
150
|
-
* mediaEmbed: {
|
151
|
-
* elementName: 'o-embed'
|
152
|
-
* }
|
153
|
-
* ```
|
154
|
-
*
|
155
|
-
* This will produce semantic data with the `<o-embed>` tag:
|
156
|
-
*
|
157
|
-
* ```html
|
158
|
-
* <figure class="media">
|
159
|
-
* <o-embed url="https://url"></o-embed>
|
160
|
-
* </figure>
|
161
|
-
* ```
|
162
|
-
*
|
163
|
-
* @default 'oembed'
|
164
|
-
*/
|
165
|
-
elementName?: string;
|
166
|
-
/**
|
167
|
-
* Controls the data format produced by the feature.
|
168
|
-
*
|
169
|
-
* When `false` (default), the feature produces "semantic" data, i.e. it does not include the preview of
|
170
|
-
* the media, just the `<oembed>` tag with the `url` attribute:
|
171
|
-
*
|
172
|
-
* ```ts
|
173
|
-
* <figure class="media">
|
174
|
-
* <oembed url="https://url"></oembed>
|
175
|
-
* </figure>
|
176
|
-
* ```
|
177
|
-
*
|
178
|
-
* When `true`, the media is represented in the output in the same way it looks in the editor,
|
179
|
-
* i.e. the media preview is saved to the database:
|
180
|
-
*
|
181
|
-
* ```ts
|
182
|
-
* <figure class="media">
|
183
|
-
* <div data-oembed-url="https://url">
|
184
|
-
* <iframe src="https://preview"></iframe>
|
185
|
-
* </div>
|
186
|
-
* </figure>
|
187
|
-
* ```
|
188
|
-
*
|
189
|
-
* **Note:** Media without preview are always represented in the data using the "semantic" markup
|
190
|
-
* regardless of the value of the `previewsInData`. Learn more about different kinds of media
|
191
|
-
* in the {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#providers `config.mediaEmbed.providers`}
|
192
|
-
* configuration description.
|
193
|
-
*
|
194
|
-
* @defualt false
|
195
|
-
*/
|
196
|
-
previewsInData?: boolean;
|
197
|
-
/**
|
198
|
-
* Items to be placed in the media embed toolbar.
|
199
|
-
* This option requires adding {@link module:media-embed/mediaembedtoolbar~MediaEmbedToolbar} to the plugin list.
|
200
|
-
*
|
201
|
-
* Read more about configuring toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
|
202
|
-
*/
|
203
|
-
toolbar?: Array<ToolbarConfigItem>;
|
204
|
-
}
|
205
|
-
/**
|
206
|
-
* The media embed provider descriptor. Used in
|
207
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#providers `config.mediaEmbed.providers`} and
|
208
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#extraProviders `config.mediaEmbed.extraProviders`}.
|
209
|
-
*
|
210
|
-
* See {@link module:media-embed/mediaembedconfig~MediaEmbedConfig} to learn more.
|
211
|
-
*
|
212
|
-
* ```ts
|
213
|
-
* {
|
214
|
-
* name: 'example',
|
215
|
-
*
|
216
|
-
* // The following RegExp matches https://www.example.com/media/{media id},
|
217
|
-
* // (either with "http(s)://" and "www" or without), so the valid URLs are:
|
218
|
-
* //
|
219
|
-
* // * https://www.example.com/media/{media id},
|
220
|
-
* // * http://www.example.com/media/{media id},
|
221
|
-
* // * www.example.com/media/{media id},
|
222
|
-
* // * example.com/media/{media id}
|
223
|
-
* url: /^example\.com\/media\/(\w+)/,
|
224
|
-
*
|
225
|
-
* // The rendering function of the provider.
|
226
|
-
* // Used to represent the media when editing the content (i.e. in the view)
|
227
|
-
* // and also in the data output of the editor if semantic data output is disabled.
|
228
|
-
* html: match => `The HTML representing the media with ID=${ match[ 1 ] }.`
|
229
|
-
* }
|
230
|
-
* ```
|
231
|
-
*
|
232
|
-
* You can allow any sort of media in the editor using the "allow–all" `RegExp`.
|
233
|
-
* But mind that, since URLs are processed in the order of configuration, if one of the previous
|
234
|
-
* `RegExps` matches the URL, it will have a precedence over this one.
|
235
|
-
*
|
236
|
-
* ```ts
|
237
|
-
* {
|
238
|
-
* name: 'allow-all',
|
239
|
-
* url: /^.+/
|
240
|
-
* }
|
241
|
-
* ```
|
242
|
-
*
|
243
|
-
* To implement responsive media, you can use the following HTML structure:
|
244
|
-
*
|
245
|
-
* ```ts
|
246
|
-
* {
|
247
|
-
* ...
|
248
|
-
* html: match =>
|
249
|
-
* '<div style="position:relative; padding-bottom:100%; height:0">' +
|
250
|
-
* '<iframe src="..." frameborder="0" ' +
|
251
|
-
* 'style="position:absolute; width:100%; height:100%; top:0; left:0">' +
|
252
|
-
* '</iframe>' +
|
253
|
-
* '</div>'
|
254
|
-
* }
|
255
|
-
* ```
|
256
|
-
*/
|
257
|
-
export interface MediaEmbedProvider {
|
258
|
-
/**
|
259
|
-
* The name of the provider. Used e.g. when
|
260
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#removeProviders removing providers}.
|
261
|
-
*/
|
262
|
-
name: string;
|
263
|
-
/**
|
264
|
-
* The `RegExp` object (or array of objects) defining the URL of the media.
|
265
|
-
* If any URL matches the `RegExp`, it becomes the media in the editor model, as defined by the provider. The result
|
266
|
-
* of matching (output of `String.prototype.match()`) is passed to the `html` rendering function of the media.
|
267
|
-
*
|
268
|
-
* **Note:** You do not need to include the protocol (`http://`, `https://`) and `www` subdomain in your `RegExps`,
|
269
|
-
* they are stripped from the URLs before matching anyway.
|
270
|
-
*/
|
271
|
-
url: ArrayOrItem<RegExp>;
|
272
|
-
/**
|
273
|
-
* The rendering function of the media. The function receives the entire matching
|
274
|
-
* array from the corresponding `url` `RegExp` as an argument, allowing rendering a dedicated
|
275
|
-
* preview of the media identified by a certain ID or a hash. When not defined, the media embed feature
|
276
|
-
* will use a generic media representation in the view and output data.
|
277
|
-
* Note that when
|
278
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#previewsInData `config.mediaEmbed.previewsInData`}
|
279
|
-
* is `true`, the rendering function **will always** be used for the media in the editor data output.
|
280
|
-
*/
|
281
|
-
html?: (match: RegExpMatchArray) => string;
|
282
|
-
}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed/mediaembedediting
|
11
|
-
*/
|
12
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
13
|
-
import MediaRegistry from './mediaregistry.js';
|
14
|
-
import '../theme/mediaembedediting.css';
|
15
|
-
/**
|
16
|
-
* The media embed editing feature.
|
17
|
-
*/
|
18
|
-
export default class MediaEmbedEditing extends Plugin {
|
19
|
-
/**
|
20
|
-
* @inheritDoc
|
21
|
-
*/
|
22
|
-
static get pluginName(): "MediaEmbedEditing";
|
23
|
-
/**
|
24
|
-
* The media registry managing the media providers in the editor.
|
25
|
-
*/
|
26
|
-
registry: MediaRegistry;
|
27
|
-
/**
|
28
|
-
* @inheritDoc
|
29
|
-
*/
|
30
|
-
constructor(editor: Editor);
|
31
|
-
/**
|
32
|
-
* @inheritDoc
|
33
|
-
*/
|
34
|
-
init(): void;
|
35
|
-
}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed/mediaembedtoolbar
|
11
|
-
*/
|
12
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
13
|
-
import { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';
|
14
|
-
import './mediaembedconfig.js';
|
15
|
-
/**
|
16
|
-
* The media embed toolbar plugin. It creates a toolbar for media embed that shows up when the media element is selected.
|
17
|
-
*
|
18
|
-
* Instances of toolbar components (e.g. buttons) are created based on the
|
19
|
-
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#toolbar `media.toolbar` configuration option}.
|
20
|
-
*/
|
21
|
-
export default class MediaEmbedToolbar extends Plugin {
|
22
|
-
/**
|
23
|
-
* @inheritDoc
|
24
|
-
*/
|
25
|
-
static get requires(): readonly [typeof WidgetToolbarRepository];
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
static get pluginName(): "MediaEmbedToolbar";
|
30
|
-
/**
|
31
|
-
* @inheritDoc
|
32
|
-
*/
|
33
|
-
afterInit(): void;
|
34
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* @module media-embed/mediaembedui
|
11
|
-
*/
|
12
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
13
|
-
import MediaEmbedEditing from './mediaembedediting.js';
|
14
|
-
/**
|
15
|
-
* The media embed UI plugin.
|
16
|
-
*/
|
17
|
-
export default class MediaEmbedUI extends Plugin {
|
18
|
-
/**
|
19
|
-
* @inheritDoc
|
20
|
-
*/
|
21
|
-
static get requires(): readonly [typeof MediaEmbedEditing];
|
22
|
-
/**
|
23
|
-
* @inheritDoc
|
24
|
-
*/
|
25
|
-
static get pluginName(): "MediaEmbedUI";
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
init(): void;
|
30
|
-
private _setUpDropdown;
|
31
|
-
}
|