@atlaskit/editor-common 78.27.0 → 78.28.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 +37 -0
- package/dist/cjs/extensibility/Extension/InlineExtension/index.js +6 -3
- package/dist/cjs/extensibility/Extension/InlineExtension/styles.js +9 -2
- 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/extensibility/Extension/InlineExtension/index.js +7 -4
- package/dist/es2019/extensibility/Extension/InlineExtension/styles.js +8 -1
- 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/extensibility/Extension/InlineExtension/index.js +7 -4
- package/dist/esm/extensibility/Extension/InlineExtension/styles.js +8 -1
- 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/card/cardOptions.d.ts +6 -0
- package/dist/types/card/index.d.ts +1 -1
- package/dist/types/extensibility/Extension/InlineExtension/styles.d.ts +1 -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/card/cardOptions.d.ts +6 -0
- package/dist/types-ts4.5/card/index.d.ts +1 -1
- package/dist/types-ts4.5/extensibility/Extension/InlineExtension/styles.d.ts +1 -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.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
- [#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.
|
|
9
|
+
|
|
10
|
+
This is intended to replace the `editorActions.getValue()`.
|
|
11
|
+
|
|
12
|
+
Using the editor API you can do:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
const { editorApi, preset } = usePreset(() => createDefaultPreset({}));
|
|
16
|
+
|
|
17
|
+
//
|
|
18
|
+
editorApi?.core?.actions.requestDocument((doc) => {
|
|
19
|
+
// Use the document as you require
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
See: Editor RFC 51 for more details.
|
|
24
|
+
|
|
25
|
+
- [#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
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#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
|
|
30
|
+
- [#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
|
|
31
|
+
- [#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
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
34
|
+
## 78.27.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- [#90864](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90864) [`c8a41fe8962b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8a41fe8962b) - [ux] Removes hover overlay and adds hover border for inline macros for macro interaction design update
|
|
39
|
+
|
|
3
40
|
## 78.27.0
|
|
4
41
|
|
|
5
42
|
### Minor Changes
|
|
@@ -31,9 +31,12 @@ var InlineExtension = function InlineExtension(props) {
|
|
|
31
31
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
|
|
32
32
|
widthState = _useSharedPluginState.widthState;
|
|
33
33
|
var hasChildren = !!children;
|
|
34
|
-
var classNames = (0, _classnames.default)('extension-container', 'inline',
|
|
34
|
+
var classNames = (0, _classnames.default)('extension-container', 'inline', {
|
|
35
|
+
'with-overlay': !showMacroInteractionDesignUpdates,
|
|
35
36
|
'with-children': hasChildren,
|
|
36
|
-
'with-danger-overlay': showMacroInteractionDesignUpdates
|
|
37
|
+
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
38
|
+
'with-border': showMacroInteractionDesignUpdates,
|
|
39
|
+
'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered
|
|
37
40
|
});
|
|
38
41
|
var rendererContainerWidth = widthState ? widthState.width - _editorSharedStyles.akEditorGutterPadding * 2 : 0;
|
|
39
42
|
var extendedInlineExtension = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn') || false;
|
|
@@ -49,7 +52,7 @@ var InlineExtension = function InlineExtension(props) {
|
|
|
49
52
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
50
53
|
}), (0, _react2.jsx)("div", {
|
|
51
54
|
"data-testid": "inline-extension-wrapper",
|
|
52
|
-
css: [_styles2.wrapperStyle, extendedInlineExtension && _styles2.
|
|
55
|
+
css: [_styles2.wrapperStyle, extendedInlineExtension && _styles2.inlineWrapperStyles],
|
|
53
56
|
className: classNames,
|
|
54
57
|
onMouseEnter: function onMouseEnter() {
|
|
55
58
|
return handleMouseEvent(true);
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.wrapperStyle = exports.
|
|
6
|
+
exports.wrapperStyle = exports.inlineWrapperStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
8
9
|
var _styles = require("../styles");
|
|
9
10
|
var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_styles.wrapperDefault, {
|
|
10
11
|
cursor: 'pointer',
|
|
@@ -22,9 +23,15 @@ var wrapperStyle = exports.wrapperStyle = (0, _react.css)(_styles.wrapperDefault
|
|
|
22
23
|
'&.with-children': {
|
|
23
24
|
padding: 0,
|
|
24
25
|
background: "var(--ds-background-neutral-subtle, white)"
|
|
26
|
+
},
|
|
27
|
+
'&.with-border': {
|
|
28
|
+
border: "1px solid transparent" // adding this so macro doesn't jump when hover border is shown
|
|
29
|
+
},
|
|
30
|
+
'&.with-hover-border': {
|
|
31
|
+
border: "1px solid ".concat("var(--ds-border-input, ".concat(_colors.N500, ")"))
|
|
25
32
|
}
|
|
26
33
|
});
|
|
27
|
-
var
|
|
34
|
+
var inlineWrapperStyles = exports.inlineWrapperStyles = (0, _react.css)({
|
|
28
35
|
maxWidth: '100%',
|
|
29
36
|
'tr &': {
|
|
30
37
|
maxWidth: 'inherit'
|
|
@@ -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.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
|
|
@@ -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.0";
|
|
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)",
|
|
@@ -8,7 +8,7 @@ import { useSharedPluginState } from '../../../hooks';
|
|
|
8
8
|
import { createWidthContext, WidthContext } from '../../../ui';
|
|
9
9
|
import ExtensionLozenge from '../Lozenge';
|
|
10
10
|
import { overlay } from '../styles';
|
|
11
|
-
import {
|
|
11
|
+
import { inlineWrapperStyles, wrapperStyle } from './styles';
|
|
12
12
|
const InlineExtension = props => {
|
|
13
13
|
const {
|
|
14
14
|
node,
|
|
@@ -23,9 +23,12 @@ const InlineExtension = props => {
|
|
|
23
23
|
widthState
|
|
24
24
|
} = useSharedPluginState(pluginInjectionApi, ['width']);
|
|
25
25
|
const hasChildren = !!children;
|
|
26
|
-
const classNames = classnames('extension-container', 'inline',
|
|
26
|
+
const classNames = classnames('extension-container', 'inline', {
|
|
27
|
+
'with-overlay': !showMacroInteractionDesignUpdates,
|
|
27
28
|
'with-children': hasChildren,
|
|
28
|
-
'with-danger-overlay': showMacroInteractionDesignUpdates
|
|
29
|
+
'with-danger-overlay': showMacroInteractionDesignUpdates,
|
|
30
|
+
'with-border': showMacroInteractionDesignUpdates,
|
|
31
|
+
'with-hover-border': showMacroInteractionDesignUpdates && isNodeHovered
|
|
29
32
|
});
|
|
30
33
|
const rendererContainerWidth = widthState ? widthState.width - akEditorGutterPadding * 2 : 0;
|
|
31
34
|
const extendedInlineExtension = getBooleanFF('platform.editor.inline_extension.extended_lcqdn') || false;
|
|
@@ -41,7 +44,7 @@ const InlineExtension = props => {
|
|
|
41
44
|
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
42
45
|
}), jsx("div", {
|
|
43
46
|
"data-testid": "inline-extension-wrapper",
|
|
44
|
-
css: [wrapperStyle, extendedInlineExtension &&
|
|
47
|
+
css: [wrapperStyle, extendedInlineExtension && inlineWrapperStyles],
|
|
45
48
|
className: classNames,
|
|
46
49
|
onMouseEnter: () => handleMouseEvent(true),
|
|
47
50
|
onMouseLeave: () => handleMouseEvent(false)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
+
import { N500 } from '@atlaskit/theme/colors';
|
|
2
3
|
import { wrapperDefault } from '../styles';
|
|
3
4
|
export const wrapperStyle = css(wrapperDefault, {
|
|
4
5
|
cursor: 'pointer',
|
|
@@ -16,9 +17,15 @@ export const wrapperStyle = css(wrapperDefault, {
|
|
|
16
17
|
'&.with-children': {
|
|
17
18
|
padding: 0,
|
|
18
19
|
background: "var(--ds-background-neutral-subtle, white)"
|
|
20
|
+
},
|
|
21
|
+
'&.with-border': {
|
|
22
|
+
border: `1px solid transparent` // adding this so macro doesn't jump when hover border is shown
|
|
23
|
+
},
|
|
24
|
+
'&.with-hover-border': {
|
|
25
|
+
border: `1px solid ${`var(--ds-border-input, ${N500})`}`
|
|
19
26
|
}
|
|
20
27
|
});
|
|
21
|
-
export const
|
|
28
|
+
export const inlineWrapperStyles = css({
|
|
22
29
|
maxWidth: '100%',
|
|
23
30
|
'tr &': {
|
|
24
31
|
maxWidth: 'inherit'
|
|
@@ -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.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
|
|
@@ -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.0";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { N30, N40 } from '@atlaskit/theme/colors';
|
|
5
4
|
// Wraps the navigation bar and extensionFrames
|
|
6
5
|
const mbeExtensionContainer = css({
|
|
7
6
|
background: 'transparent !important',
|
|
@@ -34,7 +33,6 @@ const mbeNavigation = css({
|
|
|
34
33
|
borderTopRightRadius: "var(--ds-border-radius, 3px)",
|
|
35
34
|
userSelect: 'none',
|
|
36
35
|
WebkitUserModify: 'read-only',
|
|
37
|
-
border: `1px solid ${`var(--ds-border, ${N40})`}`,
|
|
38
36
|
borderBottom: 'none !important',
|
|
39
37
|
background: "var(--ds-surface, white)",
|
|
40
38
|
marginLeft: "var(--ds-space-100, 8px)",
|
|
@@ -49,7 +47,6 @@ const mbeNavigation = css({
|
|
|
49
47
|
});
|
|
50
48
|
const extensionFrameContent = css({
|
|
51
49
|
padding: `${"var(--ds-space-100, 8px)"} !important`,
|
|
52
|
-
border: `1px solid ${`var(--ds-border, ${N30})`}`,
|
|
53
50
|
display: 'block',
|
|
54
51
|
minHeight: '100px',
|
|
55
52
|
background: "var(--ds-surface, white)",
|