@atlaskit/adf-schema 19.3.0 → 20.1.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 +45 -0
- package/dist/cjs/index.js +366 -360
- package/dist/cjs/schema/create-schema.js +7 -4
- package/dist/cjs/schema/default-schema.js +8 -14
- package/dist/cjs/schema/groups.js +1 -1
- package/dist/cjs/schema/index.js +244 -238
- package/dist/cjs/schema/jira-schema.js +8 -8
- package/dist/cjs/schema/marks/alignment.js +1 -1
- package/dist/cjs/schema/marks/annotation.js +1 -1
- package/dist/cjs/schema/marks/fragment.js +77 -0
- package/dist/cjs/schema/marks/index.js +63 -49
- package/dist/cjs/schema/marks/link.js +2 -55
- package/dist/cjs/schema/marks/text-color.js +18 -3
- 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/bullet-list.js +1 -1
- package/dist/cjs/schema/nodes/caption.js +0 -1
- package/dist/cjs/schema/nodes/decision-list.js +1 -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 +146 -152
- 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/media.js +1 -1
- package/dist/cjs/schema/nodes/ordered-list.js +1 -1
- package/dist/cjs/schema/nodes/panel.js +2 -28
- package/dist/cjs/schema/nodes/paragraph.js +168 -25
- package/dist/cjs/schema/nodes/tableNodes.js +4 -4
- package/dist/cjs/schema/nodes/task-list.js +1 -1
- package/dist/cjs/steps/analytics.js +1 -1
- package/dist/cjs/steps/table/sort-column.js +1 -1
- package/dist/cjs/steps/table/utils/cell-step.js +1 -1
- package/dist/cjs/steps/table/utils/table-map.js +2 -2
- package/dist/cjs/steps/type-ahead.js +1 -1
- package/dist/cjs/steps.js +10 -10
- package/dist/cjs/utils/colors.js +4 -4
- package/dist/cjs/utils/confluence/emoji.js +1 -1
- package/dist/cjs/utils/extensions.js +1 -1
- package/dist/cjs/utils/index.js +48 -48
- package/dist/cjs/utils/url.js +9 -2
- 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/link.js +3 -51
- package/dist/es2019/schema/marks/text-color.js +15 -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 +163 -25
- 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/link.js +3 -55
- package/dist/esm/schema/marks/text-color.js +17 -3
- 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 +167 -25
- 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
@@ -5,38 +5,181 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.paragraph = void 0;
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
8
|
+
var _prosemirrorModel = require("prosemirror-model");
|
9
|
+
|
10
|
+
var _url = require("../../utils/url");
|
11
|
+
|
12
|
+
var getLinkContent = function getLinkContent(node, schema) {
|
13
|
+
if (!(node instanceof HTMLAnchorElement)) {
|
14
|
+
return _prosemirrorModel.Fragment.empty;
|
15
|
+
}
|
16
|
+
|
17
|
+
var href = node.getAttribute('href') || '';
|
18
|
+
var text = node.innerText;
|
19
|
+
|
20
|
+
if (!text || text.length === 0) {
|
21
|
+
return _prosemirrorModel.Fragment.empty;
|
22
|
+
}
|
23
|
+
|
24
|
+
var marks = (0, _url.isSafeUrl)(href) ? [schema.marks.link.create({
|
25
|
+
href: href
|
26
|
+
})] : [];
|
27
|
+
var textNode = schema.text(text, marks);
|
28
|
+
return _prosemirrorModel.Fragment.from(textNode);
|
29
|
+
};
|
30
|
+
|
31
|
+
var blockTags = {
|
32
|
+
address: true,
|
33
|
+
article: true,
|
34
|
+
aside: true,
|
35
|
+
blockquote: true,
|
36
|
+
canvas: true,
|
37
|
+
dd: true,
|
38
|
+
div: true,
|
39
|
+
dl: true,
|
40
|
+
fieldset: true,
|
41
|
+
figcaption: true,
|
42
|
+
figure: true,
|
43
|
+
footer: true,
|
44
|
+
form: true,
|
45
|
+
h1: true,
|
46
|
+
h2: true,
|
47
|
+
h3: true,
|
48
|
+
h4: true,
|
49
|
+
h5: true,
|
50
|
+
h6: true,
|
51
|
+
header: true,
|
52
|
+
hgroup: true,
|
53
|
+
hr: true,
|
54
|
+
li: true,
|
55
|
+
noscript: true,
|
56
|
+
ol: true,
|
57
|
+
output: true,
|
58
|
+
p: true,
|
59
|
+
pre: true,
|
60
|
+
section: true,
|
61
|
+
table: true,
|
62
|
+
tfoot: true,
|
63
|
+
ul: true
|
64
|
+
};
|
65
|
+
|
66
|
+
var isListItemNode = function isListItemNode(node) {
|
67
|
+
return Boolean(node && node.nodeName.toLowerCase() === 'li');
|
68
|
+
};
|
69
|
+
|
70
|
+
var isTextNode = function isTextNode(node) {
|
71
|
+
return Boolean(node && node.nodeType === Node.TEXT_NODE);
|
72
|
+
};
|
73
|
+
|
74
|
+
var isImageNode = function isImageNode(node) {
|
75
|
+
return Boolean(node && node.nodeName.toLowerCase() === 'img');
|
76
|
+
};
|
77
|
+
|
78
|
+
var hasInlineImage = function hasInlineImage(node) {
|
79
|
+
if (!node) {
|
80
|
+
return false;
|
81
|
+
}
|
82
|
+
|
83
|
+
return Array.from(node.childNodes).some(function (child) {
|
84
|
+
var isImage = isImageNode(child);
|
85
|
+
|
86
|
+
if (!isImage && child.childNodes) {
|
87
|
+
return Array.from(node.childNodes).some(function (node) {
|
88
|
+
return hasInlineImage(node);
|
89
|
+
});
|
90
|
+
}
|
91
|
+
|
92
|
+
return isImage;
|
93
|
+
});
|
94
|
+
};
|
95
|
+
|
96
|
+
var hasWhiteSpacePre = function hasWhiteSpacePre(node) {
|
97
|
+
return Boolean(node instanceof HTMLElement && node.style.whiteSpace === 'pre');
|
98
|
+
};
|
99
|
+
|
100
|
+
var hasFontFamilyMonospace = function hasFontFamilyMonospace(node) {
|
101
|
+
return Boolean(node instanceof HTMLElement && node.style.fontFamily.includes('monospace'));
|
102
|
+
};
|
103
|
+
|
104
|
+
var isBlockLevelNode = function isBlockLevelNode(node) {
|
105
|
+
return Boolean(node && blockTags.hasOwnProperty(node.nodeName.toLowerCase()));
|
106
|
+
};
|
107
|
+
|
108
|
+
var NOT_INTERNAL_LINKS = [':not([data-inline-card])', ':not([data-block-card])', ':not([data-block-link])', ':not([data-skip-paste])'].join('');
|
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-task-local-id])', ':not([data-task-state])', ':not([data-pm-slice])', ':not([data-mark-type])'].join('');
|
32
111
|
var pDOM = ['p', 0];
|
33
112
|
var paragraph = {
|
34
113
|
selectable: false,
|
35
114
|
content: 'inline*',
|
36
115
|
group: 'block',
|
37
|
-
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',
|
38
117
|
parseDOM: [{
|
39
118
|
tag: 'p'
|
119
|
+
}, {
|
120
|
+
tag: "div".concat(NOT_INTERNAL_ELEMENTS, ", li:not([data-pm-slice])"),
|
121
|
+
priority: 100,
|
122
|
+
getAttrs: function getAttrs(node) {
|
123
|
+
if (!(node instanceof Node)) {
|
124
|
+
return false;
|
125
|
+
}
|
126
|
+
|
127
|
+
var isCodeBlock = hasWhiteSpacePre(node) || hasFontFamilyMonospace(node);
|
128
|
+
|
129
|
+
if (isCodeBlock || !node.hasChildNodes()) {
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
|
133
|
+
var hasInlineChildren = Array.from(node.childNodes).every(function (child) {
|
134
|
+
return !isBlockLevelNode(child) && // IMG is considered block for mediaSingle
|
135
|
+
!isImageNode(child);
|
136
|
+
});
|
137
|
+
|
138
|
+
if (!hasInlineChildren) {
|
139
|
+
return false;
|
140
|
+
}
|
141
|
+
|
142
|
+
if ( // We can skip this rule for pure list items
|
143
|
+
isListItemNode(node) && Array.from(node.childNodes).every(isTextNode)) {
|
144
|
+
return false;
|
145
|
+
}
|
146
|
+
|
147
|
+
return null;
|
148
|
+
}
|
149
|
+
}, {
|
150
|
+
tag: ":not(span) + ".concat(ANCHOR_LINK),
|
151
|
+
priority: 100,
|
152
|
+
getContent: getLinkContent
|
153
|
+
}, {
|
154
|
+
tag: ":not(span) > ".concat(ANCHOR_LINK, ":first-child"),
|
155
|
+
getAttrs: function getAttrs(node) {
|
156
|
+
if (!(node instanceof Node)) {
|
157
|
+
return false;
|
158
|
+
}
|
159
|
+
|
160
|
+
if (isBlockLevelNode(node.firstChild)) {
|
161
|
+
return null;
|
162
|
+
}
|
163
|
+
|
164
|
+
if (hasInlineImage(node)) {
|
165
|
+
return false;
|
166
|
+
}
|
167
|
+
|
168
|
+
var isNextSiblingValid = node.nextSibling === null || node.nextSibling instanceof Text && (node.nextSibling.textContent || '').trim().length === 0;
|
169
|
+
|
170
|
+
if (isNextSiblingValid) {
|
171
|
+
return null;
|
172
|
+
} // This rule should not match when there is any sibling after the anchor
|
173
|
+
|
174
|
+
|
175
|
+
if (!isBlockLevelNode(node.nextSibling)) {
|
176
|
+
return false;
|
177
|
+
}
|
178
|
+
|
179
|
+
return null;
|
180
|
+
},
|
181
|
+
priority: 100,
|
182
|
+
getContent: getLinkContent
|
40
183
|
}],
|
41
184
|
toDOM: function toDOM() {
|
42
185
|
return pDOM;
|
@@ -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.toJSONTableHeader = exports.
|
8
|
+
exports.toJSONTableHeader = exports.toJSONTableCell = exports.tableToJSON = exports.tableRow = exports.tablePrefixSelector = exports.tableHeaderSelector = exports.tableHeader = exports.tableCellSelector = exports.tableCellContentWrapperSelector = exports.tableCellContentDomSelector = exports.tableCell = exports.tableBackgroundColorPalette = exports.tableBackgroundColorNames = exports.tableBackgroundBorderColor = exports.table = exports.getCellDomAttrs = exports.getCellAttrs = void 0;
|
9
9
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
11
|
|
@@ -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) {
|
@@ -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.
|
8
|
+
exports.analyticsStepType = exports.analyticsInvertStepType = exports.AnalyticsStep = void 0;
|
9
9
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
11
11
|
|
@@ -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.
|
8
|
+
exports.tableSortingStepType = exports.TableSortStep = void 0;
|
9
9
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11
11
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.applyCellStep = applyCellStep;
|
9
|
+
exports.createCellStep = createCellStep;
|
9
10
|
exports.getMapFromCellStep = getMapFromCellStep;
|
10
11
|
exports.invertCellStep = invertCellStep;
|
11
|
-
exports.createCellStep = createCellStep;
|
12
12
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
14
14
|
|
@@ -3,11 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.getCellIndex = void 0;
|
6
7
|
exports.hasMergedColumns = hasMergedColumns;
|
7
8
|
exports.hasMergedRows = hasMergedRows;
|
8
|
-
exports.isRootRow = isRootRow;
|
9
9
|
exports.isRootCol = isRootCol;
|
10
|
-
exports.
|
10
|
+
exports.isRootRow = isRootRow;
|
11
11
|
|
12
12
|
var getCellIndex = function getCellIndex(map, row, col) {
|
13
13
|
return row * map.width + col;
|
@@ -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.
|
8
|
+
exports.insertTypeAheadStepType = exports.InsertTypeAheadStep = exports.InsertTypeAheadStages = void 0;
|
9
9
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11
11
|
|
package/dist/cjs/steps.js
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "
|
6
|
+
Object.defineProperty(exports, "AddColumnStep", {
|
7
7
|
enumerable: true,
|
8
8
|
get: function get() {
|
9
|
-
return
|
9
|
+
return _addColumn.AddColumnStep;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "AnalyticsStep", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function get() {
|
15
|
-
return
|
15
|
+
return _analytics.AnalyticsStep;
|
16
16
|
}
|
17
17
|
});
|
18
18
|
Object.defineProperty(exports, "InsertTypeAheadStages", {
|
@@ -27,22 +27,22 @@ Object.defineProperty(exports, "InsertTypeAheadStep", {
|
|
27
27
|
return _typeAhead.InsertTypeAheadStep;
|
28
28
|
}
|
29
29
|
});
|
30
|
-
Object.defineProperty(exports, "
|
30
|
+
Object.defineProperty(exports, "SetAttrsStep", {
|
31
31
|
enumerable: true,
|
32
32
|
get: function get() {
|
33
|
-
return
|
33
|
+
return _setAttrs.SetAttrsStep;
|
34
34
|
}
|
35
35
|
});
|
36
|
-
Object.defineProperty(exports, "
|
36
|
+
Object.defineProperty(exports, "TableSortOrder", {
|
37
37
|
enumerable: true,
|
38
38
|
get: function get() {
|
39
|
-
return
|
39
|
+
return _constants.SortOrder;
|
40
40
|
}
|
41
41
|
});
|
42
|
-
Object.defineProperty(exports, "
|
42
|
+
Object.defineProperty(exports, "TableSortStep", {
|
43
43
|
enumerable: true,
|
44
44
|
get: function get() {
|
45
|
-
return
|
45
|
+
return _sortColumn.TableSortStep;
|
46
46
|
}
|
47
47
|
});
|
48
48
|
|
package/dist/cjs/utils/colors.js
CHANGED
@@ -7,13 +7,13 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
9
9
|
});
|
10
|
-
exports.
|
10
|
+
exports.Y75 = exports.Y500 = exports.Y50 = exports.Y400 = exports.Y200 = exports.T75 = exports.T500 = exports.T50 = exports.T300 = exports.T100 = exports.R75 = exports.R500 = exports.R50 = exports.R400 = exports.R300 = exports.R100 = exports.P75 = exports.P500 = exports.P50 = exports.P400 = exports.P300 = exports.P100 = exports.N90 = exports.N800 = exports.N80 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N0 = exports.G75 = exports.G500 = exports.G50 = exports.G400 = exports.G300 = exports.G200 = exports.B75 = exports.B500 = exports.B50 = exports.B400 = exports.B100 = void 0;
|
11
11
|
exports.hexToRgb = hexToRgb;
|
12
12
|
exports.hexToRgba = hexToRgba;
|
13
|
-
exports.rgbToHex = rgbToHex;
|
14
|
-
exports.isRgb = isRgb;
|
15
13
|
exports.isHex = isHex;
|
16
|
-
exports.
|
14
|
+
exports.isRgb = isRgb;
|
15
|
+
exports.normalizeHexColor = normalizeHexColor;
|
16
|
+
exports.rgbToHex = rgbToHex;
|
17
17
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
19
19
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.acNameToEmoji = acNameToEmoji;
|
7
|
-
exports.emojiIdToAcName = emojiIdToAcName;
|
8
7
|
exports.acShortcutToEmoji = acShortcutToEmoji;
|
8
|
+
exports.emojiIdToAcName = emojiIdToAcName;
|
9
9
|
exports.getEmojiAcName = getEmojiAcName;
|
10
10
|
// Default emoji id for Confluence glyphs that has no match to Fabric Emoji
|
11
11
|
var DEFAULT_EMOJI_ID = '2b50'; // Default ac:name for emoticons as a fallback is `blue-star`
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.isValidLayout = exports.getExtensionAttrs = void 0;
|
7
7
|
|
8
8
|
var isValidLayout = function isValidLayout(name) {
|
9
9
|
return !!name && ['default', 'wide', 'full-width'].includes(name);
|
package/dist/cjs/utils/index.js
CHANGED
@@ -3,42 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "acNameToEmoji", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _emoji.acNameToEmoji;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "acShortcutToEmoji", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _emoji.acShortcutToEmoji;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
Object.defineProperty(exports, "emojiIdToAcName", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function get() {
|
21
|
-
return _emoji.emojiIdToAcName;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
Object.defineProperty(exports, "getEmojiAcName", {
|
25
|
-
enumerable: true,
|
26
|
-
get: function get() {
|
27
|
-
return _emoji.getEmojiAcName;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
Object.defineProperty(exports, "generateUuid", {
|
31
|
-
enumerable: true,
|
32
|
-
get: function get() {
|
33
|
-
return _uuid.generateUuid;
|
34
|
-
}
|
35
|
-
});
|
36
|
-
Object.defineProperty(exports, "uuid", {
|
37
|
-
enumerable: true,
|
38
|
-
get: function get() {
|
39
|
-
return _uuid.uuid;
|
40
|
-
}
|
41
|
-
});
|
42
6
|
Object.defineProperty(exports, "B100", {
|
43
7
|
enumerable: true,
|
44
8
|
get: function get() {
|
@@ -309,6 +273,42 @@ Object.defineProperty(exports, "Y75", {
|
|
309
273
|
return _colors.Y75;
|
310
274
|
}
|
311
275
|
});
|
276
|
+
Object.defineProperty(exports, "acNameToEmoji", {
|
277
|
+
enumerable: true,
|
278
|
+
get: function get() {
|
279
|
+
return _emoji.acNameToEmoji;
|
280
|
+
}
|
281
|
+
});
|
282
|
+
Object.defineProperty(exports, "acShortcutToEmoji", {
|
283
|
+
enumerable: true,
|
284
|
+
get: function get() {
|
285
|
+
return _emoji.acShortcutToEmoji;
|
286
|
+
}
|
287
|
+
});
|
288
|
+
Object.defineProperty(exports, "emojiIdToAcName", {
|
289
|
+
enumerable: true,
|
290
|
+
get: function get() {
|
291
|
+
return _emoji.emojiIdToAcName;
|
292
|
+
}
|
293
|
+
});
|
294
|
+
Object.defineProperty(exports, "generateUuid", {
|
295
|
+
enumerable: true,
|
296
|
+
get: function get() {
|
297
|
+
return _uuid.generateUuid;
|
298
|
+
}
|
299
|
+
});
|
300
|
+
Object.defineProperty(exports, "getEmojiAcName", {
|
301
|
+
enumerable: true,
|
302
|
+
get: function get() {
|
303
|
+
return _emoji.getEmojiAcName;
|
304
|
+
}
|
305
|
+
});
|
306
|
+
Object.defineProperty(exports, "getLinkMatch", {
|
307
|
+
enumerable: true,
|
308
|
+
get: function get() {
|
309
|
+
return _url.getLinkMatch;
|
310
|
+
}
|
311
|
+
});
|
312
312
|
Object.defineProperty(exports, "hexToRgb", {
|
313
313
|
enumerable: true,
|
314
314
|
get: function get() {
|
@@ -333,28 +333,28 @@ Object.defineProperty(exports, "isRgb", {
|
|
333
333
|
return _colors.isRgb;
|
334
334
|
}
|
335
335
|
});
|
336
|
-
Object.defineProperty(exports, "
|
336
|
+
Object.defineProperty(exports, "isSafeUrl", {
|
337
337
|
enumerable: true,
|
338
338
|
get: function get() {
|
339
|
-
return
|
339
|
+
return _url.isSafeUrl;
|
340
340
|
}
|
341
341
|
});
|
342
|
-
Object.defineProperty(exports, "
|
342
|
+
Object.defineProperty(exports, "linkify", {
|
343
343
|
enumerable: true,
|
344
344
|
get: function get() {
|
345
|
-
return
|
345
|
+
return _url.linkify;
|
346
346
|
}
|
347
347
|
});
|
348
|
-
Object.defineProperty(exports, "
|
348
|
+
Object.defineProperty(exports, "linkifyMatch", {
|
349
349
|
enumerable: true,
|
350
350
|
get: function get() {
|
351
|
-
return _url.
|
351
|
+
return _url.linkifyMatch;
|
352
352
|
}
|
353
353
|
});
|
354
|
-
Object.defineProperty(exports, "
|
354
|
+
Object.defineProperty(exports, "normalizeHexColor", {
|
355
355
|
enumerable: true,
|
356
356
|
get: function get() {
|
357
|
-
return
|
357
|
+
return _colors.normalizeHexColor;
|
358
358
|
}
|
359
359
|
});
|
360
360
|
Object.defineProperty(exports, "normalizeUrl", {
|
@@ -363,16 +363,16 @@ Object.defineProperty(exports, "normalizeUrl", {
|
|
363
363
|
return _url.normalizeUrl;
|
364
364
|
}
|
365
365
|
});
|
366
|
-
Object.defineProperty(exports, "
|
366
|
+
Object.defineProperty(exports, "rgbToHex", {
|
367
367
|
enumerable: true,
|
368
368
|
get: function get() {
|
369
|
-
return
|
369
|
+
return _colors.rgbToHex;
|
370
370
|
}
|
371
371
|
});
|
372
|
-
Object.defineProperty(exports, "
|
372
|
+
Object.defineProperty(exports, "uuid", {
|
373
373
|
enumerable: true,
|
374
374
|
get: function get() {
|
375
|
-
return
|
375
|
+
return _uuid.uuid;
|
376
376
|
}
|
377
377
|
});
|
378
378
|
|
package/dist/cjs/utils/url.js
CHANGED
@@ -5,17 +5,24 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
+
exports.LINK_REGEXP = void 0;
|
8
9
|
exports.getLinkMatch = getLinkMatch;
|
10
|
+
exports.linkifyMatch = exports.linkify = exports.isSafeUrl = void 0;
|
9
11
|
exports.normalizeUrl = normalizeUrl;
|
10
|
-
exports.linkifyMatch = exports.LINK_REGEXP = exports.linkify = exports.isSafeUrl = void 0;
|
11
12
|
|
12
13
|
var _linkifyIt = _interopRequireDefault(require("linkify-it"));
|
13
14
|
|
14
15
|
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
16
|
|
16
17
|
var isSafeUrl = function isSafeUrl(url) {
|
18
|
+
var urlTrimmed = url.trim();
|
19
|
+
|
20
|
+
if (urlTrimmed.length === 0) {
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
|
17
24
|
return whitelistedURLPatterns.some(function (p) {
|
18
|
-
return p.test(
|
25
|
+
return p.test(urlTrimmed);
|
19
26
|
});
|
20
27
|
};
|
21
28
|
|
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
|