@atlaskit/adf-schema 35.3.0 → 35.5.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 +6 -0
- package/dist/cjs/schema/create-schema.js +1 -1
- package/dist/cjs/schema/index.js +6 -0
- package/dist/cjs/schema/marks/text-color.js +1 -37
- package/dist/cjs/schema/nodes/index.js +6 -0
- package/dist/cjs/schema/nodes/nested-expand.js +57 -40
- package/dist/cjs/schema/nodes/tableNodes.js +1 -37
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/create-schema.js +2 -2
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/marks/text-color.js +2 -38
- package/dist/es2019/schema/nodes/index.js +1 -1
- package/dist/es2019/schema/nodes/nested-expand.js +55 -39
- package/dist/es2019/schema/nodes/tableNodes.js +1 -37
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/create-schema.js +2 -2
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/marks/text-color.js +2 -38
- package/dist/esm/schema/nodes/index.js +1 -1
- package/dist/esm/schema/nodes/nested-expand.js +55 -39
- package/dist/esm/schema/nodes/tableNodes.js +1 -37
- package/dist/json-schema/v1/full.json +24 -0
- package/dist/json-schema/v1/stage-0.json +24 -0
- 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 +1 -1
- package/dist/types/schema/nodes/nested-expand.d.ts +15 -1
- package/json-schema/v1/full.json +24 -0
- package/json-schema/v1/stage-0.json +24 -0
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @atlaskit/adf-schema
|
2
2
|
|
3
|
+
## 35.5.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 49b81f8: Adding node-nesting rules for list, codeblock, actions, divider, decision, panel, quote inside nestedExpand
|
8
|
+
|
9
|
+
## 35.4.0
|
10
|
+
|
11
|
+
### Minor Changes
|
12
|
+
|
13
|
+
- d915d07: EDF-26 Cleaned up platform.editor.use-lch-for-color-inversion_1qv8ol flag and removed platform feature flags as a package dependency as it is no longer used. Text and table cell background colors will now use the LCH inversion method in dark mode by default.
|
14
|
+
|
3
15
|
## 35.3.0
|
4
16
|
|
5
17
|
### Minor 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, "extendedNestedExpand", {
|
535
|
+
enumerable: true,
|
536
|
+
get: function get() {
|
537
|
+
return _schema.extendedNestedExpand;
|
538
|
+
}
|
539
|
+
});
|
534
540
|
Object.defineProperty(exports, "extendedPanel", {
|
535
541
|
enumerable: true,
|
536
542
|
get: function get() {
|
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, "extendedNestedExpand", {
|
247
|
+
enumerable: true,
|
248
|
+
get: function get() {
|
249
|
+
return _nodes.extendedNestedExpand;
|
250
|
+
}
|
251
|
+
});
|
246
252
|
Object.defineProperty(exports, "extendedPanel", {
|
247
253
|
enumerable: true,
|
248
254
|
get: function get() {
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
10
10
|
var _editorPalette = require("../../utils/editor-palette");
|
11
11
|
var _groups = require("../groups");
|
12
12
|
var _colors = require("../../utils/colors");
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
14
13
|
var _lchColorInversion = require("../../utils/lch-color-inversion");
|
15
14
|
/**
|
16
15
|
* @name textColor_mark
|
@@ -74,36 +73,6 @@ colorArrayPalette.forEach(function (_ref) {
|
|
74
73
|
return colorPalette.set(color.toLowerCase(), label);
|
75
74
|
});
|
76
75
|
|
77
|
-
/**
|
78
|
-
* This function is duplicated in @atlaskit/renderer and ../nodes/tableNodes
|
79
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
80
|
-
* it will invert the color and return the inverted color.
|
81
|
-
*/
|
82
|
-
function invertCustomColor(customColor) {
|
83
|
-
var hex;
|
84
|
-
if ((0, _colors.isHex)(customColor)) {
|
85
|
-
hex = customColor;
|
86
|
-
} else if ((0, _colors.isRgb)(customColor)) {
|
87
|
-
hex = (0, _colors.rgbToHex)(customColor);
|
88
|
-
if (hex === null) {
|
89
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
90
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
91
|
-
// to align with the rgbToHex function
|
92
|
-
return customColor;
|
93
|
-
}
|
94
|
-
} else {
|
95
|
-
return customColor;
|
96
|
-
}
|
97
|
-
var hexWithoutHash = hex.replace('#', '');
|
98
|
-
|
99
|
-
// This inverts the hex color by
|
100
|
-
// 1. converting the hex code to a number
|
101
|
-
// 2. XORing it with 0xffffff
|
102
|
-
// 3. Converting the result back to hex
|
103
|
-
// 4. Removing the leading 1 from the result
|
104
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
105
|
-
}
|
106
|
-
|
107
76
|
// these are for test only
|
108
77
|
var testGlobalTheme;
|
109
78
|
var setGlobalTheme = function setGlobalTheme(theme) {
|
@@ -199,12 +168,7 @@ var textColor = {
|
|
199
168
|
} else {
|
200
169
|
if (getGlobalTheme().colorMode === 'dark') {
|
201
170
|
// if we have a custom color, we need to check if we are in dark mode
|
202
|
-
|
203
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
204
|
-
paletteColorValue = (0, _lchColorInversion.getDarkModeLCHColor)(mark.attrs.color);
|
205
|
-
} else {
|
206
|
-
paletteColorValue = invertCustomColor(mark.attrs.color);
|
207
|
-
}
|
171
|
+
paletteColorValue = (0, _lchColorInversion.getDarkModeLCHColor)(mark.attrs.color);
|
208
172
|
} else {
|
209
173
|
// if we are in light mode, we can just set the color
|
210
174
|
paletteColorValue = mark.attrs.color;
|
@@ -142,6 +142,12 @@ Object.defineProperty(exports, "expandToJSON", {
|
|
142
142
|
return _expand.toJSON;
|
143
143
|
}
|
144
144
|
});
|
145
|
+
Object.defineProperty(exports, "extendedNestedExpand", {
|
146
|
+
enumerable: true,
|
147
|
+
get: function get() {
|
148
|
+
return _nestedExpand.extendedNestedExpand;
|
149
|
+
}
|
150
|
+
});
|
145
151
|
Object.defineProperty(exports, "extendedPanel", {
|
146
152
|
enumerable: true,
|
147
153
|
get: function get() {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.nestedExpand = void 0;
|
6
|
+
exports.nestedExpand = exports.extendedNestedExpand = void 0;
|
7
7
|
/**
|
8
8
|
* @name nestedExpand_content
|
9
9
|
* @minItems 1
|
@@ -18,47 +18,64 @@ exports.nestedExpand = void 0;
|
|
18
18
|
* @name nestedExpand_with_no_marks_node
|
19
19
|
*/
|
20
20
|
|
21
|
-
var
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
var createNestedExpandSpec = function createNestedExpandSpec(isExtended) {
|
22
|
+
var nestedExpandSpec = {
|
23
|
+
inline: false,
|
24
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
25
|
+
isolating: true,
|
26
|
+
selectable: true,
|
27
|
+
attrs: {
|
28
|
+
title: {
|
29
|
+
default: ''
|
30
|
+
},
|
31
|
+
__expanded: {
|
32
|
+
default: true
|
33
|
+
}
|
30
34
|
},
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
35
|
+
parseDOM: [{
|
36
|
+
context: 'nestedExpand//',
|
37
|
+
tag: '[data-node-type="nestedExpand"]',
|
38
|
+
skip: true
|
39
|
+
}, {
|
40
|
+
tag: '[data-node-type="nestedExpand"] button',
|
41
|
+
ignore: true
|
42
|
+
}, {
|
43
|
+
tag: '[data-node-type="expand"] button',
|
44
|
+
ignore: true
|
45
|
+
}, {
|
46
|
+
tag: 'div[data-node-type="nestedExpand"]',
|
47
|
+
getAttrs: function getAttrs(domNode) {
|
48
|
+
var dom = domNode;
|
49
|
+
return {
|
50
|
+
title: dom.getAttribute('data-title'),
|
51
|
+
__expanded: true
|
52
|
+
};
|
53
|
+
}
|
54
|
+
}],
|
55
|
+
toDOM: function toDOM(node) {
|
56
|
+
var attrs = {
|
57
|
+
'data-node-type': 'nestedExpand',
|
58
|
+
'data-title': node.attrs.title,
|
59
|
+
'data-expanded': node.attrs.__expanded
|
52
60
|
};
|
61
|
+
return ['div', attrs, 0];
|
53
62
|
}
|
54
|
-
}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
'data-expanded': node.attrs.__expanded
|
60
|
-
};
|
61
|
-
return ['div', attrs, 0];
|
63
|
+
};
|
64
|
+
if (isExtended) {
|
65
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | codeBlock | bulletList | orderedList | taskList | decisionList | rule | panel | blockquote | unsupportedBlock)+';
|
66
|
+
} else {
|
67
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | unsupportedBlock)+';
|
62
68
|
}
|
69
|
+
return nestedExpandSpec;
|
63
70
|
};
|
64
|
-
|
71
|
+
var nestedExpand = createNestedExpandSpec(false);
|
72
|
+
|
73
|
+
/**
|
74
|
+
* @name extended_nestedExpand
|
75
|
+
* @description it allows more type of content to be part of the nestedExpand.
|
76
|
+
* Specifically, it allows codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote nodes in
|
77
|
+
* addition to content allowed inside nestedExpand
|
78
|
+
*/
|
79
|
+
exports.nestedExpand = nestedExpand;
|
80
|
+
var extendedNestedExpand = createNestedExpandSpec(true);
|
81
|
+
exports.extendedNestedExpand = extendedNestedExpand;
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
10
10
|
var _editorPalette = require("../../utils/editor-palette");
|
11
11
|
var _colors = require("../../utils/colors");
|
12
12
|
var _uuid = require("../../utils/uuid");
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
14
13
|
var _lchColorInversion = require("../../utils/lch-color-inversion");
|
15
14
|
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; }
|
16
15
|
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; }
|
@@ -64,36 +63,6 @@ var getCellAttrs = function getCellAttrs(dom) {
|
|
64
63
|
};
|
65
64
|
};
|
66
65
|
exports.getCellAttrs = getCellAttrs;
|
67
|
-
/**
|
68
|
-
* This function is duplicated in @atlaskit/renderer
|
69
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
70
|
-
* it will invert the color and return the inverted color.
|
71
|
-
*/
|
72
|
-
function invertCustomColor(customColor) {
|
73
|
-
var hex;
|
74
|
-
if ((0, _colors.isHex)(customColor)) {
|
75
|
-
hex = customColor;
|
76
|
-
} else if ((0, _colors.isRgb)(customColor)) {
|
77
|
-
hex = (0, _colors.rgbToHex)(customColor);
|
78
|
-
if (hex === null) {
|
79
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
80
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
81
|
-
// to align with the rgbToHex function
|
82
|
-
return customColor;
|
83
|
-
}
|
84
|
-
} else {
|
85
|
-
return customColor;
|
86
|
-
}
|
87
|
-
var hexWithoutHash = hex.replace('#', '');
|
88
|
-
|
89
|
-
// This inverts the hex color by
|
90
|
-
// 1. converting the hex code to a number
|
91
|
-
// 2. XORing it with 0xffffff
|
92
|
-
// 3. Converting the result back to hex
|
93
|
-
// 4. Removing the leading 1 from the result
|
94
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
95
|
-
}
|
96
|
-
|
97
66
|
// these are for test only
|
98
67
|
var testGlobalTheme;
|
99
68
|
var setGlobalTheme = function setGlobalTheme(theme) {
|
@@ -172,12 +141,7 @@ var getCellDomAttrs = function getCellDomAttrs(node) {
|
|
172
141
|
// if we have a custom color, we need to check if we are in dark mode
|
173
142
|
if (getGlobalTheme().colorMode === 'dark') {
|
174
143
|
// if we have a custom color, we need to check if we are in dark mode
|
175
|
-
|
176
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
177
|
-
attrs.style = "background-color: ".concat((0, _lchColorInversion.getDarkModeLCHColor)(color), ";");
|
178
|
-
} else {
|
179
|
-
attrs.style = "background-color: ".concat(invertCustomColor(color), ";");
|
180
|
-
}
|
144
|
+
attrs.style = "background-color: ".concat((0, _lchColorInversion.getDarkModeLCHColor)(color), ";");
|
181
145
|
} else {
|
182
146
|
// if we are in light mode, we can just set the color
|
183
147
|
attrs.style = "background-color: ".concat(background, ";");
|
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, 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';
|
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, extendedNestedExpand, 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, 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,
|
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, extendedNestedExpand, embedCard, caption } from './nodes';
|
5
5
|
function addItems(builtInItems, config, customSpecs = {}) {
|
6
6
|
if (!config) {
|
7
7
|
return {};
|
@@ -162,7 +162,7 @@ const nodesInOrder = [{
|
|
162
162
|
spec: expand
|
163
163
|
}, {
|
164
164
|
name: 'nestedExpand',
|
165
|
-
spec:
|
165
|
+
spec: extendedNestedExpand
|
166
166
|
}, {
|
167
167
|
name: 'extension',
|
168
168
|
spec: extension
|
@@ -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, 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';
|
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, extendedNestedExpand, 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';
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { hexToEditorTextPaletteColor } from '../../utils/editor-palette';
|
2
2
|
import { COLOR } from '../groups';
|
3
|
-
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
3
|
+
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500 } from '../../utils/colors';
|
5
4
|
import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
|
6
5
|
|
7
6
|
/**
|
@@ -59,36 +58,6 @@ export const colorPalette = new Map();
|
|
59
58
|
export const colorPaletteExtended = colorPalette;
|
60
59
|
colorArrayPalette.forEach(([color, label]) => colorPalette.set(color.toLowerCase(), label));
|
61
60
|
|
62
|
-
/**
|
63
|
-
* This function is duplicated in @atlaskit/renderer and ../nodes/tableNodes
|
64
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
65
|
-
* it will invert the color and return the inverted color.
|
66
|
-
*/
|
67
|
-
function invertCustomColor(customColor) {
|
68
|
-
let hex;
|
69
|
-
if (isHex(customColor)) {
|
70
|
-
hex = customColor;
|
71
|
-
} else if (isRgb(customColor)) {
|
72
|
-
hex = rgbToHex(customColor);
|
73
|
-
if (hex === null) {
|
74
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
75
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
76
|
-
// to align with the rgbToHex function
|
77
|
-
return customColor;
|
78
|
-
}
|
79
|
-
} else {
|
80
|
-
return customColor;
|
81
|
-
}
|
82
|
-
const hexWithoutHash = hex.replace('#', '');
|
83
|
-
|
84
|
-
// This inverts the hex color by
|
85
|
-
// 1. converting the hex code to a number
|
86
|
-
// 2. XORing it with 0xffffff
|
87
|
-
// 3. Converting the result back to hex
|
88
|
-
// 4. Removing the leading 1 from the result
|
89
|
-
return `#${(Number(`0x1${hexWithoutHash}`) ^ 0xffffff).toString(16).substring(1).toUpperCase()}`;
|
90
|
-
}
|
91
|
-
|
92
61
|
// these are for test only
|
93
62
|
let testGlobalTheme;
|
94
63
|
export const setGlobalTheme = theme => {
|
@@ -183,12 +152,7 @@ export const textColor = {
|
|
183
152
|
} else {
|
184
153
|
if (getGlobalTheme().colorMode === 'dark') {
|
185
154
|
// if we have a custom color, we need to check if we are in dark mode
|
186
|
-
|
187
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
188
|
-
paletteColorValue = getDarkModeLCHColor(mark.attrs.color);
|
189
|
-
} else {
|
190
|
-
paletteColorValue = invertCustomColor(mark.attrs.color);
|
191
|
-
}
|
155
|
+
paletteColorValue = getDarkModeLCHColor(mark.attrs.color);
|
192
156
|
} else {
|
193
157
|
// if we are in light mode, we can just set the color
|
194
158
|
paletteColorValue = mark.attrs.color;
|
@@ -38,7 +38,7 @@ export { blockCard } from './block-card';
|
|
38
38
|
export { unsupportedBlock } from './unsupported-block';
|
39
39
|
export { unsupportedInline } from './unsupported-inline';
|
40
40
|
export { status } from './status';
|
41
|
-
export { nestedExpand } from './nested-expand';
|
41
|
+
export { nestedExpand, extendedNestedExpand } from './nested-expand';
|
42
42
|
export { embedCard } from './embed-card';
|
43
43
|
// Extensions
|
44
44
|
export { extension } from './extension';
|
@@ -12,46 +12,62 @@
|
|
12
12
|
* @name nestedExpand_with_no_marks_node
|
13
13
|
*/
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
const createNestedExpandSpec = isExtended => {
|
16
|
+
const nestedExpandSpec = {
|
17
|
+
inline: false,
|
18
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
19
|
+
isolating: true,
|
20
|
+
selectable: true,
|
21
|
+
attrs: {
|
22
|
+
title: {
|
23
|
+
default: ''
|
24
|
+
},
|
25
|
+
__expanded: {
|
26
|
+
default: true
|
27
|
+
}
|
24
28
|
},
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
29
|
+
parseDOM: [{
|
30
|
+
context: 'nestedExpand//',
|
31
|
+
tag: '[data-node-type="nestedExpand"]',
|
32
|
+
skip: true
|
33
|
+
}, {
|
34
|
+
tag: '[data-node-type="nestedExpand"] button',
|
35
|
+
ignore: true
|
36
|
+
}, {
|
37
|
+
tag: '[data-node-type="expand"] button',
|
38
|
+
ignore: true
|
39
|
+
}, {
|
40
|
+
tag: 'div[data-node-type="nestedExpand"]',
|
41
|
+
getAttrs: domNode => {
|
42
|
+
const dom = domNode;
|
43
|
+
return {
|
44
|
+
title: dom.getAttribute('data-title'),
|
45
|
+
__expanded: true
|
46
|
+
};
|
47
|
+
}
|
48
|
+
}],
|
49
|
+
toDOM(node) {
|
50
|
+
const attrs = {
|
51
|
+
'data-node-type': 'nestedExpand',
|
52
|
+
'data-title': node.attrs.title,
|
53
|
+
'data-expanded': node.attrs.__expanded
|
46
54
|
};
|
55
|
+
return ['div', attrs, 0];
|
47
56
|
}
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
'data-expanded': node.attrs.__expanded
|
54
|
-
};
|
55
|
-
return ['div', attrs, 0];
|
57
|
+
};
|
58
|
+
if (isExtended) {
|
59
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | codeBlock | bulletList | orderedList | taskList | decisionList | rule | panel | blockquote | unsupportedBlock)+';
|
60
|
+
} else {
|
61
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | unsupportedBlock)+';
|
56
62
|
}
|
57
|
-
|
63
|
+
return nestedExpandSpec;
|
64
|
+
};
|
65
|
+
export const nestedExpand = createNestedExpandSpec(false);
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @name extended_nestedExpand
|
69
|
+
* @description it allows more type of content to be part of the nestedExpand.
|
70
|
+
* Specifically, it allows codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote nodes in
|
71
|
+
* addition to content allowed inside nestedExpand
|
72
|
+
*/
|
73
|
+
export const extendedNestedExpand = createNestedExpandSpec(true);
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { hexToEditorBackgroundPaletteRawValue } from '../../utils/editor-palette';
|
2
2
|
import { B100, B50, B75, G200, G50, G75, hexToRgba, isHex, isRgb, N0, N20, N60, N800, P100, P50, P75, R100, R50, R75, rgbToHex, T100, T50, T75, Y200, Y50, Y75 } from '../../utils/colors';
|
3
3
|
import { uuid } from '../../utils/uuid';
|
4
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
5
4
|
import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
|
6
5
|
export const tablePrefixSelector = 'pm-table';
|
7
6
|
export const tableCellSelector = `${tablePrefixSelector}-cell-content-wrap`;
|
@@ -46,36 +45,6 @@ export const getCellAttrs = (dom, defaultValues = {}) => {
|
|
46
45
|
background: backgroundHexCode
|
47
46
|
};
|
48
47
|
};
|
49
|
-
/**
|
50
|
-
* This function is duplicated in @atlaskit/renderer
|
51
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
52
|
-
* it will invert the color and return the inverted color.
|
53
|
-
*/
|
54
|
-
function invertCustomColor(customColor) {
|
55
|
-
let hex;
|
56
|
-
if (isHex(customColor)) {
|
57
|
-
hex = customColor;
|
58
|
-
} else if (isRgb(customColor)) {
|
59
|
-
hex = rgbToHex(customColor);
|
60
|
-
if (hex === null) {
|
61
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
62
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
63
|
-
// to align with the rgbToHex function
|
64
|
-
return customColor;
|
65
|
-
}
|
66
|
-
} else {
|
67
|
-
return customColor;
|
68
|
-
}
|
69
|
-
const hexWithoutHash = hex.replace('#', '');
|
70
|
-
|
71
|
-
// This inverts the hex color by
|
72
|
-
// 1. converting the hex code to a number
|
73
|
-
// 2. XORing it with 0xffffff
|
74
|
-
// 3. Converting the result back to hex
|
75
|
-
// 4. Removing the leading 1 from the result
|
76
|
-
return `#${(Number(`0x1${hexWithoutHash}`) ^ 0xffffff).toString(16).substring(1).toUpperCase()}`;
|
77
|
-
}
|
78
|
-
|
79
48
|
// these are for test only
|
80
49
|
let testGlobalTheme;
|
81
50
|
export const setGlobalTheme = theme => {
|
@@ -155,12 +124,7 @@ export const getCellDomAttrs = node => {
|
|
155
124
|
// if we have a custom color, we need to check if we are in dark mode
|
156
125
|
if (getGlobalTheme().colorMode === 'dark') {
|
157
126
|
// if we have a custom color, we need to check if we are in dark mode
|
158
|
-
|
159
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
160
|
-
attrs.style = `background-color: ${getDarkModeLCHColor(color)};`;
|
161
|
-
} else {
|
162
|
-
attrs.style = `background-color: ${invertCustomColor(color)};`;
|
163
|
-
}
|
127
|
+
attrs.style = `background-color: ${getDarkModeLCHColor(color)};`;
|
164
128
|
} else {
|
165
129
|
// if we are in light mode, we can just set the color
|
166
130
|
attrs.style = `background-color: ${background};`;
|
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, 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';
|
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, extendedNestedExpand, 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, 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,
|
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, extendedNestedExpand, 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) {
|
@@ -167,7 +167,7 @@ var nodesInOrder = [{
|
|
167
167
|
spec: expand
|
168
168
|
}, {
|
169
169
|
name: 'nestedExpand',
|
170
|
-
spec:
|
170
|
+
spec: extendedNestedExpand
|
171
171
|
}, {
|
172
172
|
name: 'extension',
|
173
173
|
spec: extension
|
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, 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';
|
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, extendedNestedExpand, 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';
|
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
import { hexToEditorTextPaletteColor } from '../../utils/editor-palette';
|
4
4
|
import { COLOR } from '../groups';
|
5
|
-
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
5
|
+
import { rgbToHex, N0, N80, P50, P300, P500, T75, T300, T500, G75, G300, G500, R75, R300, R500, Y75, Y200, Y400, B75, B100, B500 } from '../../utils/colors';
|
7
6
|
import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
|
8
7
|
|
9
8
|
/**
|
@@ -66,36 +65,6 @@ colorArrayPalette.forEach(function (_ref) {
|
|
66
65
|
return colorPalette.set(color.toLowerCase(), label);
|
67
66
|
});
|
68
67
|
|
69
|
-
/**
|
70
|
-
* This function is duplicated in @atlaskit/renderer and ../nodes/tableNodes
|
71
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
72
|
-
* it will invert the color and return the inverted color.
|
73
|
-
*/
|
74
|
-
function invertCustomColor(customColor) {
|
75
|
-
var hex;
|
76
|
-
if (isHex(customColor)) {
|
77
|
-
hex = customColor;
|
78
|
-
} else if (isRgb(customColor)) {
|
79
|
-
hex = rgbToHex(customColor);
|
80
|
-
if (hex === null) {
|
81
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
82
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
83
|
-
// to align with the rgbToHex function
|
84
|
-
return customColor;
|
85
|
-
}
|
86
|
-
} else {
|
87
|
-
return customColor;
|
88
|
-
}
|
89
|
-
var hexWithoutHash = hex.replace('#', '');
|
90
|
-
|
91
|
-
// This inverts the hex color by
|
92
|
-
// 1. converting the hex code to a number
|
93
|
-
// 2. XORing it with 0xffffff
|
94
|
-
// 3. Converting the result back to hex
|
95
|
-
// 4. Removing the leading 1 from the result
|
96
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
97
|
-
}
|
98
|
-
|
99
68
|
// these are for test only
|
100
69
|
var testGlobalTheme;
|
101
70
|
export var setGlobalTheme = function setGlobalTheme(theme) {
|
@@ -190,12 +159,7 @@ export var textColor = {
|
|
190
159
|
} else {
|
191
160
|
if (getGlobalTheme().colorMode === 'dark') {
|
192
161
|
// if we have a custom color, we need to check if we are in dark mode
|
193
|
-
|
194
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
195
|
-
paletteColorValue = getDarkModeLCHColor(mark.attrs.color);
|
196
|
-
} else {
|
197
|
-
paletteColorValue = invertCustomColor(mark.attrs.color);
|
198
|
-
}
|
162
|
+
paletteColorValue = getDarkModeLCHColor(mark.attrs.color);
|
199
163
|
} else {
|
200
164
|
// if we are in light mode, we can just set the color
|
201
165
|
paletteColorValue = mark.attrs.color;
|
@@ -38,7 +38,7 @@ export { blockCard } from './block-card';
|
|
38
38
|
export { unsupportedBlock } from './unsupported-block';
|
39
39
|
export { unsupportedInline } from './unsupported-inline';
|
40
40
|
export { status } from './status';
|
41
|
-
export { nestedExpand } from './nested-expand';
|
41
|
+
export { nestedExpand, extendedNestedExpand } from './nested-expand';
|
42
42
|
export { embedCard } from './embed-card';
|
43
43
|
// Extensions
|
44
44
|
export { extension } from './extension';
|
@@ -12,46 +12,62 @@
|
|
12
12
|
* @name nestedExpand_with_no_marks_node
|
13
13
|
*/
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
var createNestedExpandSpec = function createNestedExpandSpec(isExtended) {
|
16
|
+
var nestedExpandSpec = {
|
17
|
+
inline: false,
|
18
|
+
marks: 'unsupportedMark unsupportedNodeAttribute',
|
19
|
+
isolating: true,
|
20
|
+
selectable: true,
|
21
|
+
attrs: {
|
22
|
+
title: {
|
23
|
+
default: ''
|
24
|
+
},
|
25
|
+
__expanded: {
|
26
|
+
default: true
|
27
|
+
}
|
24
28
|
},
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
29
|
+
parseDOM: [{
|
30
|
+
context: 'nestedExpand//',
|
31
|
+
tag: '[data-node-type="nestedExpand"]',
|
32
|
+
skip: true
|
33
|
+
}, {
|
34
|
+
tag: '[data-node-type="nestedExpand"] button',
|
35
|
+
ignore: true
|
36
|
+
}, {
|
37
|
+
tag: '[data-node-type="expand"] button',
|
38
|
+
ignore: true
|
39
|
+
}, {
|
40
|
+
tag: 'div[data-node-type="nestedExpand"]',
|
41
|
+
getAttrs: function getAttrs(domNode) {
|
42
|
+
var dom = domNode;
|
43
|
+
return {
|
44
|
+
title: dom.getAttribute('data-title'),
|
45
|
+
__expanded: true
|
46
|
+
};
|
47
|
+
}
|
48
|
+
}],
|
49
|
+
toDOM: function toDOM(node) {
|
50
|
+
var attrs = {
|
51
|
+
'data-node-type': 'nestedExpand',
|
52
|
+
'data-title': node.attrs.title,
|
53
|
+
'data-expanded': node.attrs.__expanded
|
46
54
|
};
|
55
|
+
return ['div', attrs, 0];
|
47
56
|
}
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
'data-expanded': node.attrs.__expanded
|
54
|
-
};
|
55
|
-
return ['div', attrs, 0];
|
57
|
+
};
|
58
|
+
if (isExtended) {
|
59
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | codeBlock | bulletList | orderedList | taskList | decisionList | rule | panel | blockquote | unsupportedBlock)+';
|
60
|
+
} else {
|
61
|
+
nestedExpandSpec.content = '(paragraph | heading | mediaSingle | mediaGroup | unsupportedBlock)+';
|
56
62
|
}
|
57
|
-
|
63
|
+
return nestedExpandSpec;
|
64
|
+
};
|
65
|
+
export var nestedExpand = createNestedExpandSpec(false);
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @name extended_nestedExpand
|
69
|
+
* @description it allows more type of content to be part of the nestedExpand.
|
70
|
+
* Specifically, it allows codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote nodes in
|
71
|
+
* addition to content allowed inside nestedExpand
|
72
|
+
*/
|
73
|
+
export var extendedNestedExpand = createNestedExpandSpec(true);
|
@@ -5,7 +5,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
5
5
|
import { hexToEditorBackgroundPaletteRawValue } from '../../utils/editor-palette';
|
6
6
|
import { B100, B50, B75, G200, G50, G75, hexToRgba, isHex, isRgb, N0, N20, N60, N800, P100, P50, P75, R100, R50, R75, rgbToHex, T100, T50, T75, Y200, Y50, Y75 } from '../../utils/colors';
|
7
7
|
import { uuid } from '../../utils/uuid';
|
8
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
9
8
|
import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
|
10
9
|
export var tablePrefixSelector = 'pm-table';
|
11
10
|
export var tableCellSelector = "".concat(tablePrefixSelector, "-cell-content-wrap");
|
@@ -51,36 +50,6 @@ export var getCellAttrs = function getCellAttrs(dom) {
|
|
51
50
|
background: backgroundHexCode
|
52
51
|
};
|
53
52
|
};
|
54
|
-
/**
|
55
|
-
* This function is duplicated in @atlaskit/renderer
|
56
|
-
* it takes a color string, and if the color string is a hex or rgb value
|
57
|
-
* it will invert the color and return the inverted color.
|
58
|
-
*/
|
59
|
-
function invertCustomColor(customColor) {
|
60
|
-
var hex;
|
61
|
-
if (isHex(customColor)) {
|
62
|
-
hex = customColor;
|
63
|
-
} else if (isRgb(customColor)) {
|
64
|
-
hex = rgbToHex(customColor);
|
65
|
-
if (hex === null) {
|
66
|
-
// in some cases the rgb color is invalid, in this case we just return the color
|
67
|
-
// See https://product-fabric.atlassian.net/browse/DTR-2003 for a ticket to improve the isRgb function
|
68
|
-
// to align with the rgbToHex function
|
69
|
-
return customColor;
|
70
|
-
}
|
71
|
-
} else {
|
72
|
-
return customColor;
|
73
|
-
}
|
74
|
-
var hexWithoutHash = hex.replace('#', '');
|
75
|
-
|
76
|
-
// This inverts the hex color by
|
77
|
-
// 1. converting the hex code to a number
|
78
|
-
// 2. XORing it with 0xffffff
|
79
|
-
// 3. Converting the result back to hex
|
80
|
-
// 4. Removing the leading 1 from the result
|
81
|
-
return "#".concat((Number("0x1".concat(hexWithoutHash)) ^ 0xffffff).toString(16).substring(1).toUpperCase());
|
82
|
-
}
|
83
|
-
|
84
53
|
// these are for test only
|
85
54
|
var testGlobalTheme;
|
86
55
|
export var setGlobalTheme = function setGlobalTheme(theme) {
|
@@ -158,12 +127,7 @@ export var getCellDomAttrs = function getCellDomAttrs(node) {
|
|
158
127
|
// if we have a custom color, we need to check if we are in dark mode
|
159
128
|
if (getGlobalTheme().colorMode === 'dark') {
|
160
129
|
// if we have a custom color, we need to check if we are in dark mode
|
161
|
-
|
162
|
-
if (getBooleanFF('platform.editor.use-lch-for-color-inversion_1qv8ol')) {
|
163
|
-
attrs.style = "background-color: ".concat(getDarkModeLCHColor(color), ";");
|
164
|
-
} else {
|
165
|
-
attrs.style = "background-color: ".concat(invertCustomColor(color), ";");
|
166
|
-
}
|
130
|
+
attrs.style = "background-color: ".concat(getDarkModeLCHColor(color), ";");
|
167
131
|
} else {
|
168
132
|
// if we are in light mode, we can just set the color
|
169
133
|
attrs.style = "background-color: ".concat(background, ";");
|
@@ -2097,6 +2097,9 @@
|
|
2097
2097
|
"type": "array",
|
2098
2098
|
"items": {
|
2099
2099
|
"anyOf": [
|
2100
|
+
{
|
2101
|
+
"$ref": "#/definitions/codeBlock_with_no_marks_node"
|
2102
|
+
},
|
2100
2103
|
{
|
2101
2104
|
"$ref": "#/definitions/paragraph_with_no_marks_node"
|
2102
2105
|
},
|
@@ -2106,11 +2109,32 @@
|
|
2106
2109
|
{
|
2107
2110
|
"$ref": "#/definitions/mediaSingle_full_node"
|
2108
2111
|
},
|
2112
|
+
{
|
2113
|
+
"$ref": "#/definitions/taskList_node"
|
2114
|
+
},
|
2115
|
+
{
|
2116
|
+
"$ref": "#/definitions/bulletList_node"
|
2117
|
+
},
|
2118
|
+
{
|
2119
|
+
"$ref": "#/definitions/orderedList_node"
|
2120
|
+
},
|
2109
2121
|
{
|
2110
2122
|
"$ref": "#/definitions/heading_with_no_marks_node"
|
2111
2123
|
},
|
2112
2124
|
{
|
2113
2125
|
"$ref": "#/definitions/mediaGroup_node"
|
2126
|
+
},
|
2127
|
+
{
|
2128
|
+
"$ref": "#/definitions/decisionList_node"
|
2129
|
+
},
|
2130
|
+
{
|
2131
|
+
"$ref": "#/definitions/rule_node"
|
2132
|
+
},
|
2133
|
+
{
|
2134
|
+
"$ref": "#/definitions/panel_node"
|
2135
|
+
},
|
2136
|
+
{
|
2137
|
+
"$ref": "#/definitions/blockquote_node"
|
2114
2138
|
}
|
2115
2139
|
]
|
2116
2140
|
},
|
@@ -2097,6 +2097,9 @@
|
|
2097
2097
|
"type": "array",
|
2098
2098
|
"items": {
|
2099
2099
|
"anyOf": [
|
2100
|
+
{
|
2101
|
+
"$ref": "#/definitions/codeBlock_with_no_marks_node"
|
2102
|
+
},
|
2100
2103
|
{
|
2101
2104
|
"$ref": "#/definitions/paragraph_with_no_marks_node"
|
2102
2105
|
},
|
@@ -2106,11 +2109,32 @@
|
|
2106
2109
|
{
|
2107
2110
|
"$ref": "#/definitions/mediaSingle_full_node"
|
2108
2111
|
},
|
2112
|
+
{
|
2113
|
+
"$ref": "#/definitions/taskList_node"
|
2114
|
+
},
|
2115
|
+
{
|
2116
|
+
"$ref": "#/definitions/bulletList_node"
|
2117
|
+
},
|
2118
|
+
{
|
2119
|
+
"$ref": "#/definitions/orderedList_node"
|
2120
|
+
},
|
2109
2121
|
{
|
2110
2122
|
"$ref": "#/definitions/heading_with_no_marks_node"
|
2111
2123
|
},
|
2112
2124
|
{
|
2113
2125
|
"$ref": "#/definitions/mediaGroup_node"
|
2126
|
+
},
|
2127
|
+
{
|
2128
|
+
"$ref": "#/definitions/decisionList_node"
|
2129
|
+
},
|
2130
|
+
{
|
2131
|
+
"$ref": "#/definitions/rule_node"
|
2132
|
+
},
|
2133
|
+
{
|
2134
|
+
"$ref": "#/definitions/panel_node"
|
2135
|
+
},
|
2136
|
+
{
|
2137
|
+
"$ref": "#/definitions/blockquote_node"
|
2114
2138
|
}
|
2115
2139
|
]
|
2116
2140
|
},
|
package/dist/types/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, 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, 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
|
+
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, extendedNestedExpand, 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';
|
4
4
|
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, DatasourceAttributeProperties, 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, ExtendedMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, MultiBodiedExtensionDefinition, ExtensionFrameDefinition, } 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, getDarkModeLCHColor, } from './utils';
|
6
6
|
export type { Match, NameToEmoji } from './utils';
|
@@ -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, 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';
|
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, extendedNestedExpand, 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 type { BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, DatasourceAttributes, DatasourceAttributeProperties, 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, ExtendedMediaAttributes, RichMediaLayout, CellDomAttrs, ExtensionFrameDefinition, MultiBodiedExtensionDefinition, } 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. */
|
@@ -70,7 +70,7 @@ export { unsupportedBlock } from './unsupported-block';
|
|
70
70
|
export { unsupportedInline } from './unsupported-inline';
|
71
71
|
export { status } from './status';
|
72
72
|
export type { StatusDefinition } from './status';
|
73
|
-
export { nestedExpand } from './nested-expand';
|
73
|
+
export { nestedExpand, extendedNestedExpand } from './nested-expand';
|
74
74
|
export type { NestedExpandDefinition } from './nested-expand';
|
75
75
|
export type { NoMark } from './types/mark';
|
76
76
|
export type { MarksObject } from './types/mark';
|
@@ -4,12 +4,19 @@ import { ParagraphDefinition as Paragraph } from './paragraph';
|
|
4
4
|
import { HeadingDefinition as Heading } from './heading';
|
5
5
|
import { MediaSingleDefinition as MediaSingle } from './media-single';
|
6
6
|
import { MediaGroupDefinition as MediaGroup } from './media-group';
|
7
|
+
import { CodeBlockDefinition as CodeBlock } from './code-block';
|
8
|
+
import { BulletListDefinition as BulletList, OrderedListDefinition as OrderedList } from './types/list';
|
9
|
+
import { TaskListDefinition as TaskList } from './task-list';
|
10
|
+
import { DecisionListDefinition as DecisionList } from './decision-list';
|
11
|
+
import { RuleDefinition as Rule } from './rule';
|
12
|
+
import { PanelDefinition as Panel } from './panel';
|
13
|
+
import { BlockQuoteDefinition as BlockQuote } from './blockquote';
|
7
14
|
/**
|
8
15
|
* @name nestedExpand_content
|
9
16
|
* @minItems 1
|
10
17
|
* @allowUnsupportedBlock true
|
11
18
|
*/
|
12
|
-
export type NestedExpandContent = Array<Paragraph | Heading | MediaSingle | MediaGroup>;
|
19
|
+
export type NestedExpandContent = Array<Paragraph | Heading | MediaSingle | MediaGroup | CodeBlock | BulletList | OrderedList | TaskList | DecisionList | Rule | Panel | BlockQuote>;
|
13
20
|
/**
|
14
21
|
* @name nestedExpand_node
|
15
22
|
*/
|
@@ -25,3 +32,10 @@ export interface NestedExpandBaseDefinition {
|
|
25
32
|
*/
|
26
33
|
export type NestedExpandDefinition = NestedExpandBaseDefinition & NoMark;
|
27
34
|
export declare const nestedExpand: NodeSpec;
|
35
|
+
/**
|
36
|
+
* @name extended_nestedExpand
|
37
|
+
* @description it allows more type of content to be part of the nestedExpand.
|
38
|
+
* Specifically, it allows codeBlock, bulletList, orderedList, taskList, decisionList, rule, panel, blockquote nodes in
|
39
|
+
* addition to content allowed inside nestedExpand
|
40
|
+
*/
|
41
|
+
export declare const extendedNestedExpand: NodeSpec;
|
package/json-schema/v1/full.json
CHANGED
@@ -2097,6 +2097,9 @@
|
|
2097
2097
|
"type": "array",
|
2098
2098
|
"items": {
|
2099
2099
|
"anyOf": [
|
2100
|
+
{
|
2101
|
+
"$ref": "#/definitions/codeBlock_with_no_marks_node"
|
2102
|
+
},
|
2100
2103
|
{
|
2101
2104
|
"$ref": "#/definitions/paragraph_with_no_marks_node"
|
2102
2105
|
},
|
@@ -2106,11 +2109,32 @@
|
|
2106
2109
|
{
|
2107
2110
|
"$ref": "#/definitions/mediaSingle_full_node"
|
2108
2111
|
},
|
2112
|
+
{
|
2113
|
+
"$ref": "#/definitions/taskList_node"
|
2114
|
+
},
|
2115
|
+
{
|
2116
|
+
"$ref": "#/definitions/bulletList_node"
|
2117
|
+
},
|
2118
|
+
{
|
2119
|
+
"$ref": "#/definitions/orderedList_node"
|
2120
|
+
},
|
2109
2121
|
{
|
2110
2122
|
"$ref": "#/definitions/heading_with_no_marks_node"
|
2111
2123
|
},
|
2112
2124
|
{
|
2113
2125
|
"$ref": "#/definitions/mediaGroup_node"
|
2126
|
+
},
|
2127
|
+
{
|
2128
|
+
"$ref": "#/definitions/decisionList_node"
|
2129
|
+
},
|
2130
|
+
{
|
2131
|
+
"$ref": "#/definitions/rule_node"
|
2132
|
+
},
|
2133
|
+
{
|
2134
|
+
"$ref": "#/definitions/panel_node"
|
2135
|
+
},
|
2136
|
+
{
|
2137
|
+
"$ref": "#/definitions/blockquote_node"
|
2114
2138
|
}
|
2115
2139
|
]
|
2116
2140
|
},
|
@@ -2097,6 +2097,9 @@
|
|
2097
2097
|
"type": "array",
|
2098
2098
|
"items": {
|
2099
2099
|
"anyOf": [
|
2100
|
+
{
|
2101
|
+
"$ref": "#/definitions/codeBlock_with_no_marks_node"
|
2102
|
+
},
|
2100
2103
|
{
|
2101
2104
|
"$ref": "#/definitions/paragraph_with_no_marks_node"
|
2102
2105
|
},
|
@@ -2106,11 +2109,32 @@
|
|
2106
2109
|
{
|
2107
2110
|
"$ref": "#/definitions/mediaSingle_full_node"
|
2108
2111
|
},
|
2112
|
+
{
|
2113
|
+
"$ref": "#/definitions/taskList_node"
|
2114
|
+
},
|
2115
|
+
{
|
2116
|
+
"$ref": "#/definitions/bulletList_node"
|
2117
|
+
},
|
2118
|
+
{
|
2119
|
+
"$ref": "#/definitions/orderedList_node"
|
2120
|
+
},
|
2109
2121
|
{
|
2110
2122
|
"$ref": "#/definitions/heading_with_no_marks_node"
|
2111
2123
|
},
|
2112
2124
|
{
|
2113
2125
|
"$ref": "#/definitions/mediaGroup_node"
|
2126
|
+
},
|
2127
|
+
{
|
2128
|
+
"$ref": "#/definitions/decisionList_node"
|
2129
|
+
},
|
2130
|
+
{
|
2131
|
+
"$ref": "#/definitions/rule_node"
|
2132
|
+
},
|
2133
|
+
{
|
2134
|
+
"$ref": "#/definitions/panel_node"
|
2135
|
+
},
|
2136
|
+
{
|
2137
|
+
"$ref": "#/definitions/blockquote_node"
|
2114
2138
|
}
|
2115
2139
|
]
|
2116
2140
|
},
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/adf-schema",
|
3
|
-
"version": "35.
|
3
|
+
"version": "35.5.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/"
|
@@ -41,8 +41,7 @@
|
|
41
41
|
"memoize-one": "^6.0.0"
|
42
42
|
},
|
43
43
|
"devDependencies": {
|
44
|
-
"@
|
45
|
-
"@atlassian/adf-schema-json": "^1.4.0",
|
44
|
+
"@atlassian/adf-schema-json": "^1.5.0",
|
46
45
|
"@babel/cli": "^7.22.9",
|
47
46
|
"@babel/core": "^7.22.9",
|
48
47
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|