@atlaskit/adf-schema 35.1.1 → 35.3.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 +12 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/schema/create-schema.js +2 -2
- package/dist/cjs/schema/index.js +12 -0
- package/dist/cjs/schema/marks/border.js +5 -3
- package/dist/cjs/schema/nodes/index.js +12 -0
- package/dist/cjs/schema/nodes/list-item.js +20 -2
- package/dist/cjs/schema/nodes/panel.js +33 -2
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/create-schema.js +3 -3
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/marks/border.js +5 -3
- package/dist/es2019/schema/nodes/index.js +2 -2
- package/dist/es2019/schema/nodes/list-item.js +17 -0
- package/dist/es2019/schema/nodes/panel.js +28 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/create-schema.js +3 -3
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/marks/border.js +5 -3
- package/dist/esm/schema/nodes/index.js +2 -2
- package/dist/esm/schema/nodes/list-item.js +17 -0
- package/dist/esm/schema/nodes/panel.js +30 -0
- package/dist/json-schema/v1/full.json +217 -193
- package/dist/json-schema/v1/stage-0.json +224 -200
- package/dist/types/index.d.ts +1 -1
- package/dist/types/schema/index.d.ts +1 -1
- package/dist/types/schema/nodes/index.d.ts +2 -2
- package/dist/types/schema/nodes/list-item.d.ts +5 -0
- package/dist/types/schema/nodes/panel.d.ts +14 -1
- package/dist/types/schema/nodes/types/list.d.ts +2 -1
- package/json-schema/v1/full.json +217 -193
- package/json-schema/v1/stage-0.json +224 -200
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 35.3.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 529022b: ED-21611: Adding node-nesting rules for task inside list, and media, codeblock, rule, action and decision inside panel.
|
8
|
+
|
9
|
+
## 35.2.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- b241b07: Add inline support for border mark
|
14
|
+
|
3
15
|
## 35.1.1
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
@@ -531,6 +531,12 @@ Object.defineProperty(exports, "expandToJSON", {
|
|
531
531
|
return _schema.expandToJSON;
|
532
532
|
}
|
533
533
|
});
|
534
|
+
Object.defineProperty(exports, "extendedPanel", {
|
535
|
+
enumerable: true,
|
536
|
+
get: function get() {
|
537
|
+
return _schema.extendedPanel;
|
538
|
+
}
|
539
|
+
});
|
534
540
|
Object.defineProperty(exports, "extension", {
|
535
541
|
enumerable: true,
|
536
542
|
get: function get() {
|
@@ -705,6 +711,12 @@ Object.defineProperty(exports, "listItem", {
|
|
705
711
|
return _schema.listItem;
|
706
712
|
}
|
707
713
|
});
|
714
|
+
Object.defineProperty(exports, "listItemWithTask", {
|
715
|
+
enumerable: true,
|
716
|
+
get: function get() {
|
717
|
+
return _schema.listItemWithTask;
|
718
|
+
}
|
719
|
+
});
|
708
720
|
Object.defineProperty(exports, "media", {
|
709
721
|
enumerable: true,
|
710
722
|
get: function get() {
|
@@ -81,7 +81,7 @@ var nodesInOrder = [{
|
|
81
81
|
spec: _nodes.orderedListWithOrder
|
82
82
|
}, {
|
83
83
|
name: 'listItem',
|
84
|
-
spec: _nodes.
|
84
|
+
spec: _nodes.listItemWithTask
|
85
85
|
}, {
|
86
86
|
name: 'heading',
|
87
87
|
spec: _nodes.heading
|
@@ -93,7 +93,7 @@ var nodesInOrder = [{
|
|
93
93
|
spec: _nodes.codeBlock
|
94
94
|
}, {
|
95
95
|
name: 'panel',
|
96
|
-
spec: (0, _nodes.
|
96
|
+
spec: (0, _nodes.extendedPanel)(true)
|
97
97
|
}, {
|
98
98
|
name: 'rule',
|
99
99
|
spec: _nodes.rule
|
package/dist/cjs/schema/index.js
CHANGED
@@ -243,6 +243,12 @@ Object.defineProperty(exports, "expandToJSON", {
|
|
243
243
|
return _nodes.expandToJSON;
|
244
244
|
}
|
245
245
|
});
|
246
|
+
Object.defineProperty(exports, "extendedPanel", {
|
247
|
+
enumerable: true,
|
248
|
+
get: function get() {
|
249
|
+
return _nodes.extendedPanel;
|
250
|
+
}
|
251
|
+
});
|
246
252
|
Object.defineProperty(exports, "extension", {
|
247
253
|
enumerable: true,
|
248
254
|
get: function get() {
|
@@ -357,6 +363,12 @@ Object.defineProperty(exports, "listItem", {
|
|
357
363
|
return _nodes.listItem;
|
358
364
|
}
|
359
365
|
});
|
366
|
+
Object.defineProperty(exports, "listItemWithTask", {
|
367
|
+
enumerable: true,
|
368
|
+
get: function get() {
|
369
|
+
return _nodes.listItemWithTask;
|
370
|
+
}
|
371
|
+
});
|
360
372
|
Object.defineProperty(exports, "media", {
|
361
373
|
enumerable: true,
|
362
374
|
get: function get() {
|
@@ -25,7 +25,7 @@ borderColorArrayPalette.forEach(function (_ref) {
|
|
25
25
|
var border = {
|
26
26
|
inclusive: false,
|
27
27
|
parseDOM: [{
|
28
|
-
tag: '
|
28
|
+
tag: '[data-mark-type="border"]',
|
29
29
|
getAttrs: function getAttrs(domNode) {
|
30
30
|
var _dom$getAttribute, _dom$getAttribute2;
|
31
31
|
var dom = domNode;
|
@@ -41,12 +41,14 @@ var border = {
|
|
41
41
|
color: {},
|
42
42
|
size: {}
|
43
43
|
},
|
44
|
-
toDOM: function toDOM(mark) {
|
44
|
+
toDOM: function toDOM(mark, isInline) {
|
45
|
+
var wrapperStyle = isInline ? 'span' : 'div';
|
46
|
+
|
45
47
|
// Note -- while there is no way to create custom colors using default tooling
|
46
48
|
// the editor does supported ad hoc color values -- and there may be content
|
47
49
|
// which has been migrated or created via apis which use such values.
|
48
50
|
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(mark.attrs.color) || mark.attrs.color;
|
49
|
-
return [
|
51
|
+
return [wrapperStyle, {
|
50
52
|
'data-mark-type': 'border',
|
51
53
|
'data-color': mark.attrs.color,
|
52
54
|
'data-size': mark.attrs.size,
|
@@ -142,6 +142,12 @@ Object.defineProperty(exports, "expandToJSON", {
|
|
142
142
|
return _expand.toJSON;
|
143
143
|
}
|
144
144
|
});
|
145
|
+
Object.defineProperty(exports, "extendedPanel", {
|
146
|
+
enumerable: true,
|
147
|
+
get: function get() {
|
148
|
+
return _panel.extendedPanel;
|
149
|
+
}
|
150
|
+
});
|
145
151
|
Object.defineProperty(exports, "extension", {
|
146
152
|
enumerable: true,
|
147
153
|
get: function get() {
|
@@ -220,6 +226,12 @@ Object.defineProperty(exports, "listItem", {
|
|
220
226
|
return _listItem.listItem;
|
221
227
|
}
|
222
228
|
});
|
229
|
+
Object.defineProperty(exports, "listItemWithTask", {
|
230
|
+
enumerable: true,
|
231
|
+
get: function get() {
|
232
|
+
return _listItem.listItemWithTask;
|
233
|
+
}
|
234
|
+
});
|
223
235
|
Object.defineProperty(exports, "media", {
|
224
236
|
enumerable: true,
|
225
237
|
get: function get() {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.listItem = void 0;
|
6
|
+
exports.listItemWithTask = exports.listItem = void 0;
|
7
7
|
var listItem = {
|
8
8
|
content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock | unsupportedBlock)*',
|
9
9
|
marks: 'unsupportedMark unsupportedNodeAttribute',
|
@@ -16,4 +16,22 @@ var listItem = {
|
|
16
16
|
return ['li', 0];
|
17
17
|
}
|
18
18
|
};
|
19
|
-
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @name list_item_with_task
|
22
|
+
* @description this node allows task-list to be nested inside list-item
|
23
|
+
*/
|
24
|
+
exports.listItem = listItem;
|
25
|
+
var listItemWithTask = {
|
26
|
+
content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | taskList | mediaSingle | codeBlock | unsupportedBlock)*',
|
27
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
28
|
+
defining: true,
|
29
|
+
selectable: false,
|
30
|
+
parseDOM: [{
|
31
|
+
tag: 'li'
|
32
|
+
}],
|
33
|
+
toDOM: function toDOM() {
|
34
|
+
return ['li', 0];
|
35
|
+
}
|
36
|
+
};
|
37
|
+
exports.listItemWithTask = listItemWithTask;
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
5
5
|
value: true
|
6
6
|
});
|
7
|
-
exports.panel = exports.PanelType = void 0;
|
7
|
+
exports.panel = exports.extendedPanel = exports.PanelType = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
10
10
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
@@ -91,4 +91,35 @@ var panel = function panel(allowCustomPanel) {
|
|
91
91
|
};
|
92
92
|
return panelNodeSpec;
|
93
93
|
};
|
94
|
-
|
94
|
+
|
95
|
+
/**
|
96
|
+
* @name extended_panel
|
97
|
+
* @description it allows more content to be nested as compared to panel node.
|
98
|
+
* Specifically, it allows Media, action, code-block, rule and decision nodes in
|
99
|
+
* addition to content allowed inside panel
|
100
|
+
*/
|
101
|
+
exports.panel = panel;
|
102
|
+
var extendedPanel = function extendedPanel(allowCustomPanel) {
|
103
|
+
var panelNodeSpec = {
|
104
|
+
group: 'block',
|
105
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock)+',
|
106
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
107
|
+
attrs: getDefaultAttrs(),
|
108
|
+
selectable: true,
|
109
|
+
parseDOM: [{
|
110
|
+
tag: 'div[data-panel-type]',
|
111
|
+
getAttrs: function getAttrs(dom) {
|
112
|
+
return getParseDOMAttrs(allowCustomPanel, dom);
|
113
|
+
}
|
114
|
+
}],
|
115
|
+
toDOM: function toDOM(node) {
|
116
|
+
var attrs = getDomAttrs(node.attrs);
|
117
|
+
var contentAttrs = {
|
118
|
+
'data-panel-content': 'true'
|
119
|
+
};
|
120
|
+
return ['div', attrs, ['div', contentAttrs, 0]];
|
121
|
+
}
|
122
|
+
};
|
123
|
+
return panelNodeSpec;
|
124
|
+
};
|
125
|
+
exports.extendedPanel = extendedPanel;
|
package/dist/es2019/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, 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, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension } 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension } 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, getDarkModeLCHColor } from './utils';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Schema } from '@atlaskit/editor-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, fragment, border } from './marks';
|
4
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder,
|
4
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItemWithTask, heading, blockquoteWithList, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, 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) {
|
7
7
|
return {};
|
@@ -66,7 +66,7 @@ const nodesInOrder = [{
|
|
66
66
|
spec: orderedListWithOrder
|
67
67
|
}, {
|
68
68
|
name: 'listItem',
|
69
|
-
spec:
|
69
|
+
spec: listItemWithTask
|
70
70
|
}, {
|
71
71
|
name: 'heading',
|
72
72
|
spec: heading
|
@@ -78,7 +78,7 @@ const nodesInOrder = [{
|
|
78
78
|
spec: codeBlock
|
79
79
|
}, {
|
80
80
|
name: 'panel',
|
81
|
-
spec:
|
81
|
+
spec: extendedPanel(true)
|
82
82
|
}, {
|
83
83
|
name: 'rule',
|
84
84
|
spec: rule
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
|
1
|
+
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } 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
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';
|
@@ -12,7 +12,7 @@ borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color
|
|
12
12
|
export const border = {
|
13
13
|
inclusive: false,
|
14
14
|
parseDOM: [{
|
15
|
-
tag: '
|
15
|
+
tag: '[data-mark-type="border"]',
|
16
16
|
getAttrs: domNode => {
|
17
17
|
var _dom$getAttribute, _dom$getAttribute2;
|
18
18
|
const dom = domNode;
|
@@ -28,12 +28,14 @@ export const border = {
|
|
28
28
|
color: {},
|
29
29
|
size: {}
|
30
30
|
},
|
31
|
-
toDOM(mark) {
|
31
|
+
toDOM(mark, isInline) {
|
32
|
+
const wrapperStyle = isInline ? 'span' : 'div';
|
33
|
+
|
32
34
|
// Note -- while there is no way to create custom colors using default tooling
|
33
35
|
// the editor does supported ad hoc color values -- and there may be content
|
34
36
|
// which has been migrated or created via apis which use such values.
|
35
37
|
const paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
36
|
-
return [
|
38
|
+
return [wrapperStyle, {
|
37
39
|
'data-mark-type': 'border',
|
38
40
|
'data-color': mark.attrs.color,
|
39
41
|
'data-size': mark.attrs.size,
|
@@ -15,8 +15,8 @@ export { paragraph } from './paragraph';
|
|
15
15
|
export { emoji } from './emoji';
|
16
16
|
export { image } from './image';
|
17
17
|
export { mention, toJSON as mentionToJSON } from './mention';
|
18
|
-
export { listItem } from './list-item';
|
19
|
-
export { panel, PanelType } from './panel';
|
18
|
+
export { listItem, listItemWithTask } from './list-item';
|
19
|
+
export { panel, extendedPanel, PanelType } from './panel';
|
20
20
|
export { text } from './text';
|
21
21
|
export { default as unknownBlock } from './unknown-block';
|
22
22
|
export { caption } from './caption';
|
@@ -9,4 +9,21 @@ export const listItem = {
|
|
9
9
|
toDOM() {
|
10
10
|
return ['li', 0];
|
11
11
|
}
|
12
|
+
};
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @name list_item_with_task
|
16
|
+
* @description this node allows task-list to be nested inside list-item
|
17
|
+
*/
|
18
|
+
export const listItemWithTask = {
|
19
|
+
content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | taskList | mediaSingle | codeBlock | unsupportedBlock)*',
|
20
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
21
|
+
defining: true,
|
22
|
+
selectable: false,
|
23
|
+
parseDOM: [{
|
24
|
+
tag: 'li'
|
25
|
+
}],
|
26
|
+
toDOM() {
|
27
|
+
return ['li', 0];
|
28
|
+
}
|
12
29
|
};
|
@@ -80,4 +80,32 @@ export const panel = allowCustomPanel => {
|
|
80
80
|
}
|
81
81
|
};
|
82
82
|
return panelNodeSpec;
|
83
|
+
};
|
84
|
+
|
85
|
+
/**
|
86
|
+
* @name extended_panel
|
87
|
+
* @description it allows more content to be nested as compared to panel node.
|
88
|
+
* Specifically, it allows Media, action, code-block, rule and decision nodes in
|
89
|
+
* addition to content allowed inside panel
|
90
|
+
*/
|
91
|
+
export const extendedPanel = allowCustomPanel => {
|
92
|
+
const panelNodeSpec = {
|
93
|
+
group: 'block',
|
94
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock)+',
|
95
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
96
|
+
attrs: getDefaultAttrs(),
|
97
|
+
selectable: true,
|
98
|
+
parseDOM: [{
|
99
|
+
tag: 'div[data-panel-type]',
|
100
|
+
getAttrs: dom => getParseDOMAttrs(allowCustomPanel, dom)
|
101
|
+
}],
|
102
|
+
toDOM(node) {
|
103
|
+
const attrs = getDomAttrs(node.attrs);
|
104
|
+
const contentAttrs = {
|
105
|
+
'data-panel-content': 'true'
|
106
|
+
};
|
107
|
+
return ['div', attrs, ['div', contentAttrs, 0]];
|
108
|
+
}
|
109
|
+
};
|
110
|
+
return panelNodeSpec;
|
83
111
|
};
|
package/dist/esm/index.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, 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, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension } 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableWithCustomWidth, 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, extensionFrame, multiBodiedExtension } 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, getDarkModeLCHColor } from './utils';
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
4
4
|
import { Schema } from '@atlaskit/editor-prosemirror/model';
|
5
5
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
6
6
|
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
|
7
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder,
|
7
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItemWithTask, heading, blockquoteWithList, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, 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] : {};
|
10
10
|
if (!config) {
|
@@ -71,7 +71,7 @@ var nodesInOrder = [{
|
|
71
71
|
spec: orderedListWithOrder
|
72
72
|
}, {
|
73
73
|
name: 'listItem',
|
74
|
-
spec:
|
74
|
+
spec: listItemWithTask
|
75
75
|
}, {
|
76
76
|
name: 'heading',
|
77
77
|
spec: heading
|
@@ -83,7 +83,7 @@ var nodesInOrder = [{
|
|
83
83
|
spec: codeBlock
|
84
84
|
}, {
|
85
85
|
name: 'panel',
|
86
|
-
spec:
|
86
|
+
spec: extendedPanel(true)
|
87
87
|
}, {
|
88
88
|
name: 'rule',
|
89
89
|
spec: rule
|
package/dist/esm/schema/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
|
1
|
+
export { PanelType, blockCard, blockquote, blockquoteWithList, 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, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } 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
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';
|
@@ -18,7 +18,7 @@ borderColorArrayPalette.forEach(function (_ref) {
|
|
18
18
|
export var border = {
|
19
19
|
inclusive: false,
|
20
20
|
parseDOM: [{
|
21
|
-
tag: '
|
21
|
+
tag: '[data-mark-type="border"]',
|
22
22
|
getAttrs: function getAttrs(domNode) {
|
23
23
|
var _dom$getAttribute, _dom$getAttribute2;
|
24
24
|
var dom = domNode;
|
@@ -34,12 +34,14 @@ export var border = {
|
|
34
34
|
color: {},
|
35
35
|
size: {}
|
36
36
|
},
|
37
|
-
toDOM: function toDOM(mark) {
|
37
|
+
toDOM: function toDOM(mark, isInline) {
|
38
|
+
var wrapperStyle = isInline ? 'span' : 'div';
|
39
|
+
|
38
40
|
// Note -- while there is no way to create custom colors using default tooling
|
39
41
|
// the editor does supported ad hoc color values -- and there may be content
|
40
42
|
// which has been migrated or created via apis which use such values.
|
41
43
|
var paletteColorValue = hexToEditorBorderPaletteColor(mark.attrs.color) || mark.attrs.color;
|
42
|
-
return [
|
44
|
+
return [wrapperStyle, {
|
43
45
|
'data-mark-type': 'border',
|
44
46
|
'data-color': mark.attrs.color,
|
45
47
|
'data-size': mark.attrs.size,
|
@@ -15,8 +15,8 @@ export { paragraph } from './paragraph';
|
|
15
15
|
export { emoji } from './emoji';
|
16
16
|
export { image } from './image';
|
17
17
|
export { mention, toJSON as mentionToJSON } from './mention';
|
18
|
-
export { listItem } from './list-item';
|
19
|
-
export { panel, PanelType } from './panel';
|
18
|
+
export { listItem, listItemWithTask } from './list-item';
|
19
|
+
export { panel, extendedPanel, PanelType } from './panel';
|
20
20
|
export { text } from './text';
|
21
21
|
export { default as unknownBlock } from './unknown-block';
|
22
22
|
export { caption } from './caption';
|
@@ -9,4 +9,21 @@ export var listItem = {
|
|
9
9
|
toDOM: function toDOM() {
|
10
10
|
return ['li', 0];
|
11
11
|
}
|
12
|
+
};
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @name list_item_with_task
|
16
|
+
* @description this node allows task-list to be nested inside list-item
|
17
|
+
*/
|
18
|
+
export var listItemWithTask = {
|
19
|
+
content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | taskList | mediaSingle | codeBlock | unsupportedBlock)*',
|
20
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
21
|
+
defining: true,
|
22
|
+
selectable: false,
|
23
|
+
parseDOM: [{
|
24
|
+
tag: 'li'
|
25
|
+
}],
|
26
|
+
toDOM: function toDOM() {
|
27
|
+
return ['li', 0];
|
28
|
+
}
|
12
29
|
};
|
@@ -84,4 +84,34 @@ export var panel = function panel(allowCustomPanel) {
|
|
84
84
|
}
|
85
85
|
};
|
86
86
|
return panelNodeSpec;
|
87
|
+
};
|
88
|
+
|
89
|
+
/**
|
90
|
+
* @name extended_panel
|
91
|
+
* @description it allows more content to be nested as compared to panel node.
|
92
|
+
* Specifically, it allows Media, action, code-block, rule and decision nodes in
|
93
|
+
* addition to content allowed inside panel
|
94
|
+
*/
|
95
|
+
export var extendedPanel = function extendedPanel(allowCustomPanel) {
|
96
|
+
var panelNodeSpec = {
|
97
|
+
group: 'block',
|
98
|
+
content: '(paragraph | heading | bulletList | orderedList | blockCard | mediaGroup | mediaSingle | codeBlock | taskList | rule | decisionList | unsupportedBlock)+',
|
99
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
100
|
+
attrs: getDefaultAttrs(),
|
101
|
+
selectable: true,
|
102
|
+
parseDOM: [{
|
103
|
+
tag: 'div[data-panel-type]',
|
104
|
+
getAttrs: function getAttrs(dom) {
|
105
|
+
return getParseDOMAttrs(allowCustomPanel, dom);
|
106
|
+
}
|
107
|
+
}],
|
108
|
+
toDOM: function toDOM(node) {
|
109
|
+
var attrs = getDomAttrs(node.attrs);
|
110
|
+
var contentAttrs = {
|
111
|
+
'data-panel-content': 'true'
|
112
|
+
};
|
113
|
+
return ['div', attrs, ['div', contentAttrs, 0]];
|
114
|
+
}
|
115
|
+
};
|
116
|
+
return panelNodeSpec;
|
87
117
|
};
|