@ckeditor/ckeditor5-link 48.2.0 → 48.3.0-alpha.0

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/dist/utils.d.ts CHANGED
@@ -1,93 +1,93 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module link/utils
7
- */
8
- import type { DowncastConversionApi, ModelElement, ModelSchema, ViewAttributeElement, ViewNode, ViewDocumentFragment, ModelRange } from '@ckeditor/ckeditor5-engine';
9
- import type { LocaleTranslate } from '@ckeditor/ckeditor5-utils';
10
- import type { LinkDecoratorAutomaticDefinition, LinkDecoratorDefinition, LinkDecoratorManualDefinition } from './linkconfig.js';
6
+ * @module link/utils
7
+ */
8
+ import type { DowncastConversionApi, ModelElement, ModelSchema, ViewAttributeElement, ViewNode, ViewDocumentFragment, ModelRange } from "@ckeditor/ckeditor5-engine";
9
+ import type { LocaleTranslate } from "@ckeditor/ckeditor5-utils";
10
+ import type { LinkDecoratorAutomaticDefinition, LinkDecoratorDefinition, LinkDecoratorManualDefinition } from "./linkconfig.js";
11
11
  /**
12
- * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
13
- */
12
+ * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.
13
+ */
14
14
  export declare const LINK_KEYSTROKE = "Ctrl+K";
15
15
  /**
16
- * Returns `true` if a given view node is the link element.
17
- */
16
+ * Returns `true` if a given view node is the link element.
17
+ */
18
18
  export declare function isLinkElement(node: ViewNode | ViewDocumentFragment): boolean;
19
19
  /**
20
- * Creates a link {@link module:engine/view/attributeelement~ViewAttributeElement} with the provided `href` attribute.
21
- */
20
+ * Creates a link {@link module:engine/view/attributeelement~ViewAttributeElement} with the provided `href` attribute.
21
+ */
22
22
  export declare function createLinkElement(href: string, { writer }: DowncastConversionApi): ViewAttributeElement;
23
23
  /**
24
- * Returns a safe URL based on a given value.
25
- *
26
- * A URL is considered safe if it is safe for the user (does not contain any malicious code).
27
- *
28
- * If a URL is considered unsafe, a simple `"#"` is returned.
29
- *
30
- * @internal
31
- */
24
+ * Returns a safe URL based on a given value.
25
+ *
26
+ * A URL is considered safe if it is safe for the user (does not contain any malicious code).
27
+ *
28
+ * If a URL is considered unsafe, a simple `"#"` is returned.
29
+ *
30
+ * @internal
31
+ */
32
32
  export declare function ensureSafeUrl(url: unknown, allowedProtocols?: Array<string>): string;
33
33
  /**
34
- * Returns the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration processed
35
- * to respect the locale of the editor, i.e. to display the {@link module:link/linkconfig~LinkDecoratorManualDefinition label}
36
- * in the correct language.
37
- *
38
- * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
39
- * translated in the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration.
40
- *
41
- * @param t Shorthand for {@link module:utils/locale~Locale#t Locale#t}.
42
- * @param decorators The decorator reference where the label values should be localized.
43
- * @internal
44
- */
34
+ * Returns the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration processed
35
+ * to respect the locale of the editor, i.e. to display the {@link module:link/linkconfig~LinkDecoratorManualDefinition label}
36
+ * in the correct language.
37
+ *
38
+ * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually
39
+ * translated in the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration.
40
+ *
41
+ * @param t Shorthand for {@link module:utils/locale~Locale#t Locale#t}.
42
+ * @param decorators The decorator reference where the label values should be localized.
43
+ * @internal
44
+ */
45
45
  export declare function getLocalizedDecorators(t: LocaleTranslate, decorators: Array<NormalizedLinkDecoratorDefinition>): Array<NormalizedLinkDecoratorDefinition>;
46
46
  /**
47
- * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
48
- * is used as the attribute's name in the model.
49
- *
50
- * @internal
51
- */
47
+ * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and
48
+ * is used as the attribute's name in the model.
49
+ *
50
+ * @internal
51
+ */
52
52
  export declare function normalizeDecorators(decorators?: Record<string, LinkDecoratorDefinition>): Array<NormalizedLinkDecoratorDefinition>;
53
53
  /**
54
- * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).
55
- */
54
+ * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).
55
+ */
56
56
  export declare function isLinkableElement(element: ModelElement | null, schema: ModelSchema): element is ModelElement;
