@atlaskit/adf-schema 42.0.0 → 42.0.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/CHANGELOG.md +6 -0
- package/dist/cjs/schema/marks/link.js +2 -2
- package/dist/cjs/utils/url.js +3 -1
- package/dist/es2019/schema/marks/link.js +1 -1
- package/dist/es2019/utils/url.js +3 -1
- package/dist/esm/schema/marks/link.js +1 -1
- package/dist/esm/utils/url.js +3 -1
- package/dist/types/schema/marks/link.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.toJSON = exports.link = void 0;
|
7
|
+
exports.toJSON = exports.link = exports.getLinkAttrs = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _markTypes = require("../../next-schema/generated/markTypes");
|
10
10
|
var _url = require("../../utils/url");
|
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
14
14
|
* @name link_mark
|
15
15
|
*/
|
16
16
|
|
17
|
-
var getLinkAttrs = function getLinkAttrs(attribute) {
|
17
|
+
var getLinkAttrs = exports.getLinkAttrs = function getLinkAttrs(attribute) {
|
18
18
|
return function (domNode) {
|
19
19
|
var dom = domNode;
|
20
20
|
var href = dom.getAttribute(attribute) || '';
|
package/dist/cjs/utils/url.js
CHANGED
@@ -119,5 +119,7 @@ function normalizeUrl(url) {
|
|
119
119
|
* checks if root relative link
|
120
120
|
*/
|
121
121
|
function isRootRelative(url) {
|
122
|
-
|
122
|
+
// Support `#top` and `#` special references as per:
|
123
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_element_on_the_same_page
|
124
|
+
return url.startsWith('/') || url === '#top' || url === '#';
|
123
125
|
}
|
@@ -5,7 +5,7 @@ import { isRootRelative, isSafeUrl, normalizeUrl } from '../../utils/url';
|
|
5
5
|
* @name link_mark
|
6
6
|
*/
|
7
7
|
|
8
|
-
const getLinkAttrs = attribute => domNode => {
|
8
|
+
export const getLinkAttrs = attribute => domNode => {
|
9
9
|
const dom = domNode;
|
10
10
|
const href = dom.getAttribute(attribute) || '';
|
11
11
|
const attrs = {
|
package/dist/es2019/utils/url.js
CHANGED
@@ -105,5 +105,7 @@ export function normalizeUrl(url) {
|
|
105
105
|
* checks if root relative link
|
106
106
|
*/
|
107
107
|
export function isRootRelative(url) {
|
108
|
-
|
108
|
+
// Support `#top` and `#` special references as per:
|
109
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_element_on_the_same_page
|
110
|
+
return url.startsWith('/') || url === '#top' || url === '#';
|
109
111
|
}
|
@@ -8,7 +8,7 @@ import { isRootRelative, isSafeUrl, normalizeUrl } from '../../utils/url';
|
|
8
8
|
* @name link_mark
|
9
9
|
*/
|
10
10
|
|
11
|
-
var getLinkAttrs = function getLinkAttrs(attribute) {
|
11
|
+
export var getLinkAttrs = function getLinkAttrs(attribute) {
|
12
12
|
return function (domNode) {
|
13
13
|
var dom = domNode;
|
14
14
|
var href = dom.getAttribute(attribute) || '';
|
package/dist/esm/utils/url.js
CHANGED
@@ -107,5 +107,7 @@ export function normalizeUrl(url) {
|
|
107
107
|
* checks if root relative link
|
108
108
|
*/
|
109
109
|
export function isRootRelative(url) {
|
110
|
-
|
110
|
+
// Support `#top` and `#` special references as per:
|
111
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#linking_to_an_element_on_the_same_page
|
112
|
+
return url.startsWith('/') || url === '#top' || url === '#';
|
111
113
|
}
|
@@ -28,6 +28,10 @@ export interface LinkDefinition {
|
|
28
28
|
type: 'link';
|
29
29
|
attrs: LinkAttributes;
|
30
30
|
}
|
31
|
+
export declare const getLinkAttrs: (attribute: string) => (domNode: Node | string) => false | {
|
32
|
+
__confluenceMetadata: string;
|
33
|
+
href?: string;
|
34
|
+
};
|
31
35
|
export declare const link: MarkSpec;
|
32
36
|
export declare const toJSON: (mark: Mark) => {
|
33
37
|
type: string;
|
package/package.json
CHANGED