@atlaskit/adf-schema 19.2.4 → 20.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 +46 -0
- package/dist/cjs/index.js +24 -6
- package/dist/cjs/schema/create-schema.js +10 -3
- package/dist/cjs/schema/default-schema.js +7 -13
- package/dist/cjs/schema/index.js +12 -6
- package/dist/cjs/schema/jira-schema.js +1 -1
- package/dist/cjs/schema/marks/fragment.js +77 -0
- package/dist/cjs/schema/marks/index.js +15 -1
- package/dist/cjs/schema/marks/unsupported-mark.js +1 -0
- package/dist/cjs/schema/nodes/bodied-extension.js +1 -1
- package/dist/cjs/schema/nodes/caption.js +0 -1
- package/dist/cjs/schema/nodes/doc.js +1 -1
- package/dist/cjs/schema/nodes/emoji.js +4 -0
- package/dist/cjs/schema/nodes/expand.js +1 -1
- package/dist/cjs/schema/nodes/index.js +0 -6
- package/dist/cjs/schema/nodes/layout-column.js +1 -1
- package/dist/cjs/schema/nodes/media-single.js +1 -1
- package/dist/cjs/schema/nodes/panel.js +58 -53
- package/dist/cjs/schema/nodes/paragraph.js +2 -2
- package/dist/cjs/schema/nodes/tableNodes.js +3 -3
- package/dist/cjs/utils/index.js +12 -0
- package/dist/cjs/utils/url.js +62 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +2 -2
- package/dist/es2019/schema/create-schema.js +10 -5
- package/dist/es2019/schema/default-schema.js +6 -10
- package/dist/es2019/schema/index.js +2 -2
- package/dist/es2019/schema/jira-schema.js +1 -1
- package/dist/es2019/schema/marks/fragment.js +59 -0
- package/dist/es2019/schema/marks/index.js +2 -1
- package/dist/es2019/schema/marks/unsupported-mark.js +1 -0
- package/dist/es2019/schema/nodes/bodied-extension.js +1 -1
- package/dist/es2019/schema/nodes/caption.js +0 -1
- package/dist/es2019/schema/nodes/doc.js +1 -1
- package/dist/es2019/schema/nodes/emoji.js +4 -0
- package/dist/es2019/schema/nodes/expand.js +1 -1
- package/dist/es2019/schema/nodes/index.js +1 -1
- package/dist/es2019/schema/nodes/layout-column.js +1 -1
- package/dist/es2019/schema/nodes/media-single.js +1 -1
- package/dist/es2019/schema/nodes/panel.js +42 -49
- package/dist/es2019/schema/nodes/paragraph.js +2 -2
- package/dist/es2019/schema/nodes/tableNodes.js +3 -3
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/url.js +57 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/schema/create-schema.js +10 -5
- package/dist/esm/schema/default-schema.js +6 -10
- package/dist/esm/schema/index.js +2 -2
- package/dist/esm/schema/jira-schema.js +1 -1
- package/dist/esm/schema/marks/fragment.js +64 -0
- package/dist/esm/schema/marks/index.js +2 -1
- package/dist/esm/schema/marks/unsupported-mark.js +1 -0
- package/dist/esm/schema/nodes/bodied-extension.js +1 -1
- package/dist/esm/schema/nodes/caption.js +0 -1
- package/dist/esm/schema/nodes/doc.js +1 -1
- package/dist/esm/schema/nodes/emoji.js +4 -0
- package/dist/esm/schema/nodes/expand.js +1 -1
- package/dist/esm/schema/nodes/index.js +1 -1
- package/dist/esm/schema/nodes/layout-column.js +1 -1
- package/dist/esm/schema/nodes/media-single.js +1 -1
- package/dist/esm/schema/nodes/panel.js +53 -51
- package/dist/esm/schema/nodes/paragraph.js +2 -2
- package/dist/esm/schema/nodes/tableNodes.js +3 -3
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/url.js +57 -4
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/v1/full.json +108 -73
- package/dist/json-schema/v1/stage-0.json +63 -26
- package/dist/types/index.d.ts +3 -3
- package/dist/types/schema/create-schema.d.ts +1 -0
- package/dist/types/schema/index.d.ts +3 -3
- package/dist/types/schema/marks/fragment.d.ts +30 -0
- package/dist/types/schema/marks/index.d.ts +2 -0
- package/dist/types/schema/marks/link.d.ts +3 -0
- package/dist/types/schema/nodes/block-card.d.ts +3 -0
- package/dist/types/schema/nodes/bodied-extension.d.ts +7 -5
- package/dist/types/schema/nodes/caption.d.ts +0 -1
- package/dist/types/schema/nodes/embed-card.d.ts +3 -0
- package/dist/types/schema/nodes/extension.d.ts +7 -5
- package/dist/types/schema/nodes/index.d.ts +1 -1
- package/dist/types/schema/nodes/inline-card.d.ts +0 -9
- package/dist/types/schema/nodes/inline-extension.d.ts +7 -5
- package/dist/types/schema/nodes/media-single.d.ts +0 -1
- package/dist/types/schema/nodes/panel.d.ts +1 -11
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/url.d.ts +7 -2
- package/json-schema/v1/full.json +108 -73
- package/json-schema/v1/stage-0.json +63 -26
- package/package.json +11 -8
- package/test-helpers/schema.ts +1 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 20.0.1
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [`977f778e630`](https://bitbucket.org/atlassian/atlassian-frontend/commits/977f778e630) - Add action elements to paste allowlist
|
8
|
+
|
9
|
+
## 20.0.0
|
10
|
+
|
11
|
+
### Major Changes
|
12
|
+
|
13
|
+
- [`3a2a5e14fdc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a2a5e14fdc) - As we are moving to full schema, merged the customPanel nodeSpec with panel nodeSpec
|
14
|
+
- [`8f0577e0eb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0577e0eb1) - [ux] Promoted captions to full schema and better support of wikimarkup, email and slack renderer
|
15
|
+
|
16
|
+
### Minor Changes
|
17
|
+
|
18
|
+
- [`65a541166fe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65a541166fe) - ED-13766 fix pm node spec for media single with caption
|
19
|
+
- [`83154234335`](https://bitbucket.org/atlassian/atlassian-frontend/commits/83154234335) - ED-13522 Add safe URL check to ADF validator (smart cards now show as unsupported content if the check fails)
|
20
|
+
- [`8bbb96540ea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8bbb96540ea) - Add "fragment" mark to stage0 ADF schema
|
21
|
+
|
22
|
+
### Patch Changes
|
23
|
+
|
24
|
+
- [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) - ED-11632: Bump prosemirror packages;
|
25
|
+
|
26
|
+
- prosmirror-commands 1.1.4 -> 1.1.11,
|
27
|
+
- prosemirror-model 1.11.0 -> 1.14.3,
|
28
|
+
- prosemirror-state 1.3.3 -> 1.3.4,
|
29
|
+
- prosemirror-transform 1.2.8 -> 1.3.2,
|
30
|
+
- prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
|
31
|
+
|
32
|
+
- [`297d113d54b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/297d113d54b) - Unskip backwrd compat test and fix mistakes
|
33
|
+
- Updated dependencies
|
34
|
+
|
35
|
+
## 19.3.1
|
36
|
+
|
37
|
+
### Patch Changes
|
38
|
+
|
39
|
+
- [`f4ce830a2f2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4ce830a2f2) - [HOT-97158] Fix paste link applying marks on block nodes
|
40
|
+
|
41
|
+
## 19.3.0
|
42
|
+
|
43
|
+
### Minor Changes
|
44
|
+
|
45
|
+
- [`93da0afefce`](https://bitbucket.org/atlassian/atlassian-frontend/commits/93da0afefce) - CETI-78 Change panel nodeSpec to handle paste when feature flag is off
|
46
|
+
- [`971845eac0d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/971845eac0d) - CETI-96 Added new rule to emoji to solve the duplicate icon issue when we copy from renderer
|
47
|
+
- [`e856b56fd31`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e856b56fd31) - ED-13669 reuse same links normalization method in plugin and adf schema
|
48
|
+
|
3
49
|
## 19.2.3
|
4
50
|
|
5
51
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
@@ -255,6 +255,18 @@ Object.defineProperty(exports, "extension", {
|
|
255
255
|
return _schema.extension;
|
256
256
|
}
|
257
257
|
});
|
258
|
+
Object.defineProperty(exports, "fragment", {
|
259
|
+
enumerable: true,
|
260
|
+
get: function get() {
|
261
|
+
return _schema.fragment;
|
262
|
+
}
|
263
|
+
});
|
264
|
+
Object.defineProperty(exports, "fragmentToJSON", {
|
265
|
+
enumerable: true,
|
266
|
+
get: function get() {
|
267
|
+
return _schema.fragmentToJSON;
|
268
|
+
}
|
269
|
+
});
|
258
270
|
Object.defineProperty(exports, "getSchemaBasedOnStage", {
|
259
271
|
enumerable: true,
|
260
272
|
get: function get() {
|
@@ -477,12 +489,6 @@ Object.defineProperty(exports, "panel", {
|
|
477
489
|
return _schema.panel;
|
478
490
|
}
|
479
491
|
});
|
480
|
-
Object.defineProperty(exports, "customPanel", {
|
481
|
-
enumerable: true,
|
482
|
-
get: function get() {
|
483
|
-
return _schema.customPanel;
|
484
|
-
}
|
485
|
-
});
|
486
492
|
Object.defineProperty(exports, "paragraph", {
|
487
493
|
enumerable: true,
|
488
494
|
get: function get() {
|
@@ -1059,6 +1065,18 @@ Object.defineProperty(exports, "isSafeUrl", {
|
|
1059
1065
|
return _utils.isSafeUrl;
|
1060
1066
|
}
|
1061
1067
|
});
|
1068
|
+
Object.defineProperty(exports, "linkify", {
|
1069
|
+
enumerable: true,
|
1070
|
+
get: function get() {
|
1071
|
+
return _utils.linkify;
|
1072
|
+
}
|
1073
|
+
});
|
1074
|
+
Object.defineProperty(exports, "linkifyMatch", {
|
1075
|
+
enumerable: true,
|
1076
|
+
get: function get() {
|
1077
|
+
return _utils.linkifyMatch;
|
1078
|
+
}
|
1079
|
+
});
|
1062
1080
|
Object.defineProperty(exports, "normalizeHexColor", {
|
1063
1081
|
enumerable: true,
|
1064
1082
|
get: function get() {
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
exports.createSchema = createSchema;
|
9
9
|
exports.sanitizeNodes = sanitizeNodes;
|
10
10
|
exports.sanitizeNodeSpecContent = sanitizeNodeSpecContent;
|
11
|
+
exports.allowCustomPanel = void 0;
|
11
12
|
|
12
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
14
|
|
@@ -107,7 +108,7 @@ var nodesInOrder = [{
|
|
107
108
|
spec: _nodes.codeBlock
|
108
109
|
}, {
|
109
110
|
name: 'panel',
|
110
|
-
spec: _nodes.panel
|
111
|
+
spec: (0, _nodes.panel)(true)
|
111
112
|
}, {
|
112
113
|
name: 'rule',
|
113
114
|
spec: _nodes.rule
|
@@ -128,7 +129,7 @@ var nodesInOrder = [{
|
|
128
129
|
spec: _nodes.mediaGroup
|
129
130
|
}, {
|
130
131
|
name: 'mediaSingle',
|
131
|
-
spec: _nodes.
|
132
|
+
spec: _nodes.mediaSingleWithCaption
|
132
133
|
}, {
|
133
134
|
name: 'mediaInline',
|
134
135
|
spec: _nodes.mediaInline
|
@@ -262,6 +263,9 @@ var marksInOrder = [{
|
|
262
263
|
}, {
|
263
264
|
name: 'dataConsumer',
|
264
265
|
spec: _marks.dataConsumer
|
266
|
+
}, {
|
267
|
+
name: 'fragment',
|
268
|
+
spec: _marks.fragment
|
265
269
|
}, {
|
266
270
|
name: 'indentation',
|
267
271
|
spec: _marks.indentation
|
@@ -351,4 +355,7 @@ function isContentSupported(nodes, contentKey) {
|
|
351
355
|
}
|
352
356
|
|
353
357
|
return false;
|
354
|
-
}
|
358
|
+
}
|
359
|
+
|
360
|
+
var allowCustomPanel = true;
|
361
|
+
exports.allowCustomPanel = allowCustomPanel;
|
@@ -5,19 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.defaultSchema = exports.getSchemaBasedOnStage = exports.defaultSchemaConfig = void 0;
|
7
7
|
|
8
|
-
var
|
9
|
-
|
10
|
-
var _layoutSection = require("./nodes/layout-section");
|
8
|
+
var _nodes = require("./nodes");
|
11
9
|
|
12
|
-
var
|
10
|
+
var _marks = require("./marks");
|
13
11
|
|
14
12
|
var _createSchema = require("./create-schema");
|
15
13
|
|
16
|
-
var _nodes = require("./nodes");
|
17
|
-
|
18
14
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
19
15
|
var defaultSchemaConfig = {
|
20
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
|
16
|
+
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'caption', 'mention', 'media', 'mediaGroup', 'mediaSingle', 'mediaInline', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'hardBreak', 'emoji', 'table', 'tableCell', 'tableHeader', 'tableRow', 'decisionList', 'decisionItem', 'taskList', 'taskItem', 'unknownBlock', 'date', 'status', 'placeholder', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard', 'unsupportedBlock', 'unsupportedInline'],
|
21
17
|
marks: ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'code', 'textColor', 'confluenceInlineComment', 'breakout', 'alignment', 'indentation', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute', 'typeAheadQuery' // https://product-fabric.atlassian.net/browse/ED-10214,
|
22
18
|
]
|
23
19
|
};
|
@@ -29,18 +25,16 @@ exports.defaultSchemaConfig = defaultSchemaConfig;
|
|
29
25
|
|
30
26
|
var getSchemaBasedOnStage = function getSchemaBasedOnStage() {
|
31
27
|
var stage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'final';
|
32
|
-
var defaultSchemaConfig = getDefaultSchemaConfig();
|
28
|
+
var defaultSchemaConfig = getDefaultSchemaConfig();
|
33
29
|
|
34
30
|
if (stage === 'stage0') {
|
35
31
|
defaultSchemaConfig.customNodeSpecs = {
|
36
|
-
|
37
|
-
mediaSingle: _nodes.mediaSingleWithCaption,
|
38
|
-
layoutSection: _layoutSection.layoutSectionWithSingleColumn
|
32
|
+
layoutSection: _nodes.layoutSectionWithSingleColumn
|
39
33
|
};
|
40
34
|
defaultSchemaConfig.customMarkSpecs = {
|
41
|
-
dataConsumer:
|
35
|
+
dataConsumer: _marks.dataConsumer,
|
36
|
+
fragment: _marks.fragment
|
42
37
|
};
|
43
|
-
defaultSchemaConfig.nodes.push('caption');
|
44
38
|
defaultSchemaConfig.nodes.push('mediaInline');
|
45
39
|
}
|
46
40
|
|
package/dist/cjs/schema/index.js
CHANGED
@@ -275,12 +275,6 @@ Object.defineProperty(exports, "panel", {
|
|
275
275
|
return _nodes.panel;
|
276
276
|
}
|
277
277
|
});
|
278
|
-
Object.defineProperty(exports, "customPanel", {
|
279
|
-
enumerable: true,
|
280
|
-
get: function get() {
|
281
|
-
return _nodes.customPanel;
|
282
|
-
}
|
283
|
-
});
|
284
278
|
Object.defineProperty(exports, "paragraph", {
|
285
279
|
enumerable: true,
|
286
280
|
get: function get() {
|
@@ -521,6 +515,18 @@ Object.defineProperty(exports, "em", {
|
|
521
515
|
return _marks.em;
|
522
516
|
}
|
523
517
|
});
|
518
|
+
Object.defineProperty(exports, "fragment", {
|
519
|
+
enumerable: true,
|
520
|
+
get: function get() {
|
521
|
+
return _marks.fragment;
|
522
|
+
}
|
523
|
+
});
|
524
|
+
Object.defineProperty(exports, "fragmentToJSON", {
|
525
|
+
enumerable: true,
|
526
|
+
get: function get() {
|
527
|
+
return _marks.fragmentToJSON;
|
528
|
+
}
|
529
|
+
});
|
524
530
|
Object.defineProperty(exports, "indentation", {
|
525
531
|
enumerable: true,
|
526
532
|
get: function get() {
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.toJSON = exports.fragment = void 0;
|
9
|
+
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
+
|
12
|
+
var _parseDOM = require("../../utils/parseDOM");
|
13
|
+
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
15
|
+
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
17
|
+
|
18
|
+
var parseFragment = function parseFragment(maybeValue) {
|
19
|
+
var _maybeValue$getAttrib;
|
20
|
+
|
21
|
+
if (!(0, _parseDOM.isDOMElement)(maybeValue)) {
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
|
25
|
+
var name = (_maybeValue$getAttrib = maybeValue.getAttribute('data-name')) !== null && _maybeValue$getAttrib !== void 0 ? _maybeValue$getAttrib : undefined;
|
26
|
+
var localId = maybeValue.getAttribute('data-localId');
|
27
|
+
|
28
|
+
if (!localId) {
|
29
|
+
return false;
|
30
|
+
}
|
31
|
+
|
32
|
+
return {
|
33
|
+
localId: localId,
|
34
|
+
name: name
|
35
|
+
};
|
36
|
+
};
|
37
|
+
|
38
|
+
var fragment = {
|
39
|
+
inclusive: false,
|
40
|
+
excludes: '',
|
41
|
+
attrs: {
|
42
|
+
localId: {
|
43
|
+
default: ''
|
44
|
+
},
|
45
|
+
name: {
|
46
|
+
default: null
|
47
|
+
}
|
48
|
+
},
|
49
|
+
parseDOM: [{
|
50
|
+
tag: '[data-mark-type="fragment"]',
|
51
|
+
getAttrs: function getAttrs(maybeValue) {
|
52
|
+
return parseFragment(maybeValue);
|
53
|
+
}
|
54
|
+
}],
|
55
|
+
toDOM: function toDOM(mark, inline) {
|
56
|
+
var wrapperStyle = inline ? 'span' : 'div';
|
57
|
+
return [wrapperStyle, {
|
58
|
+
'data-mark-type': 'fragment',
|
59
|
+
'data-name': mark.attrs.name,
|
60
|
+
'data-localId': mark.attrs.localId
|
61
|
+
}];
|
62
|
+
}
|
63
|
+
};
|
64
|
+
exports.fragment = fragment;
|
65
|
+
|
66
|
+
var toJSON = function toJSON(mark) {
|
67
|
+
return {
|
68
|
+
type: mark.type.name,
|
69
|
+
attrs: _objectSpread({
|
70
|
+
localId: mark.attrs.localId
|
71
|
+
}, mark.attrs.name ? {
|
72
|
+
name: mark.attrs.name
|
73
|
+
} : {})
|
74
|
+
};
|
75
|
+
};
|
76
|
+
|
77
|
+
exports.toJSON = toJSON;
|
@@ -153,6 +153,18 @@ Object.defineProperty(exports, "dataConsumerToJSON", {
|
|
153
153
|
return _dataConsumer.toJSON;
|
154
154
|
}
|
155
155
|
});
|
156
|
+
Object.defineProperty(exports, "fragment", {
|
157
|
+
enumerable: true,
|
158
|
+
get: function get() {
|
159
|
+
return _fragment.fragment;
|
160
|
+
}
|
161
|
+
});
|
162
|
+
Object.defineProperty(exports, "fragmentToJSON", {
|
163
|
+
enumerable: true,
|
164
|
+
get: function get() {
|
165
|
+
return _fragment.toJSON;
|
166
|
+
}
|
167
|
+
});
|
156
168
|
|
157
169
|
var _em = require("./em");
|
158
170
|
|
@@ -186,4 +198,6 @@ var _unsupportedMark = require("./unsupported-mark");
|
|
186
198
|
|
187
199
|
var _unsupportedNodeAttributes = require("./unsupported-node-attributes");
|
188
200
|
|
189
|
-
var _dataConsumer = require("./data-consumer");
|
201
|
+
var _dataConsumer = require("./data-consumer");
|
202
|
+
|
203
|
+
var _fragment = require("./fragment");
|
@@ -11,7 +11,7 @@ var createBodiedExtensionNodeSpec = function createBodiedExtensionNodeSpec() {
|
|
11
11
|
var nodeSpec = {
|
12
12
|
inline: false,
|
13
13
|
group: 'block',
|
14
|
-
marks: 'link dataConsumer',
|
14
|
+
marks: 'link dataConsumer fragment',
|
15
15
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | extension | unsupportedBlock | embedCard)+',
|
16
16
|
defining: true,
|
17
17
|
selectable: true,
|
@@ -10,6 +10,6 @@ exports.doc = void 0;
|
|
10
10
|
*/
|
11
11
|
var doc = {
|
12
12
|
content: '(block|layoutSection)+',
|
13
|
-
marks: 'alignment breakout dataConsumer indentation link unsupportedMark unsupportedNodeAttribute'
|
13
|
+
marks: 'alignment breakout dataConsumer fragment indentation link unsupportedMark unsupportedNodeAttribute'
|
14
14
|
};
|
15
15
|
exports.doc = doc;
|
@@ -32,6 +32,10 @@ var emoji = {
|
|
32
32
|
text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default
|
33
33
|
};
|
34
34
|
}
|
35
|
+
}, // Handle copy/paste beautiful panel from renderer />
|
36
|
+
{
|
37
|
+
tag: 'div.ak-editor-panel__icon',
|
38
|
+
ignore: true
|
35
39
|
}, // Handle copy/paste from old <ac:emoticon />
|
36
40
|
{
|
37
41
|
tag: 'img[data-emoticon-name]',
|
@@ -27,7 +27,7 @@ function getExpandAttrs(domNode) {
|
|
27
27
|
var expand = {
|
28
28
|
inline: false,
|
29
29
|
group: 'block',
|
30
|
-
marks: 'link dataConsumer unsupportedMark unsupportedNodeAttribute',
|
30
|
+
marks: 'link dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
31
31
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
|
32
32
|
isolating: true,
|
33
33
|
selectable: true,
|
@@ -143,12 +143,6 @@ Object.defineProperty(exports, "panel", {
|
|
143
143
|
return _panel.panel;
|
144
144
|
}
|
145
145
|
});
|
146
|
-
Object.defineProperty(exports, "customPanel", {
|
147
|
-
enumerable: true,
|
148
|
-
get: function get() {
|
149
|
-
return _panel.customPanel;
|
150
|
-
}
|
151
|
-
});
|
152
146
|
Object.defineProperty(exports, "PanelType", {
|
153
147
|
enumerable: true,
|
154
148
|
get: function get() {
|
@@ -11,7 +11,7 @@ exports.layoutColumn = void 0;
|
|
11
11
|
var layoutColumn = {
|
12
12
|
content: '(block|unsupportedBlock)+',
|
13
13
|
isolating: true,
|
14
|
-
marks: 'link alignment indentation dataConsumer unsupportedMark unsupportedNodeAttribute',
|
14
|
+
marks: 'link alignment indentation dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
15
15
|
selectable: false,
|
16
16
|
attrs: {
|
17
17
|
width: {
|
@@ -32,7 +32,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
32
32
|
|
33
33
|
/**
|
34
34
|
* @name mediaSingle_caption_node
|
35
|
-
* @stage 0
|
36
35
|
*/
|
37
36
|
var defaultAttrs = {
|
38
37
|
width: {
|
@@ -81,6 +80,7 @@ var mediaSingle = {
|
|
81
80
|
exports.mediaSingle = mediaSingle;
|
82
81
|
|
83
82
|
var mediaSingleWithCaption = _objectSpread(_objectSpread({}, mediaSingle), {}, {
|
83
|
+
atom: false,
|
84
84
|
content: 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*'
|
85
85
|
});
|
86
86
|
|
@@ -1,9 +1,18 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
4
6
|
value: true
|
5
7
|
});
|
6
|
-
exports.panel = exports.
|
8
|
+
exports.panel = exports.PanelType = void 0;
|
9
|
+
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
|
+
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
13
|
+
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
15
|
+
|
7
16
|
var PanelType;
|
8
17
|
exports.PanelType = PanelType;
|
9
18
|
|
@@ -17,12 +26,8 @@ exports.PanelType = PanelType;
|
|
17
26
|
PanelType["CUSTOM"] = "custom";
|
18
27
|
})(PanelType || (exports.PanelType = PanelType = {}));
|
19
28
|
|
20
|
-
|
21
|
-
var
|
22
|
-
group: 'block',
|
23
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
24
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
25
|
-
attrs: {
|
29
|
+
var getDefaultAttrs = function getDefaultAttrs() {
|
30
|
+
var attrs = {
|
26
31
|
panelType: {
|
27
32
|
default: 'info'
|
28
33
|
},
|
@@ -32,54 +37,54 @@ var customPanel = {
|
|
32
37
|
panelColor: {
|
33
38
|
default: null
|
34
39
|
}
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
40
|
+
};
|
41
|
+
return attrs;
|
42
|
+
};
|
43
|
+
|
44
|
+
var getDomAttrs = function getDomAttrs(nodeAttrs) {
|
45
|
+
var attrs = {
|
46
|
+
'data-panel-type': nodeAttrs.panelType,
|
47
|
+
'data-panel-icon': nodeAttrs.panelIcon,
|
48
|
+
'data-panel-color': nodeAttrs.panelColor
|
49
|
+
};
|
50
|
+
return attrs;
|
51
|
+
};
|
52
|
+
|
53
|
+
var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom) {
|
54
|
+
var parseDOMAttrs = {
|
55
|
+
panelType: dom.getAttribute('data-panel-type')
|
56
|
+
};
|
57
|
+
|
58
|
+
if (allowCustomPanel) {
|
59
|
+
parseDOMAttrs = _objectSpread(_objectSpread({}, parseDOMAttrs), {}, {
|
60
|
+
panelIcon: dom.getAttribute('data-panel-icon'),
|
61
|
+
panelColor: dom.getAttribute('data-panel-color')
|
62
|
+
});
|
63
|
+
} else {
|
64
|
+
parseDOMAttrs.panelType = parseDOMAttrs.panelType === PanelType.CUSTOM ? PanelType.INFO : parseDOMAttrs.panelType;
|
57
65
|
}
|
66
|
+
|
67
|
+
return parseDOMAttrs;
|
58
68
|
};
|
59
|
-
|
60
|
-
var panel = {
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
};
|
69
|
+
|
70
|
+
var panel = function panel(allowCustomPanel) {
|
71
|
+
var panelNodeSpec = {
|
72
|
+
group: 'block',
|
73
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
74
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
75
|
+
attrs: getDefaultAttrs(),
|
76
|
+
parseDOM: [{
|
77
|
+
tag: 'div[data-panel-type]',
|
78
|
+
getAttrs: function getAttrs(dom) {
|
79
|
+
return getParseDOMAttrs(allowCustomPanel, dom);
|
80
|
+
}
|
81
|
+
}],
|
82
|
+
toDOM: function toDOM(node) {
|
83
|
+
var attrs = getDomAttrs(node.attrs);
|
84
|
+
return ['div', attrs, ['div', {}, 0]];
|
75
85
|
}
|
76
|
-
}
|
77
|
-
|
78
|
-
var panelType = node.attrs.panelType;
|
79
|
-
var attrs = {
|
80
|
-
'data-panel-type': panelType
|
81
|
-
};
|
82
|
-
return ['div', attrs, ['div', {}, 0]];
|
83
|
-
}
|
86
|
+
};
|
87
|
+
return panelNodeSpec;
|
84
88
|
};
|
89
|
+
|
85
90
|
exports.panel = panel;
|
@@ -107,13 +107,13 @@ var isBlockLevelNode = function isBlockLevelNode(node) {
|
|
107
107
|
|
108
108
|
var NOT_INTERNAL_LINKS = [':not([data-inline-card])', ':not([data-block-card])', ':not([data-block-link])', ':not([data-skip-paste])'].join('');
|
109
109
|
var ANCHOR_LINK = "a[href]".concat(NOT_INTERNAL_LINKS);
|
110
|
-
var NOT_INTERNAL_ELEMENTS = [':not(.code-block)', ':not([data-node-type])', ':not([data-embed-card])', ':not([data-layout-section])', ':not([data-pm-slice])', ':not([data-mark-type])'].join('');
|
110
|
+
var NOT_INTERNAL_ELEMENTS = [':not(.code-block)', ':not([data-node-type])', ':not([data-embed-card])', ':not([data-layout-section])', ':not([data-task-local-id])', ':not([data-task-state])', ':not([data-pm-slice])', ':not([data-mark-type])'].join('');
|
111
111
|
var pDOM = ['p', 0];
|
112
112
|
var paragraph = {
|
113
113
|
selectable: false,
|
114
114
|
content: 'inline*',
|
115
115
|
group: 'block',
|
116
|
-
marks: 'strong code em link strike subsup textColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer',
|
116
|
+
marks: 'strong code em link strike subsup textColor typeAheadQuery underline confluenceInlineComment action annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
|
117
117
|
parseDOM: [{
|
118
118
|
tag: 'p'
|
119
119
|
}, {
|
@@ -135,7 +135,7 @@ var createTableSpec = function createTableSpec() {
|
|
135
135
|
var tableNodeSpec = {
|
136
136
|
content: 'tableRow+',
|
137
137
|
attrs: attrs,
|
138
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
138
|
+
marks: 'fragment unsupportedMark unsupportedNodeAttribute',
|
139
139
|
tableRole: 'table',
|
140
140
|
isolating: true,
|
141
141
|
selectable: false,
|
@@ -221,7 +221,7 @@ var tableCell = {
|
|
221
221
|
content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaSingle | mediaGroup | decisionList | taskList | blockCard | embedCard | extension | nestedExpand | unsupportedBlock)+',
|
222
222
|
attrs: cellAttrs,
|
223
223
|
tableRole: 'cell',
|
224
|
-
marks: 'link alignment dataConsumer unsupportedMark unsupportedNodeAttribute',
|
224
|
+
marks: 'link alignment dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
225
225
|
isolating: true,
|
226
226
|
parseDOM: [// Ignore number cell copied from renderer
|
227
227
|
{
|
@@ -258,7 +258,7 @@ var tableHeader = {
|
|
258
258
|
attrs: cellAttrs,
|
259
259
|
tableRole: 'header_cell',
|
260
260
|
isolating: true,
|
261
|
-
marks: 'link alignment dataConsumer unsupportedMark unsupportedNodeAttribute',
|
261
|
+
marks: 'link alignment dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
|
262
262
|
parseDOM: [{
|
263
263
|
tag: 'th',
|
264
264
|
getAttrs: function getAttrs(dom) {
|
package/dist/cjs/utils/index.js
CHANGED
@@ -363,6 +363,18 @@ Object.defineProperty(exports, "normalizeUrl", {
|
|
363
363
|
return _url.normalizeUrl;
|
364
364
|
}
|
365
365
|
});
|
366
|
+
Object.defineProperty(exports, "linkify", {
|
367
|
+
enumerable: true,
|
368
|
+
get: function get() {
|
369
|
+
return _url.linkify;
|
370
|
+
}
|
371
|
+
});
|
372
|
+
Object.defineProperty(exports, "linkifyMatch", {
|
373
|
+
enumerable: true,
|
374
|
+
get: function get() {
|
375
|
+
return _url.linkifyMatch;
|
376
|
+
}
|
377
|
+
});
|
366
378
|
|
367
379
|
var _emoji = require("./confluence/emoji");
|
368
380
|
|