57
57
  /**
58
- * Returns `true` if the specified `value` is an email.
59
- *
60
- * @internal
61
- */
58
+ * Returns `true` if the specified `value` is an email.
59
+ *
60
+ * @internal
61
+ */
62
62
  export declare function isEmail(value: string): boolean;
63
63
  /**
64
- * Adds the protocol prefix to the specified `link` when:
65
- *
66
- * * it does not contain it already, and there is a {@link module:link/linkconfig~LinkConfig#defaultProtocol `defaultProtocol` }
67
- * configuration value provided,
68
- * * or the link is an email address.
69
- */
64
+ * Adds the protocol prefix to the specified `link` when:
65
+ *
66
+ * * it does not contain it already, and there is a {@link module:link/linkconfig~LinkConfig#defaultProtocol `defaultProtocol` }
67
+ * configuration value provided,
68
+ * * or the link is an email address.
69
+ */
70
70
  export declare function addLinkProtocolIfApplicable(link: string, defaultProtocol?: string): string;
71
71
  /**
72
- * Checks if protocol is already included in the link.
73
- *
74
- * @internal
75
- */
72
+ * Checks if protocol is already included in the link.
73
+ *
74
+ * @internal
75
+ */
76
76
  export declare function linkHasProtocol(link: string): boolean;
77
77
  /**
78
- * Opens the link in a new browser tab.
79
- */
78
+ * Opens the link in a new browser tab.
79
+ */
80
80
  export declare function openLink(link: string): void;
81
81
  /**
82
- * Returns a text of a link range.
83
- *
84
- * If the returned value is `undefined`, the range contains elements other than text nodes.
85
- */
82
+ * Returns a text of a link range.
83
+ *
84
+ * If the returned value is `undefined`, the range contains elements other than text nodes.
85
+ */
86
86
  export declare function extractTextFromLinkRange(range: ModelRange): string | undefined;
87
87
  export type NormalizedLinkDecoratorAutomaticDefinition = LinkDecoratorAutomaticDefinition & {
88
- id: string;
88
+ id: string;
89
89
  };
90
90
  export type NormalizedLinkDecoratorManualDefinition = LinkDecoratorManualDefinition & {
91
- id: string;
91
+ id: string;
92
92
  };
93
93
  export type NormalizedLinkDecoratorDefinition = NormalizedLinkDecoratorAutomaticDefinition | NormalizedLinkDecoratorManualDefinition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-link",
3
- "version": "48.2.0",
3
+ "version": "48.3.0-alpha.0",
4
4
  "description": "Link feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -26,16 +26,16 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-clipboard": "48.2.0",
30
- "@ckeditor/ckeditor5-core": "48.2.0",
31
- "@ckeditor/ckeditor5-engine": "48.2.0",
32
- "@ckeditor/ckeditor5-enter": "48.2.0",
33
- "@ckeditor/ckeditor5-icons": "48.2.0",
34
- "@ckeditor/ckeditor5-image": "48.2.0",
35
- "@ckeditor/ckeditor5-typing": "48.2.0",
36
- "@ckeditor/ckeditor5-ui": "48.2.0",
37
- "@ckeditor/ckeditor5-utils": "48.2.0",
38
- "@ckeditor/ckeditor5-widget": "48.2.0",
29
+ "@ckeditor/ckeditor5-clipboard": "48.3.0-alpha.0",
30
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.0",
31
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.0",
32
+ "@ckeditor/ckeditor5-enter": "48.3.0-alpha.0",
33
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.0",
34
+ "@ckeditor/ckeditor5-image": "48.3.0-alpha.0",
35
+ "@ckeditor/ckeditor5-typing": "48.3.0-alpha.0",
36
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.0",
37
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.0",
38
+ "@ckeditor/ckeditor5-widget": "48.3.0-alpha.0",
39
39
  "es-toolkit": "1.45.1"
40
40
  },
41
41
  "files": [