@atlaskit/adf-schema 25.10.1 → 26.0.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 +6 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/schema/default-schema.js +2 -1
- package/dist/cjs/schema/index.js +18 -0
- package/dist/cjs/schema/nodes/index.js +18 -0
- package/dist/cjs/schema/nodes/media-single.js +69 -23
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/schema/create-schema.js +1 -1
- package/dist/es2019/schema/default-schema.js +3 -2
- package/dist/es2019/schema/index.js +1 -1
- package/dist/es2019/schema/nodes/index.js +1 -1
- package/dist/es2019/schema/nodes/media-single.js +69 -21
- package/dist/es2019/version.json +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/schema/create-schema.js +1 -1
- package/dist/esm/schema/default-schema.js +3 -2
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/schema/nodes/index.js +1 -1
- package/dist/esm/schema/nodes/media-single.js +65 -22
- package/dist/esm/version.json +1 -1
- package/dist/json-schema/v1/stage-0.json +60 -20
- package/dist/types/index.d.ts +2 -2
- package/dist/types/schema/index.d.ts +2 -2
- package/dist/types/schema/nodes/index.d.ts +2 -2
- package/dist/types/schema/nodes/media-single.d.ts +10 -4
- package/dist/types/schema/nodes/types/rich-media-common.d.ts +21 -0
- package/dist/types-ts4.5/index.d.ts +2 -2
- package/dist/types-ts4.5/schema/index.d.ts +2 -2
- package/dist/types-ts4.5/schema/nodes/index.d.ts +2 -2
- package/dist/types-ts4.5/schema/nodes/media-single.d.ts +10 -4
- package/dist/types-ts4.5/schema/nodes/types/rich-media-common.d.ts +21 -0
- package/json-schema/v1/stage-0.json +60 -20
- package/package.json +2 -2
- package/report.api.md +36 -1
- package/tmp/api-report-tmp.d.ts +31 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/adf-schema
|
|
2
2
|
|
|
3
|
+
## 26.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`68ef7e6146c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/68ef7e6146c) - [ADF change] added widthType attribute to mediaSingle node, to support fixed width media node.
|
|
8
|
+
|
|
3
9
|
## 25.10.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -711,6 +711,18 @@ Object.defineProperty(exports, "mediaSingle", {
|
|
|
711
711
|
return _schema.mediaSingle;
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
|
+
Object.defineProperty(exports, "mediaSingleFull", {
|
|
715
|
+
enumerable: true,
|
|
716
|
+
get: function get() {
|
|
717
|
+
return _schema.mediaSingleFull;
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
Object.defineProperty(exports, "mediaSingleSpec", {
|
|
721
|
+
enumerable: true,
|
|
722
|
+
get: function get() {
|
|
723
|
+
return _schema.mediaSingleSpec;
|
|
724
|
+
}
|
|
725
|
+
});
|
|
714
726
|
Object.defineProperty(exports, "mediaSingleToJSON", {
|
|
715
727
|
enumerable: true,
|
|
716
728
|
get: function get() {
|
|
@@ -723,6 +735,12 @@ Object.defineProperty(exports, "mediaSingleWithCaption", {
|
|
|
723
735
|
return _schema.mediaSingleWithCaption;
|
|
724
736
|
}
|
|
725
737
|
});
|
|
738
|
+
Object.defineProperty(exports, "mediaSingleWithWidthType", {
|
|
739
|
+
enumerable: true,
|
|
740
|
+
get: function get() {
|
|
741
|
+
return _schema.mediaSingleWithWidthType;
|
|
742
|
+
}
|
|
743
|
+
});
|
|
726
744
|
Object.defineProperty(exports, "mediaToJSON", {
|
|
727
745
|
enumerable: true,
|
|
728
746
|
get: function get() {
|
|
@@ -26,7 +26,8 @@ var getSchemaBasedOnStage = (0, _memoizeOne.default)(function () {
|
|
|
26
26
|
if (stage === 'stage0') {
|
|
27
27
|
defaultSchemaConfig.customNodeSpecs = {
|
|
28
28
|
layoutSection: _nodes.layoutSectionWithSingleColumn,
|
|
29
|
-
table: _nodes.tableWithCustomWidth
|
|
29
|
+
table: _nodes.tableWithCustomWidth,
|
|
30
|
+
mediaSingle: _nodes.mediaSingleFull
|
|
30
31
|
};
|
|
31
32
|
defaultSchemaConfig.customMarkSpecs = {
|
|
32
33
|
border: _marks.border
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -369,6 +369,18 @@ Object.defineProperty(exports, "mediaSingle", {
|
|
|
369
369
|
return _nodes.mediaSingle;
|
|
370
370
|
}
|
|
371
371
|
});
|
|
372
|
+
Object.defineProperty(exports, "mediaSingleFull", {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function get() {
|
|
375
|
+
return _nodes.mediaSingleFull;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, "mediaSingleSpec", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function get() {
|
|
381
|
+
return _nodes.mediaSingleSpec;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
372
384
|
Object.defineProperty(exports, "mediaSingleToJSON", {
|
|
373
385
|
enumerable: true,
|
|
374
386
|
get: function get() {
|
|
@@ -381,6 +393,12 @@ Object.defineProperty(exports, "mediaSingleWithCaption", {
|
|
|
381
393
|
return _nodes.mediaSingleWithCaption;
|
|
382
394
|
}
|
|
383
395
|
});
|
|
396
|
+
Object.defineProperty(exports, "mediaSingleWithWidthType", {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function get() {
|
|
399
|
+
return _nodes.mediaSingleWithWidthType;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
384
402
|
Object.defineProperty(exports, "mediaToJSON", {
|
|
385
403
|
enumerable: true,
|
|
386
404
|
get: function get() {
|
|
@@ -232,6 +232,18 @@ Object.defineProperty(exports, "mediaSingle", {
|
|
|
232
232
|
return _mediaSingle.mediaSingle;
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
|
+
Object.defineProperty(exports, "mediaSingleFull", {
|
|
236
|
+
enumerable: true,
|
|
237
|
+
get: function get() {
|
|
238
|
+
return _mediaSingle.mediaSingleFull;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
Object.defineProperty(exports, "mediaSingleSpec", {
|
|
242
|
+
enumerable: true,
|
|
243
|
+
get: function get() {
|
|
244
|
+
return _mediaSingle.mediaSingleSpec;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
235
247
|
Object.defineProperty(exports, "mediaSingleToJSON", {
|
|
236
248
|
enumerable: true,
|
|
237
249
|
get: function get() {
|
|
@@ -244,6 +256,12 @@ Object.defineProperty(exports, "mediaSingleWithCaption", {
|
|
|
244
256
|
return _mediaSingle.mediaSingleWithCaption;
|
|
245
257
|
}
|
|
246
258
|
});
|
|
259
|
+
Object.defineProperty(exports, "mediaSingleWithWidthType", {
|
|
260
|
+
enumerable: true,
|
|
261
|
+
get: function get() {
|
|
262
|
+
return _mediaSingle.mediaSingleWithWidthType;
|
|
263
|
+
}
|
|
264
|
+
});
|
|
247
265
|
Object.defineProperty(exports, "mediaToJSON", {
|
|
248
266
|
enumerable: true,
|
|
249
267
|
get: function get() {
|
|
@@ -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.toJSON = exports.mediaSingleWithCaption = exports.mediaSingle = exports.defaultAttrs = void 0;
|
|
7
|
+
exports.toJSON = exports.mediaSingleWithWidthType = exports.mediaSingleWithCaption = exports.mediaSingleSpec = exports.mediaSingleFull = exports.mediaSingle = exports.defaultAttrs = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -39,24 +39,29 @@ var defaultAttrs = {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
exports.defaultAttrs = defaultAttrs;
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
content: 'media|unsupportedBlock+|media unsupportedBlock+'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
var mediaSingleSpec = function mediaSingleSpec(_ref) {
|
|
43
|
+
var _ref$withCaption = _ref.withCaption,
|
|
44
|
+
withCaption = _ref$withCaption === void 0 ? false : _ref$withCaption,
|
|
45
|
+
_ref$withExtendedWidt = _ref.withExtendedWidthTypes,
|
|
46
|
+
withExtendedWidthTypes = _ref$withExtendedWidt === void 0 ? false : _ref$withExtendedWidt;
|
|
47
|
+
var content = withCaption ? 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*' : 'media|unsupportedBlock+|media unsupportedBlock+';
|
|
48
|
+
var atom = !withCaption;
|
|
49
|
+
var getAttrs = function getAttrs(dom) {
|
|
50
|
+
var domAttrs = {
|
|
51
|
+
layout: dom.getAttribute('data-layout') || 'center',
|
|
52
|
+
width: Number(dom.getAttribute('data-width')) || null
|
|
53
|
+
};
|
|
54
|
+
if (withExtendedWidthTypes) {
|
|
55
|
+
var widthType = dom.getAttribute('data-width-type');
|
|
56
|
+
if (widthType) {
|
|
57
|
+
return _objectSpread(_objectSpread({}, domAttrs), {}, {
|
|
58
|
+
widthType: widthType
|
|
59
|
+
});
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
return domAttrs;
|
|
63
|
+
};
|
|
64
|
+
var getAttrsFromNode = function getAttrsFromNode(node) {
|
|
60
65
|
var _node$attrs = node.attrs,
|
|
61
66
|
layout = _node$attrs.layout,
|
|
62
67
|
width = _node$attrs.width;
|
|
@@ -68,15 +73,56 @@ var mediaSingle = {
|
|
|
68
73
|
if (width) {
|
|
69
74
|
attrs['data-width'] = isFinite(width) && Math.floor(width) === width ? width : width.toFixed(2);
|
|
70
75
|
}
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
if (withExtendedWidthTypes && node.attrs.widthType) {
|
|
77
|
+
var widthType = node.attrs.widthType;
|
|
78
|
+
return _objectSpread(_objectSpread({}, attrs), {}, {
|
|
79
|
+
'data-width-type': widthType || 'percentage'
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return attrs;
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
inline: false,
|
|
86
|
+
group: 'block',
|
|
87
|
+
selectable: true,
|
|
88
|
+
atom: atom,
|
|
89
|
+
content: content,
|
|
90
|
+
attrs: withExtendedWidthTypes ? _objectSpread(_objectSpread({}, defaultAttrs), {}, {
|
|
91
|
+
widthType: {
|
|
92
|
+
default: null
|
|
93
|
+
}
|
|
94
|
+
}) : defaultAttrs,
|
|
95
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
|
96
|
+
parseDOM: [{
|
|
97
|
+
tag: 'div[data-node-type="mediaSingle"]',
|
|
98
|
+
getAttrs: getAttrs
|
|
99
|
+
}],
|
|
100
|
+
toDOM: function toDOM(node) {
|
|
101
|
+
return ['div', getAttrsFromNode(node), 0];
|
|
102
|
+
}
|
|
103
|
+
};
|
|
73
104
|
};
|
|
105
|
+
exports.mediaSingleSpec = mediaSingleSpec;
|
|
106
|
+
var mediaSingle = mediaSingleSpec({
|
|
107
|
+
withCaption: false,
|
|
108
|
+
withExtendedWidthTypes: false
|
|
109
|
+
});
|
|
74
110
|
exports.mediaSingle = mediaSingle;
|
|
75
|
-
var mediaSingleWithCaption =
|
|
76
|
-
|
|
77
|
-
|
|
111
|
+
var mediaSingleWithCaption = mediaSingleSpec({
|
|
112
|
+
withCaption: true,
|
|
113
|
+
withExtendedWidthTypes: false
|
|
78
114
|
});
|
|
79
115
|
exports.mediaSingleWithCaption = mediaSingleWithCaption;
|
|
116
|
+
var mediaSingleWithWidthType = mediaSingleSpec({
|
|
117
|
+
withCaption: false,
|
|
118
|
+
withExtendedWidthTypes: true
|
|
119
|
+
});
|
|
120
|
+
exports.mediaSingleWithWidthType = mediaSingleWithWidthType;
|
|
121
|
+
var mediaSingleFull = mediaSingleSpec({
|
|
122
|
+
withCaption: true,
|
|
123
|
+
withExtendedWidthTypes: true
|
|
124
|
+
});
|
|
125
|
+
exports.mediaSingleFull = mediaSingleFull;
|
|
80
126
|
var toJSON = function toJSON(node) {
|
|
81
127
|
return {
|
|
82
128
|
attrs: Object.keys(node.attrs).reduce(function (obj, key) {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, 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 } from './schema';
|
|
2
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, 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 } from './schema';
|
|
3
3
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from 'prosemirror-model';
|
|
2
2
|
import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
|
|
3
3
|
import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border } from './marks';
|
|
4
|
-
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline,
|
|
4
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleWithCaption, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
|
|
5
5
|
function addItems(builtInItems, config, customSpecs = {}) {
|
|
6
6
|
if (!config) {
|
|
7
7
|
return {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
|
-
import { layoutSectionWithSingleColumn, tableWithCustomWidth } from './nodes';
|
|
2
|
+
import { mediaSingleFull, layoutSectionWithSingleColumn, tableWithCustomWidth } from './nodes';
|
|
3
3
|
import { border } from './marks';
|
|
4
4
|
import { createSchema } from './create-schema';
|
|
5
5
|
const getDefaultSchemaConfig = () => {
|
|
@@ -17,7 +17,8 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
|
|
|
17
17
|
if (stage === 'stage0') {
|
|
18
18
|
defaultSchemaConfig.customNodeSpecs = {
|
|
19
19
|
layoutSection: layoutSectionWithSingleColumn,
|
|
20
|
-
table: tableWithCustomWidth
|
|
20
|
+
table: tableWithCustomWidth,
|
|
21
|
+
mediaSingle: mediaSingleFull
|
|
21
22
|
};
|
|
22
23
|
defaultSchemaConfig.customMarkSpecs = {
|
|
23
24
|
border
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, 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 } from './nodes';
|
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, 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 } 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';
|
|
@@ -22,7 +22,7 @@ export { caption } from './caption';
|
|
|
22
22
|
export { media, copyPrivateAttributes as copyPrivateMediaAttributes, toJSON as mediaToJSON } from './media';
|
|
23
23
|
export { mediaGroup } from './media-group';
|
|
24
24
|
export { mediaInline } from './media-inline';
|
|
25
|
-
export { mediaSingle, mediaSingleWithCaption, toJSON as mediaSingleToJSON } from './media-single';
|
|
25
|
+
export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, toJSON as mediaSingleToJSON } from './media-single';
|
|
26
26
|
export { table, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
|
|
27
27
|
export { decisionList, decisionListSelector } from './decision-list';
|
|
28
28
|
export { decisionItem } from './decision-item';
|
|
@@ -28,22 +28,29 @@ export const defaultAttrs = {
|
|
|
28
28
|
default: 'center'
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
export const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
parseDOM: [{
|
|
40
|
-
tag: 'div[data-node-type="mediaSingle"]',
|
|
41
|
-
getAttrs: dom => ({
|
|
31
|
+
export const mediaSingleSpec = ({
|
|
32
|
+
withCaption = false,
|
|
33
|
+
withExtendedWidthTypes = false
|
|
34
|
+
}) => {
|
|
35
|
+
const content = withCaption ? 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*' : 'media|unsupportedBlock+|media unsupportedBlock+';
|
|
36
|
+
const atom = !withCaption;
|
|
37
|
+
const getAttrs = dom => {
|
|
38
|
+
const domAttrs = {
|
|
42
39
|
layout: dom.getAttribute('data-layout') || 'center',
|
|
43
40
|
width: Number(dom.getAttribute('data-width')) || null
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
};
|
|
42
|
+
if (withExtendedWidthTypes) {
|
|
43
|
+
const widthType = dom.getAttribute('data-width-type');
|
|
44
|
+
if (widthType) {
|
|
45
|
+
return {
|
|
46
|
+
...domAttrs,
|
|
47
|
+
widthType
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return domAttrs;
|
|
52
|
+
};
|
|
53
|
+
const getAttrsFromNode = node => {
|
|
47
54
|
const {
|
|
48
55
|
layout,
|
|
49
56
|
width
|
|
@@ -56,14 +63,55 @@ export const mediaSingle = {
|
|
|
56
63
|
if (width) {
|
|
57
64
|
attrs['data-width'] = isFinite(width) && Math.floor(width) === width ? width : width.toFixed(2);
|
|
58
65
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
if (withExtendedWidthTypes && node.attrs.widthType) {
|
|
67
|
+
const {
|
|
68
|
+
widthType
|
|
69
|
+
} = node.attrs;
|
|
70
|
+
return {
|
|
71
|
+
...attrs,
|
|
72
|
+
'data-width-type': widthType || 'percentage'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return attrs;
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
inline: false,
|
|
79
|
+
group: 'block',
|
|
80
|
+
selectable: true,
|
|
81
|
+
atom,
|
|
82
|
+
content,
|
|
83
|
+
attrs: withExtendedWidthTypes ? {
|
|
84
|
+
...defaultAttrs,
|
|
85
|
+
widthType: {
|
|
86
|
+
default: null
|
|
87
|
+
}
|
|
88
|
+
} : defaultAttrs,
|
|
89
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
|
90
|
+
parseDOM: [{
|
|
91
|
+
tag: 'div[data-node-type="mediaSingle"]',
|
|
92
|
+
getAttrs
|
|
93
|
+
}],
|
|
94
|
+
toDOM(node) {
|
|
95
|
+
return ['div', getAttrsFromNode(node), 0];
|
|
96
|
+
}
|
|
97
|
+
};
|
|
66
98
|
};
|
|
99
|
+
export const mediaSingle = mediaSingleSpec({
|
|
100
|
+
withCaption: false,
|
|
101
|
+
withExtendedWidthTypes: false
|
|
102
|
+
});
|
|
103
|
+
export const mediaSingleWithCaption = mediaSingleSpec({
|
|
104
|
+
withCaption: true,
|
|
105
|
+
withExtendedWidthTypes: false
|
|
106
|
+
});
|
|
107
|
+
export const mediaSingleWithWidthType = mediaSingleSpec({
|
|
108
|
+
withCaption: false,
|
|
109
|
+
withExtendedWidthTypes: true
|
|
110
|
+
});
|
|
111
|
+
export const mediaSingleFull = mediaSingleSpec({
|
|
112
|
+
withCaption: true,
|
|
113
|
+
withExtendedWidthTypes: true
|
|
114
|
+
});
|
|
67
115
|
export const toJSON = node => ({
|
|
68
116
|
attrs: Object.keys(node.attrs).reduce((obj, key) => {
|
|
69
117
|
if (node.attrs[key] !== null) {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
2
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, 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 } from './schema';
|
|
2
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, 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 } from './schema';
|
|
3
3
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid } from './utils';
|
|
@@ -4,7 +4,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
import { Schema } from '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, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline,
|
|
7
|
+
import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, blockquote, codeBlock, panel, rule, image, mention, media, mediaInline, mediaSingleWithCaption, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
|
|
8
8
|
function addItems(builtInItems, config) {
|
|
9
9
|
var customSpecs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10
10
|
if (!config) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
|
-
import { layoutSectionWithSingleColumn, tableWithCustomWidth } from './nodes';
|
|
2
|
+
import { mediaSingleFull, layoutSectionWithSingleColumn, tableWithCustomWidth } from './nodes';
|
|
3
3
|
import { border } from './marks';
|
|
4
4
|
import { createSchema } from './create-schema';
|
|
5
5
|
var getDefaultSchemaConfig = function getDefaultSchemaConfig() {
|
|
@@ -18,7 +18,8 @@ export var getSchemaBasedOnStage = memoizeOne(function () {
|
|
|
18
18
|
if (stage === 'stage0') {
|
|
19
19
|
defaultSchemaConfig.customNodeSpecs = {
|
|
20
20
|
layoutSection: layoutSectionWithSingleColumn,
|
|
21
|
-
table: tableWithCustomWidth
|
|
21
|
+
table: tableWithCustomWidth,
|
|
22
|
+
mediaSingle: mediaSingleFull
|
|
22
23
|
};
|
|
23
24
|
defaultSchemaConfig.customMarkSpecs = {
|
|
24
25
|
border: border
|
package/dist/esm/schema/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, 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 } from './nodes';
|
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, 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 } 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';
|
|
@@ -22,7 +22,7 @@ export { caption } from './caption';
|
|
|
22
22
|
export { media, copyPrivateAttributes as copyPrivateMediaAttributes, toJSON as mediaToJSON } from './media';
|
|
23
23
|
export { mediaGroup } from './media-group';
|
|
24
24
|
export { mediaInline } from './media-inline';
|
|
25
|
-
export { mediaSingle, mediaSingleWithCaption, toJSON as mediaSingleToJSON } from './media-single';
|
|
25
|
+
export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, toJSON as mediaSingleToJSON } from './media-single';
|
|
26
26
|
export { table, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
|
|
27
27
|
export { decisionList, decisionListSelector } from './decision-list';
|
|
28
28
|
export { decisionItem } from './decision-item';
|
|
@@ -31,24 +31,29 @@ export var defaultAttrs = {
|
|
|
31
31
|
default: 'center'
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
export var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
content: 'media|unsupportedBlock+|media unsupportedBlock+'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
export var mediaSingleSpec = function mediaSingleSpec(_ref) {
|
|
35
|
+
var _ref$withCaption = _ref.withCaption,
|
|
36
|
+
withCaption = _ref$withCaption === void 0 ? false : _ref$withCaption,
|
|
37
|
+
_ref$withExtendedWidt = _ref.withExtendedWidthTypes,
|
|
38
|
+
withExtendedWidthTypes = _ref$withExtendedWidt === void 0 ? false : _ref$withExtendedWidt;
|
|
39
|
+
var content = withCaption ? 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*' : 'media|unsupportedBlock+|media unsupportedBlock+';
|
|
40
|
+
var atom = !withCaption;
|
|
41
|
+
var getAttrs = function getAttrs(dom) {
|
|
42
|
+
var domAttrs = {
|
|
43
|
+
layout: dom.getAttribute('data-layout') || 'center',
|
|
44
|
+
width: Number(dom.getAttribute('data-width')) || null
|
|
45
|
+
};
|
|
46
|
+
if (withExtendedWidthTypes) {
|
|
47
|
+
var widthType = dom.getAttribute('data-width-type');
|
|
48
|
+
if (widthType) {
|
|
49
|
+
return _objectSpread(_objectSpread({}, domAttrs), {}, {
|
|
50
|
+
widthType: widthType
|
|
51
|
+
});
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
return domAttrs;
|
|
55
|
+
};
|
|
56
|
+
var getAttrsFromNode = function getAttrsFromNode(node) {
|
|
52
57
|
var _node$attrs = node.attrs,
|
|
53
58
|
layout = _node$attrs.layout,
|
|
54
59
|
width = _node$attrs.width;
|
|
@@ -60,12 +65,50 @@ export var mediaSingle = {
|
|
|
60
65
|
if (width) {
|
|
61
66
|
attrs['data-width'] = isFinite(width) && Math.floor(width) === width ? width : width.toFixed(2);
|
|
62
67
|
}
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
if (withExtendedWidthTypes && node.attrs.widthType) {
|
|
69
|
+
var widthType = node.attrs.widthType;
|
|
70
|
+
return _objectSpread(_objectSpread({}, attrs), {}, {
|
|
71
|
+
'data-width-type': widthType || 'percentage'
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return attrs;
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
inline: false,
|
|
78
|
+
group: 'block',
|
|
79
|
+
selectable: true,
|
|
80
|
+
atom: atom,
|
|
81
|
+
content: content,
|
|
82
|
+
attrs: withExtendedWidthTypes ? _objectSpread(_objectSpread({}, defaultAttrs), {}, {
|
|
83
|
+
widthType: {
|
|
84
|
+
default: null
|
|
85
|
+
}
|
|
86
|
+
}) : defaultAttrs,
|
|
87
|
+
marks: 'unsupportedMark unsupportedNodeAttribute border link',
|
|
88
|
+
parseDOM: [{
|
|
89
|
+
tag: 'div[data-node-type="mediaSingle"]',
|
|
90
|
+
getAttrs: getAttrs
|
|
91
|
+
}],
|
|
92
|
+
toDOM: function toDOM(node) {
|
|
93
|
+
return ['div', getAttrsFromNode(node), 0];
|
|
94
|
+
}
|
|
95
|
+
};
|
|
65
96
|
};
|
|
66
|
-
export var
|
|
67
|
-
|
|
68
|
-
|
|
97
|
+
export var mediaSingle = mediaSingleSpec({
|
|
98
|
+
withCaption: false,
|
|
99
|
+
withExtendedWidthTypes: false
|
|
100
|
+
});
|
|
101
|
+
export var mediaSingleWithCaption = mediaSingleSpec({
|
|
102
|
+
withCaption: true,
|
|
103
|
+
withExtendedWidthTypes: false
|
|
104
|
+
});
|
|
105
|
+
export var mediaSingleWithWidthType = mediaSingleSpec({
|
|
106
|
+
withCaption: false,
|
|
107
|
+
withExtendedWidthTypes: true
|
|
108
|
+
});
|
|
109
|
+
export var mediaSingleFull = mediaSingleSpec({
|
|
110
|
+
withCaption: true,
|
|
111
|
+
withExtendedWidthTypes: true
|
|
69
112
|
});
|
|
70
113
|
export var toJSON = function toJSON(node) {
|
|
71
114
|
return {
|
package/dist/esm/version.json
CHANGED
|
@@ -1301,28 +1301,68 @@
|
|
|
1301
1301
|
]
|
|
1302
1302
|
},
|
|
1303
1303
|
"attrs": {
|
|
1304
|
-
"
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
"
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
"
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
"
|
|
1319
|
-
|
|
1304
|
+
"anyOf": [
|
|
1305
|
+
{
|
|
1306
|
+
"type": "object",
|
|
1307
|
+
"properties": {
|
|
1308
|
+
"widthType": {
|
|
1309
|
+
"enum": [
|
|
1310
|
+
"percentage"
|
|
1311
|
+
]
|
|
1312
|
+
},
|
|
1313
|
+
"width": {
|
|
1314
|
+
"type": "number",
|
|
1315
|
+
"minimum": 0,
|
|
1316
|
+
"maximum": 100
|
|
1317
|
+
},
|
|
1318
|
+
"layout": {
|
|
1319
|
+
"enum": [
|
|
1320
|
+
"wide",
|
|
1321
|
+
"full-width",
|
|
1322
|
+
"center",
|
|
1323
|
+
"wrap-right",
|
|
1324
|
+
"wrap-left",
|
|
1325
|
+
"align-end",
|
|
1326
|
+
"align-start"
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
"additionalProperties": false,
|
|
1331
|
+
"required": [
|
|
1332
|
+
"layout"
|
|
1320
1333
|
]
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"type": "object",
|
|
1337
|
+
"properties": {
|
|
1338
|
+
"width": {
|
|
1339
|
+
"type": "number",
|
|
1340
|
+
"minimum": 0
|
|
1341
|
+
},
|
|
1342
|
+
"widthType": {
|
|
1343
|
+
"enum": [
|
|
1344
|
+
"pixel"
|
|
1345
|
+
]
|
|
1346
|
+
},
|
|
1347
|
+
"layout": {
|
|
1348
|
+
"enum": [
|
|
1349
|
+
"wide",
|
|
1350
|
+
"full-width",
|
|
1351
|
+
"center",
|
|
1352
|
+
"wrap-right",
|
|
1353
|
+
"wrap-left",
|
|
1354
|
+
"align-end",
|
|
1355
|
+
"align-start"
|
|
1356
|
+
]
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
"required": [
|
|
1360
|
+
"width",
|
|
1361
|
+
"widthType",
|
|
1362
|
+
"layout"
|
|
1363
|
+
],
|
|
1364
|
+
"additionalProperties": false
|
|
1321
1365
|
}
|
|
1322
|
-
},
|
|
1323
|
-
"additionalProperties": false,
|
|
1324
|
-
"required": [
|
|
1325
|
-
"layout"
|
|
1326
1366
|
]
|
|
1327
1367
|
},
|
|
1328
1368
|
"marks": {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette,
|
|
2
2
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
3
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, 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, } from './schema';
|
|
4
|
-
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, } from './schema';
|
|
3
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, 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, } from './schema';
|
|
4
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, 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, } from './schema';
|
|
5
5
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, } from './utils';
|
|
6
6
|
export type { Match, NameToEmoji } from './utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, } from './nodes';
|
|
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, RichMediaLayout, CellDomAttrs, } from './nodes';
|
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, 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, } from './nodes';
|
|
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, } from './nodes';
|
|
3
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
|
4
4
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
5
5
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, } from './marks';
|
|
@@ -41,7 +41,7 @@ export { mediaGroup } from './media-group';
|
|
|
41
41
|
export { mediaInline } from './media-inline';
|
|
42
42
|
export type { MediaInlineAttributes, MediaInlineDefinition, } from './media-inline';
|
|
43
43
|
export type { MediaGroupDefinition } from './media-group';
|
|
44
|
-
export { mediaSingle, mediaSingleWithCaption, toJSON as mediaSingleToJSON, } from './media-single';
|
|
44
|
+
export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, toJSON as mediaSingleToJSON, } from './media-single';
|
|
45
45
|
export type { MediaSingleDefinition } from './media-single';
|
|
46
46
|
export { table, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes';
|
|
47
47
|
export type { TableAttributes, CellAttributes, Layout as TableLayout, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, CellDomAttrs, } from './tableNodes';
|
|
@@ -90,4 +90,4 @@ export type { NestedExpandContent } from './nested-expand';
|
|
|
90
90
|
export type { Layout as ExtensionLayout } from './types/extensions';
|
|
91
91
|
export { embedCard } from './embed-card';
|
|
92
92
|
export type { EmbedCardDefinition, EmbedCardAttributes } from './embed-card';
|
|
93
|
-
export type { RichMediaAttributes, Layout as RichMediaLayout, } from './types/rich-media-common';
|
|
93
|
+
export type { RichMediaAttributes, ExtendedMediaAttributes, Layout as RichMediaLayout, } from './types/rich-media-common';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NodeSpec, Node } from 'prosemirror-model';
|
|
1
|
+
import { NodeSpec, Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { MediaDefinition as Media } from './media';
|
|
3
3
|
import { LinkDefinition } from '../marks/link';
|
|
4
|
-
import {
|
|
4
|
+
import { ExtendedMediaAttributes } from './types/rich-media-common';
|
|
5
5
|
import { CaptionDefinition as Caption } from './caption';
|
|
6
6
|
export type MediaSingleDefinition = MediaSingleFullDefinition | MediaSingleWithCaptionDefinition;
|
|
7
7
|
/**
|
|
@@ -10,7 +10,7 @@ export type MediaSingleDefinition = MediaSingleFullDefinition | MediaSingleWithC
|
|
|
10
10
|
*/
|
|
11
11
|
export interface MediaSingleBaseDefinition {
|
|
12
12
|
type: 'mediaSingle';
|
|
13
|
-
attrs?:
|
|
13
|
+
attrs?: ExtendedMediaAttributes;
|
|
14
14
|
marks?: Array<LinkDefinition>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -51,8 +51,14 @@ export declare const defaultAttrs: {
|
|
|
51
51
|
default: string;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
+
export declare const mediaSingleSpec: ({ withCaption, withExtendedWidthTypes, }: {
|
|
55
|
+
withCaption?: boolean | undefined;
|
|
56
|
+
withExtendedWidthTypes?: boolean | undefined;
|
|
57
|
+
}) => NodeSpec;
|
|
54
58
|
export declare const mediaSingle: NodeSpec;
|
|
55
59
|
export declare const mediaSingleWithCaption: NodeSpec;
|
|
56
|
-
export declare const
|
|
60
|
+
export declare const mediaSingleWithWidthType: NodeSpec;
|
|
61
|
+
export declare const mediaSingleFull: NodeSpec;
|
|
62
|
+
export declare const toJSON: (node: PMNode) => {
|
|
57
63
|
attrs: any;
|
|
58
64
|
};
|
|
@@ -11,3 +11,24 @@ export interface OptionalRichMediaAttributes {
|
|
|
11
11
|
width?: number;
|
|
12
12
|
layout?: Layout;
|
|
13
13
|
}
|
|
14
|
+
interface DefaultMediaAttributes extends RichMediaAttributes {
|
|
15
|
+
/**
|
|
16
|
+
* @stage 0
|
|
17
|
+
* @description optional widthType attribute for media with percentage layout
|
|
18
|
+
*/
|
|
19
|
+
widthType?: 'percentage';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @stage 0
|
|
23
|
+
* @description The widthType attribute is used to support fixed with media single
|
|
24
|
+
*/
|
|
25
|
+
interface FixedLayoutMediaAttributes {
|
|
26
|
+
/**
|
|
27
|
+
* @minimum 0
|
|
28
|
+
*/
|
|
29
|
+
width: number;
|
|
30
|
+
widthType: 'pixel';
|
|
31
|
+
layout: Layout;
|
|
32
|
+
}
|
|
33
|
+
export type ExtendedMediaAttributes = DefaultMediaAttributes | FixedLayoutMediaAttributes;
|
|
34
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette,
|
|
2
2
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
3
|
-
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, 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, } from './schema';
|
|
4
|
-
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, DataConsumerAttributes, DataConsumerDefinition, DataType, DateDefinition, DecisionItemDefinition, DecisionListDefinition, DocNode, EmbedCardDefinition, EmbedCardAttributes, EmDefinition, EmojiAttributes, EmojiDefinition, ExpandDefinition, ExtensionDefinition, ExtensionLayout, ExternalMediaAttributes, FragmentAttributes, FragmentDefinition, HardBreakDefinition, HeadingBaseDefinition, HeadingDefinition, HeadingWithAlignmentDefinition, HeadingWithIndentationDefinition, HeadingWithMarksDefinition, IndentationMarkAttributes, IndentationMarkDefinition, Inline, InlineAtomic, InlineCardDefinition, InlineCode, InlineExtensionDefinition, InlineFormattedText, InlineLinkText, LayoutColumnDefinition, LayoutSectionDefinition, LayoutSectionFullDefinition, LayoutSectionWithSingleColumnDefinition, LinkAttributes, LinkDefinition, ListItemArray, ListItemDefinition, MarksObject, MediaADFAttrs, MediaAttributes, MediaInlineAttributes, MediaInlineDefinition, MediaBaseAttributes, MediaDefinition, MediaDisplayType, MediaGroupDefinition, MediaSingleDefinition, MediaType, MentionAttributes, MentionDefinition, MentionUserType, NestedExpandContent, NestedExpandDefinition, NoMark, NonNestableBlockContent, OrderedListDefinition, PanelAttributes, PanelDefinition, ParagraphBaseDefinition, ParagraphDefinition, ParagraphWithAlignmentDefinition, ParagraphWithIndentationDefinition, ParagraphWithMarksDefinition, PlaceholderDefinition, RuleDefinition, StatusDefinition, StrikeDefinition, StrongDefinition, SubSupAttributes, SubSupDefinition, TableAttributes, TableCellDefinition, TableDefinition, TableHeaderDefinition, TableLayout, TableRowDefinition, TaskItemDefinition, TaskListContent, TaskListDefinition, TextColorAttributes, TextColorDefinition, TextDefinition, UnderlineDefinition, UrlType, AnnotationId, RichMediaAttributes, RichMediaLayout, AnnotationDataAttributes, CellDomAttrs, BorderMarkAttributes, BorderMarkDefinition, } from './schema';
|
|
3
|
+
colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, media, mediaGroup, mediaSingle, mediaSingleWithCaption, 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, } from './schema';
|
|
4
|
+
export type { AlignmentAttributes, AlignmentMarkDefinition, AnnotationMarkAttributes, AnnotationMarkDefinition, BlockCardDefinition, BlockContent, BlockQuoteDefinition, BodiedExtensionDefinition, BreakoutMarkAttrs, BreakoutMarkDefinition, BulletListDefinition, CaptionDefinition, CardAttributes, CellAttributes, CodeBlockAttrs, CodeBlockBaseDefinition, CodeBlockDefinition, CodeBlockWithMarksDefinition, CodeDefinition, DatasourceAttributes, 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, } from './schema';
|
|
5
5
|
export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, } from './utils';
|
|
6
6
|
export type { Match, NameToEmoji } from './utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, mediaInline, mediaSingleWithCaption, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, } from './nodes';
|
|
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, RichMediaLayout, CellDomAttrs, } from './nodes';
|
|
1
|
+
export { PanelType, blockCard, blockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, media, mediaGroup, mediaSingle, 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, } from './nodes';
|
|
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, } from './nodes';
|
|
3
3
|
export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
|
|
4
4
|
/** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
|
|
5
5
|
colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, } from './marks';
|
|
@@ -41,7 +41,7 @@ export { mediaGroup } from './media-group';
|
|
|
41
41
|
export { mediaInline } from './media-inline';
|
|
42
42
|
export type { MediaInlineAttributes, MediaInlineDefinition, } from './media-inline';
|
|
43
43
|
export type { MediaGroupDefinition } from './media-group';
|
|
44
|
-
export { mediaSingle, mediaSingleWithCaption, toJSON as mediaSingleToJSON, } from './media-single';
|
|
44
|
+
export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, toJSON as mediaSingleToJSON, } from './media-single';
|
|
45
45
|
export type { MediaSingleDefinition } from './media-single';
|
|
46
46
|
export { table, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector, } from './tableNodes';
|
|
47
47
|
export type { TableAttributes, CellAttributes, Layout as TableLayout, TableDefinition, TableCell as TableCellDefinition, TableHeader as TableHeaderDefinition, TableRow as TableRowDefinition, CellDomAttrs, } from './tableNodes';
|
|
@@ -90,4 +90,4 @@ export type { NestedExpandContent } from './nested-expand';
|
|
|
90
90
|
export type { Layout as ExtensionLayout } from './types/extensions';
|
|
91
91
|
export { embedCard } from './embed-card';
|
|
92
92
|
export type { EmbedCardDefinition, EmbedCardAttributes } from './embed-card';
|
|
93
|
-
export type { RichMediaAttributes, Layout as RichMediaLayout, } from './types/rich-media-common';
|
|
93
|
+
export type { RichMediaAttributes, ExtendedMediaAttributes, Layout as RichMediaLayout, } from './types/rich-media-common';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NodeSpec, Node } from 'prosemirror-model';
|
|
1
|
+
import { NodeSpec, Node as PMNode } from 'prosemirror-model';
|
|
2
2
|
import { MediaDefinition as Media } from './media';
|
|
3
3
|
import { LinkDefinition } from '../marks/link';
|
|
4
|
-
import {
|
|
4
|
+
import { ExtendedMediaAttributes } from './types/rich-media-common';
|
|
5
5
|
import { CaptionDefinition as Caption } from './caption';
|
|
6
6
|
export type MediaSingleDefinition = MediaSingleFullDefinition | MediaSingleWithCaptionDefinition;
|
|
7
7
|
/**
|
|
@@ -10,7 +10,7 @@ export type MediaSingleDefinition = MediaSingleFullDefinition | MediaSingleWithC
|
|
|
10
10
|
*/
|
|
11
11
|
export interface MediaSingleBaseDefinition {
|
|
12
12
|
type: 'mediaSingle';
|
|
13
|
-
attrs?:
|
|
13
|
+
attrs?: ExtendedMediaAttributes;
|
|
14
14
|
marks?: Array<LinkDefinition>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -54,8 +54,14 @@ export declare const defaultAttrs: {
|
|
|
54
54
|
default: string;
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
+
export declare const mediaSingleSpec: ({ withCaption, withExtendedWidthTypes, }: {
|
|
58
|
+
withCaption?: boolean | undefined;
|
|
59
|
+
withExtendedWidthTypes?: boolean | undefined;
|
|
60
|
+
}) => NodeSpec;
|
|
57
61
|
export declare const mediaSingle: NodeSpec;
|
|
58
62
|
export declare const mediaSingleWithCaption: NodeSpec;
|
|
59
|
-
export declare const
|
|
63
|
+
export declare const mediaSingleWithWidthType: NodeSpec;
|
|
64
|
+
export declare const mediaSingleFull: NodeSpec;
|
|
65
|
+
export declare const toJSON: (node: PMNode) => {
|
|
60
66
|
attrs: any;
|
|
61
67
|
};
|
|
@@ -11,3 +11,24 @@ export interface OptionalRichMediaAttributes {
|
|
|
11
11
|
width?: number;
|
|
12
12
|
layout?: Layout;
|
|
13
13
|
}
|
|
14
|
+
interface DefaultMediaAttributes extends RichMediaAttributes {
|
|
15
|
+
/**
|
|
16
|
+
* @stage 0
|
|
17
|
+
* @description optional widthType attribute for media with percentage layout
|
|
18
|
+
*/
|
|
19
|
+
widthType?: 'percentage';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @stage 0
|
|
23
|
+
* @description The widthType attribute is used to support fixed with media single
|
|
24
|
+
*/
|
|
25
|
+
interface FixedLayoutMediaAttributes {
|
|
26
|
+
/**
|
|
27
|
+
* @minimum 0
|
|
28
|
+
*/
|
|
29
|
+
width: number;
|
|
30
|
+
widthType: 'pixel';
|
|
31
|
+
layout: Layout;
|
|
32
|
+
}
|
|
33
|
+
export type ExtendedMediaAttributes = DefaultMediaAttributes | FixedLayoutMediaAttributes;
|
|
34
|
+
export {};
|
|
@@ -1301,28 +1301,68 @@
|
|
|
1301
1301
|
]
|
|
1302
1302
|
},
|
|
1303
1303
|
"attrs": {
|
|
1304
|
-
"
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
"
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
"
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
"
|
|
1319
|
-
|
|
1304
|
+
"anyOf": [
|
|
1305
|
+
{
|
|
1306
|
+
"type": "object",
|
|
1307
|
+
"properties": {
|
|
1308
|
+
"widthType": {
|
|
1309
|
+
"enum": [
|
|
1310
|
+
"percentage"
|
|
1311
|
+
]
|
|
1312
|
+
},
|
|
1313
|
+
"width": {
|
|
1314
|
+
"type": "number",
|
|
1315
|
+
"minimum": 0,
|
|
1316
|
+
"maximum": 100
|
|
1317
|
+
},
|
|
1318
|
+
"layout": {
|
|
1319
|
+
"enum": [
|
|
1320
|
+
"wide",
|
|
1321
|
+
"full-width",
|
|
1322
|
+
"center",
|
|
1323
|
+
"wrap-right",
|
|
1324
|
+
"wrap-left",
|
|
1325
|
+
"align-end",
|
|
1326
|
+
"align-start"
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
"additionalProperties": false,
|
|
1331
|
+
"required": [
|
|
1332
|
+
"layout"
|
|
1320
1333
|
]
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"type": "object",
|
|
1337
|
+
"properties": {
|
|
1338
|
+
"width": {
|
|
1339
|
+
"type": "number",
|
|
1340
|
+
"minimum": 0
|
|
1341
|
+
},
|
|
1342
|
+
"widthType": {
|
|
1343
|
+
"enum": [
|
|
1344
|
+
"pixel"
|
|
1345
|
+
]
|
|
1346
|
+
},
|
|
1347
|
+
"layout": {
|
|
1348
|
+
"enum": [
|
|
1349
|
+
"wide",
|
|
1350
|
+
"full-width",
|
|
1351
|
+
"center",
|
|
1352
|
+
"wrap-right",
|
|
1353
|
+
"wrap-left",
|
|
1354
|
+
"align-end",
|
|
1355
|
+
"align-start"
|
|
1356
|
+
]
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
"required": [
|
|
1360
|
+
"width",
|
|
1361
|
+
"widthType",
|
|
1362
|
+
"layout"
|
|
1363
|
+
],
|
|
1364
|
+
"additionalProperties": false
|
|
1321
1365
|
}
|
|
1322
|
-
},
|
|
1323
|
-
"additionalProperties": false,
|
|
1324
|
-
"required": [
|
|
1325
|
-
"layout"
|
|
1326
1366
|
]
|
|
1327
1367
|
},
|
|
1328
1368
|
"marks": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/adf-schema",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.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/"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"prosemirror-transform": "1.3.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
61
|
+
"@atlaskit/editor-test-helpers": "^18.8.0",
|
|
62
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
63
63
|
"@types/linkify-it": "^2.0.4",
|
|
64
64
|
"@types/prosemirror-history": "^1.0.1",
|
package/report.api.md
CHANGED
|
@@ -495,6 +495,11 @@ export interface DecisionListDefinition {
|
|
|
495
495
|
// @public (undocumented)
|
|
496
496
|
export const decisionListSelector: string;
|
|
497
497
|
|
|
498
|
+
// @public (undocumented)
|
|
499
|
+
interface DefaultMediaAttributes extends RichMediaAttributes {
|
|
500
|
+
widthType?: 'percentage';
|
|
501
|
+
}
|
|
502
|
+
|
|
498
503
|
// @public (undocumented)
|
|
499
504
|
export const doc: NodeSpec;
|
|
500
505
|
|
|
@@ -596,6 +601,11 @@ export const expandToJSON: (node: Node_2) => {
|
|
|
596
601
|
type ExpandWithBreakoutDefinition = ExpandBaseDefinition &
|
|
597
602
|
MarksObject<BreakoutMarkDefinition>;
|
|
598
603
|
|
|
604
|
+
// @public (undocumented)
|
|
605
|
+
export type ExtendedMediaAttributes =
|
|
606
|
+
| DefaultMediaAttributes
|
|
607
|
+
| FixedLayoutMediaAttributes;
|
|
608
|
+
|
|
599
609
|
// @public (undocumented)
|
|
600
610
|
export const extension: NodeSpec;
|
|
601
611
|
|
|
@@ -648,6 +658,16 @@ export interface ExternalMediaAttributes {
|
|
|
648
658
|
width?: number;
|
|
649
659
|
}
|
|
650
660
|
|
|
661
|
+
// @public
|
|
662
|
+
interface FixedLayoutMediaAttributes {
|
|
663
|
+
// (undocumented)
|
|
664
|
+
layout: RichMediaLayout;
|
|
665
|
+
// (undocumented)
|
|
666
|
+
width: number;
|
|
667
|
+
// (undocumented)
|
|
668
|
+
widthType: 'pixel';
|
|
669
|
+
}
|
|
670
|
+
|
|
651
671
|
// @public (undocumented)
|
|
652
672
|
export const fragment: MarkSpec;
|
|
653
673
|
|
|
@@ -1114,7 +1134,7 @@ export const mediaSingle: NodeSpec;
|
|
|
1114
1134
|
// @public
|
|
1115
1135
|
interface MediaSingleBaseDefinition {
|
|
1116
1136
|
// (undocumented)
|
|
1117
|
-
attrs?:
|
|
1137
|
+
attrs?: ExtendedMediaAttributes;
|
|
1118
1138
|
// (undocumented)
|
|
1119
1139
|
marks?: Array<LinkDefinition>;
|
|
1120
1140
|
// (undocumented)
|
|
@@ -1126,6 +1146,9 @@ export type MediaSingleDefinition =
|
|
|
1126
1146
|
| MediaSingleFullDefinition
|
|
1127
1147
|
| MediaSingleWithCaptionDefinition;
|
|
1128
1148
|
|
|
1149
|
+
// @public (undocumented)
|
|
1150
|
+
export const mediaSingleFull: NodeSpec;
|
|
1151
|
+
|
|
1129
1152
|
// @public
|
|
1130
1153
|
interface MediaSingleFullContent {
|
|
1131
1154
|
content: Array<MediaDefinition>;
|
|
@@ -1135,6 +1158,15 @@ interface MediaSingleFullContent {
|
|
|
1135
1158
|
type MediaSingleFullDefinition = MediaSingleBaseDefinition &
|
|
1136
1159
|
MediaSingleFullContent;
|
|
1137
1160
|
|
|
1161
|
+
// @public (undocumented)
|
|
1162
|
+
export const mediaSingleSpec: ({
|
|
1163
|
+
withCaption,
|
|
1164
|
+
withExtendedWidthTypes,
|
|
1165
|
+
}: {
|
|
1166
|
+
withCaption?: boolean | undefined;
|
|
1167
|
+
withExtendedWidthTypes?: boolean | undefined;
|
|
1168
|
+
}) => NodeSpec;
|
|
1169
|
+
|
|
1138
1170
|
// @public (undocumented)
|
|
1139
1171
|
export const mediaSingleToJSON: (node: Node_2) => {
|
|
1140
1172
|
attrs: any;
|
|
@@ -1147,6 +1179,9 @@ export const mediaSingleWithCaption: NodeSpec;
|
|
|
1147
1179
|
type MediaSingleWithCaptionDefinition = MediaSingleBaseDefinition &
|
|
1148
1180
|
MediaCaptionContent;
|
|
1149
1181
|
|
|
1182
|
+
// @public (undocumented)
|
|
1183
|
+
export const mediaSingleWithWidthType: NodeSpec;
|
|
1184
|
+
|
|
1150
1185
|
// @public (undocumented)
|
|
1151
1186
|
export const mediaToJSON: (node: Node_2) => {
|
|
1152
1187
|
attrs: Record<string, any>;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -441,6 +441,11 @@ export interface DecisionListDefinition {
|
|
|
441
441
|
// @public (undocumented)
|
|
442
442
|
export const decisionListSelector: string;
|
|
443
443
|
|
|
444
|
+
// @public (undocumented)
|
|
445
|
+
interface DefaultMediaAttributes extends RichMediaAttributes {
|
|
446
|
+
widthType?: 'percentage';
|
|
447
|
+
}
|
|
448
|
+
|
|
444
449
|
// @public (undocumented)
|
|
445
450
|
export const doc: NodeSpec;
|
|
446
451
|
|
|
@@ -535,6 +540,9 @@ export const expandToJSON: (node: Node_2) => {
|
|
|
535
540
|
// @public
|
|
536
541
|
type ExpandWithBreakoutDefinition = ExpandBaseDefinition & MarksObject<BreakoutMarkDefinition>;
|
|
537
542
|
|
|
543
|
+
// @public (undocumented)
|
|
544
|
+
export type ExtendedMediaAttributes = DefaultMediaAttributes | FixedLayoutMediaAttributes;
|
|
545
|
+
|
|
538
546
|
// @public (undocumented)
|
|
539
547
|
export const extension: NodeSpec;
|
|
540
548
|
|
|
@@ -586,6 +594,16 @@ export interface ExternalMediaAttributes {
|
|
|
586
594
|
width?: number;
|
|
587
595
|
}
|
|
588
596
|
|
|
597
|
+
// @public
|
|
598
|
+
interface FixedLayoutMediaAttributes {
|
|
599
|
+
// (undocumented)
|
|
600
|
+
layout: RichMediaLayout;
|
|
601
|
+
// (undocumented)
|
|
602
|
+
width: number;
|
|
603
|
+
// (undocumented)
|
|
604
|
+
widthType: 'pixel';
|
|
605
|
+
}
|
|
606
|
+
|
|
589
607
|
// @public (undocumented)
|
|
590
608
|
export const fragment: MarkSpec;
|
|
591
609
|
|
|
@@ -1011,7 +1029,7 @@ export const mediaSingle: NodeSpec;
|
|
|
1011
1029
|
// @public
|
|
1012
1030
|
interface MediaSingleBaseDefinition {
|
|
1013
1031
|
// (undocumented)
|
|
1014
|
-
attrs?:
|
|
1032
|
+
attrs?: ExtendedMediaAttributes;
|
|
1015
1033
|
// (undocumented)
|
|
1016
1034
|
marks?: Array<LinkDefinition>;
|
|
1017
1035
|
// (undocumented)
|
|
@@ -1021,6 +1039,9 @@ interface MediaSingleBaseDefinition {
|
|
|
1021
1039
|
// @public (undocumented)
|
|
1022
1040
|
export type MediaSingleDefinition = MediaSingleFullDefinition | MediaSingleWithCaptionDefinition;
|
|
1023
1041
|
|
|
1042
|
+
// @public (undocumented)
|
|
1043
|
+
export const mediaSingleFull: NodeSpec;
|
|
1044
|
+
|
|
1024
1045
|
// @public
|
|
1025
1046
|
interface MediaSingleFullContent {
|
|
1026
1047
|
content: Array<MediaDefinition>;
|
|
@@ -1029,6 +1050,12 @@ interface MediaSingleFullContent {
|
|
|
1029
1050
|
// @public
|
|
1030
1051
|
type MediaSingleFullDefinition = MediaSingleBaseDefinition & MediaSingleFullContent;
|
|
1031
1052
|
|
|
1053
|
+
// @public (undocumented)
|
|
1054
|
+
export const mediaSingleSpec: ({ withCaption, withExtendedWidthTypes, }: {
|
|
1055
|
+
withCaption?: boolean | undefined;
|
|
1056
|
+
withExtendedWidthTypes?: boolean | undefined;
|
|
1057
|
+
}) => NodeSpec;
|
|
1058
|
+
|
|
1032
1059
|
// @public (undocumented)
|
|
1033
1060
|
export const mediaSingleToJSON: (node: Node_2) => {
|
|
1034
1061
|
attrs: any;
|
|
@@ -1040,6 +1067,9 @@ export const mediaSingleWithCaption: NodeSpec;
|
|
|
1040
1067
|
// @public
|
|
1041
1068
|
type MediaSingleWithCaptionDefinition = MediaSingleBaseDefinition & MediaCaptionContent;
|
|
1042
1069
|
|
|
1070
|
+
// @public (undocumented)
|
|
1071
|
+
export const mediaSingleWithWidthType: NodeSpec;
|
|
1072
|
+
|
|
1043
1073
|
// @public (undocumented)
|
|
1044
1074
|
export const mediaToJSON: (node: Node_2) => {
|
|
1045
1075
|
attrs: Record<string, any>;
|