@atlaskit/adf-schema 19.3.1 → 20.0.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/CHANGELOG.md +26 -0
- package/dist/cjs/index.js +12 -6
- package/dist/cjs/schema/create-schema.js +5 -2
- 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/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 +2 -28
- package/dist/cjs/schema/nodes/paragraph.js +1 -1
- package/dist/cjs/schema/nodes/tableNodes.js +3 -3
- package/dist/cjs/utils/url.js +7 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/create-schema.js +7 -4
- package/dist/es2019/schema/default-schema.js +7 -11
- 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/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 +1 -28
- package/dist/es2019/schema/nodes/paragraph.js +1 -1
- package/dist/es2019/schema/nodes/tableNodes.js +3 -3
- package/dist/es2019/utils/url.js +7 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/create-schema.js +7 -4
- package/dist/esm/schema/default-schema.js +7 -11
- 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/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 +1 -26
- package/dist/esm/schema/nodes/paragraph.js +1 -1
- package/dist/esm/schema/nodes/tableNodes.js +3 -3
- package/dist/esm/utils/url.js +7 -1
- 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 +2 -2
- 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/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,31 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 20.0.0
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- [`3a2a5e14fdc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3a2a5e14fdc) - As we are moving to full schema, merged the customPanel nodeSpec with panel nodeSpec
|
8
|
+
- [`8f0577e0eb1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8f0577e0eb1) - [ux] Promoted captions to full schema and better support of wikimarkup, email and slack renderer
|
9
|
+
|
10
|
+
### Minor Changes
|
11
|
+
|
12
|
+
- [`65a541166fe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65a541166fe) - ED-13766 fix pm node spec for media single with caption
|
13
|
+
- [`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)
|
14
|
+
- [`8bbb96540ea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8bbb96540ea) - Add "fragment" mark to stage0 ADF schema
|
15
|
+
|
16
|
+
### Patch Changes
|
17
|
+
|
18
|
+
- [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) - ED-11632: Bump prosemirror packages;
|
19
|
+
|
20
|
+
- prosmirror-commands 1.1.4 -> 1.1.11,
|
21
|
+
- prosemirror-model 1.11.0 -> 1.14.3,
|
22
|
+
- prosemirror-state 1.3.3 -> 1.3.4,
|
23
|
+
- prosemirror-transform 1.2.8 -> 1.3.2,
|
24
|
+
- prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
|
25
|
+
|
26
|
+
- [`297d113d54b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/297d113d54b) - Unskip backwrd compat test and fix mistakes
|
27
|
+
- Updated dependencies
|
28
|
+
|
3
29
|
## 19.3.1
|
4
30
|
|
5
31
|
### 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() {
|
@@ -108,7 +108,7 @@ var nodesInOrder = [{
|
|
108
108
|
spec: _nodes.codeBlock
|
109
109
|
}, {
|
110
110
|
name: 'panel',
|
111
|
-
spec: _nodes.panel
|
111
|
+
spec: (0, _nodes.panel)(true)
|
112
112
|
}, {
|
113
113
|
name: 'rule',
|
114
114
|
spec: _nodes.rule
|
@@ -129,7 +129,7 @@ var nodesInOrder = [{
|
|
129
129
|
spec: _nodes.mediaGroup
|
130
130
|
}, {
|
131
131
|
name: 'mediaSingle',
|
132
|
-
spec: _nodes.
|
132
|
+
spec: _nodes.mediaSingleWithCaption
|
133
133
|
}, {
|
134
134
|
name: 'mediaInline',
|
135
135
|
spec: _nodes.mediaInline
|
@@ -263,6 +263,9 @@ var marksInOrder = [{
|
|
263
263
|
}, {
|
264
264
|
name: 'dataConsumer',
|
265
265
|
spec: _marks.dataConsumer
|
266
|
+
}, {
|
267
|
+
name: 'fragment',
|
268
|
+
spec: _marks.fragment
|
266
269
|
}, {
|
267
270
|
name: 'indentation',
|
268
271
|
spec: _marks.indentation
|
@@ -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;
|
@@ -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
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports.panel = exports.
|
8
|
+
exports.panel = exports.PanelType = void 0;
|
9
9
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
11
|
|
@@ -67,7 +67,7 @@ var getParseDOMAttrs = function getParseDOMAttrs(allowCustomPanel, dom) {
|
|
67
67
|
return parseDOMAttrs;
|
68
68
|
};
|
69
69
|
|
70
|
-
var
|
70
|
+
var panel = function panel(allowCustomPanel) {
|
71
71
|
var panelNodeSpec = {
|
72
72
|
group: 'block',
|
73
73
|
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
@@ -87,30 +87,4 @@ var customPanel = function customPanel(allowCustomPanel) {
|
|
87
87
|
return panelNodeSpec;
|
88
88
|
};
|
89
89
|
|
90
|
-
exports.customPanel = customPanel;
|
91
|
-
var panel = {
|
92
|
-
group: 'block',
|
93
|
-
content: '(paragraph | heading | bulletList | orderedList | blockCard | unsupportedBlock)+',
|
94
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
95
|
-
attrs: {
|
96
|
-
panelType: {
|
97
|
-
default: 'info'
|
98
|
-
}
|
99
|
-
},
|
100
|
-
parseDOM: [{
|
101
|
-
tag: 'div[data-panel-type]',
|
102
|
-
getAttrs: function getAttrs(dom) {
|
103
|
-
return {
|
104
|
-
panelType: dom.getAttribute('data-panel-type')
|
105
|
-
};
|
106
|
-
}
|
107
|
-
}],
|
108
|
-
toDOM: function toDOM(node) {
|
109
|
-
var panelType = node.attrs.panelType;
|
110
|
-
var attrs = {
|
111
|
-
'data-panel-type': panelType
|
112
|
-
};
|
113
|
-
return ['div', attrs, ['div', {}, 0]];
|
114
|
-
}
|
115
|
-
};
|
116
90
|
exports.panel = panel;
|
@@ -113,7 +113,7 @@ 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/url.js
CHANGED
@@ -14,8 +14,14 @@ var _linkifyIt = _interopRequireDefault(require("linkify-it"));
|
|
14
14
|
var whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im, /^notes:/im, /^hipchat:\/\//im, /^sourcetree:/im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
|
15
15
|
|
16
16
|
var isSafeUrl = function isSafeUrl(url) {
|
17
|
+
var urlTrimmed = url.trim();
|
18
|
+
|
19
|
+
if (urlTrimmed.length === 0) {
|
20
|
+
return true;
|
21
|
+
}
|
22
|
+
|
17
23
|
return whitelistedURLPatterns.some(function (p) {
|
18
|
-
return p.test(
|
24
|
+
return p.test(urlTrimmed);
|
19
25
|
});
|
20
26
|
};
|
21
27
|
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export { AnnotationTypes, PanelType, alignment, alignmentPositionMap, annotation, bitbucketSchema, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceSchema, confluenceSchemaWithMediaSingle, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createJIRASchema, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, defaultSchema, defaultSchemaConfig, doc, em, embedCard, emoji, expand, expandToJSON, extension, getSchemaBasedOnStage, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, isSchemaWithAdvancedTextFormattingMarks, isSchemaWithBlockQuotes, isSchemaWithCodeBlock, isSchemaWithEmojis, isSchemaWithLinks, isSchemaWithLists, isSchemaWithMedia, isSchemaWithMentions, isSchemaWithSubSupMark, isSchemaWithTables, isSchemaWithTextColor, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel,
|
1
|
+
export { AnnotationTypes, PanelType, alignment, alignmentPositionMap, annotation, bitbucketSchema, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceSchema, confluenceSchemaWithMediaSingle, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createJIRASchema, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, defaultSchema, defaultSchemaConfig, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, getSchemaBasedOnStage, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, isSchemaWithAdvancedTextFormattingMarks, isSchemaWithBlockQuotes, isSchemaWithCodeBlock, isSchemaWithEmojis, isSchemaWithLinks, isSchemaWithLists, isSchemaWithMedia, isSchemaWithMentions, isSchemaWithSubSupMark, isSchemaWithTables, isSchemaWithTextColor, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './schema';
|
2
2
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
2
2
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
3
|
-
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer } from './marks';
|
4
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedList, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaGroup,
|
3
|
+
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment } from './marks';
|
4
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedList, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaGroup, mediaSingleWithCaption, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
|
5
5
|
|
6
6
|
function addItems(builtInItems, config, customSpecs = {}) {
|
7
7
|
if (!config) {
|
@@ -83,7 +83,7 @@ const nodesInOrder = [{
|
|
83
83
|
spec: codeBlock
|
84
84
|
}, {
|
85
85
|
name: 'panel',
|
86
|
-
spec: panel
|
86
|
+
spec: panel(true)
|
87
87
|
}, {
|
88
88
|
name: 'rule',
|
89
89
|
spec: rule
|
@@ -104,7 +104,7 @@ const nodesInOrder = [{
|
|
104
104
|
spec: mediaGroup
|
105
105
|
}, {
|
106
106
|
name: 'mediaSingle',
|
107
|
-
spec:
|
107
|
+
spec: mediaSingleWithCaption
|
108
108
|
}, {
|
109
109
|
name: 'mediaInline',
|
110
110
|
spec: mediaInline
|
@@ -238,6 +238,9 @@ const marksInOrder = [{
|
|
238
238
|
}, {
|
239
239
|
name: 'dataConsumer',
|
240
240
|
spec: dataConsumer
|
241
|
+
}, {
|
242
|
+
name: 'fragment',
|
243
|
+
spec: fragment
|
241
244
|
}, {
|
242
245
|
name: 'indentation',
|
243
246
|
spec: indentation
|
@@ -1,12 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import { allowCustomPanel, createSchema } from './create-schema';
|
5
|
-
import { mediaSingleWithCaption } from './nodes';
|
1
|
+
import { layoutSectionWithSingleColumn } from './nodes';
|
2
|
+
import { dataConsumer, fragment } from './marks';
|
3
|
+
import { createSchema } from './create-schema';
|
6
4
|
|
7
5
|
const getDefaultSchemaConfig = () => {
|
8
6
|
let defaultSchemaConfig = {
|
9
|
-
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'],
|
7
|
+
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'],
|
10
8
|
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,
|
11
9
|
]
|
12
10
|
};
|
@@ -15,18 +13,16 @@ const getDefaultSchemaConfig = () => {
|
|
15
13
|
|
16
14
|
export const defaultSchemaConfig = getDefaultSchemaConfig();
|
17
15
|
export const getSchemaBasedOnStage = (stage = 'final') => {
|
18
|
-
const defaultSchemaConfig = getDefaultSchemaConfig();
|
16
|
+
const defaultSchemaConfig = getDefaultSchemaConfig();
|
19
17
|
|
20
18
|
if (stage === 'stage0') {
|
21
19
|
defaultSchemaConfig.customNodeSpecs = {
|
22
|
-
panel: customPanel(allowCustomPanel),
|
23
|
-
mediaSingle: mediaSingleWithCaption,
|
24
20
|
layoutSection: layoutSectionWithSingleColumn
|
25
21
|
};
|
26
22
|
defaultSchemaConfig.customMarkSpecs = {
|
27
|
-
dataConsumer: dataConsumer
|
23
|
+
dataConsumer: dataConsumer,
|
24
|
+
fragment
|
28
25
|
};
|
29
|
-
defaultSchemaConfig.nodes.push('caption');
|
30
26
|
defaultSchemaConfig.nodes.push('mediaInline');
|
31
27
|
}
|
32
28
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel,
|
2
|
-
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline } from './nodes';
|
2
|
+
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
|
3
3
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
4
4
|
export { inlineNodes } from './inline-nodes';
|
5
5
|
export { sanitizeNodes, createSchema } from './create-schema';
|