@atlaskit/editor-common 76.33.2 → 76.34.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/media-inline/media-inline-image-card.js +24 -19
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +7 -0
- package/dist/cjs/utils/insert-node-into-ordered-list.js +91 -0
- package/dist/es2019/media-inline/media-inline-image-card.js +24 -19
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -0
- package/dist/es2019/utils/insert-node-into-ordered-list.js +84 -0
- package/dist/esm/media-inline/media-inline-image-card.js +24 -19
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/insert-node-into-ordered-list.js +84 -0
- package/dist/types/extensions/types/extension-handler.d.ts +2 -0
- package/dist/types/media-inline/media-inline-image-card.d.ts +3 -2
- package/dist/types/media-inline/types.d.ts +6 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/insert-node-into-ordered-list.d.ts +3 -0
- package/dist/types-ts4.5/extensions/types/extension-handler.d.ts +2 -0
- package/dist/types-ts4.5/media-inline/media-inline-image-card.d.ts +3 -2
- package/dist/types-ts4.5/media-inline/types.d.ts +6 -2
- package/dist/types-ts4.5/utils/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/insert-node-into-ordered-list.d.ts +3 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 76.34.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#64836](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64836) [`f3e1604287a9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f3e1604287a9) - ED-20879 add ssr support for mediaInline
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#64335](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64335) [`efc8826c907f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/efc8826c907f) - [ux] [ED-16509] Restart numbered list inserting nodes via QUICK INSERT, nodes including : panels, expands, decisions, tables, layout, quotes, actions, dividers, headings. Changes are being guarded behind feature flag platform.editor.ordered-list-inserting-nodes_bh0vo
|
|
12
|
+
- [#63266](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63266) [`630f6c9fc80c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/630f6c9fc80c) - ED-21576: Added new Example for MBE - Interactive Fake Tabs
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 76.33.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -26,7 +26,8 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
|
|
|
26
26
|
isLazy = _ref.isLazy,
|
|
27
27
|
width = _ref.width,
|
|
28
28
|
height = _ref.height,
|
|
29
|
-
border = _ref.border
|
|
29
|
+
border = _ref.border,
|
|
30
|
+
ssr = _ref.ssr;
|
|
30
31
|
var _useState = (0, _react.useState)(),
|
|
31
32
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
33
|
fileState = _useState2[0],
|
|
@@ -40,21 +41,23 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
|
|
|
40
41
|
}),
|
|
41
42
|
formatMessage = _ref2.formatMessage;
|
|
42
43
|
(0, _react.useEffect)(function () {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
if (mediaClient) {
|
|
45
|
+
var subscription = mediaClient.file.getFileState(identifier.id, {
|
|
46
|
+
collectionName: identifier.collectionName
|
|
47
|
+
}).subscribe({
|
|
48
|
+
next: function next(fileState) {
|
|
49
|
+
setFileState(fileState);
|
|
50
|
+
setSubscribeError(undefined);
|
|
51
|
+
},
|
|
52
|
+
error: function error(e) {
|
|
53
|
+
setSubscribeError(e);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return function () {
|
|
57
|
+
subscription.unsubscribe();
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}, [identifier, mediaClient]);
|
|
58
61
|
var content = function content(dimensions) {
|
|
59
62
|
if (subscribeError) {
|
|
60
63
|
var isUploading = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading';
|
|
@@ -79,18 +82,20 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
|
|
|
79
82
|
message: formatMessage(_mediaInlineCard.messages.unableToLoadContent)
|
|
80
83
|
});
|
|
81
84
|
}
|
|
85
|
+
var mediaClientConfig = (ssr === null || ssr === void 0 ? void 0 : ssr.config) || (mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig);
|
|
82
86
|
if (!fileState) {
|
|
83
87
|
return (0, _react2.jsx)(_loadingView.InlineImageCardLoadingView, null);
|
|
84
88
|
}
|
|
85
89
|
return (0, _react2.jsx)(_mediaCard.Card, {
|
|
86
|
-
mediaClientConfig:
|
|
90
|
+
mediaClientConfig: mediaClientConfig,
|
|
87
91
|
isLazy: isLazy,
|
|
88
92
|
identifier: identifier,
|
|
89
93
|
dimensions: dimensions,
|
|
90
94
|
selectable: true,
|
|
91
95
|
disableOverlay: true,
|
|
92
96
|
selected: isSelected,
|
|
93
|
-
alt: alt
|
|
97
|
+
alt: alt,
|
|
98
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
94
99
|
});
|
|
95
100
|
};
|
|
96
101
|
var aspectRatio = (0, _react.useMemo)(function () {
|
|
@@ -99,7 +104,7 @@ var MediaInlineImageCardInternal = exports.MediaInlineImageCardInternal = functi
|
|
|
99
104
|
|
|
100
105
|
/**
|
|
101
106
|
* scaledDimensions is used to define the correct media size fetched from media service
|
|
102
|
-
* inline images will only ever be
|
|
107
|
+
* inline images will only ever be rendered at a maximum height of H1 and so scaled dimensions
|
|
103
108
|
* will only ever return a width and height where the height has a maximum height of H1
|
|
104
109
|
*/
|
|
105
110
|
var scaledDimension = (0, _react.useMemo)(function () {
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "76.
|
|
19
|
+
var packageVersion = "76.34.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
22
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "76.
|
|
25
|
+
var packageVersion = "76.34.0";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -1028,6 +1028,12 @@ Object.defineProperty(exports, "todayTimestampInUTC", {
|
|
|
1028
1028
|
return _date.todayTimestampInUTC;
|
|
1029
1029
|
}
|
|
1030
1030
|
});
|
|
1031
|
+
Object.defineProperty(exports, "transformNodeIntoListItem", {
|
|
1032
|
+
enumerable: true,
|
|
1033
|
+
get: function get() {
|
|
1034
|
+
return _insertNodeIntoOrderedList.transformNodeIntoListItem;
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1031
1037
|
Object.defineProperty(exports, "unwrap", {
|
|
1032
1038
|
enumerable: true,
|
|
1033
1039
|
get: function get() {
|
|
@@ -1146,6 +1152,7 @@ var _countNodes = require("./count-nodes");
|
|
|
1146
1152
|
var _inputRules = require("./input-rules");
|
|
1147
1153
|
var _dedupe = require("./dedupe");
|
|
1148
1154
|
var _createWrapSelectionTransaction = require("./create-wrap-selection-transaction");
|
|
1155
|
+
var _insertNodeIntoOrderedList = require("./insert-node-into-ordered-list");
|
|
1149
1156
|
var _wrapSelectionIn = require("./wrap-selection-in");
|
|
1150
1157
|
var _calculateToolbarPosition = require("./calculate-toolbar-position");
|
|
1151
1158
|
var _nodesByLocalIds = require("./nodes-by-localIds");
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.transformNodeIntoListItem = transformNodeIntoListItem;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
|
+
var _list = require("./list");
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function transformNodeIntoListItem(tr, node) {
|
|
14
|
+
var _tr$doc$nodeAt, _findParentNodeOfType;
|
|
15
|
+
var _tr$selection = tr.selection,
|
|
16
|
+
$to = _tr$selection.$to,
|
|
17
|
+
$from = _tr$selection.$from,
|
|
18
|
+
to = _tr$selection.to,
|
|
19
|
+
from = _tr$selection.from;
|
|
20
|
+
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
21
|
+
orderedList = _tr$doc$type$schema$n.orderedList,
|
|
22
|
+
bulletList = _tr$doc$type$schema$n.bulletList,
|
|
23
|
+
listItem = _tr$doc$type$schema$n.listItem;
|
|
24
|
+
var startLinePosition = $from.start();
|
|
25
|
+
var parentStartPosition = $from.depth === 0 ? 0 : $from.before();
|
|
26
|
+
|
|
27
|
+
// Setting the start position
|
|
28
|
+
var startMapped = startLinePosition === from ? parentStartPosition : from;
|
|
29
|
+
|
|
30
|
+
// Selected nodes
|
|
31
|
+
var selectionParentListItemNode = (0, _utils.findParentNodeOfType)(listItem)(tr.selection);
|
|
32
|
+
var selectionParentListNodeWithPos = (0, _utils.findParentNodeOfType)([bulletList, orderedList])(tr.selection);
|
|
33
|
+
var selectionParentListNode = selectionParentListNodeWithPos === null || selectionParentListNodeWithPos === void 0 ? void 0 : selectionParentListNodeWithPos.node;
|
|
34
|
+
if (!selectionParentListNodeWithPos) {
|
|
35
|
+
return tr;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Offsets
|
|
39
|
+
var listWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth + 1; // difference in depth between to position and list node
|
|
40
|
+
var listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
41
|
+
|
|
42
|
+
// Anything to do with nested lists should safeInsert and not be handled here
|
|
43
|
+
var grandParentListNode = (0, _utils.findParentNodeOfTypeClosestToPos)(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
44
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
45
|
+
var selectedListItemHasNestedList = false;
|
|
46
|
+
selectionParentListItemNode === null || selectionParentListItemNode === void 0 || selectionParentListItemNode.node.content.forEach(function (child) {
|
|
47
|
+
if ((0, _list.isListNode)(child)) {
|
|
48
|
+
selectedListItemHasNestedList = true;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
52
|
+
return (0, _utils.safeInsert)(node)(tr).scrollIntoView();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Check if node after the insert position is listItem
|
|
56
|
+
var isNodeAfterInsertPositionIsListItem = ((_tr$doc$nodeAt = tr.doc.nodeAt(to + listItemWrappingOffset)) === null || _tr$doc$nodeAt === void 0 ? void 0 : _tr$doc$nodeAt.type) === listItem;
|
|
57
|
+
var replaceTo;
|
|
58
|
+
if (isNodeAfterInsertPositionIsListItem) {
|
|
59
|
+
replaceTo = to + listItemWrappingOffset;
|
|
60
|
+
} else if (!isNodeAfterInsertPositionIsListItem) {
|
|
61
|
+
replaceTo = to;
|
|
62
|
+
} else {
|
|
63
|
+
replaceTo = to + listWrappingOffset;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// handle the insertion of the slice
|
|
67
|
+
tr.replaceWith(startMapped, replaceTo, node).scrollIntoView();
|
|
68
|
+
|
|
69
|
+
// Get the next list items position (used later to find the split out ordered list)
|
|
70
|
+
var indexOfNextListItem = $to.indexAfter($to.depth - listItemWrappingOffset);
|
|
71
|
+
var positionOfNextListItem = tr.doc.resolve(selectionParentListNodeWithPos.pos + 1).posAtIndex(indexOfNextListItem);
|
|
72
|
+
|
|
73
|
+
// Find the ordered list node after the pasted content so we can set it's order
|
|
74
|
+
var mappedPositionOfNextListItem = tr.mapping.map(positionOfNextListItem);
|
|
75
|
+
if (mappedPositionOfNextListItem > tr.doc.nodeSize) {
|
|
76
|
+
return tr;
|
|
77
|
+
}
|
|
78
|
+
var nodeAfterPastedContentResolvedPos = (0, _utils.findParentNodeOfTypeClosestToPos)(tr.doc.resolve(mappedPositionOfNextListItem), [orderedList]);
|
|
79
|
+
|
|
80
|
+
// Work out the new split out lists 'order' (the number it starts from)
|
|
81
|
+
var originalParentOrderedListNodeOrder = selectionParentListNode === null || selectionParentListNode === void 0 ? void 0 : selectionParentListNode.attrs.order;
|
|
82
|
+
var numOfListItemsInOriginalList = (_findParentNodeOfType = (0, _utils.findParentNodeOfTypeClosestToPos)(tr.doc.resolve(from - 1), [orderedList])) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node.childCount;
|
|
83
|
+
|
|
84
|
+
// Set the new split out lists order attribute
|
|
85
|
+
if (typeof originalParentOrderedListNodeOrder === 'number' && numOfListItemsInOriginalList && nodeAfterPastedContentResolvedPos) {
|
|
86
|
+
tr.setNodeMarkup(nodeAfterPastedContentResolvedPos.pos, orderedList, _objectSpread(_objectSpread({}, nodeAfterPastedContentResolvedPos.node.attrs), {}, {
|
|
87
|
+
order: originalParentOrderedListNodeOrder + numOfListItemsInOriginalList
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
return tr;
|
|
91
|
+
}
|
|
@@ -18,7 +18,8 @@ export const MediaInlineImageCardInternal = ({
|
|
|
18
18
|
isLazy,
|
|
19
19
|
width,
|
|
20
20
|
height,
|
|
21
|
-
border
|
|
21
|
+
border,
|
|
22
|
+
ssr
|
|
22
23
|
}) => {
|
|
23
24
|
const [fileState, setFileState] = useState();
|
|
24
25
|
const [subscribeError, setSubscribeError] = useState();
|
|
@@ -28,21 +29,23 @@ export const MediaInlineImageCardInternal = ({
|
|
|
28
29
|
locale: 'en'
|
|
29
30
|
});
|
|
30
31
|
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
if (mediaClient) {
|
|
33
|
+
const subscription = mediaClient.file.getFileState(identifier.id, {
|
|
34
|
+
collectionName: identifier.collectionName
|
|
35
|
+
}).subscribe({
|
|
36
|
+
next: fileState => {
|
|
37
|
+
setFileState(fileState);
|
|
38
|
+
setSubscribeError(undefined);
|
|
39
|
+
},
|
|
40
|
+
error: e => {
|
|
41
|
+
setSubscribeError(e);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
subscription.unsubscribe();
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}, [identifier, mediaClient]);
|
|
46
49
|
const content = dimensions => {
|
|
47
50
|
if (subscribeError) {
|
|
48
51
|
const isUploading = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading';
|
|
@@ -67,25 +70,27 @@ export const MediaInlineImageCardInternal = ({
|
|
|
67
70
|
message: formatMessage(messages.unableToLoadContent)
|
|
68
71
|
});
|
|
69
72
|
}
|
|
73
|
+
const mediaClientConfig = (ssr === null || ssr === void 0 ? void 0 : ssr.config) || (mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig);
|
|
70
74
|
if (!fileState) {
|
|
71
75
|
return jsx(InlineImageCardLoadingView, null);
|
|
72
76
|
}
|
|
73
77
|
return jsx(Card, {
|
|
74
|
-
mediaClientConfig:
|
|
78
|
+
mediaClientConfig: mediaClientConfig,
|
|
75
79
|
isLazy: isLazy,
|
|
76
80
|
identifier: identifier,
|
|
77
81
|
dimensions: dimensions,
|
|
78
82
|
selectable: true,
|
|
79
83
|
disableOverlay: true,
|
|
80
84
|
selected: isSelected,
|
|
81
|
-
alt: alt
|
|
85
|
+
alt: alt,
|
|
86
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
82
87
|
});
|
|
83
88
|
};
|
|
84
89
|
const aspectRatio = useMemo(() => width && height ? width / height : undefined, [width, height]);
|
|
85
90
|
|
|
86
91
|
/**
|
|
87
92
|
* scaledDimensions is used to define the correct media size fetched from media service
|
|
88
|
-
* inline images will only ever be
|
|
93
|
+
* inline images will only ever be rendered at a maximum height of H1 and so scaled dimensions
|
|
89
94
|
* will only ever return a width and height where the height has a maximum height of H1
|
|
90
95
|
*/
|
|
91
96
|
const scaledDimension = useMemo(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "76.
|
|
3
|
+
const packageVersion = "76.34.0";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "76.
|
|
10
|
+
const packageVersion = "76.34.0";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -213,6 +213,7 @@ export function isInEmptyLine(state) {
|
|
|
213
213
|
}
|
|
214
214
|
export { dedupe } from './dedupe';
|
|
215
215
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
216
|
+
export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
|
|
216
217
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
217
218
|
export { toJSON, nodeToJSON } from './nodes';
|
|
218
219
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
2
|
+
import { isListNode } from './list';
|
|
3
|
+
export function transformNodeIntoListItem(tr, node) {
|
|
4
|
+
var _tr$doc$nodeAt, _findParentNodeOfType;
|
|
5
|
+
const {
|
|
6
|
+
$to,
|
|
7
|
+
$from,
|
|
8
|
+
to,
|
|
9
|
+
from
|
|
10
|
+
} = tr.selection;
|
|
11
|
+
const {
|
|
12
|
+
orderedList,
|
|
13
|
+
bulletList,
|
|
14
|
+
listItem
|
|
15
|
+
} = tr.doc.type.schema.nodes;
|
|
16
|
+
const startLinePosition = $from.start();
|
|
17
|
+
const parentStartPosition = $from.depth === 0 ? 0 : $from.before();
|
|
18
|
+
|
|
19
|
+
// Setting the start position
|
|
20
|
+
const startMapped = startLinePosition === from ? parentStartPosition : from;
|
|
21
|
+
|
|
22
|
+
// Selected nodes
|
|
23
|
+
const selectionParentListItemNode = findParentNodeOfType(listItem)(tr.selection);
|
|
24
|
+
const selectionParentListNodeWithPos = findParentNodeOfType([bulletList, orderedList])(tr.selection);
|
|
25
|
+
const selectionParentListNode = selectionParentListNodeWithPos === null || selectionParentListNodeWithPos === void 0 ? void 0 : selectionParentListNodeWithPos.node;
|
|
26
|
+
if (!selectionParentListNodeWithPos) {
|
|
27
|
+
return tr;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Offsets
|
|
31
|
+
const listWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth + 1; // difference in depth between to position and list node
|
|
32
|
+
const listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
33
|
+
|
|
34
|
+
// Anything to do with nested lists should safeInsert and not be handled here
|
|
35
|
+
const grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
36
|
+
const selectionIsInNestedList = !!grandParentListNode;
|
|
37
|
+
let selectedListItemHasNestedList = false;
|
|
38
|
+
selectionParentListItemNode === null || selectionParentListItemNode === void 0 ? void 0 : selectionParentListItemNode.node.content.forEach(child => {
|
|
39
|
+
if (isListNode(child)) {
|
|
40
|
+
selectedListItemHasNestedList = true;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
44
|
+
return safeInsert(node)(tr).scrollIntoView();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Check if node after the insert position is listItem
|
|
48
|
+
const isNodeAfterInsertPositionIsListItem = ((_tr$doc$nodeAt = tr.doc.nodeAt(to + listItemWrappingOffset)) === null || _tr$doc$nodeAt === void 0 ? void 0 : _tr$doc$nodeAt.type) === listItem;
|
|
49
|
+
let replaceTo;
|
|
50
|
+
if (isNodeAfterInsertPositionIsListItem) {
|
|
51
|
+
replaceTo = to + listItemWrappingOffset;
|
|
52
|
+
} else if (!isNodeAfterInsertPositionIsListItem) {
|
|
53
|
+
replaceTo = to;
|
|
54
|
+
} else {
|
|
55
|
+
replaceTo = to + listWrappingOffset;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// handle the insertion of the slice
|
|
59
|
+
tr.replaceWith(startMapped, replaceTo, node).scrollIntoView();
|
|
60
|
+
|
|
61
|
+
// Get the next list items position (used later to find the split out ordered list)
|
|
62
|
+
const indexOfNextListItem = $to.indexAfter($to.depth - listItemWrappingOffset);
|
|
63
|
+
const positionOfNextListItem = tr.doc.resolve(selectionParentListNodeWithPos.pos + 1).posAtIndex(indexOfNextListItem);
|
|
64
|
+
|
|
65
|
+
// Find the ordered list node after the pasted content so we can set it's order
|
|
66
|
+
const mappedPositionOfNextListItem = tr.mapping.map(positionOfNextListItem);
|
|
67
|
+
if (mappedPositionOfNextListItem > tr.doc.nodeSize) {
|
|
68
|
+
return tr;
|
|
69
|
+
}
|
|
70
|
+
const nodeAfterPastedContentResolvedPos = findParentNodeOfTypeClosestToPos(tr.doc.resolve(mappedPositionOfNextListItem), [orderedList]);
|
|
71
|
+
|
|
72
|
+
// Work out the new split out lists 'order' (the number it starts from)
|
|
73
|
+
const originalParentOrderedListNodeOrder = selectionParentListNode === null || selectionParentListNode === void 0 ? void 0 : selectionParentListNode.attrs.order;
|
|
74
|
+
const numOfListItemsInOriginalList = (_findParentNodeOfType = findParentNodeOfTypeClosestToPos(tr.doc.resolve(from - 1), [orderedList])) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node.childCount;
|
|
75
|
+
|
|
76
|
+
// Set the new split out lists order attribute
|
|
77
|
+
if (typeof originalParentOrderedListNodeOrder === 'number' && numOfListItemsInOriginalList && nodeAfterPastedContentResolvedPos) {
|
|
78
|
+
tr.setNodeMarkup(nodeAfterPastedContentResolvedPos.pos, orderedList, {
|
|
79
|
+
...nodeAfterPastedContentResolvedPos.node.attrs,
|
|
80
|
+
order: originalParentOrderedListNodeOrder + numOfListItemsInOriginalList
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return tr;
|
|
84
|
+
}
|
|
@@ -19,7 +19,8 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
19
19
|
isLazy = _ref.isLazy,
|
|
20
20
|
width = _ref.width,
|
|
21
21
|
height = _ref.height,
|
|
22
|
-
border = _ref.border
|
|
22
|
+
border = _ref.border,
|
|
23
|
+
ssr = _ref.ssr;
|
|
23
24
|
var _useState = useState(),
|
|
24
25
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
26
|
fileState = _useState2[0],
|
|
@@ -33,21 +34,23 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
33
34
|
}),
|
|
34
35
|
formatMessage = _ref2.formatMessage;
|
|
35
36
|
useEffect(function () {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
if (mediaClient) {
|
|
38
|
+
var subscription = mediaClient.file.getFileState(identifier.id, {
|
|
39
|
+
collectionName: identifier.collectionName
|
|
40
|
+
}).subscribe({
|
|
41
|
+
next: function next(fileState) {
|
|
42
|
+
setFileState(fileState);
|
|
43
|
+
setSubscribeError(undefined);
|
|
44
|
+
},
|
|
45
|
+
error: function error(e) {
|
|
46
|
+
setSubscribeError(e);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return function () {
|
|
50
|
+
subscription.unsubscribe();
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}, [identifier, mediaClient]);
|
|
51
54
|
var content = function content(dimensions) {
|
|
52
55
|
if (subscribeError) {
|
|
53
56
|
var isUploading = (fileState === null || fileState === void 0 ? void 0 : fileState.status) === 'uploading';
|
|
@@ -72,18 +75,20 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
72
75
|
message: formatMessage(messages.unableToLoadContent)
|
|
73
76
|
});
|
|
74
77
|
}
|
|
78
|
+
var mediaClientConfig = (ssr === null || ssr === void 0 ? void 0 : ssr.config) || (mediaClient === null || mediaClient === void 0 ? void 0 : mediaClient.mediaClientConfig);
|
|
75
79
|
if (!fileState) {
|
|
76
80
|
return jsx(InlineImageCardLoadingView, null);
|
|
77
81
|
}
|
|
78
82
|
return jsx(Card, {
|
|
79
|
-
mediaClientConfig:
|
|
83
|
+
mediaClientConfig: mediaClientConfig,
|
|
80
84
|
isLazy: isLazy,
|
|
81
85
|
identifier: identifier,
|
|
82
86
|
dimensions: dimensions,
|
|
83
87
|
selectable: true,
|
|
84
88
|
disableOverlay: true,
|
|
85
89
|
selected: isSelected,
|
|
86
|
-
alt: alt
|
|
90
|
+
alt: alt,
|
|
91
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
87
92
|
});
|
|
88
93
|
};
|
|
89
94
|
var aspectRatio = useMemo(function () {
|
|
@@ -92,7 +97,7 @@ export var MediaInlineImageCardInternal = function MediaInlineImageCardInternal(
|
|
|
92
97
|
|
|
93
98
|
/**
|
|
94
99
|
* scaledDimensions is used to define the correct media size fetched from media service
|
|
95
|
-
* inline images will only ever be
|
|
100
|
+
* inline images will only ever be rendered at a maximum height of H1 and so scaled dimensions
|
|
96
101
|
* will only ever return a width and height where the height has a maximum height of H1
|
|
97
102
|
*/
|
|
98
103
|
var scaledDimension = useMemo(function () {
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
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) { _defineProperty(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; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "76.
|
|
9
|
+
var packageVersion = "76.34.0";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "76.
|
|
20
|
+
var packageVersion = "76.34.0";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -216,6 +216,7 @@ export function isInEmptyLine(state) {
|
|
|
216
216
|
}
|
|
217
217
|
export { dedupe } from './dedupe';
|
|
218
218
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
219
|
+
export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
|
|
219
220
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
220
221
|
export { toJSON, nodeToJSON } from './nodes';
|
|
221
222
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead } from './calculate-toolbar-position';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
4
|
+
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
+
import { isListNode } from './list';
|
|
6
|
+
export function transformNodeIntoListItem(tr, node) {
|
|
7
|
+
var _tr$doc$nodeAt, _findParentNodeOfType;
|
|
8
|
+
var _tr$selection = tr.selection,
|
|
9
|
+
$to = _tr$selection.$to,
|
|
10
|
+
$from = _tr$selection.$from,
|
|
11
|
+
to = _tr$selection.to,
|
|
12
|
+
from = _tr$selection.from;
|
|
13
|
+
var _tr$doc$type$schema$n = tr.doc.type.schema.nodes,
|
|
14
|
+
orderedList = _tr$doc$type$schema$n.orderedList,
|
|
15
|
+
bulletList = _tr$doc$type$schema$n.bulletList,
|
|
16
|
+
listItem = _tr$doc$type$schema$n.listItem;
|
|
17
|
+
var startLinePosition = $from.start();
|
|
18
|
+
var parentStartPosition = $from.depth === 0 ? 0 : $from.before();
|
|
19
|
+
|
|
20
|
+
// Setting the start position
|
|
21
|
+
var startMapped = startLinePosition === from ? parentStartPosition : from;
|
|
22
|
+
|
|
23
|
+
// Selected nodes
|
|
24
|
+
var selectionParentListItemNode = findParentNodeOfType(listItem)(tr.selection);
|
|
25
|
+
var selectionParentListNodeWithPos = findParentNodeOfType([bulletList, orderedList])(tr.selection);
|
|
26
|
+
var selectionParentListNode = selectionParentListNodeWithPos === null || selectionParentListNodeWithPos === void 0 ? void 0 : selectionParentListNodeWithPos.node;
|
|
27
|
+
if (!selectionParentListNodeWithPos) {
|
|
28
|
+
return tr;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Offsets
|
|
32
|
+
var listWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth + 1; // difference in depth between to position and list node
|
|
33
|
+
var listItemWrappingOffset = $to.depth - selectionParentListNodeWithPos.depth; // difference in depth between to position and list item node
|
|
34
|
+
|
|
35
|
+
// Anything to do with nested lists should safeInsert and not be handled here
|
|
36
|
+
var grandParentListNode = findParentNodeOfTypeClosestToPos(tr.doc.resolve(selectionParentListNodeWithPos.pos), [bulletList, orderedList]);
|
|
37
|
+
var selectionIsInNestedList = !!grandParentListNode;
|
|
38
|
+
var selectedListItemHasNestedList = false;
|
|
39
|
+
selectionParentListItemNode === null || selectionParentListItemNode === void 0 || selectionParentListItemNode.node.content.forEach(function (child) {
|
|
40
|
+
if (isListNode(child)) {
|
|
41
|
+
selectedListItemHasNestedList = true;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
if (selectedListItemHasNestedList || selectionIsInNestedList) {
|
|
45
|
+
return safeInsert(node)(tr).scrollIntoView();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check if node after the insert position is listItem
|
|
49
|
+
var isNodeAfterInsertPositionIsListItem = ((_tr$doc$nodeAt = tr.doc.nodeAt(to + listItemWrappingOffset)) === null || _tr$doc$nodeAt === void 0 ? void 0 : _tr$doc$nodeAt.type) === listItem;
|
|
50
|
+
var replaceTo;
|
|
51
|
+
if (isNodeAfterInsertPositionIsListItem) {
|
|
52
|
+
replaceTo = to + listItemWrappingOffset;
|
|
53
|
+
} else if (!isNodeAfterInsertPositionIsListItem) {
|
|
54
|
+
replaceTo = to;
|
|
55
|
+
} else {
|
|
56
|
+
replaceTo = to + listWrappingOffset;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// handle the insertion of the slice
|
|
60
|
+
tr.replaceWith(startMapped, replaceTo, node).scrollIntoView();
|
|
61
|
+
|
|
62
|
+
// Get the next list items position (used later to find the split out ordered list)
|
|
63
|
+
var indexOfNextListItem = $to.indexAfter($to.depth - listItemWrappingOffset);
|
|
64
|
+
var positionOfNextListItem = tr.doc.resolve(selectionParentListNodeWithPos.pos + 1).posAtIndex(indexOfNextListItem);
|
|
65
|
+
|
|
66
|
+
// Find the ordered list node after the pasted content so we can set it's order
|
|
67
|
+
var mappedPositionOfNextListItem = tr.mapping.map(positionOfNextListItem);
|
|
68
|
+
if (mappedPositionOfNextListItem > tr.doc.nodeSize) {
|
|
69
|
+
return tr;
|
|
70
|
+
}
|
|
71
|
+
var nodeAfterPastedContentResolvedPos = findParentNodeOfTypeClosestToPos(tr.doc.resolve(mappedPositionOfNextListItem), [orderedList]);
|
|
72
|
+
|
|
73
|
+
// Work out the new split out lists 'order' (the number it starts from)
|
|
74
|
+
var originalParentOrderedListNodeOrder = selectionParentListNode === null || selectionParentListNode === void 0 ? void 0 : selectionParentListNode.attrs.order;
|
|
75
|
+
var numOfListItemsInOriginalList = (_findParentNodeOfType = findParentNodeOfTypeClosestToPos(tr.doc.resolve(from - 1), [orderedList])) === null || _findParentNodeOfType === void 0 ? void 0 : _findParentNodeOfType.node.childCount;
|
|
76
|
+
|
|
77
|
+
// Set the new split out lists order attribute
|
|
78
|
+
if (typeof originalParentOrderedListNodeOrder === 'number' && numOfListItemsInOriginalList && nodeAfterPastedContentResolvedPos) {
|
|
79
|
+
tr.setNodeMarkup(nodeAfterPastedContentResolvedPos.pos, orderedList, _objectSpread(_objectSpread({}, nodeAfterPastedContentResolvedPos.node.attrs), {}, {
|
|
80
|
+
order: originalParentOrderedListNodeOrder + numOfListItemsInOriginalList
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
return tr;
|
|
84
|
+
}
|
|
@@ -9,6 +9,8 @@ export interface ExtensionParams<T extends Parameters> {
|
|
|
9
9
|
content?: object | string;
|
|
10
10
|
localId?: string;
|
|
11
11
|
fragmentLocalId?: string;
|
|
12
|
+
maxFrames?: number;
|
|
13
|
+
layout?: string;
|
|
12
14
|
}
|
|
13
15
|
export type ExtensionHandler<T extends Parameters = Parameters> = (ext: ExtensionParams<T>, doc: object, actions?: MultiBodiedExtensionActions) => JSX.Element | null;
|
|
14
16
|
export type OnSaveCallback<T extends Parameters = Parameters> = (params: T) => void;
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { FileIdentifier, MediaClient } from '@atlaskit/media-client';
|
|
5
|
-
import type { MediaInlineAttrs } from './types';
|
|
5
|
+
import type { MediaInlineAttrs, MediaSSR } from './types';
|
|
6
6
|
export interface MediaInlineImageCardProps {
|
|
7
7
|
identifier: FileIdentifier;
|
|
8
|
-
mediaClient
|
|
8
|
+
mediaClient?: MediaClient;
|
|
9
9
|
isSelected?: boolean;
|
|
10
10
|
isLazy?: boolean;
|
|
11
11
|
border?: {
|
|
12
12
|
borderSize?: number;
|
|
13
13
|
borderColor?: string;
|
|
14
14
|
};
|
|
15
|
+
ssr?: MediaSSR;
|
|
15
16
|
}
|
|
16
17
|
export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
|
|
17
18
|
export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { SSR } from '@atlaskit/media-common';
|
|
2
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
1
3
|
export type MediaInlineAttrs = {
|
|
2
4
|
type?: string;
|
|
3
5
|
alt?: string;
|
|
4
6
|
width?: number;
|
|
5
7
|
height?: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
};
|
|
9
|
+
export type MediaSSR = {
|
|
10
|
+
mode: SSR;
|
|
11
|
+
config: MediaClientConfig;
|
|
8
12
|
};
|
|
@@ -82,6 +82,7 @@ export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
|
82
82
|
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
83
83
|
export { dedupe } from './dedupe';
|
|
84
84
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
85
|
+
export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
|
|
85
86
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
86
87
|
export { toJSON, nodeToJSON } from './nodes';
|
|
87
88
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
|
|
@@ -9,6 +9,8 @@ export interface ExtensionParams<T extends Parameters> {
|
|
|
9
9
|
content?: object | string;
|
|
10
10
|
localId?: string;
|
|
11
11
|
fragmentLocalId?: string;
|
|
12
|
+
maxFrames?: number;
|
|
13
|
+
layout?: string;
|
|
12
14
|
}
|
|
13
15
|
export type ExtensionHandler<T extends Parameters = Parameters> = (ext: ExtensionParams<T>, doc: object, actions?: MultiBodiedExtensionActions) => JSX.Element | null;
|
|
14
16
|
export type OnSaveCallback<T extends Parameters = Parameters> = (params: T) => void;
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
import type { FC } from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { FileIdentifier, MediaClient } from '@atlaskit/media-client';
|
|
5
|
-
import type { MediaInlineAttrs } from './types';
|
|
5
|
+
import type { MediaInlineAttrs, MediaSSR } from './types';
|
|
6
6
|
export interface MediaInlineImageCardProps {
|
|
7
7
|
identifier: FileIdentifier;
|
|
8
|
-
mediaClient
|
|
8
|
+
mediaClient?: MediaClient;
|
|
9
9
|
isSelected?: boolean;
|
|
10
10
|
isLazy?: boolean;
|
|
11
11
|
border?: {
|
|
12
12
|
borderSize?: number;
|
|
13
13
|
borderColor?: string;
|
|
14
14
|
};
|
|
15
|
+
ssr?: MediaSSR;
|
|
15
16
|
}
|
|
16
17
|
export declare const MediaInlineImageCardInternal: FC<MediaInlineImageCardProps & WrappedComponentProps & MediaInlineAttrs>;
|
|
17
18
|
export declare const MediaInlineImageCard: FC<MediaInlineImageCardProps & MediaInlineAttrs>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import type { SSR } from '@atlaskit/media-common';
|
|
2
|
+
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
1
3
|
export type MediaInlineAttrs = {
|
|
2
4
|
type?: string;
|
|
3
5
|
alt?: string;
|
|
4
6
|
width?: number;
|
|
5
7
|
height?: number;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
};
|
|
9
|
+
export type MediaSSR = {
|
|
10
|
+
mode: SSR;
|
|
11
|
+
config: MediaClientConfig;
|
|
8
12
|
};
|
|
@@ -82,6 +82,7 @@ export declare function isNodeEmpty(node?: PMNode): boolean;
|
|
|
82
82
|
export declare function isInEmptyLine(state: EditorState): boolean;
|
|
83
83
|
export { dedupe } from './dedupe';
|
|
84
84
|
export { createWrapSelectionTransaction } from './create-wrap-selection-transaction';
|
|
85
|
+
export { transformNodeIntoListItem } from './insert-node-into-ordered-list';
|
|
85
86
|
export { wrapSelectionIn } from './wrap-selection-in';
|
|
86
87
|
export { toJSON, nodeToJSON } from './nodes';
|
|
87
88
|
export { calculateToolbarPositionAboveSelection, calculateToolbarPositionTrackHead, } from './calculate-toolbar-position';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "76.
|
|
3
|
+
"version": "76.34.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"@atlaskit/analytics-namespaced-context": "^6.7.0",
|
|
97
97
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
98
98
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
99
|
-
"@atlaskit/button": "^17.
|
|
99
|
+
"@atlaskit/button": "^17.2.0",
|
|
100
100
|
"@atlaskit/code": "^15.1.0",
|
|
101
101
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
102
102
|
"@atlaskit/custom-steps": "^0.0.10",
|