@atlaskit/editor-common 78.27.1 → 78.28.1
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 +37 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/clipboard/index.js +29 -1
- package/dist/cjs/extensions/module-helpers.js +1 -0
- package/dist/cjs/media/messages/comments.js +1 -1
- package/dist/cjs/media-single/CommentBadge.js +23 -3
- package/dist/cjs/messages/insert-block.js +4 -4
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/cjs/preset/core-plugin/requestDocument.js +62 -0
- package/dist/cjs/preset/core-plugin/types.js +5 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/clipboard/index.js +29 -1
- package/dist/es2019/extensions/module-helpers.js +1 -0
- package/dist/es2019/media/messages/comments.js +1 -1
- package/dist/es2019/media-single/CommentBadge.js +23 -4
- package/dist/es2019/messages/insert-block.js +4 -4
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/es2019/preset/core-plugin/requestDocument.js +51 -0
- package/dist/es2019/preset/core-plugin/types.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/clipboard/index.js +29 -1
- package/dist/esm/extensions/module-helpers.js +1 -0
- package/dist/esm/media/messages/comments.js +1 -1
- package/dist/esm/media-single/CommentBadge.js +24 -4
- package/dist/esm/messages/insert-block.js +4 -4
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/{core-plugin.js → core-plugin/index.js} +15 -1
- package/dist/esm/preset/core-plugin/requestDocument.js +54 -0
- package/dist/esm/preset/core-plugin/types.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MultiBodiedExtension/index.js +0 -3
- package/dist/types/analytics/types/cut-copy-events.d.ts +7 -2
- package/dist/types/analytics/types/enums.d.ts +2 -1
- package/dist/types/analytics/types/extension-events.d.ts +6 -1
- package/dist/types/analytics/types/insert-events.d.ts +1 -0
- package/dist/types/card/cardOptions.d.ts +6 -0
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/extensions/types/utils.d.ts +2 -1
- package/dist/types/media-single/CommentBadge.d.ts +4 -1
- package/dist/types/preset/core-plugin/index.d.ts +6 -0
- package/dist/types/preset/core-plugin/requestDocument.d.ts +7 -0
- package/dist/types/preset/core-plugin/types.d.ts +59 -0
- package/dist/types/preset/plugin-injection-api.d.ts +1 -1
- package/dist/types/types/next-editor-plugin.d.ts +2 -2
- package/dist/types-ts4.5/analytics/types/cut-copy-events.d.ts +7 -2
- package/dist/types-ts4.5/analytics/types/enums.d.ts +2 -1
- package/dist/types-ts4.5/analytics/types/extension-events.d.ts +6 -1
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +1 -0
- package/dist/types-ts4.5/card/cardOptions.d.ts +6 -0
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/extensions/types/utils.d.ts +2 -1
- package/dist/types-ts4.5/media-single/CommentBadge.d.ts +4 -1
- package/dist/types-ts4.5/preset/core-plugin/index.d.ts +6 -0
- package/dist/types-ts4.5/preset/core-plugin/requestDocument.d.ts +7 -0
- package/dist/types-ts4.5/preset/core-plugin/types.d.ts +59 -0
- package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +2 -2
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +2 -2
- package/package.json +4 -4
- package/dist/types/preset/core-plugin.d.ts +0 -39
- package/dist/types-ts4.5/preset/core-plugin.d.ts +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 78.28.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#87119](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87119) [`0cea7cb799c3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0cea7cb799c3) - [EDF-462] Add analytics for AI Blocks
|
|
8
|
+
|
|
9
|
+
## 78.28.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#90742](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90742) [`f893b885cc0a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f893b885cc0a) - [ux] Add comment on media badge states
|
|
14
|
+
- [#88342](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88342) [`104d7d1b8191`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104d7d1b8191) - Introducing requestDocument API on core plugin which can be used to get the document using the editor API.
|
|
15
|
+
|
|
16
|
+
This is intended to replace the `editorActions.getValue()`.
|
|
17
|
+
|
|
18
|
+
Using the editor API you can do:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
const { editorApi, preset } = usePreset(() => createDefaultPreset({}));
|
|
22
|
+
|
|
23
|
+
//
|
|
24
|
+
editorApi?.core?.actions.requestDocument((doc) => {
|
|
25
|
+
// Use the document as you require
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
See: Editor RFC 51 for more details.
|
|
30
|
+
|
|
31
|
+
- [#89840](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89840) [`9f256dde75e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f256dde75e9) - [ux] Implement onClickCallback plugin option to editor-plugin-card, allowing a callback to be executed when a smartlink is clicked, used by CCFE for live view to open smartlinks on-click
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [#91106](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91106) [`b6ffa30186b9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b6ffa30186b9) - Bump ADF-schema package to version 35.0.0
|
|
36
|
+
- [#89296](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89296) [`14a5e5877b97`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14a5e5877b97) - [ux] [ED-22875] - Removed borders from multi-bodied extensions
|
|
37
|
+
- [#90878](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90878) [`962275ee0910`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/962275ee0910) - [ux] [ED-22852] Update loom quick insert title, description and logo
|
|
38
|
+
- Updated dependencies
|
|
39
|
+
|
|
3
40
|
## 78.27.1
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -230,6 +230,7 @@ var ACTION_SUBJECT = exports.ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJ
|
|
|
230
230
|
ACTION_SUBJECT["TOOLTIP"] = "tooltip";
|
|
231
231
|
ACTION_SUBJECT["LOOM"] = "loom";
|
|
232
232
|
ACTION_SUBJECT["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
|
|
233
|
+
ACTION_SUBJECT["BODIED_EXTENSION"] = "bodiedExtension";
|
|
233
234
|
return ACTION_SUBJECT;
|
|
234
235
|
}({});
|
|
235
236
|
var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -22,6 +22,12 @@ var isClipboardApiSupported = function isClipboardApiSupported() {
|
|
|
22
22
|
var isIEClipboardApiSupported = function isIEClipboardApiSupported() {
|
|
23
23
|
return window.clipboardData && typeof window.clipboardData.setData === 'function';
|
|
24
24
|
};
|
|
25
|
+
var isExtensionNode = function isExtensionNode(node) {
|
|
26
|
+
if (node === 'extension' || node === 'bodiedExtension' || node === 'inlineExtension' || node === 'multiBodiedExtension') {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
25
31
|
var copyToClipboard = exports.copyToClipboard = /*#__PURE__*/function () {
|
|
26
32
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(textToCopy) {
|
|
27
33
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -136,11 +142,21 @@ var getAnalyticsPayload = exports.getAnalyticsPayload = function getAnalyticsPay
|
|
|
136
142
|
doc = state.doc;
|
|
137
143
|
var selectionAnalyticsPayload = (0, _selection.getNodeSelectionAnalyticsPayload)(selection) || (0, _selection.getRangeSelectionAnalyticsPayload)(selection, doc) || (0, _selection.getAllSelectionAnalyticsPayload)(selection) || (0, _selection.getCellSelectionAnalyticsPayload)(state);
|
|
138
144
|
if (selectionAnalyticsPayload) {
|
|
145
|
+
var _attributes;
|
|
139
146
|
var selectionActionSubjectId = selectionAnalyticsPayload.actionSubjectId;
|
|
147
|
+
var node = (_attributes = selectionAnalyticsPayload.attributes) === null || _attributes === void 0 ? void 0 : _attributes.node;
|
|
140
148
|
var content = [];
|
|
149
|
+
var extensionType;
|
|
150
|
+
var extensionKey;
|
|
141
151
|
switch (selectionActionSubjectId) {
|
|
142
152
|
case _analytics.ACTION_SUBJECT_ID.NODE:
|
|
143
|
-
|
|
153
|
+
if (node) {
|
|
154
|
+
content.push(node);
|
|
155
|
+
if (isExtensionNode(node)) {
|
|
156
|
+
extensionType = selection.node.attrs.extensionType;
|
|
157
|
+
extensionKey = selection.node.attrs.extensionKey;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
144
160
|
break;
|
|
145
161
|
case _analytics.ACTION_SUBJECT_ID.RANGE:
|
|
146
162
|
content.push.apply(content, (0, _toConsumableArray2.default)(selectionAnalyticsPayload.attributes.nodes));
|
|
@@ -156,6 +172,18 @@ var getAnalyticsPayload = exports.getAnalyticsPayload = function getAnalyticsPay
|
|
|
156
172
|
break;
|
|
157
173
|
}
|
|
158
174
|
}
|
|
175
|
+
if (isExtensionNode(node)) {
|
|
176
|
+
return {
|
|
177
|
+
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
178
|
+
action: action,
|
|
179
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
180
|
+
attributes: {
|
|
181
|
+
content: content,
|
|
182
|
+
extensionKey: extensionKey,
|
|
183
|
+
extensionType: extensionType
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
159
187
|
return {
|
|
160
188
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
161
189
|
action: action,
|
|
@@ -37,6 +37,7 @@ function buildMenuItem(manifest, extensionModule) {
|
|
|
37
37
|
key: key,
|
|
38
38
|
title: title,
|
|
39
39
|
extensionType: manifest.type,
|
|
40
|
+
extensionKey: manifest.key,
|
|
40
41
|
keywords: extensionModule.keywords || manifest.keywords || [],
|
|
41
42
|
featured: extensionModule.featured || false,
|
|
42
43
|
categories: extensionModule.categories || manifest.categories || [],
|
|
@@ -13,7 +13,7 @@ var commentMessages = exports.commentMessages = (0, _reactIntlNext.defineMessage
|
|
|
13
13
|
},
|
|
14
14
|
viewCommentsOnMedia: {
|
|
15
15
|
id: 'fabric.editor.viewCommentOnMedia',
|
|
16
|
-
defaultMessage: 'View
|
|
16
|
+
defaultMessage: 'View comments',
|
|
17
17
|
description: 'View a existing comment for this media (image/video)'
|
|
18
18
|
},
|
|
19
19
|
viewAndAddCommentsOnMedia: {
|
|
@@ -13,6 +13,7 @@ var _button = require("@atlaskit/button");
|
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/glyph/comment"));
|
|
15
15
|
var _constants = require("@atlaskit/theme/constants");
|
|
16
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
16
17
|
var _media = require("../media");
|
|
17
18
|
/** @jsx jsx */
|
|
18
19
|
|
|
@@ -36,15 +37,19 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
|
|
|
36
37
|
var intl = _ref.intl,
|
|
37
38
|
width = _ref.width,
|
|
38
39
|
height = _ref.height,
|
|
40
|
+
_ref$status = _ref.status,
|
|
41
|
+
status = _ref$status === void 0 ? 'default' : _ref$status,
|
|
39
42
|
mediaElement = _ref.mediaElement,
|
|
40
43
|
onClick = _ref.onClick,
|
|
44
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
45
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
41
46
|
_ref$isEditor = _ref.isEditor,
|
|
42
47
|
isEditor = _ref$isEditor === void 0 ? false : _ref$isEditor;
|
|
43
48
|
var _useState = (0, _react.useState)(getBadgeSize(width, height)),
|
|
44
49
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
45
50
|
badgeSize = _useState2[0],
|
|
46
51
|
setBadgeSize = _useState2[1];
|
|
47
|
-
var title = intl.formatMessage(_media.commentMessages.
|
|
52
|
+
var title = intl.formatMessage(_media.commentMessages.viewCommentsOnMedia);
|
|
48
53
|
(0, _react.useEffect)(function () {
|
|
49
54
|
var observer = new ResizeObserver((0, _debounce.default)(function (entries) {
|
|
50
55
|
var _entries = (0, _slicedToArray2.default)(entries, 1),
|
|
@@ -62,21 +67,36 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
|
|
|
62
67
|
};
|
|
63
68
|
}, [mediaElement]);
|
|
64
69
|
var badgeDimensions = badgeSize === 'medium' ? '24px' : '16px';
|
|
70
|
+
var colourToken = (0, _react.useMemo)(function () {
|
|
71
|
+
switch (status) {
|
|
72
|
+
case 'active':
|
|
73
|
+
return "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)";
|
|
74
|
+
case 'entered':
|
|
75
|
+
return "var(--ds-background-accent-yellow-subtlest-hovered, #F8E6A0)";
|
|
76
|
+
default:
|
|
77
|
+
return "var(--ds-background-accent-yellow-subtlest, #FFF7D6)";
|
|
78
|
+
}
|
|
79
|
+
}, [status]);
|
|
65
80
|
return (0, _react2.jsx)("div", {
|
|
66
81
|
css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
|
|
82
|
+
}, (0, _react2.jsx)(_tooltip.default, {
|
|
83
|
+
position: "top",
|
|
84
|
+
content: title
|
|
67
85
|
}, (0, _react2.jsx)(_button.CustomThemeButton, {
|
|
68
86
|
style: {
|
|
69
87
|
height: badgeDimensions,
|
|
70
88
|
width: badgeDimensions,
|
|
71
|
-
background:
|
|
89
|
+
background: colourToken,
|
|
72
90
|
display: 'flex',
|
|
73
91
|
justifyContent: 'center',
|
|
74
92
|
alignItems: 'center'
|
|
75
93
|
},
|
|
76
94
|
onClick: onClick,
|
|
95
|
+
onMouseEnter: onMouseEnter,
|
|
96
|
+
onMouseLeave: onMouseLeave,
|
|
77
97
|
iconAfter: (0, _react2.jsx)(_comment.default, {
|
|
78
98
|
label: title,
|
|
79
99
|
size: badgeSize
|
|
80
100
|
})
|
|
81
|
-
}));
|
|
101
|
+
})));
|
|
82
102
|
};
|
|
@@ -198,8 +198,8 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
|
|
|
198
198
|
},
|
|
199
199
|
recordVideo: {
|
|
200
200
|
id: 'fabric.editor.recordVideo',
|
|
201
|
-
defaultMessage: 'Record video',
|
|
202
|
-
description: 'Record
|
|
201
|
+
defaultMessage: 'Record a Loom video',
|
|
202
|
+
description: 'Record a Loom video'
|
|
203
203
|
},
|
|
204
204
|
addLoomVideo: {
|
|
205
205
|
id: 'fabric.editor.addLoomVideo',
|
|
@@ -208,7 +208,7 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
|
|
|
208
208
|
},
|
|
209
209
|
recordVideoDescription: {
|
|
210
210
|
id: 'fabric.editor.recordVideo.description',
|
|
211
|
-
defaultMessage: 'Record
|
|
212
|
-
description: 'Record
|
|
211
|
+
defaultMessage: 'Record your screen and camera',
|
|
212
|
+
description: 'Record your screen and camera'
|
|
213
213
|
}
|
|
214
214
|
});
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
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 = "78.
|
|
19
|
+
var packageVersion = "78.28.1";
|
|
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
|
|
@@ -4,7 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.corePlugin = void 0;
|
|
7
|
-
var _editorCommands = require("
|
|
7
|
+
var _editorCommands = require("../editor-commands");
|
|
8
|
+
var _requestDocument = require("./requestDocument");
|
|
8
9
|
/**
|
|
9
10
|
* Core plugin that is always included in the preset.
|
|
10
11
|
* Allows for executing `EditorCommand` and other core functionality.
|
|
@@ -41,6 +42,19 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
|
|
|
41
42
|
}
|
|
42
43
|
editorView.dom.blur();
|
|
43
44
|
return true;
|
|
45
|
+
},
|
|
46
|
+
requestDocument: function requestDocument(onReceive, options) {
|
|
47
|
+
var _config$getEditorView;
|
|
48
|
+
var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
49
|
+
(0, _requestDocument.scheduleDocumentRequest)(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer);
|
|
50
|
+
},
|
|
51
|
+
createTransformer: function createTransformer(cb) {
|
|
52
|
+
var _config$getEditorView2;
|
|
53
|
+
var view = (_config$getEditorView2 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView2 !== void 0 ? _config$getEditorView2 : null;
|
|
54
|
+
if (!(view !== null && view !== void 0 && view.state.schema)) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
44
58
|
}
|
|
45
59
|
}
|
|
46
60
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.scheduleDocumentRequest = void 0;
|
|
8
|
+
exports.toJSON = toJSON;
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
11
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
|
+
var transformer = new _editorJsonTransformer.JSONTransformer();
|
|
13
|
+
function toJSON(node) {
|
|
14
|
+
return transformer.encode(node);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* This throttles the callback with requestIdleCallback.
|
|
19
|
+
*/
|
|
20
|
+
function createThrottleSchedule(callback) {
|
|
21
|
+
var frameId;
|
|
22
|
+
var lastArgs;
|
|
23
|
+
var wrapperFn = function wrapperFn() {
|
|
24
|
+
var _globalThis$requestId;
|
|
25
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26
|
+
args[_key] = arguments[_key];
|
|
27
|
+
}
|
|
28
|
+
lastArgs = args;
|
|
29
|
+
if (frameId) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// If `requestIdleCallback` doesn't exist - fallback to `requestAnimationFrame`
|
|
34
|
+
var delayFunction = (_globalThis$requestId = globalThis.requestIdleCallback) !== null && _globalThis$requestId !== void 0 ? _globalThis$requestId : globalThis.requestAnimationFrame;
|
|
35
|
+
frameId = delayFunction(function () {
|
|
36
|
+
frameId = undefined;
|
|
37
|
+
if (lastArgs) {
|
|
38
|
+
callback.apply(void 0, (0, _toConsumableArray2.default)(lastArgs));
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
timeout: 100
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
return wrapperFn;
|
|
45
|
+
}
|
|
46
|
+
var scheduleDocumentRequest = exports.scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
47
|
+
function returnDocumentRequest(editorView, callback, transformer) {
|
|
48
|
+
var _editorView$state;
|
|
49
|
+
var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
|
|
50
|
+
doc = _ref.doc,
|
|
51
|
+
schema = _ref.schema;
|
|
52
|
+
if (!doc || !schema) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
var json = toJSON(doc);
|
|
56
|
+
if (typeof transformer === 'undefined') {
|
|
57
|
+
callback(json);
|
|
58
|
+
} else {
|
|
59
|
+
var nodeSanitized = _model.Node.fromJSON(schema, json);
|
|
60
|
+
callback(transformer.encode(nodeSanitized));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -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() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "78.
|
|
25
|
+
var packageVersion = "78.28.1";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.sharedMultiBodiedExtensionStyles = exports.removeMarginsAndBorder = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
9
8
|
/** @jsx jsx */
|
|
10
9
|
|
|
11
10
|
// Wraps the navigation bar and extensionFrames
|
|
@@ -40,7 +39,6 @@ var mbeNavigation = (0, _react.css)({
|
|
|
40
39
|
borderTopRightRadius: "var(--ds-border-radius, 3px)",
|
|
41
40
|
userSelect: 'none',
|
|
42
41
|
WebkitUserModify: 'read-only',
|
|
43
|
-
border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
|
|
44
42
|
borderBottom: 'none !important',
|
|
45
43
|
background: "var(--ds-surface, white)",
|
|
46
44
|
marginLeft: "var(--ds-space-100, 8px)",
|
|
@@ -55,7 +53,6 @@ var mbeNavigation = (0, _react.css)({
|
|
|
55
53
|
});
|
|
56
54
|
var extensionFrameContent = (0, _react.css)({
|
|
57
55
|
padding: "var(--ds-space-100, 8px)".concat(" !important"),
|
|
58
|
-
border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N30, ")")),
|
|
59
56
|
display: 'block',
|
|
60
57
|
minHeight: '100px',
|
|
61
58
|
background: "var(--ds-surface, white)",
|
|
@@ -224,6 +224,7 @@ export let ACTION_SUBJECT = /*#__PURE__*/function (ACTION_SUBJECT) {
|
|
|
224
224
|
ACTION_SUBJECT["TOOLTIP"] = "tooltip";
|
|
225
225
|
ACTION_SUBJECT["LOOM"] = "loom";
|
|
226
226
|
ACTION_SUBJECT["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
|
|
227
|
+
ACTION_SUBJECT["BODIED_EXTENSION"] = "bodiedExtension";
|
|
227
228
|
return ACTION_SUBJECT;
|
|
228
229
|
}({});
|
|
229
230
|
export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
|
|
@@ -4,6 +4,12 @@ import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
|
4
4
|
import { getAllSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, getNodeSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload } from '../selection';
|
|
5
5
|
const isClipboardApiSupported = () => !!navigator.clipboard && typeof navigator.clipboard.writeText === 'function';
|
|
6
6
|
const isIEClipboardApiSupported = () => window.clipboardData && typeof window.clipboardData.setData === 'function';
|
|
7
|
+
const isExtensionNode = node => {
|
|
8
|
+
if (node === 'extension' || node === 'bodiedExtension' || node === 'inlineExtension' || node === 'multiBodiedExtension') {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
7
13
|
export const copyToClipboard = async textToCopy => {
|
|
8
14
|
if (isClipboardApiSupported()) {
|
|
9
15
|
try {
|
|
@@ -61,13 +67,23 @@ export const getAnalyticsPayload = (state, action) => {
|
|
|
61
67
|
} = state;
|
|
62
68
|
const selectionAnalyticsPayload = getNodeSelectionAnalyticsPayload(selection) || getRangeSelectionAnalyticsPayload(selection, doc) || getAllSelectionAnalyticsPayload(selection) || getCellSelectionAnalyticsPayload(state);
|
|
63
69
|
if (selectionAnalyticsPayload) {
|
|
70
|
+
var _attributes;
|
|
64
71
|
const {
|
|
65
72
|
actionSubjectId: selectionActionSubjectId
|
|
66
73
|
} = selectionAnalyticsPayload;
|
|
74
|
+
const node = (_attributes = selectionAnalyticsPayload.attributes) === null || _attributes === void 0 ? void 0 : _attributes.node;
|
|
67
75
|
let content = [];
|
|
76
|
+
let extensionType;
|
|
77
|
+
let extensionKey;
|
|
68
78
|
switch (selectionActionSubjectId) {
|
|
69
79
|
case ACTION_SUBJECT_ID.NODE:
|
|
70
|
-
|
|
80
|
+
if (node) {
|
|
81
|
+
content.push(node);
|
|
82
|
+
if (isExtensionNode(node)) {
|
|
83
|
+
extensionType = selection.node.attrs.extensionType;
|
|
84
|
+
extensionKey = selection.node.attrs.extensionKey;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
71
87
|
break;
|
|
72
88
|
case ACTION_SUBJECT_ID.RANGE:
|
|
73
89
|
content.push(...selectionAnalyticsPayload.attributes.nodes);
|
|
@@ -84,6 +100,18 @@ export const getAnalyticsPayload = (state, action) => {
|
|
|
84
100
|
break;
|
|
85
101
|
}
|
|
86
102
|
}
|
|
103
|
+
if (isExtensionNode(node)) {
|
|
104
|
+
return {
|
|
105
|
+
eventType: EVENT_TYPE.TRACK,
|
|
106
|
+
action,
|
|
107
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
108
|
+
attributes: {
|
|
109
|
+
content,
|
|
110
|
+
extensionKey,
|
|
111
|
+
extensionType
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
87
115
|
return {
|
|
88
116
|
eventType: EVENT_TYPE.TRACK,
|
|
89
117
|
action,
|
|
@@ -14,6 +14,7 @@ export function buildMenuItem(manifest, extensionModule) {
|
|
|
14
14
|
key,
|
|
15
15
|
title,
|
|
16
16
|
extensionType: manifest.type,
|
|
17
|
+
extensionKey: manifest.key,
|
|
17
18
|
keywords: extensionModule.keywords || manifest.keywords || [],
|
|
18
19
|
featured: extensionModule.featured || false,
|
|
19
20
|
categories: extensionModule.categories || manifest.categories || [],
|
|
@@ -7,7 +7,7 @@ export const commentMessages = defineMessages({
|
|
|
7
7
|
},
|
|
8
8
|
viewCommentsOnMedia: {
|
|
9
9
|
id: 'fabric.editor.viewCommentOnMedia',
|
|
10
|
-
defaultMessage: 'View
|
|
10
|
+
defaultMessage: 'View comments',
|
|
11
11
|
description: 'View a existing comment for this media (image/video)'
|
|
12
12
|
},
|
|
13
13
|
viewAndAddCommentsOnMedia: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import debounce from 'lodash/debounce';
|
|
5
5
|
import { CustomThemeButton } from '@atlaskit/button';
|
|
6
6
|
import { akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import CommentIcon from '@atlaskit/icon/glyph/comment';
|
|
8
8
|
import { layers } from '@atlaskit/theme/constants';
|
|
9
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
9
10
|
import { commentMessages as messages } from '../media';
|
|
10
11
|
const commentBadgeWrapper = css({
|
|
11
12
|
position: 'absolute',
|
|
@@ -27,12 +28,15 @@ export const CommentBadge = ({
|
|
|
27
28
|
intl,
|
|
28
29
|
width,
|
|
29
30
|
height,
|
|
31
|
+
status = 'default',
|
|
30
32
|
mediaElement,
|
|
31
33
|
onClick,
|
|
34
|
+
onMouseEnter,
|
|
35
|
+
onMouseLeave,
|
|
32
36
|
isEditor = false
|
|
33
37
|
}) => {
|
|
34
38
|
const [badgeSize, setBadgeSize] = useState(getBadgeSize(width, height));
|
|
35
|
-
const title = intl.formatMessage(messages.
|
|
39
|
+
const title = intl.formatMessage(messages.viewCommentsOnMedia);
|
|
36
40
|
useEffect(() => {
|
|
37
41
|
const observer = new ResizeObserver(debounce(entries => {
|
|
38
42
|
const [entry] = entries;
|
|
@@ -50,21 +54,36 @@ export const CommentBadge = ({
|
|
|
50
54
|
};
|
|
51
55
|
}, [mediaElement]);
|
|
52
56
|
const badgeDimensions = badgeSize === 'medium' ? '24px' : '16px';
|
|
57
|
+
const colourToken = useMemo(() => {
|
|
58
|
+
switch (status) {
|
|
59
|
+
case 'active':
|
|
60
|
+
return "var(--ds-background-accent-yellow-subtlest-pressed, #F5CD47)";
|
|
61
|
+
case 'entered':
|
|
62
|
+
return "var(--ds-background-accent-yellow-subtlest-hovered, #F8E6A0)";
|
|
63
|
+
default:
|
|
64
|
+
return "var(--ds-background-accent-yellow-subtlest, #FFF7D6)";
|
|
65
|
+
}
|
|
66
|
+
}, [status]);
|
|
53
67
|
return jsx("div", {
|
|
54
68
|
css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
|
|
69
|
+
}, jsx(Tooltip, {
|
|
70
|
+
position: "top",
|
|
71
|
+
content: title
|
|
55
72
|
}, jsx(CustomThemeButton, {
|
|
56
73
|
style: {
|
|
57
74
|
height: badgeDimensions,
|
|
58
75
|
width: badgeDimensions,
|
|
59
|
-
background:
|
|
76
|
+
background: colourToken,
|
|
60
77
|
display: 'flex',
|
|
61
78
|
justifyContent: 'center',
|
|
62
79
|
alignItems: 'center'
|
|
63
80
|
},
|
|
64
81
|
onClick: onClick,
|
|
82
|
+
onMouseEnter: onMouseEnter,
|
|
83
|
+
onMouseLeave: onMouseLeave,
|
|
65
84
|
iconAfter: jsx(CommentIcon, {
|
|
66
85
|
label: title,
|
|
67
86
|
size: badgeSize
|
|
68
87
|
})
|
|
69
|
-
}));
|
|
88
|
+
})));
|
|
70
89
|
};
|
|
@@ -192,8 +192,8 @@ export const toolbarInsertBlockMessages = defineMessages({
|
|
|
192
192
|
},
|
|
193
193
|
recordVideo: {
|
|
194
194
|
id: 'fabric.editor.recordVideo',
|
|
195
|
-
defaultMessage: 'Record video',
|
|
196
|
-
description: 'Record
|
|
195
|
+
defaultMessage: 'Record a Loom video',
|
|
196
|
+
description: 'Record a Loom video'
|
|
197
197
|
},
|
|
198
198
|
addLoomVideo: {
|
|
199
199
|
id: 'fabric.editor.addLoomVideo',
|
|
@@ -202,7 +202,7 @@ export const toolbarInsertBlockMessages = defineMessages({
|
|
|
202
202
|
},
|
|
203
203
|
recordVideoDescription: {
|
|
204
204
|
id: 'fabric.editor.recordVideo.description',
|
|
205
|
-
defaultMessage: 'Record
|
|
206
|
-
description: 'Record
|
|
205
|
+
defaultMessage: 'Record your screen and camera',
|
|
206
|
+
description: 'Record your screen and camera'
|
|
207
207
|
}
|
|
208
208
|
});
|
|
@@ -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 = "78.
|
|
3
|
+
const packageVersion = "78.28.1";
|
|
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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { editorCommandToPMCommand } from '
|
|
1
|
+
import { editorCommandToPMCommand } from '../editor-commands';
|
|
2
|
+
import { scheduleDocumentRequest } from './requestDocument';
|
|
2
3
|
/**
|
|
3
4
|
* Core plugin that is always included in the preset.
|
|
4
5
|
* Allows for executing `EditorCommand` and other core functionality.
|
|
@@ -38,6 +39,19 @@ export const corePlugin = ({
|
|
|
38
39
|
}
|
|
39
40
|
editorView.dom.blur();
|
|
40
41
|
return true;
|
|
42
|
+
},
|
|
43
|
+
requestDocument(onReceive, options) {
|
|
44
|
+
var _config$getEditorView;
|
|
45
|
+
const view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
46
|
+
scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer);
|
|
47
|
+
},
|
|
48
|
+
createTransformer(cb) {
|
|
49
|
+
var _config$getEditorView2;
|
|
50
|
+
const view = (_config$getEditorView2 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView2 !== void 0 ? _config$getEditorView2 : null;
|
|
51
|
+
if (!(view !== null && view !== void 0 && view.state.schema)) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
41
55
|
}
|
|
42
56
|
}
|
|
43
57
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
2
|
+
import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
const transformer = new JSONTransformer();
|
|
4
|
+
export function toJSON(node) {
|
|
5
|
+
return transformer.encode(node);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This throttles the callback with requestIdleCallback.
|
|
10
|
+
*/
|
|
11
|
+
function createThrottleSchedule(callback) {
|
|
12
|
+
let frameId;
|
|
13
|
+
let lastArgs;
|
|
14
|
+
const wrapperFn = (...args) => {
|
|
15
|
+
var _globalThis$requestId;
|
|
16
|
+
lastArgs = args;
|
|
17
|
+
if (frameId) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// If `requestIdleCallback` doesn't exist - fallback to `requestAnimationFrame`
|
|
22
|
+
const delayFunction = (_globalThis$requestId = globalThis.requestIdleCallback) !== null && _globalThis$requestId !== void 0 ? _globalThis$requestId : globalThis.requestAnimationFrame;
|
|
23
|
+
frameId = delayFunction(() => {
|
|
24
|
+
frameId = undefined;
|
|
25
|
+
if (lastArgs) {
|
|
26
|
+
callback(...lastArgs);
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
timeout: 100
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return wrapperFn;
|
|
33
|
+
}
|
|
34
|
+
export const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
35
|
+
function returnDocumentRequest(editorView, callback, transformer) {
|
|
36
|
+
var _editorView$state;
|
|
37
|
+
const {
|
|
38
|
+
doc,
|
|
39
|
+
schema
|
|
40
|
+
} = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {};
|
|
41
|
+
if (!doc || !schema) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
const json = toJSON(doc);
|
|
45
|
+
if (typeof transformer === 'undefined') {
|
|
46
|
+
callback(json);
|
|
47
|
+
} else {
|
|
48
|
+
const nodeSanitized = PMNode.fromJSON(schema, json);
|
|
49
|
+
callback(transformer.encode(nodeSanitized));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 = "78.
|
|
10
|
+
const packageVersion = "78.28.1";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|