@atlaskit/adf-schema 25.3.2 → 25.4.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 +11 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/schema/create-schema.js +3 -0
- package/dist/cjs/schema/default-schema.js +4 -0
- package/dist/cjs/schema/index.js +12 -0
- package/dist/cjs/schema/marks/border.js +52 -0
- package/dist/cjs/schema/marks/index.js +14 -1
- package/dist/cjs/schema/nodes/media-group.js +4 -1
- package/dist/cjs/schema/nodes/media-single.js +1 -1
- package/dist/cjs/utils/colors.js +7 -1
- 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 +4 -0
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/marks/border.js +37 -0
- package/dist/es2019/schema/marks/index.js +2 -1
- package/dist/es2019/schema/nodes/media-group.js +4 -1
- package/dist/es2019/schema/nodes/media-single.js +1 -1
- package/dist/es2019/utils/colors.js +3 -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 +4 -0
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/marks/border.js +43 -0
- package/dist/esm/schema/marks/index.js +2 -1
- package/dist/esm/schema/nodes/media-group.js +4 -1
- package/dist/esm/schema/nodes/media-single.js +1 -1
- package/dist/esm/utils/colors.js +3 -0
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/v1/stage-0.json +42 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/schema/index.d.ts +2 -2
- package/dist/types/schema/marks/border.d.ts +24 -0
- package/dist/types/schema/marks/index.d.ts +2 -0
- package/dist/types/schema/nodes/media.d.ts +2 -1
- package/dist/types/utils/colors.d.ts +3 -0
- package/json-schema/v1/stage-0.json +42 -1
- package/package.json +4 -4
- package/report.api.md +24 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 25.4.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [`bf04c417bfd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bf04c417bfd) - Add "border" mark to stage0 ADF schema
|
8
|
+
- [`af9a85063e5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/af9a85063e5) - add image border toolbar
|
9
|
+
|
10
|
+
### Patch Changes
|
11
|
+
|
12
|
+
- Updated dependencies
|
13
|
+
|
3
14
|
## 25.3.2
|
4
15
|
|
5
16
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
@@ -339,6 +339,18 @@ Object.defineProperty(exports, "bodiedExtension", {
|
|
339
339
|
return _schema.bodiedExtension;
|
340
340
|
}
|
341
341
|
});
|
342
|
+
Object.defineProperty(exports, "border", {
|
343
|
+
enumerable: true,
|
344
|
+
get: function get() {
|
345
|
+
return _schema.border;
|
346
|
+
}
|
347
|
+
});
|
348
|
+
Object.defineProperty(exports, "borderColorPalette", {
|
349
|
+
enumerable: true,
|
350
|
+
get: function get() {
|
351
|
+
return _schema.borderColorPalette;
|
352
|
+
}
|
353
|
+
});
|
342
354
|
Object.defineProperty(exports, "breakout", {
|
343
355
|
enumerable: true,
|
344
356
|
get: function get() {
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.getSchemaBasedOnStage = exports.defaultSchemaConfig = exports.defaultSchema = void 0;
|
7
7
|
var _nodes = require("./nodes");
|
8
|
+
var _marks = require("./marks");
|
8
9
|
var _createSchema = require("./create-schema");
|
9
10
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
10
11
|
var defaultSchemaConfig = {
|
@@ -24,6 +25,9 @@ var getSchemaBasedOnStage = function getSchemaBasedOnStage() {
|
|
24
25
|
defaultSchemaConfig.customNodeSpecs = {
|
25
26
|
layoutSection: _nodes.layoutSectionWithSingleColumn
|
26
27
|
};
|
28
|
+
defaultSchemaConfig.customMarkSpecs = {
|
29
|
+
border: _marks.border
|
30
|
+
};
|
27
31
|
}
|
28
32
|
return (0, _createSchema.createSchema)(defaultSchemaConfig);
|
29
33
|
};
|
package/dist/cjs/schema/index.js
CHANGED
@@ -57,6 +57,18 @@ Object.defineProperty(exports, "bodiedExtension", {
|
|
57
57
|
return _nodes.bodiedExtension;
|
58
58
|
}
|
59
59
|
});
|
60
|
+
Object.defineProperty(exports, "border", {
|
61
|
+
enumerable: true,
|
62
|
+
get: function get() {
|
63
|
+
return _marks.border;
|
64
|
+
}
|
65
|
+
});
|
66
|
+
Object.defineProperty(exports, "borderColorPalette", {
|
67
|
+
enumerable: true,
|
68
|
+
get: function get() {
|
69
|
+
return _marks.borderColorPalette;
|
70
|
+
}
|
71
|
+
});
|
60
72
|
Object.defineProperty(exports, "breakout", {
|
61
73
|
enumerable: true,
|
62
74
|
get: function get() {
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.borderColorPalette = exports.border = void 0;
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
9
|
+
var _editorPalette = require("@atlaskit/editor-palette");
|
10
|
+
var _colors = require("../../utils/colors");
|
11
|
+
var borderColorArrayPalette = [[_colors.N300A, 'Subtle gray'], [_colors.N600, 'Gray'], [_colors.N1000, 'Bold gray']];
|
12
|
+
var borderColorPalette = new Map();
|
13
|
+
exports.borderColorPalette = borderColorPalette;
|
14
|
+
borderColorArrayPalette.forEach(function (_ref) {
|
15
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
16
|
+
color = _ref2[0],
|
17
|
+
label = _ref2[1];
|
18
|
+
return borderColorPalette.set(color.toLowerCase(), label);
|
19
|
+
});
|
20
|
+
var border = {
|
21
|
+
inclusive: false,
|
22
|
+
parseDOM: [{
|
23
|
+
tag: 'div[data-mark-type="border"]',
|
24
|
+
getAttrs: function getAttrs(domNode) {
|
25
|
+
var _dom$getAttribute, _dom$getAttribute2;
|
26
|
+
var dom = domNode;
|
27
|
+
var color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
|
28
|
+
var size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
|
29
|
+
return {
|
30
|
+
size: size > 3 ? 3 : size < 1 ? false : size,
|
31
|
+
color: borderColorPalette.has(color) ? color : false
|
32
|
+
};
|
33
|
+
}
|
34
|
+
}],
|
35
|
+
attrs: {
|
36
|
+
color: {},
|
37
|
+
size: {}
|
38
|
+
},
|
39
|
+
toDOM: function toDOM(mark) {
|
40
|
+
// Note -- while there is no way to create custom colors using default tooling
|
41
|
+
// the editor does supported ad hoc color values -- and there may be content
|
42
|
+
// which has been migrated or created via apis which use such values.
|
43
|
+
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(mark.attrs.color) || mark.attrs.color;
|
44
|
+
return ['div', {
|
45
|
+
'data-mark-type': 'border',
|
46
|
+
'data-color': mark.attrs.color,
|
47
|
+
'data-size': mark.attrs.size,
|
48
|
+
style: "--custom-palette-color: ".concat(paletteColorValue)
|
49
|
+
}];
|
50
|
+
}
|
51
|
+
};
|
52
|
+
exports.border = border;
|
@@ -33,6 +33,18 @@ Object.defineProperty(exports, "annotation", {
|
|
33
33
|
return _annotation.annotation;
|
34
34
|
}
|
35
35
|
});
|
36
|
+
Object.defineProperty(exports, "border", {
|
37
|
+
enumerable: true,
|
38
|
+
get: function get() {
|
39
|
+
return _border.border;
|
40
|
+
}
|
41
|
+
});
|
42
|
+
Object.defineProperty(exports, "borderColorPalette", {
|
43
|
+
enumerable: true,
|
44
|
+
get: function get() {
|
45
|
+
return _border.borderColorPalette;
|
46
|
+
}
|
47
|
+
});
|
36
48
|
Object.defineProperty(exports, "breakout", {
|
37
49
|
enumerable: true,
|
38
50
|
get: function get() {
|
@@ -182,4 +194,5 @@ var _annotation = require("./annotation");
|
|
182
194
|
var _unsupportedMark = require("./unsupported-mark");
|
183
195
|
var _unsupportedNodeAttributes = require("./unsupported-node-attributes");
|
184
196
|
var _dataConsumer = require("./data-consumer");
|
185
|
-
var _fragment = require("./fragment");
|
197
|
+
var _fragment = require("./fragment");
|
198
|
+
var _border = require("./border");
|
@@ -8,12 +8,15 @@ exports.mediaGroup = void 0;
|
|
8
8
|
* @name mediaGroup_node
|
9
9
|
*/
|
10
10
|
|
11
|
+
// Temporary due to an existing issue in validator below:
|
12
|
+
// https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
|
13
|
+
// TODO: Remove border and link marks from white list
|
11
14
|
var mediaGroup = {
|
12
15
|
inline: false,
|
13
16
|
group: 'block',
|
14
17
|
content: '(media|unsupportedBlock)+',
|
15
18
|
attrs: {},
|
16
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
19
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
17
20
|
selectable: false,
|
18
21
|
parseDOM: [{
|
19
22
|
tag: 'div[data-node-type="mediaGroup"]'
|
@@ -46,7 +46,7 @@ var mediaSingle = {
|
|
46
46
|
atom: true,
|
47
47
|
content: 'media|unsupportedBlock+|media unsupportedBlock+',
|
48
48
|
attrs: defaultAttrs,
|
49
|
-
marks: 'unsupportedMark unsupportedNodeAttribute link',
|
49
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
50
50
|
parseDOM: [{
|
51
51
|
tag: 'div[data-node-type="mediaSingle"]',
|
52
52
|
getAttrs: function getAttrs(dom) {
|
package/dist/cjs/utils/colors.js
CHANGED
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
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;
|
8
|
+
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.N600 = exports.N60 = exports.N500 = exports.N50 = exports.N40 = exports.N300A = exports.N300 = exports.N30 = exports.N200 = exports.N20 = exports.N1000 = 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;
|
9
9
|
exports.hexToRgb = hexToRgb;
|
10
10
|
exports.hexToRgba = hexToRgba;
|
11
11
|
exports.isHex = isHex;
|
@@ -89,10 +89,16 @@ var N200 = '#6B778C';
|
|
89
89
|
exports.N200 = N200;
|
90
90
|
var N300 = '#5E6C84';
|
91
91
|
exports.N300 = N300;
|
92
|
+
var N300A = '#091E4224';
|
93
|
+
exports.N300A = N300A;
|
92
94
|
var N500 = '#42526E';
|
93
95
|
exports.N500 = N500;
|
96
|
+
var N600 = '#758195';
|
97
|
+
exports.N600 = N600;
|
94
98
|
var N800 = '#172B4D';
|
95
99
|
exports.N800 = N800;
|
100
|
+
var N1000 = '#172B4D';
|
101
|
+
exports.N1000 = N1000;
|
96
102
|
var P50 = '#EAE6FF';
|
97
103
|
exports.P50 = P50;
|
98
104
|
var P75 = '#C0B6F2';
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, border, borderColorPalette } from './schema';
|
3
3
|
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,6 +1,6 @@
|
|
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, fragment } from './marks';
|
3
|
+
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
|
4
4
|
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, 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
|
function addItems(builtInItems, config, customSpecs = {}) {
|
6
6
|
if (!config) {
|
@@ -239,6 +239,9 @@ const marksInOrder = [{
|
|
239
239
|
}, {
|
240
240
|
name: 'indentation',
|
241
241
|
spec: indentation
|
242
|
+
}, {
|
243
|
+
name: 'border',
|
244
|
+
spec: border
|
242
245
|
}, {
|
243
246
|
name: 'unsupportedMark',
|
244
247
|
spec: unsupportedMark
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { layoutSectionWithSingleColumn } from './nodes';
|
2
|
+
import { border } from './marks';
|
2
3
|
import { createSchema } from './create-schema';
|
3
4
|
const getDefaultSchemaConfig = () => {
|
4
5
|
let defaultSchemaConfig = {
|
@@ -16,6 +17,9 @@ export const getSchemaBasedOnStage = (stage = 'final') => {
|
|
16
17
|
defaultSchemaConfig.customNodeSpecs = {
|
17
18
|
layoutSection: layoutSectionWithSingleColumn
|
18
19
|
};
|
20
|
+
defaultSchemaConfig.customMarkSpecs = {
|
21
|
+
border
|
22
|
+
};
|
19
23
|
}
|
20
24
|
return createSchema(defaultSchemaConfig);
|
21
25
|
};
|
@@ -1,6 +1,6 @@
|
|
1
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, orderedListWithOrder, 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
2
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
|
-
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
|
3
|
+
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './marks';
|
4
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
5
5
|
export { inlineNodes } from './inline-nodes';
|
6
6
|
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
2
|
+
import { N300A, N600, N1000 } from '../../utils/colors';
|
3
|
+
const borderColorArrayPalette = [[N300A, 'Subtle gray'], [N600, 'Gray'], [N1000, 'Bold gray']];
|
4
|
+
export const borderColorPalette = new Map();
|
5
|
+
borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color.toLowerCase(), label));
|
6
|
+
export const border = {
|
7
|
+
inclusive: false,
|
8
|
+
parseDOM: [{
|
9
|
+
tag: 'div[data-mark-type="border"]',
|
10
|
+
getAttrs: domNode => {
|
11
|
+
var _dom$getAttribute, _dom$getAttribute2;
|
12
|
+
const dom = domNode;
|
13
|
+
const color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
|
14
|
+
const size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
|
15
|
+
return {
|
16
|
+
size: size > 3 ? 3 : size < 1 ? false : size,
|
17
|
+
color: borderColorPalette.has(color) ? color : false
|
18
|
+
};
|
19
|
+
}
|
20
|
+
}],
|
21
|
+
attrs: {
|
22
|
+
color: {},
|
23
|
+
size: {}
|
24
|
+
},
|
25
|
+
toDOM(mark) {
|
26
|
+
// Note -- while there is no way to create custom colors using default tooling
|
27
|
+
// the editor does supported ad hoc color values -- and there may be content
|
28
|
+
// which has been migrated or created via apis which use such values.
|
29
|
+
const paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
30
|
+
return ['div', {
|
31
|
+
'data-mark-type': 'border',
|
32
|
+
'data-color': mark.attrs.color,
|
33
|
+
'data-size': mark.attrs.size,
|
34
|
+
style: `--custom-palette-color: ${paletteColorValue}`
|
35
|
+
}];
|
36
|
+
}
|
37
|
+
};
|
@@ -15,4 +15,5 @@ export { annotation, AnnotationMarkStates, buildDataAttributes as buildAnnotatio
|
|
15
15
|
export { unsupportedMark } from './unsupported-mark';
|
16
16
|
export { unsupportedNodeAttribute } from './unsupported-node-attributes';
|
17
17
|
export { dataConsumer, toJSON as dataConsumerToJSON } from './data-consumer';
|
18
|
-
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
18
|
+
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
19
|
+
export { border, borderColorPalette } from './border';
|
@@ -2,12 +2,15 @@
|
|
2
2
|
* @name mediaGroup_node
|
3
3
|
*/
|
4
4
|
|
5
|
+
// Temporary due to an existing issue in validator below:
|
6
|
+
// https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
|
7
|
+
// TODO: Remove border and link marks from white list
|
5
8
|
export const mediaGroup = {
|
6
9
|
inline: false,
|
7
10
|
group: 'block',
|
8
11
|
content: '(media|unsupportedBlock)+',
|
9
12
|
attrs: {},
|
10
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
13
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
11
14
|
selectable: false,
|
12
15
|
parseDOM: [{
|
13
16
|
tag: 'div[data-node-type="mediaGroup"]'
|
@@ -35,7 +35,7 @@ export const mediaSingle = {
|
|
35
35
|
atom: true,
|
36
36
|
content: 'media|unsupportedBlock+|media unsupportedBlock+',
|
37
37
|
attrs: defaultAttrs,
|
38
|
-
marks: 'unsupportedMark unsupportedNodeAttribute link',
|
38
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
39
39
|
parseDOM: [{
|
40
40
|
tag: 'div[data-node-type="mediaSingle"]',
|
41
41
|
getAttrs: dom => ({
|
@@ -39,8 +39,11 @@ export const N80 = '#97A0AF';
|
|
39
39
|
export const N90 = '#8993A4';
|
40
40
|
export const N200 = '#6B778C';
|
41
41
|
export const N300 = '#5E6C84';
|
42
|
+
export const N300A = '#091E4224';
|
42
43
|
export const N500 = '#42526E';
|
44
|
+
export const N600 = '#758195';
|
43
45
|
export const N800 = '#172B4D';
|
46
|
+
export const N1000 = '#172B4D';
|
44
47
|
export const P50 = '#EAE6FF';
|
45
48
|
export const P75 = '#C0B6F2';
|
46
49
|
export const P100 = '#998DD9';
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, border, borderColorPalette } from './schema';
|
3
3
|
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';
|
@@ -3,7 +3,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
4
|
import { Schema } from 'prosemirror-model';
|
5
5
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
6
|
-
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment } from './marks';
|
6
|
+
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
|
7
7
|
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, 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';
|
8
8
|
function addItems(builtInItems, config) {
|
9
9
|
var customSpecs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
@@ -244,6 +244,9 @@ var marksInOrder = [{
|
|
244
244
|
}, {
|
245
245
|
name: 'indentation',
|
246
246
|
spec: indentation
|
247
|
+
}, {
|
248
|
+
name: 'border',
|
249
|
+
spec: border
|
247
250
|
}, {
|
248
251
|
name: 'unsupportedMark',
|
249
252
|
spec: unsupportedMark
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { layoutSectionWithSingleColumn } from './nodes';
|
2
|
+
import { border } from './marks';
|
2
3
|
import { createSchema } from './create-schema';
|
3
4
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
4
5
|
var defaultSchemaConfig = {
|
@@ -17,6 +18,9 @@ export var getSchemaBasedOnStage = function getSchemaBasedOnStage() {
|
|
17
18
|
defaultSchemaConfig.customNodeSpecs = {
|
18
19
|
layoutSection: layoutSectionWithSingleColumn
|
19
20
|
};
|
21
|
+
defaultSchemaConfig.customMarkSpecs = {
|
22
|
+
border: border
|
23
|
+
};
|
20
24
|
}
|
21
25
|
return createSchema(defaultSchemaConfig);
|
22
26
|
};
|
package/dist/esm/schema/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
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, orderedListWithOrder, 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
2
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
|
-
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute } from './marks';
|
3
|
+
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette } from './marks';
|
4
4
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
5
5
|
export { inlineNodes } from './inline-nodes';
|
6
6
|
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
|
+
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
3
|
+
import { N300A, N600, N1000 } from '../../utils/colors';
|
4
|
+
var borderColorArrayPalette = [[N300A, 'Subtle gray'], [N600, 'Gray'], [N1000, 'Bold gray']];
|
5
|
+
export var borderColorPalette = new Map();
|
6
|
+
borderColorArrayPalette.forEach(function (_ref) {
|
7
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
8
|
+
color = _ref2[0],
|
9
|
+
label = _ref2[1];
|
10
|
+
return borderColorPalette.set(color.toLowerCase(), label);
|
11
|
+
});
|
12
|
+
export var border = {
|
13
|
+
inclusive: false,
|
14
|
+
parseDOM: [{
|
15
|
+
tag: 'div[data-mark-type="border"]',
|
16
|
+
getAttrs: function getAttrs(domNode) {
|
17
|
+
var _dom$getAttribute, _dom$getAttribute2;
|
18
|
+
var dom = domNode;
|
19
|
+
var color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
|
20
|
+
var size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
|
21
|
+
return {
|
22
|
+
size: size > 3 ? 3 : size < 1 ? false : size,
|
23
|
+
color: borderColorPalette.has(color) ? color : false
|
24
|
+
};
|
25
|
+
}
|
26
|
+
}],
|
27
|
+
attrs: {
|
28
|
+
color: {},
|
29
|
+
size: {}
|
30
|
+
},
|
31
|
+
toDOM: function toDOM(mark) {
|
32
|
+
// Note -- while there is no way to create custom colors using default tooling
|
33
|
+
// the editor does supported ad hoc color values -- and there may be content
|
34
|
+
// which has been migrated or created via apis which use such values.
|
35
|
+
var paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
36
|
+
return ['div', {
|
37
|
+
'data-mark-type': 'border',
|
38
|
+
'data-color': mark.attrs.color,
|
39
|
+
'data-size': mark.attrs.size,
|
40
|
+
style: "--custom-palette-color: ".concat(paletteColorValue)
|
41
|
+
}];
|
42
|
+
}
|
43
|
+
};
|
@@ -15,4 +15,5 @@ export { annotation, AnnotationMarkStates, buildDataAttributes as buildAnnotatio
|
|
15
15
|
export { unsupportedMark } from './unsupported-mark';
|
16
16
|
export { unsupportedNodeAttribute } from './unsupported-node-attributes';
|
17
17
|
export { dataConsumer, toJSON as dataConsumerToJSON } from './data-consumer';
|
18
|
-
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
18
|
+
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
19
|
+
export { border, borderColorPalette } from './border';
|
@@ -2,12 +2,15 @@
|
|
2
2
|
* @name mediaGroup_node
|
3
3
|
*/
|
4
4
|
|
5
|
+
// Temporary due to an existing issue in validator below:
|
6
|
+
// https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
|
7
|
+
// TODO: Remove border and link marks from white list
|
5
8
|
export var mediaGroup = {
|
6
9
|
inline: false,
|
7
10
|
group: 'block',
|
8
11
|
content: '(media|unsupportedBlock)+',
|
9
12
|
attrs: {},
|
10
|
-
marks: 'unsupportedMark unsupportedNodeAttribute',
|
13
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
11
14
|
selectable: false,
|
12
15
|
parseDOM: [{
|
13
16
|
tag: 'div[data-node-type="mediaGroup"]'
|
@@ -38,7 +38,7 @@ export var mediaSingle = {
|
|
38
38
|
atom: true,
|
39
39
|
content: 'media|unsupportedBlock+|media unsupportedBlock+',
|
40
40
|
attrs: defaultAttrs,
|
41
|
-
marks: 'unsupportedMark unsupportedNodeAttribute link',
|
41
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
42
42
|
parseDOM: [{
|
43
43
|
tag: 'div[data-node-type="mediaSingle"]',
|
44
44
|
getAttrs: function getAttrs(dom) {
|
package/dist/esm/utils/colors.js
CHANGED
@@ -40,8 +40,11 @@ export var N80 = '#97A0AF';
|
|
40
40
|
export var N90 = '#8993A4';
|
41
41
|
export var N200 = '#6B778C';
|
42
42
|
export var N300 = '#5E6C84';
|
43
|
+
export var N300A = '#091E4224';
|
43
44
|
export var N500 = '#42526E';
|
45
|
+
export var N600 = '#758195';
|
44
46
|
export var N800 = '#172B4D';
|
47
|
+
export var N1000 = '#172B4D';
|
45
48
|
export var P50 = '#EAE6FF';
|
46
49
|
export var P75 = '#C0B6F2';
|
47
50
|
export var P100 = '#998DD9';
|
package/dist/esm/version.json
CHANGED
@@ -458,6 +458,40 @@
|
|
458
458
|
],
|
459
459
|
"additionalProperties": false
|
460
460
|
},
|
461
|
+
"border_mark": {
|
462
|
+
"type": "object",
|
463
|
+
"properties": {
|
464
|
+
"type": {
|
465
|
+
"enum": [
|
466
|
+
"border"
|
467
|
+
]
|
468
|
+
},
|
469
|
+
"attrs": {
|
470
|
+
"type": "object",
|
471
|
+
"properties": {
|
472
|
+
"size": {
|
473
|
+
"type": "number",
|
474
|
+
"minimum": 1,
|
475
|
+
"maximum": 3
|
476
|
+
},
|
477
|
+
"color": {
|
478
|
+
"type": "string",
|
479
|
+
"pattern": "^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$"
|
480
|
+
}
|
481
|
+
},
|
482
|
+
"required": [
|
483
|
+
"size",
|
484
|
+
"color"
|
485
|
+
],
|
486
|
+
"additionalProperties": false
|
487
|
+
}
|
488
|
+
},
|
489
|
+
"required": [
|
490
|
+
"type",
|
491
|
+
"attrs"
|
492
|
+
],
|
493
|
+
"additionalProperties": false
|
494
|
+
},
|
461
495
|
"hardBreak_node": {
|
462
496
|
"type": "object",
|
463
497
|
"properties": {
|
@@ -887,7 +921,14 @@
|
|
887
921
|
"marks": {
|
888
922
|
"type": "array",
|
889
923
|
"items": {
|
890
|
-
"
|
924
|
+
"anyOf": [
|
925
|
+
{
|
926
|
+
"$ref": "#/definitions/link_mark"
|
927
|
+
},
|
928
|
+
{
|
929
|
+
"$ref": "#/definitions/border_mark"
|
930
|
+
}
|
931
|
+
]
|
891
932
|
}
|
892
933
|
}
|
893
934
|
},
|
package/dist/types/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette,
|
2
2
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
3
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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';
|
4
|
-
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, } from './schema';
|
3
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, border, borderColorPalette, } from './schema';
|
4
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, } from './schema';
|
5
5
|
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';
|
6
6
|
export type { Match, NameToEmoji } from './utils';
|
@@ -2,8 +2,8 @@ export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletLi
|
|
2
2
|
export type { BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionBaseDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextDefinition, UrlType, RichMediaAttributes, RichMediaLayout, CellDomAttrs, } from './nodes';
|
3
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
4
4
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
5
|
-
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, } from './marks';
|
6
|
-
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, CodeDefinition, EmDefinition, FragmentAttributes, FragmentDefinition, IndentationMarkAttributes, IndentationMarkDefinition, LinkAttributes, LinkDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TextColorAttributes, TextColorDefinition, UnderlineDefinition, AnnotationId, AnnotationDataAttributes, DataConsumerAttributes, DataConsumerDefinition, } from './marks';
|
5
|
+
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, } from './marks';
|
6
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, CodeDefinition, EmDefinition, FragmentAttributes, FragmentDefinition, IndentationMarkAttributes, IndentationMarkDefinition, LinkAttributes, LinkDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TextColorAttributes, TextColorDefinition, UnderlineDefinition, AnnotationId, AnnotationDataAttributes, DataConsumerAttributes, DataConsumerDefinition, BorderMarkAttributes, BorderMarkDefinition, } from './marks';
|
7
7
|
export { unsupportedNodeTypesForMediaCards } from './unsupported';
|
8
8
|
export { inlineNodes } from './inline-nodes';
|
9
9
|
export { sanitizeNodes, createSchema } from './create-schema';
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { MarkSpec } from 'prosemirror-model';
|
2
|
+
export declare type BorderMarkAttributes = {
|
3
|
+
/**
|
4
|
+
* @minimum 1
|
5
|
+
* @maximum 3
|
6
|
+
*/
|
7
|
+
size: number;
|
8
|
+
/**
|
9
|
+
* @pattern "^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$"
|
10
|
+
*/
|
11
|
+
color: string;
|
12
|
+
};
|
13
|
+
/**
|
14
|
+
* @name border_mark
|
15
|
+
* @stage 0
|
16
|
+
* @description This mark adds decoration to an element, and any element decorated with it will also have a border style.
|
17
|
+
*/
|
18
|
+
export interface BorderMarkDefinition {
|
19
|
+
type: 'border';
|
20
|
+
attrs: BorderMarkAttributes;
|
21
|
+
}
|
22
|
+
export declare type BorderColorKey = 'Subtle gray' | 'Gray' | 'Bold gray';
|
23
|
+
export declare const borderColorPalette: Map<string, BorderColorKey>;
|
24
|
+
export declare const border: MarkSpec;
|
@@ -30,3 +30,5 @@ export type { DataConsumerAttributes, DataConsumerDefinition, } from './data-con
|
|
30
30
|
export { dataConsumer, toJSON as dataConsumerToJSON } from './data-consumer';
|
31
31
|
export type { FragmentAttributes, FragmentDefinition, LocalId, } from './fragment';
|
32
32
|
export { fragment, toJSON as fragmentToJSON } from './fragment';
|
33
|
+
export { border, borderColorPalette } from './border';
|
34
|
+
export type { BorderMarkAttributes, BorderMarkDefinition } from './border';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { NodeSpec, Node as PMNode } from 'prosemirror-model';
|
2
|
+
import { BorderMarkDefinition } from '../marks/border';
|
2
3
|
import { LinkDefinition } from '../marks/link';
|
3
4
|
export declare type MediaType = 'file' | 'link' | 'external';
|
4
5
|
export declare type DisplayType = 'file' | 'thumbnail';
|
@@ -16,7 +17,7 @@ export interface MediaDefinition {
|
|
16
17
|
* @minItems 1
|
17
18
|
*/
|
18
19
|
attrs: MediaADFAttrs;
|
19
|
-
marks?: Array<LinkDefinition>;
|
20
|
+
marks?: Array<LinkDefinition | BorderMarkDefinition>;
|
20
21
|
}
|
21
22
|
export interface MediaBaseAttributes {
|
22
23
|
/**
|
@@ -36,8 +36,11 @@ export declare const N80 = "#97A0AF";
|
|
36
36
|
export declare const N90 = "#8993A4";
|
37
37
|
export declare const N200 = "#6B778C";
|
38
38
|
export declare const N300 = "#5E6C84";
|
39
|
+
export declare const N300A = "#091E4224";
|
39
40
|
export declare const N500 = "#42526E";
|
41
|
+
export declare const N600 = "#758195";
|
40
42
|
export declare const N800 = "#172B4D";
|
43
|
+
export declare const N1000 = "#172B4D";
|
41
44
|
export declare const P50 = "#EAE6FF";
|
42
45
|
export declare const P75 = "#C0B6F2";
|
43
46
|
export declare const P100 = "#998DD9";
|
@@ -458,6 +458,40 @@
|
|
458
458
|
],
|
459
459
|
"additionalProperties": false
|
460
460
|
},
|
461
|
+
"border_mark": {
|
462
|
+
"type": "object",
|
463
|
+
"properties": {
|
464
|
+
"type": {
|
465
|
+
"enum": [
|
466
|
+
"border"
|
467
|
+
]
|
468
|
+
},
|
469
|
+
"attrs": {
|
470
|
+
"type": "object",
|
471
|
+
"properties": {
|
472
|
+
"size": {
|
473
|
+
"type": "number",
|
474
|
+
"minimum": 1,
|
475
|
+
"maximum": 3
|
476
|
+
},
|
477
|
+
"color": {
|
478
|
+
"type": "string",
|
479
|
+
"pattern": "^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$"
|
480
|
+
}
|
481
|
+
},
|
482
|
+
"required": [
|
483
|
+
"size",
|
484
|
+
"color"
|
485
|
+
],
|
486
|
+
"additionalProperties": false
|
487
|
+
}
|
488
|
+
},
|
489
|
+
"required": [
|
490
|
+
"type",
|
491
|
+
"attrs"
|
492
|
+
],
|
493
|
+
"additionalProperties": false
|
494
|
+
},
|
461
495
|
"hardBreak_node": {
|
462
496
|
"type": "object",
|
463
497
|
"properties": {
|
@@ -887,7 +921,14 @@
|
|
887
921
|
"marks": {
|
888
922
|
"type": "array",
|
889
923
|
"items": {
|
890
|
-
"
|
924
|
+
"anyOf": [
|
925
|
+
{
|
926
|
+
"$ref": "#/definitions/link_mark"
|
927
|
+
},
|
928
|
+
{
|
929
|
+
"$ref": "#/definitions/border_mark"
|
930
|
+
}
|
931
|
+
]
|
891
932
|
}
|
892
933
|
}
|
893
934
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "25.
|
3
|
+
"version": "25.4.0",
|
4
4
|
"description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -40,7 +40,7 @@
|
|
40
40
|
},
|
41
41
|
"dependencies": {
|
42
42
|
"@atlaskit/codemod-utils": "^4.1.0",
|
43
|
-
"@atlaskit/editor-palette": "1.
|
43
|
+
"@atlaskit/editor-palette": "1.2.0",
|
44
44
|
"@atlaskit/editor-tables": "^2.2.0",
|
45
45
|
"@atlaskit/tokens": "^1.2.1",
|
46
46
|
"@babel/runtime": "^7.0.0",
|
@@ -54,9 +54,9 @@
|
|
54
54
|
"prosemirror-transform": "1.3.2"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
57
|
-
"@atlaskit/adf-utils": "^18.
|
57
|
+
"@atlaskit/adf-utils": "^18.1.0",
|
58
58
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
59
|
-
"@atlaskit/editor-test-helpers": "^18.
|
59
|
+
"@atlaskit/editor-test-helpers": "^18.2.0",
|
60
60
|
"@atlaskit/json-schema-generator": "^3.3.0",
|
61
61
|
"@atlassian/adf-sample": "^1.1.0",
|
62
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
package/report.api.md
CHANGED
@@ -206,6 +206,29 @@ interface BodiedExtensionBaseDefinition {
|
|
206
206
|
export type BodiedExtensionDefinition = BodiedExtensionBaseDefinition &
|
207
207
|
MarksObject<DataConsumerDefinition | FragmentDefinition>;
|
208
208
|
|
209
|
+
// @public (undocumented)
|
210
|
+
export const border: MarkSpec;
|
211
|
+
|
212
|
+
// @public (undocumented)
|
213
|
+
type BorderColorKey = 'Bold gray' | 'Gray' | 'Subtle gray';
|
214
|
+
|
215
|
+
// @public (undocumented)
|
216
|
+
export const borderColorPalette: Map<string, BorderColorKey>;
|
217
|
+
|
218
|
+
// @public (undocumented)
|
219
|
+
export type BorderMarkAttributes = {
|
220
|
+
size: number;
|
221
|
+
color: string;
|
222
|
+
};
|
223
|
+
|
224
|
+
// @public
|
225
|
+
export interface BorderMarkDefinition {
|
226
|
+
// (undocumented)
|
227
|
+
attrs: BorderMarkAttributes;
|
228
|
+
// (undocumented)
|
229
|
+
type: 'border';
|
230
|
+
}
|
231
|
+
|
209
232
|
// @public (undocumented)
|
210
233
|
export const breakout: MarkSpec;
|
211
234
|
|
@@ -1027,7 +1050,7 @@ export interface MediaDefinition {
|
|
1027
1050
|
// (undocumented)
|
1028
1051
|
attrs: MediaADFAttrs;
|
1029
1052
|
// (undocumented)
|
1030
|
-
marks?: Array<LinkDefinition>;
|
1053
|
+
marks?: Array<BorderMarkDefinition | LinkDefinition>;
|
1031
1054
|
// (undocumented)
|
1032
1055
|
type: 'media';
|
1033
1056
|
}
|