@atlaskit/adf-schema 19.0.0 → 19.2.2
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 +29 -0
- package/dist/cjs/index.js +14 -2
- package/dist/cjs/schema/create-schema.js +3 -0
- package/dist/cjs/schema/default-schema.js +6 -2
- package/dist/cjs/schema/index.js +20 -2
- package/dist/cjs/schema/nodes/index.js +22 -2
- package/dist/cjs/schema/nodes/layout-section.js +35 -3
- package/dist/cjs/schema/nodes/media-inline.js +11 -0
- package/dist/cjs/schema/nodes/media.js +8 -3
- package/dist/cjs/schema/nodes/tableNodes.js +13 -9
- package/dist/cjs/steps/analytics.js +3 -3
- package/dist/cjs/steps/type-ahead.js +134 -0
- package/dist/cjs/steps.js +14 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/create-schema.js +4 -1
- package/dist/es2019/schema/default-schema.js +5 -2
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/index.js +3 -2
- package/dist/es2019/schema/nodes/layout-section.js +34 -1
- package/dist/es2019/schema/nodes/media-inline.js +2 -0
- package/dist/es2019/schema/nodes/media.js +70 -64
- package/dist/es2019/schema/nodes/tableNodes.js +10 -9
- package/dist/es2019/steps/analytics.js +2 -2
- package/dist/es2019/steps/type-ahead.js +85 -0
- package/dist/es2019/steps.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/create-schema.js +4 -1
- package/dist/esm/schema/default-schema.js +5 -2
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/index.js +3 -2
- package/dist/esm/schema/nodes/layout-section.js +32 -1
- package/dist/esm/schema/nodes/media-inline.js +2 -0
- package/dist/esm/schema/nodes/media.js +8 -3
- package/dist/esm/schema/nodes/tableNodes.js +10 -9
- package/dist/esm/steps/analytics.js +3 -3
- package/dist/esm/steps/type-ahead.js +117 -0
- package/dist/esm/steps.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/v1/full.json +131 -97
- package/dist/json-schema/v1/stage-0.json +225 -97
- package/dist/types/index.d.ts +2 -2
- package/dist/types/schema/default-schema.d.ts +1 -1
- package/dist/types/schema/index.d.ts +2 -2
- package/dist/types/schema/nodes/index.d.ts +5 -3
- package/dist/types/schema/nodes/layout-section.d.ts +28 -1
- package/dist/types/schema/nodes/media-inline.d.ts +16 -0
- package/dist/types/schema/nodes/media.d.ts +1 -1
- package/dist/types/schema/nodes/tableNodes.d.ts +11 -1
- package/dist/types/schema/nodes/types/inline-content.d.ts +2 -1
- package/dist/types/steps/type-ahead.d.ts +35 -0
- package/dist/types/steps.d.ts +1 -0
- package/json-schema/v1/full.json +131 -97
- package/json-schema/v1/stage-0.json +225 -97
- package/package.json +3 -3
- package/test-helpers/schema-builder.ts +3 -0
- package/test-helpers/schema.ts +1 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,34 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 19.2.2
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [`b85e7ce12cd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b85e7ce12cd) - Internal upgrade of memoize-one to 6.0.0
|
8
|
+
|
9
|
+
## 19.2.1
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- [`a55dbcb3ecd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a55dbcb3ecd) - [ED-13882] Fix layout section ProseMirror Schema content
|
14
|
+
|
15
|
+
## 19.2.0
|
16
|
+
|
17
|
+
### Minor Changes
|
18
|
+
|
19
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - CETI-72 Web: Copy from renderer loses custom panel attributes
|
20
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - Add single column support for layouts
|
21
|
+
- [`9fbaa50c904`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fbaa50c904) - ED-13133 fixed broken table with sticky headers after undo merge cells with tableCellOptimisation on
|
22
|
+
- [`cf853e39278`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cf853e39278) - [ux] add single layout support for layout
|
23
|
+
- [`6840e64d105`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6840e64d105) - CETI-124: Revert panel content wrapper from span to div
|
24
|
+
|
25
|
+
## 19.1.0
|
26
|
+
|
27
|
+
### Minor Changes
|
28
|
+
|
29
|
+
- [`ad67f6684f1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad67f6684f1) - Add MediaInline to ADF Stage0 schema
|
30
|
+
- [`71bb1bb3cd0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71bb1bb3cd0) - [ED-12933] Add new custom step for TypeAhead local flow control
|
31
|
+
|
3
32
|
## 19.0.0
|
4
33
|
|
5
34
|
### Major Changes
|
package/dist/cjs/index.js
CHANGED
@@ -423,6 +423,12 @@ Object.defineProperty(exports, "mediaSingleWithCaption", {
|
|
423
423
|
return _schema.mediaSingleWithCaption;
|
424
424
|
}
|
425
425
|
});
|
426
|
+
Object.defineProperty(exports, "mediaInline", {
|
427
|
+
enumerable: true,
|
428
|
+
get: function get() {
|
429
|
+
return _schema.mediaInline;
|
430
|
+
}
|
431
|
+
});
|
426
432
|
Object.defineProperty(exports, "mediaSingleToJSON", {
|
427
433
|
enumerable: true,
|
428
434
|
get: function get() {
|
@@ -501,10 +507,16 @@ Object.defineProperty(exports, "sanitizeNodes", {
|
|
501
507
|
return _schema.sanitizeNodes;
|
502
508
|
}
|
503
509
|
});
|
504
|
-
Object.defineProperty(exports, "
|
510
|
+
Object.defineProperty(exports, "getCellAttrs", {
|
511
|
+
enumerable: true,
|
512
|
+
get: function get() {
|
513
|
+
return _schema.getCellAttrs;
|
514
|
+
}
|
515
|
+
});
|
516
|
+
Object.defineProperty(exports, "getCellDomAttrs", {
|
505
517
|
enumerable: true,
|
506
518
|
get: function get() {
|
507
|
-
return _schema.
|
519
|
+
return _schema.getCellDomAttrs;
|
508
520
|
}
|
509
521
|
});
|
510
522
|
Object.defineProperty(exports, "status", {
|
@@ -7,6 +7,8 @@ exports.defaultSchema = exports.getSchemaBasedOnStage = exports.defaultSchemaCon
|
|
7
7
|
|
8
8
|
var _panel = require("./nodes/panel");
|
9
9
|
|
10
|
+
var _layoutSection = require("./nodes/layout-section");
|
11
|
+
|
10
12
|
var _dataConsumer = require("./marks/data-consumer");
|
11
13
|
|
12
14
|
var _createSchema = require("./create-schema");
|
@@ -15,7 +17,7 @@ var _nodes = require("./nodes");
|
|
15
17
|
|
16
18
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
17
19
|
var defaultSchemaConfig = {
|
18
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'mention', 'media', 'mediaGroup', 'mediaSingle', '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'],
|
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'],
|
19
21
|
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,
|
20
22
|
]
|
21
23
|
};
|
@@ -32,12 +34,14 @@ var getSchemaBasedOnStage = function getSchemaBasedOnStage() {
|
|
32
34
|
if (stage === 'stage0') {
|
33
35
|
defaultSchemaConfig.customNodeSpecs = {
|
34
36
|
panel: _panel.customPanel,
|
35
|
-
mediaSingle: _nodes.mediaSingleWithCaption
|
37
|
+
mediaSingle: _nodes.mediaSingleWithCaption,
|
38
|
+
layoutSection: _layoutSection.layoutSectionWithSingleColumn
|
36
39
|
};
|
37
40
|
defaultSchemaConfig.customMarkSpecs = {
|
38
41
|
dataConsumer: _dataConsumer.dataConsumer
|
39
42
|
};
|
40
43
|
defaultSchemaConfig.nodes.push('caption');
|
44
|
+
defaultSchemaConfig.nodes.push('mediaInline');
|
41
45
|
}
|
42
46
|
|
43
47
|
return (0, _createSchema.createSchema)(defaultSchemaConfig);
|
package/dist/cjs/schema/index.js
CHANGED
@@ -185,6 +185,12 @@ Object.defineProperty(exports, "layoutSection", {
|
|
185
185
|
return _nodes.layoutSection;
|
186
186
|
}
|
187
187
|
});
|
188
|
+
Object.defineProperty(exports, "layoutSectionWithSingleColumn", {
|
189
|
+
enumerable: true,
|
190
|
+
get: function get() {
|
191
|
+
return _nodes.layoutSectionWithSingleColumn;
|
192
|
+
}
|
193
|
+
});
|
188
194
|
Object.defineProperty(exports, "listItem", {
|
189
195
|
enumerable: true,
|
190
196
|
get: function get() {
|
@@ -209,6 +215,12 @@ Object.defineProperty(exports, "mediaSingle", {
|
|
209
215
|
return _nodes.mediaSingle;
|
210
216
|
}
|
211
217
|
});
|
218
|
+
Object.defineProperty(exports, "mediaInline", {
|
219
|
+
enumerable: true,
|
220
|
+
get: function get() {
|
221
|
+
return _nodes.mediaInline;
|
222
|
+
}
|
223
|
+
});
|
212
224
|
Object.defineProperty(exports, "mediaSingleWithCaption", {
|
213
225
|
enumerable: true,
|
214
226
|
get: function get() {
|
@@ -287,10 +299,16 @@ Object.defineProperty(exports, "rule", {
|
|
287
299
|
return _nodes.rule;
|
288
300
|
}
|
289
301
|
});
|
290
|
-
Object.defineProperty(exports, "
|
302
|
+
Object.defineProperty(exports, "getCellAttrs", {
|
303
|
+
enumerable: true,
|
304
|
+
get: function get() {
|
305
|
+
return _nodes.getCellAttrs;
|
306
|
+
}
|
307
|
+
});
|
308
|
+
Object.defineProperty(exports, "getCellDomAttrs", {
|
291
309
|
enumerable: true,
|
292
310
|
get: function get() {
|
293
|
-
return _nodes.
|
311
|
+
return _nodes.getCellDomAttrs;
|
294
312
|
}
|
295
313
|
});
|
296
314
|
Object.defineProperty(exports, "status", {
|
@@ -197,6 +197,12 @@ Object.defineProperty(exports, "mediaGroup", {
|
|
197
197
|
return _mediaGroup.mediaGroup;
|
198
198
|
}
|
199
199
|
});
|
200
|
+
Object.defineProperty(exports, "mediaInline", {
|
201
|
+
enumerable: true,
|
202
|
+
get: function get() {
|
203
|
+
return _mediaInline.mediaInline;
|
204
|
+
}
|
205
|
+
});
|
200
206
|
Object.defineProperty(exports, "mediaSingle", {
|
201
207
|
enumerable: true,
|
202
208
|
get: function get() {
|
@@ -275,10 +281,16 @@ Object.defineProperty(exports, "tableBackgroundColorNames", {
|
|
275
281
|
return _tableNodes.tableBackgroundColorNames;
|
276
282
|
}
|
277
283
|
});
|
278
|
-
Object.defineProperty(exports, "
|
284
|
+
Object.defineProperty(exports, "getCellAttrs", {
|
279
285
|
enumerable: true,
|
280
286
|
get: function get() {
|
281
|
-
return _tableNodes.
|
287
|
+
return _tableNodes.getCellAttrs;
|
288
|
+
}
|
289
|
+
});
|
290
|
+
Object.defineProperty(exports, "getCellDomAttrs", {
|
291
|
+
enumerable: true,
|
292
|
+
get: function get() {
|
293
|
+
return _tableNodes.getCellDomAttrs;
|
282
294
|
}
|
283
295
|
});
|
284
296
|
Object.defineProperty(exports, "tablePrefixSelector", {
|
@@ -383,6 +395,12 @@ Object.defineProperty(exports, "layoutSection", {
|
|
383
395
|
return _layoutSection.layoutSection;
|
384
396
|
}
|
385
397
|
});
|
398
|
+
Object.defineProperty(exports, "layoutSectionWithSingleColumn", {
|
399
|
+
enumerable: true,
|
400
|
+
get: function get() {
|
401
|
+
return _layoutSection.layoutSectionWithSingleColumn;
|
402
|
+
}
|
403
|
+
});
|
386
404
|
Object.defineProperty(exports, "layoutColumn", {
|
387
405
|
enumerable: true,
|
388
406
|
get: function get() {
|
@@ -478,6 +496,8 @@ var _media = require("./media");
|
|
478
496
|
|
479
497
|
var _mediaGroup = require("./media-group");
|
480
498
|
|
499
|
+
var _mediaInline = require("./media-inline");
|
500
|
+
|
481
501
|
var _mediaSingle = require("./media-single");
|
482
502
|
|
483
503
|
var _tableNodes = require("./tableNodes");
|
@@ -3,13 +3,45 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.layoutSection = void 0;
|
6
|
+
exports.layoutSectionWithSingleColumn = exports.layoutSection = void 0;
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @name layoutSection_node
|
10
10
|
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Need duplicate `type` and `marks` to make both validator and json-schema satisfied
|
14
|
+
*/
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @name layoutSection_full_node
|
18
|
+
*/
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @stage 0
|
22
|
+
* @name layoutSection_with_single_column_node
|
23
|
+
*/
|
11
24
|
var layoutSection = {
|
12
|
-
content: '(layoutColumn | unsupportedBlock){
|
25
|
+
content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
26
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
27
|
+
isolating: true,
|
28
|
+
parseDOM: [{
|
29
|
+
context: 'layoutSection//|layoutColumn//',
|
30
|
+
tag: 'div[data-layout-section]',
|
31
|
+
skip: true
|
32
|
+
}, {
|
33
|
+
tag: 'div[data-layout-section]'
|
34
|
+
}],
|
35
|
+
toDOM: function toDOM() {
|
36
|
+
var attrs = {
|
37
|
+
'data-layout-section': 'true'
|
38
|
+
};
|
39
|
+
return ['div', attrs, 0];
|
40
|
+
}
|
41
|
+
};
|
42
|
+
exports.layoutSection = layoutSection;
|
43
|
+
var layoutSectionWithSingleColumn = {
|
44
|
+
content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
|
13
45
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
14
46
|
isolating: true,
|
15
47
|
parseDOM: [{
|
@@ -26,4 +58,4 @@ var layoutSection = {
|
|
26
58
|
return ['div', attrs, 0];
|
27
59
|
}
|
28
60
|
};
|
29
|
-
exports.
|
61
|
+
exports.layoutSectionWithSingleColumn = layoutSectionWithSingleColumn;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.mediaInline = void 0;
|
7
|
+
|
8
|
+
var _media = require("./media");
|
9
|
+
|
10
|
+
var mediaInline = (0, _media.createMediaSpec)(_media.defaultAttrs, true);
|
11
|
+
exports.mediaInline = mediaInline;
|
@@ -54,11 +54,16 @@ var defaultAttrs = {
|
|
54
54
|
exports.defaultAttrs = defaultAttrs;
|
55
55
|
|
56
56
|
var createMediaSpec = function createMediaSpec(attributes) {
|
57
|
+
var inline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
58
|
+
var domNodeType = inline ? 'span' : 'div';
|
59
|
+
var nodeName = inline ? 'mediaInline' : 'media';
|
57
60
|
return {
|
58
61
|
selectable: true,
|
62
|
+
inline: inline,
|
63
|
+
group: inline ? 'inline' : undefined,
|
59
64
|
attrs: attributes,
|
60
65
|
parseDOM: [{
|
61
|
-
tag:
|
66
|
+
tag: "".concat(domNodeType, "[data-node-type=\"").concat(nodeName, "\"]"),
|
62
67
|
getAttrs: function getAttrs(dom) {
|
63
68
|
var attrs = {};
|
64
69
|
|
@@ -109,7 +114,7 @@ var createMediaSpec = function createMediaSpec(attributes) {
|
|
109
114
|
toDOM: function toDOM(node) {
|
110
115
|
var attrs = {
|
111
116
|
'data-id': node.attrs.id,
|
112
|
-
'data-node-type':
|
117
|
+
'data-node-type': "".concat(nodeName),
|
113
118
|
'data-type': node.attrs.type,
|
114
119
|
'data-collection': node.attrs.collection,
|
115
120
|
'data-occurrence-key': node.attrs.occurrenceKey,
|
@@ -128,7 +133,7 @@ var createMediaSpec = function createMediaSpec(attributes) {
|
|
128
133
|
copyPrivateAttributes(node.attrs, attrs, function (key) {
|
129
134
|
return "data-".concat(camelCaseToKebabCase(key.slice(2)));
|
130
135
|
});
|
131
|
-
return [
|
136
|
+
return ["".concat(domNodeType), attrs];
|
132
137
|
}
|
133
138
|
};
|
134
139
|
};
|
@@ -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.tableHeader = exports.toJSONTableCell = exports.tableCell = exports.tableRow = exports.tableToJSON = exports.table = exports.tableBackgroundColorNames = exports.tableBackgroundBorderColor = exports.tableBackgroundColorPalette = exports.
|
8
|
+
exports.toJSONTableHeader = exports.tableHeader = exports.toJSONTableCell = exports.tableCell = exports.tableRow = exports.tableToJSON = exports.table = exports.tableBackgroundColorNames = exports.tableBackgroundBorderColor = exports.tableBackgroundColorPalette = exports.getCellDomAttrs = exports.getCellAttrs = exports.tableCellContentDomSelector = exports.tableCellContentWrapperSelector = exports.tableHeaderSelector = exports.tableCellSelector = exports.tablePrefixSelector = void 0;
|
9
9
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
11
|
|
@@ -51,17 +51,21 @@ var getCellAttrs = function getCellAttrs(dom) {
|
|
51
51
|
};
|
52
52
|
};
|
53
53
|
|
54
|
-
|
54
|
+
exports.getCellAttrs = getCellAttrs;
|
55
|
+
|
56
|
+
/**
|
57
|
+
* gets cell dom attributes based on node attributes
|
58
|
+
* @returns CellDomAttrs
|
59
|
+
*/
|
60
|
+
var getCellDomAttrs = function getCellDomAttrs(node) {
|
55
61
|
var attrs = {};
|
56
62
|
var nodeType = node.type.name;
|
57
|
-
var colspan = cell ? parseInt(cell.getAttribute('colspan') || '1', 10) : 1;
|
58
|
-
var rowspan = cell ? parseInt(cell.getAttribute('rowspan') || '1', 10) : 1;
|
59
63
|
|
60
|
-
if (node.attrs.colspan !==
|
64
|
+
if (node.attrs.colspan !== 1) {
|
61
65
|
attrs.colspan = node.attrs.colspan;
|
62
66
|
}
|
63
67
|
|
64
|
-
if (node.attrs.rowspan !==
|
68
|
+
if (node.attrs.rowspan !== 1) {
|
65
69
|
attrs.rowspan = node.attrs.rowspan;
|
66
70
|
}
|
67
71
|
|
@@ -94,7 +98,7 @@ var setCellAttrs = function setCellAttrs(node, cell) {
|
|
94
98
|
return attrs;
|
95
99
|
};
|
96
100
|
|
97
|
-
exports.
|
101
|
+
exports.getCellDomAttrs = getCellDomAttrs;
|
98
102
|
var tableBackgroundColorPalette = new Map();
|
99
103
|
exports.tableBackgroundColorPalette = tableBackgroundColorPalette;
|
100
104
|
|
@@ -230,7 +234,7 @@ var tableCell = {
|
|
230
234
|
}
|
231
235
|
}],
|
232
236
|
toDOM: function toDOM(node) {
|
233
|
-
return ['td',
|
237
|
+
return ['td', getCellDomAttrs(node), 0];
|
234
238
|
}
|
235
239
|
};
|
236
240
|
exports.tableCell = tableCell;
|
@@ -264,7 +268,7 @@ var tableHeader = {
|
|
264
268
|
}
|
265
269
|
}],
|
266
270
|
toDOM: function toDOM(node) {
|
267
|
-
return ['th',
|
271
|
+
return ['th', getCellDomAttrs(node), 0];
|
268
272
|
}
|
269
273
|
};
|
270
274
|
exports.tableHeader = tableHeader;
|
@@ -88,12 +88,12 @@ var AnalyticsStep = /*#__PURE__*/function (_Step) {
|
|
88
88
|
|
89
89
|
var _super = _createSuper(AnalyticsStep);
|
90
90
|
|
91
|
-
function AnalyticsStep(analyticsEvents)
|
92
|
-
{
|
91
|
+
function AnalyticsStep(analyticsEvents) {
|
93
92
|
var _this;
|
94
93
|
|
95
94
|
var actionsToIgnore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
96
|
-
var pos
|
95
|
+
var pos // Used to create the map, prevent splitting history.
|
96
|
+
= arguments.length > 2 ? arguments[2] : undefined;
|
97
97
|
(0, _classCallCheck2.default)(this, AnalyticsStep);
|
98
98
|
_this = _super.call(this);
|
99
99
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "analyticsEvents", []);
|
@@ -0,0 +1,134 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.InsertTypeAheadStep = exports.InsertTypeAheadStages = exports.insertTypeAheadStepType = void 0;
|
9
|
+
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
11
|
+
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
13
|
+
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
15
|
+
|
16
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
17
|
+
|
18
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
19
|
+
|
20
|
+
var _prosemirrorModel = require("prosemirror-model");
|
21
|
+
|
22
|
+
var _prosemirrorTransform = require("prosemirror-transform");
|
23
|
+
|
24
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
25
|
+
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
27
|
+
|
28
|
+
var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
|
29
|
+
exports.insertTypeAheadStepType = insertTypeAheadStepType;
|
30
|
+
var InsertTypeAheadStages;
|
31
|
+
exports.InsertTypeAheadStages = InsertTypeAheadStages;
|
32
|
+
|
33
|
+
(function (InsertTypeAheadStages) {
|
34
|
+
InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
|
35
|
+
InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
|
36
|
+
})(InsertTypeAheadStages || (exports.InsertTypeAheadStages = InsertTypeAheadStages = {}));
|
37
|
+
|
38
|
+
var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
|
39
|
+
(0, _inherits2.default)(InsertTypeAheadStep, _Step);
|
40
|
+
|
41
|
+
var _super = _createSuper(InsertTypeAheadStep);
|
42
|
+
|
43
|
+
function InsertTypeAheadStep(_ref) {
|
44
|
+
var _this;
|
45
|
+
|
46
|
+
var stage = _ref.stage,
|
47
|
+
query = _ref.query,
|
48
|
+
trigger = _ref.trigger,
|
49
|
+
selectedIndex = _ref.selectedIndex;
|
50
|
+
var isInvertStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
51
|
+
(0, _classCallCheck2.default)(this, InsertTypeAheadStep);
|
52
|
+
_this = _super.call(this);
|
53
|
+
_this.isInvertStep = isInvertStep;
|
54
|
+
_this.stage = stage;
|
55
|
+
_this.query = query;
|
56
|
+
_this.trigger = trigger;
|
57
|
+
_this.selectedIndex = selectedIndex;
|
58
|
+
return _this;
|
59
|
+
}
|
60
|
+
|
61
|
+
(0, _createClass2.default)(InsertTypeAheadStep, [{
|
62
|
+
key: "invert",
|
63
|
+
value: function invert() {
|
64
|
+
var config = {
|
65
|
+
stage: this.stage,
|
66
|
+
query: this.query,
|
67
|
+
trigger: this.trigger,
|
68
|
+
selectedIndex: this.selectedIndex
|
69
|
+
};
|
70
|
+
return new InsertTypeAheadStep(config, !this.isInvertStep);
|
71
|
+
}
|
72
|
+
}, {
|
73
|
+
key: "apply",
|
74
|
+
value: function apply(doc) {
|
75
|
+
return _prosemirrorTransform.StepResult.ok(doc);
|
76
|
+
}
|
77
|
+
}, {
|
78
|
+
key: "merge",
|
79
|
+
value: function merge() {
|
80
|
+
return null;
|
81
|
+
}
|
82
|
+
}, {
|
83
|
+
key: "isInsertionStep",
|
84
|
+
value: function isInsertionStep() {
|
85
|
+
return !this.isInvertStep;
|
86
|
+
}
|
87
|
+
}, {
|
88
|
+
key: "isUndoingStep",
|
89
|
+
value: function isUndoingStep() {
|
90
|
+
return this.isInvertStep;
|
91
|
+
}
|
92
|
+
}, {
|
93
|
+
key: "map",
|
94
|
+
value: function map(mapping) {
|
95
|
+
var config = {
|
96
|
+
stage: this.stage,
|
97
|
+
query: this.query,
|
98
|
+
trigger: this.trigger,
|
99
|
+
selectedIndex: this.selectedIndex
|
100
|
+
}; // Return the same events, this step will never be removed
|
101
|
+
|
102
|
+
return new InsertTypeAheadStep(config, this.isInvertStep);
|
103
|
+
}
|
104
|
+
}, {
|
105
|
+
key: "getMap",
|
106
|
+
value: function getMap() {
|
107
|
+
return new _prosemirrorTransform.StepMap([0, 0, 0]);
|
108
|
+
}
|
109
|
+
}, {
|
110
|
+
key: "toJSON",
|
111
|
+
value: function toJSON() {
|
112
|
+
// When serialized we should create a noop Replace step
|
113
|
+
return {
|
114
|
+
stepType: 'replace',
|
115
|
+
from: 0,
|
116
|
+
to: 0
|
117
|
+
};
|
118
|
+
}
|
119
|
+
}], [{
|
120
|
+
key: "fromJSON",
|
121
|
+
value: function fromJSON() {
|
122
|
+
// This is a "local custom step" once serialized
|
123
|
+
// we need to transform it in a no-operation action
|
124
|
+
return new _prosemirrorTransform.ReplaceStep(0, 0, _prosemirrorModel.Slice.empty);
|
125
|
+
}
|
126
|
+
}]);
|
127
|
+
return InsertTypeAheadStep;
|
128
|
+
}(_prosemirrorTransform.Step);
|
129
|
+
/** Register this step with Prosemirror */
|
130
|
+
|
131
|
+
|
132
|
+
exports.InsertTypeAheadStep = InsertTypeAheadStep;
|
133
|
+
|
134
|
+
_prosemirrorTransform.Step.jsonID(insertTypeAheadStepType, InsertTypeAheadStep);
|
package/dist/cjs/steps.js
CHANGED
@@ -15,6 +15,18 @@ Object.defineProperty(exports, "TableSortStep", {
|
|
15
15
|
return _sortColumn.TableSortStep;
|
16
16
|
}
|
17
17
|
});
|
18
|
+
Object.defineProperty(exports, "InsertTypeAheadStages", {
|
19
|
+
enumerable: true,
|
20
|
+
get: function get() {
|
21
|
+
return _typeAhead.InsertTypeAheadStages;
|
22
|
+
}
|
23
|
+
});
|
24
|
+
Object.defineProperty(exports, "InsertTypeAheadStep", {
|
25
|
+
enumerable: true,
|
26
|
+
get: function get() {
|
27
|
+
return _typeAhead.InsertTypeAheadStep;
|
28
|
+
}
|
29
|
+
});
|
18
30
|
Object.defineProperty(exports, "AddColumnStep", {
|
19
31
|
enumerable: true,
|
20
32
|
get: function get() {
|
@@ -38,6 +50,8 @@ var _constants = require("./steps/table/constants");
|
|
38
50
|
|
39
51
|
var _sortColumn = require("./steps/table/sort-column");
|
40
52
|
|
53
|
+
var _typeAhead = require("./steps/type-ahead");
|
54
|
+
|
41
55
|
var _addColumn = require("./steps/table/add-column");
|
42
56
|
|
43
57
|
var _setAttrs = require("./steps/set-attrs");
|
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, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, customPanel, paragraph, placeholder, rule, sanitizeNodes,
|
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, customPanel, 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, 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
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, mediaGroup, mediaSingle, 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';
|
4
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedList, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaGroup, mediaSingle, 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) {
|
@@ -105,6 +105,9 @@ const nodesInOrder = [{
|
|
105
105
|
}, {
|
106
106
|
name: 'mediaSingle',
|
107
107
|
spec: mediaSingle
|
108
|
+
}, {
|
109
|
+
name: 'mediaInline',
|
110
|
+
spec: mediaInline
|
108
111
|
}, {
|
109
112
|
name: 'placeholder',
|
110
113
|
spec: placeholder
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { customPanel } from './nodes/panel';
|
2
|
+
import { layoutSectionWithSingleColumn } from './nodes/layout-section';
|
2
3
|
import { dataConsumer } from './marks/data-consumer';
|
3
4
|
import { createSchema } from './create-schema';
|
4
5
|
import { mediaSingleWithCaption } from './nodes';
|
5
6
|
|
6
7
|
const getDefaultSchemaConfig = () => {
|
7
8
|
let defaultSchemaConfig = {
|
8
|
-
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'panel', 'rule', 'image', 'mention', 'media', 'mediaGroup', 'mediaSingle', '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'],
|
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'],
|
9
10
|
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,
|
10
11
|
]
|
11
12
|
};
|
@@ -19,12 +20,14 @@ export const getSchemaBasedOnStage = (stage = 'final') => {
|
|
19
20
|
if (stage === 'stage0') {
|
20
21
|
defaultSchemaConfig.customNodeSpecs = {
|
21
22
|
panel: customPanel,
|
22
|
-
mediaSingle: mediaSingleWithCaption
|
23
|
+
mediaSingle: mediaSingleWithCaption,
|
24
|
+
layoutSection: layoutSectionWithSingleColumn
|
23
25
|
};
|
24
26
|
defaultSchemaConfig.customMarkSpecs = {
|
25
27
|
dataConsumer: dataConsumer
|
26
28
|
};
|
27
29
|
defaultSchemaConfig.nodes.push('caption');
|
30
|
+
defaultSchemaConfig.nodes.push('mediaInline');
|
28
31
|
}
|
29
32
|
|
30
33
|
return createSchema(defaultSchemaConfig);
|
@@ -1,4 +1,4 @@
|
|
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, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, panel, customPanel, paragraph, placeholder, rule,
|
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, customPanel, 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
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';
|
3
3
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
4
4
|
export { inlineNodes } from './inline-nodes';
|