Skip to content

Commit f68568c

Browse files
authored
Export and add internal tags for entities indended to be internal. (#18644)
Internal: Export and add internal tags for entities intended to be internal.
1 parent fc6963d commit f68568c

File tree

194 files changed

+1715
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+1715
-167
lines changed

docs/_snippets/framework/tutorials/inline-widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
Widget,
1717
toWidget,
1818
viewToModelPositionOutsideModelElement,
19-
ViewModel,
19+
UIModel,
2020
addListToDropdown,
2121
createDropdown,
2222
Collection
@@ -106,7 +106,7 @@ function getDropdownItemsDefinitions( placeholderNames ) {
106106
for ( const name of placeholderNames ) {
107107
const definition = {
108108
type: 'button',
109-
model: new ViewModel( {
109+
model: new UIModel( {
110110
commandParam: name,
111111
label: name,
112112
withText: true

docs/_snippets/framework/ui/ui-dropdown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
addListToDropdown,
1111
addToolbarToDropdown,
1212
createDropdown,
13-
ViewModel,
13+
UIModel,
1414
IconBold,
1515
IconItalic,
1616
Collection,
@@ -22,14 +22,14 @@ const locale = new Locale();
2222
const collection = new Collection();
2323
collection.add( {
2424
type: 'button',
25-
model: new ViewModel( {
25+
model: new UIModel( {
2626
label: 'Button',
2727
withText: true
2828
} )
2929
} );
3030
collection.add( {
3131
type: 'switchbutton',
32-
model: new ViewModel( {
32+
model: new UIModel( {
3333
label: 'Switch button',
3434
withText: true
3535
} )

docs/framework/architecture/ui-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,22 +344,22 @@ import {
344344
Collection,
345345
createDropdown,
346346
Locale,
347-
ViewModel
347+
UIModel
348348
} from 'ckeditor5';
349349

350350
const locale = new Locale();
351351

352352
const collection = new Collection();
353353
collection.add( {
354354
type: 'button',
355-
model: new ViewModel( {
355+
model: new UIModel( {
356356
label: 'Button',
357357
withText: true
358358
} )
359359
} );
360360
collection.add( {
361361
type: 'switchbutton',
362-
model: new ViewModel( {
362+
model: new UIModel( {
363363
label: 'Switch button',
364364
withText: true
365365
} )

docs/framework/architecture/ui-library.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ The {@link module:ui/list/listview~ListView} can be added to a dropdown using th
399399

400400
<code-switcher>
401401
```js
402-
import { ViewModel, addListToDropdown, createDropdown, Collection } from 'ckeditor5';
402+
import { UIModel, addListToDropdown, createDropdown, Collection } from 'ckeditor5';
403403

404404
// The default dropdown.
405405
const dropdownView = createDropdown( locale );
@@ -409,15 +409,15 @@ const items = new Collection();
409409

410410
items.add( {
411411
type: 'button',
412-
model: new ViewModel( {
412+
model: new UIModel( {
413413
withText: true,
414414
label: 'Foo'
415415
} )
416416
} );
417417

418418
items.add( {
419419
type: 'button',
420-
model: new ViewModel( {
420+
model: new UIModel( {
421421
withText: true,
422422
label: 'Bar'
423423
} )

docs/tutorials/widgets/implementing-an-inline-widget.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In this tutorial, you will learn how to implement an inline widget. You will bui
1111
<info-box warning>
1212
**We have an official implementation of this feature!**
1313

14-
While this tutorial was created for learning purposes, it only offers a basic, simplified solution. We have an official implementation of this mechanism, called the {@link features/merge-fields merge fields} feature. It is much more robust than the solution presented here, and offers many configuration options.
14+
While this tutorial was created for learning purposes, it only offers a basic, simplified solution. We have an official implementation of this mechanism, called the {@link features/merge-fields merge fields} feature. It is much more robust than the solution presented here, and offers many configuration options.
1515
info-box>
1616

1717
First, you will use widget utilities and conversion to define the behavior of this feature. Later on, you will use dropdown utilities to create a dropdown that will allow for inserting new placeholders. You will also learn how to use the editor configuration to define allowed placeholder names.
@@ -444,7 +444,7 @@ In this tutorial, you will create a dropdown with a list of available placeholde
444444

445445
import {
446446
Plugin,
447-
ViewModel,
447+
UIModel,
448448
addListToDropdown,
449449
createDropdown,
450450
Collection
@@ -493,7 +493,7 @@ function getDropdownItemsDefinitions( placeholderNames ) {
493493
for ( const name of placeholderNames ) {
494494
const definition = {
495495
type: 'button',
496-
model: new ViewModel( {
496+
model: new UIModel( {
497497
commandParam: name,
498498
label: name,
499499
withText: true

packages/ckeditor5-adapter-ckfinder/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@
88
*/
99

1010
export { CKFinderUploadAdapter } from './uploadadapter.js';
11+
export {
12+
getCsrfToken as _getCKFinderCsrfToken,
13+
getCookie as _getCKFinderCookie,
14+
setCookie as _setCKFinderCookie
15+
} from './utils.js';
1116

1217
import './augmentation.js';

packages/ckeditor5-adapter-ckfinder/src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ const tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';
1515
* Returns the CSRF token value. The value is a hash stored in `document.cookie`
1616
* under the `ckCsrfToken` key. The CSRF token can be used to secure the communication
1717
* between the web browser and the CKFinder server.
18+
*
19+
* @internal
1820
*/
1921
export function getCsrfToken(): string {
2022
let token = getCookie( TOKEN_COOKIE_NAME );
@@ -29,6 +31,8 @@ export function getCsrfToken(): string {
2931

3032
/**
3133
* Returns the value of the cookie with a given name or `null` if the cookie is not found.
34+
*
35+
* @internal
3236
*/
3337
export function getCookie( name: string ): string | null {
3438
name = name.toLowerCase();
@@ -48,6 +52,8 @@ export function getCookie( name: string ): string | null {
4852

4953
/**
5054
* Sets the value of the cookie with a given name.
55+
*
56+
* @internal
5157
*/
5258
export function setCookie( name: string, value: string ): void {
5359
document.cookie = encodeURIComponent( name ) + '=' + encodeURIComponent( value ) + ';path=/';

packages/ckeditor5-alignment/src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ export { AlignmentUI } from './alignmentui.js';
1313
export { AlignmentCommand } from './alignmentcommand.js';
1414
export type { AlignmentConfig } from './alignmentconfig.js';
1515

16+
export {
17+
supportedOptions as _ALIGNMENT_SUPPORTED_OPTIONS,
18+
isSupported as _isAlignmentSupported,
19+
isDefault as _isDefaultAlignment,
20+
normalizeAlignmentOptions as _normalizeAlignmentOptions
21+
} from './utils.js';
22+
1623
import './augmentation.js';

packages/ckeditor5-alignment/src/utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ import type { AlignmentFormat, SupportedOption } from './alignmentconfig.js';
1717
* * `'right'`,
1818
* * `'center'`,
1919
* * `'justify'`
20+
*
21+
* @internal
2022
*/
2123
export const supportedOptions: ReadonlyArray<SupportedOption> = [ 'left', 'right', 'center', 'justify' ];
2224

2325
/**
2426
* Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.
2527
*
28+
* @internal
2629
* @param option The option value to check.
2730
*/
2831
export function isSupported( option: string ): boolean {
@@ -33,6 +36,7 @@ export function isSupported( option: string ): boolean {
3336
* Checks whether alignment is the default one considering the direction
3437
* of the editor content.
3538
*
39+
* @internal
3640
* @param alignment The name of the alignment to check.
3741
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
3842
*/
@@ -49,6 +53,7 @@ export function isDefault( alignment: string, locale: Locale ): boolean {
4953
/**
5054
* Brings the configuration to the common form, an array of objects.
5155
*
56+
* @internal
5257
* @param configuredOptions Alignment plugin configuration.
5358
* @returns Normalized object holding the configuration.
5459
*/

packages/ckeditor5-basic-styles/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ export { UnderlineEditing } from './underline/underlineediting.js';
3030
export { UnderlineUI } from './underline/underlineui.js';
3131
export { AttributeCommand } from './attributecommand.js';
3232

33+
export { getButtonCreator as _getBasicStylesButtonCreator } from './utils.js';
34+
3335
import './augmentation.js';

packages/ckeditor5-basic-styles/src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { MenuBarMenuListItemButtonView, type ButtonView } from 'ckeditor5/src/ui
1313

1414
/**
1515
* Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
16+
*
17+
* @internal
1618
*/
1719
export function getButtonCreator( {
1820
editor, commandName, plugin, icon, label, keystroke

packages/ckeditor5-bookmark/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ export { UpdateBookmarkCommand } from './updatebookmarkcommand.js';
1515

1616
export type { BookmarkConfig } from './bookmarkconfig.js';
1717

18+
export { isBookmarkIdValid as _isBookmarkIdValid } from './utils.js';
19+
1820
import './augmentation.js';

packages/ckeditor5-bookmark/src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* Returns `true` if the bookmark id is valid; otherwise, returns `false`.
12+
*
13+
* @internal
1214
*/
1315
export function isBookmarkIdValid( id: string ): boolean {
1416
if ( !id || typeof id !== 'string' ) {

packages/ckeditor5-ckbox/src/ckboxconfig.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,17 @@ export interface CKBoxUploadConfig {
279279
* Asset definition.
280280
*
281281
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
282+
*
283+
* @internal
282284
*/
283285
export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
284286

285287
/**
286288
* Image asset definition.
287289
*
288290
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
291+
*
292+
* @internal
289293
*/
290294
export interface CKBoxAssetImageDefinition {
291295

@@ -309,6 +313,8 @@ export interface CKBoxAssetImageDefinition {
309313
* Link asset definition.
310314
*
311315
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
316+
*
317+
* @internal
312318
*/
313319
export interface CKBoxAssetLinkDefinition {
314320

@@ -357,6 +363,8 @@ export interface CKBoxAssetLinkDefinition {
357363
* imageTextAlternative: 'An alternative text for the image'
358364
* }
359365
* ```
366+
*
367+
* @internal
360368
*/
361369
export interface CKBoxAssetImageAttributesDefinition {
362370

@@ -406,6 +414,8 @@ export interface CKBoxAssetImageAttributesDefinition {
406414
* linkHref: 'https://example.com/assets/asset-id/file.pdf'
407415
* }
408416
* ```
417+
*
418+
* @internal
409419
*/
410420
export interface CKBoxAssetLinkAttributesDefinition {
411421

packages/ckeditor5-ckbox/src/index.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,25 @@ export { CKBoxImageEditCommand } from './ckboximageedit/ckboximageeditcommand.js
1818

1919
export type { CKBoxConfig } from './ckboxconfig.js';
2020

21+
export {
22+
getImageUrls as _getCKBoxImageUrls,
23+
getWorkspaceId as _getCKBoxWorkspaceId,
24+
blurHashToDataUrl as _ckboxBlurHashToDataUrl,
25+
sendHttpRequest as _sendCKBoxHttpRequest,
26+
convertMimeTypeToExtension as _ckBoxConvertMimeTypeToExtension,
27+
getContentTypeOfUrl as _getCKBoxContentTypeOfUrl,
28+
getFileExtension as _getCKBoxFileExtension
29+
} from './utils.js';
30+
31+
export type {
32+
CKBoxAssetDefinition as _CKBoxAssetDefinition,
33+
CKBoxAssetImageDefinition as _CKBoxAssetImageDefinition,
34+
CKBoxAssetLinkDefinition as _CKBoxAssetLinkDefinition,
35+
CKBoxAssetImageAttributesDefinition as _CKBoxAssetImageAttributesDefinition,
36+
CKBoxAssetLinkAttributesDefinition as _CKBoxAssetLinkAttributesDefinition
37+
} from './ckboxconfig.js';
38+
39+
export { createEditabilityChecker as _createCKBoxEditabilityChecker } from './ckboximageedit/utils.js';
40+
export { prepareImageAssetAttributes as _prepareCKBoxImageAssetAttributes } from './ckboxcommand.js';
41+
2142
import './augmentation.js';

packages/ckeditor5-ckbox/src/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { decode } from 'blurhash';
1616
* Converts image source set provided by the CKBox into an object containing:
1717
* - responsive URLs for the "webp" image format,
1818
* - one fallback URL for browsers that do not support the "webp" format.
19+
*
20+
* @internal
1921
*/
2022
export function getImageUrls( imageUrls: CKBoxImageUrls ): {
2123
imageFallbackUrl: string;
@@ -56,6 +58,7 @@ export function getImageUrls( imageUrls: CKBoxImageUrls ): {
5658
* Returns a workspace id to use for communication with the CKBox service.
5759
*
5860
* @param defaultWorkspaceId The default workspace to use taken from editor config.
61+
* @internal
5962
*/
6063
export function getWorkspaceId( token: InitializedToken, defaultWorkspaceId?: string ): string | null {
6164
const [ , binaryTokenPayload ] = token.value.split( '.' );
@@ -81,6 +84,8 @@ const BLUR_RESOLUTION = 32;
8184

8285
/**
8386
* Generates an image data URL from its `blurhash` representation.
87+
*
88+
* @internal
8489
*/
8590
export function blurHashToDataUrl( hash?: string ): string | undefined {
8691
if ( !hash ) {
@@ -205,13 +210,17 @@ const MIME_TO_EXTENSION: Record = {
205210

206211
/**
207212
* Returns an extension a typical file in the specified `mimeType` format would have.
213+
*
214+
* @internal
208215
*/
209216
export function convertMimeTypeToExtension( mimeType: string ): string {
210217
return MIME_TO_EXTENSION[ mimeType ];
211218
}
212219

213220
/**
214221
* Tries to fetch the given `url` and returns 'content-type' of the response.
222+
*
223+
* @internal
215224
*/
216225
export async function getContentTypeOfUrl( url: string, options: { signal: AbortSignal } ): Promise<string> {
217226
try {
@@ -233,6 +242,8 @@ export async function getContentTypeOfUrl( url: string, options: { signal: Abort
233242

234243
/**
235244
* Returns an extension from the given value.
245+
*
246+
* @internal
236247
*/
237248
export function getFileExtension( file: File ): string {
238249
const fileName = file.name;

packages/ckeditor5-ckbox/tests/ckboxui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { CloudServices } from '@ckeditor/ckeditor5-cloud-services/src/cloudservi
1414
import { ClassicTestEditor } from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor.js';
1515
import { CloudServicesCoreMock } from './_utils/cloudservicescoremock.js';
1616
import { ImageInsertUI } from '@ckeditor/ckeditor5-image/src/imageinsert/imageinsertui.js';
17-
import { ViewModel } from '@ckeditor/ckeditor5-ui/src/model.js';
17+
import { UIModel } from '@ckeditor/ckeditor5-ui/src/model.js';
1818
import { testUtils } from '@ckeditor/ckeditor5-core/tests/_utils/utils.js';
1919
import { IconImageAssetManager, IconBrowseFiles } from 'ckeditor5/src/icons.js';
2020

@@ -265,7 +265,7 @@ describe( 'CKBoxUI', () => {
265265

266266
function mockAnotherIntegration() {
267267
const insertImageUI = editor.plugins.get( 'ImageInsertUI' );
268-
const observable = new ViewModel( { isEnabled: true } );
268+
const observable = new UIModel( { isEnabled: true } );
269269

270270
insertImageUI.registerIntegration( {
271271
name: 'url',

packages/ckeditor5-ckfinder/tests/ckfinderui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { ButtonView } from '@ckeditor/ckeditor5-ui/src/button/buttonview.js';
1515
import { MenuBarMenuListItemButtonView } from '@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitembuttonview.js';
1616

1717
import { CKFinder } from '../src/ckfinder.js';
18-
import { ViewModel } from '@ckeditor/ckeditor5-ui/src/model.js';
18+
import { UIModel } from '@ckeditor/ckeditor5-ui/src/model.js';
1919
import { CKFinderUI } from '../src/ckfinderui.js';
2020

2121
describe( 'CKFinderUI', () => {
@@ -204,7 +204,7 @@ describe( 'CKFinderUI', () => {
204204

205205
function mockAnotherIntegration() {
206206
const insertImageUI = editor.plugins.get( 'ImageInsertUI' );
207-
const observable = new ViewModel( { isEnabled: true } );
207+
const observable = new UIModel( { isEnabled: true } );
208208

209209
insertImageUI.registerIntegration( {
210210
name: 'url',

0 commit comments

Comments
 (0)