@atlaskit/editor-plugin-media 1.37.4 → 1.38.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 +16 -0
- package/dist/cjs/nodeviews/mediaSingle.js +3 -3
- package/dist/cjs/nodeviews/mediaSingleNext.js +2 -2
- package/dist/cjs/pm-plugins/main.js +17 -2
- package/dist/cjs/toolbar/assets/commentWithDotIcon.js +31 -1
- package/dist/cjs/ui/CaptionPlaceholder/index.js +9 -3
- package/dist/cjs/utils/media-common.js +23 -1
- package/dist/es2019/nodeviews/mediaSingle.js +3 -3
- package/dist/es2019/nodeviews/mediaSingleNext.js +2 -2
- package/dist/es2019/pm-plugins/main.js +20 -4
- package/dist/es2019/toolbar/assets/commentWithDotIcon.js +32 -2
- package/dist/es2019/ui/CaptionPlaceholder/index.js +14 -3
- package/dist/es2019/utils/media-common.js +22 -0
- package/dist/esm/nodeviews/mediaSingle.js +3 -3
- package/dist/esm/nodeviews/mediaSingleNext.js +2 -2
- package/dist/esm/pm-plugins/main.js +20 -4
- package/dist/esm/toolbar/assets/commentWithDotIcon.js +32 -2
- package/dist/esm/ui/CaptionPlaceholder/index.js +9 -3
- package/dist/esm/utils/media-common.js +22 -0
- package/dist/types/utils/media-common.d.ts +1 -0
- package/dist/types-ts4.5/utils/media-common.d.ts +1 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 1.38.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#156303](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156303)
|
|
8
|
+
[`dd9e4eaa8e65b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dd9e4eaa8e65b) -
|
|
9
|
+
[ux] ED-25493 Support caption onboarding, comment notification visual refresh and live view double
|
|
10
|
+
click support
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#157011](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157011)
|
|
15
|
+
[`dcdfd1e83ce5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dcdfd1e83ce5a) -
|
|
16
|
+
change ugc typography experiment to a gate
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 1.37.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -77,7 +77,7 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
77
77
|
isCopying: false
|
|
78
78
|
});
|
|
79
79
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaSingleWrapperRef", /*#__PURE__*/_react.default.createRef());
|
|
80
|
-
//
|
|
80
|
+
// platform_editor_typography_ugc clean up
|
|
81
81
|
// remove HTMLSpanElement type
|
|
82
82
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "captionPlaceHolderRef", /*#__PURE__*/_react.default.createRef());
|
|
83
83
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createOrUpdateMediaNodeUpdater", function (props) {
|
|
@@ -511,8 +511,8 @@ var MediaSingleNode = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
511
511
|
isDrafting: isCurrentNodeDrafting
|
|
512
512
|
}), (0, _react2.jsx)("div", {
|
|
513
513
|
ref: this.props.forwardRef
|
|
514
|
-
}), shouldShowPlaceholder && ((0,
|
|
515
|
-
//
|
|
514
|
+
}), shouldShowPlaceholder && ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? (0, _react2.jsx)(_CaptionPlaceholder.CaptionPlaceholderButton
|
|
515
|
+
// platform_editor_typography_ugc clean up
|
|
516
516
|
// remove typecasting
|
|
517
517
|
, {
|
|
518
518
|
ref: this.captionPlaceHolderRef,
|
|
@@ -518,8 +518,8 @@ var MediaSingleNodeNext = exports.MediaSingleNodeNext = function MediaSingleNode
|
|
|
518
518
|
isDrafting: isCurrentNodeDrafting
|
|
519
519
|
}), (0, _react2.jsx)("div", {
|
|
520
520
|
ref: forwardRef
|
|
521
|
-
}), shouldShowPlaceholder && ((0,
|
|
522
|
-
//
|
|
521
|
+
}), shouldShowPlaceholder && ((0, _platformFeatureFlags.fg)('platform_editor_typography_ugc') ? (0, _react2.jsx)(_CaptionPlaceholder.CaptionPlaceholderButton
|
|
522
|
+
// platform_editor_typography_ugc clean up
|
|
523
523
|
// remove typecasting
|
|
524
524
|
, {
|
|
525
525
|
ref: captionPlaceHolderRef,
|
|
@@ -933,18 +933,33 @@ var createPlugin = exports.createPlugin = function createPlugin(_schema, options
|
|
|
933
933
|
},
|
|
934
934
|
handleDoubleClickOn: function handleDoubleClickOn(view) {
|
|
935
935
|
var _pluginInjectionApi$e;
|
|
936
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_media_previewer_bugfix') || !(0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements')
|
|
936
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_media_previewer_bugfix') || !(0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements')) {
|
|
937
937
|
return;
|
|
938
938
|
}
|
|
939
|
+
var isLivePagesViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) === 'view';
|
|
939
940
|
|
|
940
941
|
// Double Click support for Media Viewer Nodes
|
|
941
942
|
var maybeMediaNode = (0, _mediaCommon2.getMediaFromSupportedMediaNodesFromSelection)(view.state);
|
|
942
943
|
if (maybeMediaNode) {
|
|
944
|
+
var _pluginInjectionApi$a;
|
|
943
945
|
// If media type is video, do not open media viewer
|
|
944
|
-
if ((0,
|
|
946
|
+
if (!(0, _mediaCommon2.isNodeDoubleClickSupportedInLivePagesViewMode)(isLivePagesViewMode, maybeMediaNode)) {
|
|
945
947
|
return false;
|
|
946
948
|
}
|
|
949
|
+
// Show media viewer
|
|
947
950
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.media.commands.showMediaViewer(maybeMediaNode.attrs));
|
|
951
|
+
|
|
952
|
+
// Call analytics event
|
|
953
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
954
|
+
action: _analytics.ACTION.OPENED,
|
|
955
|
+
actionSubject: _analytics.ACTION_SUBJECT.MEDIA_VIEWER,
|
|
956
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.MEDIA,
|
|
957
|
+
eventType: _analytics.EVENT_TYPE.UI,
|
|
958
|
+
attributes: {
|
|
959
|
+
nodeType: maybeMediaNode.type.name,
|
|
960
|
+
inputMethod: _analytics.INPUT_METHOD.DOUBLE_CLICK
|
|
961
|
+
}
|
|
962
|
+
});
|
|
948
963
|
return true;
|
|
949
964
|
}
|
|
950
965
|
return false;
|
|
@@ -8,6 +8,7 @@ exports.CommentWithDotIcon = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
13
|
var IconCommentWithDotGlyph = function IconCommentWithDotGlyph() {
|
|
13
14
|
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
@@ -36,8 +37,37 @@ var IconCommentWithDotGlyph = function IconCommentWithDotGlyph() {
|
|
|
36
37
|
fill: "var(--ds-background-warning-bold, ".concat(_colors.Y300, ")")
|
|
37
38
|
}));
|
|
38
39
|
};
|
|
40
|
+
var IconCommentConfluenceTypeWithDotGlyph = function IconCommentConfluenceTypeWithDotGlyph() {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
42
|
+
width: "24",
|
|
43
|
+
height: "24",
|
|
44
|
+
viewBox: "0 0 24 24",
|
|
45
|
+
fill: "none",
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
clipRule: "evenodd",
|
|
50
|
+
d: "M4.998 11.513C4.998 8.475 8.139 6.003 12 6.003C15.861 6.003 19.002 8.475 19.002 11.513C19.002 14.552 15.861 17.023 12 17.023C8.139 17.023 4.998 14.552 4.998 11.513ZM19.838 19.284V19.282C19.838 19.282 18.274 17.022 19.071 16.166L19.034 16.186C20.261 14.902 21 13.279 21 11.513C21 7.371 16.963 4 12 4C7.037 4 3 7.37 3 11.513C3 15.656 7.037 19.027 12 19.027C13.42 19.027 14.76 18.742 15.957 18.251C16.96 19.273 18.244 19.823 19.197 19.97L19.199 19.967C19.2515 19.9867 19.3069 19.9979 19.363 20C19.448 20 19.5317 19.9789 19.6067 19.9386C19.6816 19.8984 19.7453 19.8402 19.7923 19.7693C19.8392 19.6984 19.8679 19.6169 19.8757 19.5323C19.8835 19.4476 19.8712 19.3623 19.838 19.284Z",
|
|
51
|
+
fill: "currentColor"
|
|
52
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
53
|
+
d: "M16 9H8C7.44772 9 7 9.44772 7 10C7 10.5523 7.44772 11 8 11H16C16.5523 11 17 10.5523 17 10C17 9.44772 16.5523 9 16 9Z",
|
|
54
|
+
fill: "currentColor"
|
|
55
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
56
|
+
d: "M11 12H8C7.44772 12 7 12.4477 7 13C7 13.5523 7.44772 14 8 14H11C11.5523 14 12 13.5523 12 13C12 12.4477 11.5523 12 11 12Z",
|
|
57
|
+
fill: "currentColor"
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
59
|
+
x: "13",
|
|
60
|
+
y: "1",
|
|
61
|
+
width: "8",
|
|
62
|
+
height: "8",
|
|
63
|
+
rx: "4",
|
|
64
|
+
stroke: "var(--ds-border-inverse, ".concat(_colors.N0, ")"),
|
|
65
|
+
strokeWidth: 2,
|
|
66
|
+
fill: "var(--ds-icon-brand, #0052CC)"
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
39
69
|
var CommentWithDotIcon = exports.CommentWithDotIcon = function CommentWithDotIcon(props) {
|
|
40
70
|
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
41
|
-
glyph: IconCommentWithDotGlyph
|
|
71
|
+
glyph: (0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements') ? IconCommentConfluenceTypeWithDotGlyph : IconCommentWithDotGlyph
|
|
42
72
|
}, props));
|
|
43
73
|
};
|
|
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.CaptionPlaceholderButton = exports.CaptionPlaceholder = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _react2 = require("@emotion/react");
|
|
12
13
|
var _reactIntlNext = require("react-intl-next");
|
|
13
14
|
var _media = require("@atlaskit/editor-common/media");
|
|
14
15
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
17
|
var _primitives = require("@atlaskit/primitives");
|
|
16
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
17
19
|
var _templateObject;
|
|
@@ -22,6 +24,8 @@ var _templateObject;
|
|
|
22
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
25
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
24
26
|
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 && {}.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; }
|
|
27
|
+
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; }
|
|
28
|
+
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; }
|
|
25
29
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
26
30
|
var placeholder = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tcolor: ", ";\n\twidth: 100%;\n\ttext-align: center;\n\tmargin-top: ", " !important;\n\tdisplay: block;\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"), "var(--ds-space-100, 8px)");
|
|
27
31
|
var placeholderButton = (0, _primitives.xcss)({
|
|
@@ -29,10 +33,11 @@ var placeholderButton = (0, _primitives.xcss)({
|
|
|
29
33
|
marginTop: 'space.100'
|
|
30
34
|
});
|
|
31
35
|
|
|
32
|
-
//
|
|
36
|
+
// platform_editor_typography_ugc clean up
|
|
33
37
|
// Remove this component
|
|
34
38
|
var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
35
39
|
var onClick = _ref.onClick;
|
|
40
|
+
var message = (0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements') ? _objectSpread({}, _media.captionMessages.placeholderWithDoubleClickPrompt) : _objectSpread({}, _media.captionMessages.placeholder);
|
|
36
41
|
return (
|
|
37
42
|
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
38
43
|
(0, _react2.jsx)("span", {
|
|
@@ -41,7 +46,7 @@ var CaptionPlaceholder = exports.CaptionPlaceholder = /*#__PURE__*/_react.defaul
|
|
|
41
46
|
onClick: onClick,
|
|
42
47
|
"data-id": _mediaSingle.CAPTION_PLACEHOLDER_ID,
|
|
43
48
|
"data-testid": "caption-placeholder"
|
|
44
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage,
|
|
49
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, message))
|
|
45
50
|
);
|
|
46
51
|
});
|
|
47
52
|
var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
|
|
@@ -51,6 +56,7 @@ var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_
|
|
|
51
56
|
// Hence we want to disabled it so that user can type in caption directly after click
|
|
52
57
|
e.preventDefault();
|
|
53
58
|
}, []);
|
|
59
|
+
var message = (0, _platformFeatureFlags.fg)('platform_editor_media_interaction_improvements') ? _objectSpread({}, _media.captionMessages.placeholderWithDoubleClickPrompt) : _objectSpread({}, _media.captionMessages.placeholder);
|
|
54
60
|
return (0, _react2.jsx)(_primitives.Pressable, {
|
|
55
61
|
ref: ref,
|
|
56
62
|
backgroundColor: "color.background.neutral.subtle",
|
|
@@ -63,5 +69,5 @@ var CaptionPlaceholderButton = exports.CaptionPlaceholderButton = /*#__PURE__*/_
|
|
|
63
69
|
}, (0, _react2.jsx)(_primitives.Text, {
|
|
64
70
|
color: "color.text.subtlest",
|
|
65
71
|
size: "large"
|
|
66
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage,
|
|
72
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, message)));
|
|
67
73
|
});
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.splitMediaGroup = exports.removeMediaNode = exports.posOfPrecedingMediaGroup = exports.posOfParentMediaGroup = exports.posOfMediaGroupNearby = exports.isSelectionNonMediaBlockNode = exports.isSelectionMediaSingleNode = exports.isMediaSingleOrInlineNodeSelected = exports.isMediaBlobUrlFromAttrs = exports.isInsidePotentialEmptyParagraph = exports.getMediaSingleOrInlineNodeFromSelection = exports.getMediaNodeFromSelection = exports.getMediaFromSupportedMediaNodesFromSelection = exports.getIdentifier = exports.extractMediaNodes = exports.createMediaIdentifierArray = exports.copyOptionalAttrsFromMediaState = void 0;
|
|
7
|
+
exports.splitMediaGroup = exports.removeMediaNode = exports.posOfPrecedingMediaGroup = exports.posOfParentMediaGroup = exports.posOfMediaGroupNearby = exports.isSelectionNonMediaBlockNode = exports.isSelectionMediaSingleNode = exports.isNodeDoubleClickSupportedInLivePagesViewMode = exports.isMediaSingleOrInlineNodeSelected = exports.isMediaBlobUrlFromAttrs = exports.isInsidePotentialEmptyParagraph = exports.getMediaSingleOrInlineNodeFromSelection = exports.getMediaNodeFromSelection = exports.getMediaFromSupportedMediaNodesFromSelection = exports.getIdentifier = exports.extractMediaNodes = exports.createMediaIdentifierArray = exports.copyOptionalAttrsFromMediaState = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -223,6 +223,28 @@ var getMediaFromSupportedMediaNodesFromSelection = exports.getMediaFromSupported
|
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
|
+
var isNodeDoubleClickSupportedInLivePagesViewMode = exports.isNodeDoubleClickSupportedInLivePagesViewMode = function isNodeDoubleClickSupportedInLivePagesViewMode(isViewMode, node) {
|
|
227
|
+
if (!node) {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
// Double Click is not supported for video nodes on both views
|
|
231
|
+
if ((0, _mediaSingle.isVideo)(node.attrs.__fileMimeType)) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Double click is supported for all editor media nodes
|
|
236
|
+
if (!isViewMode) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Double Click is not supported for mediaGroup and mediaInline nodes that are file
|
|
241
|
+
if (node.type === node.type.schema.nodes.mediaGroup || node.type === node.type.schema.nodes.mediaInline && node.attrs.type === 'file') {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Double Click supported for all other media nodes
|
|
246
|
+
return true;
|
|
247
|
+
};
|
|
226
248
|
var getIdentifier = exports.getIdentifier = function getIdentifier(attrs) {
|
|
227
249
|
if ((0, _utils3.isExternalMedia)(attrs)) {
|
|
228
250
|
return {
|
|
@@ -51,7 +51,7 @@ export default class MediaSingleNode extends Component {
|
|
|
51
51
|
isCopying: false
|
|
52
52
|
});
|
|
53
53
|
_defineProperty(this, "mediaSingleWrapperRef", /*#__PURE__*/React.createRef());
|
|
54
|
-
//
|
|
54
|
+
// platform_editor_typography_ugc clean up
|
|
55
55
|
// remove HTMLSpanElement type
|
|
56
56
|
_defineProperty(this, "captionPlaceHolderRef", /*#__PURE__*/React.createRef());
|
|
57
57
|
_defineProperty(this, "createOrUpdateMediaNodeUpdater", props => {
|
|
@@ -428,8 +428,8 @@ export default class MediaSingleNode extends Component {
|
|
|
428
428
|
isDrafting: isCurrentNodeDrafting
|
|
429
429
|
}), jsx("div", {
|
|
430
430
|
ref: this.props.forwardRef
|
|
431
|
-
}), shouldShowPlaceholder && (
|
|
432
|
-
//
|
|
431
|
+
}), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
|
|
432
|
+
// platform_editor_typography_ugc clean up
|
|
433
433
|
// remove typecasting
|
|
434
434
|
, {
|
|
435
435
|
ref: this.captionPlaceHolderRef,
|
|
@@ -478,8 +478,8 @@ export const MediaSingleNodeNext = mediaSingleNodeNextProps => {
|
|
|
478
478
|
isDrafting: isCurrentNodeDrafting
|
|
479
479
|
}), jsx("div", {
|
|
480
480
|
ref: forwardRef
|
|
481
|
-
}), shouldShowPlaceholder && (
|
|
482
|
-
//
|
|
481
|
+
}), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
|
|
482
|
+
// platform_editor_typography_ugc clean up
|
|
483
483
|
// remove typecasting
|
|
484
484
|
, {
|
|
485
485
|
ref: captionPlaceHolderRef,
|
|
@@ -4,6 +4,7 @@ import React from 'react';
|
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import { RawIntlProvider } from 'react-intl-next';
|
|
6
6
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
8
|
import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
|
|
8
9
|
import { CAPTION_PLACEHOLDER_ID, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
|
|
9
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -20,10 +21,10 @@ import * as helpers from '../commands/helpers';
|
|
|
20
21
|
import { updateMediaNodeAttrs } from '../commands/helpers';
|
|
21
22
|
import PickerFacade from '../picker-facade';
|
|
22
23
|
import DropPlaceholder from '../ui/Media/DropPlaceholder';
|
|
23
|
-
import { getMediaFromSupportedMediaNodesFromSelection, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
24
|
+
import { getMediaFromSupportedMediaNodesFromSelection, isNodeDoubleClickSupportedInLivePagesViewMode, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
24
25
|
import { insertMediaGroupNode, insertMediaInlineNode } from '../utils/media-files';
|
|
25
26
|
import { getMediaNodeInsertionType } from '../utils/media-inline';
|
|
26
|
-
import { insertMediaSingleNode
|
|
27
|
+
import { insertMediaSingleNode } from '../utils/media-single';
|
|
27
28
|
import { ACTIONS } from './actions';
|
|
28
29
|
import { MediaTaskManager } from './mediaTaskManager';
|
|
29
30
|
import { stateKey } from './plugin-key';
|
|
@@ -817,18 +818,33 @@ export const createPlugin = (_schema, options, getIntl, pluginInjectionApi, disp
|
|
|
817
818
|
},
|
|
818
819
|
handleDoubleClickOn: view => {
|
|
819
820
|
var _pluginInjectionApi$e, _pluginInjectionApi$e2;
|
|
820
|
-
if (!fg('platform_editor_media_previewer_bugfix') || !fg('platform_editor_media_interaction_improvements')
|
|
821
|
+
if (!fg('platform_editor_media_previewer_bugfix') || !fg('platform_editor_media_interaction_improvements')) {
|
|
821
822
|
return;
|
|
822
823
|
}
|
|
824
|
+
const isLivePagesViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 ? void 0 : (_pluginInjectionApi$e2 = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.mode) === 'view';
|
|
823
825
|
|
|
824
826
|
// Double Click support for Media Viewer Nodes
|
|
825
827
|
const maybeMediaNode = getMediaFromSupportedMediaNodesFromSelection(view.state);
|
|
826
828
|
if (maybeMediaNode) {
|
|
829
|
+
var _pluginInjectionApi$a;
|
|
827
830
|
// If media type is video, do not open media viewer
|
|
828
|
-
if (
|
|
831
|
+
if (!isNodeDoubleClickSupportedInLivePagesViewMode(isLivePagesViewMode, maybeMediaNode)) {
|
|
829
832
|
return false;
|
|
830
833
|
}
|
|
834
|
+
// Show media viewer
|
|
831
835
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.media.commands.showMediaViewer(maybeMediaNode.attrs));
|
|
836
|
+
|
|
837
|
+
// Call analytics event
|
|
838
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
839
|
+
action: ACTION.OPENED,
|
|
840
|
+
actionSubject: ACTION_SUBJECT.MEDIA_VIEWER,
|
|
841
|
+
actionSubjectId: ACTION_SUBJECT_ID.MEDIA,
|
|
842
|
+
eventType: EVENT_TYPE.UI,
|
|
843
|
+
attributes: {
|
|
844
|
+
nodeType: maybeMediaNode.type.name,
|
|
845
|
+
inputMethod: INPUT_METHOD.DOUBLE_CLICK
|
|
846
|
+
}
|
|
847
|
+
});
|
|
832
848
|
return true;
|
|
833
849
|
}
|
|
834
850
|
return false;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Icon from '@atlaskit/icon';
|
|
4
|
-
import {
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { N0, Y300 } from '@atlaskit/theme/colors';
|
|
5
6
|
const IconCommentWithDotGlyph = () => {
|
|
6
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7
8
|
width: "24",
|
|
@@ -29,8 +30,37 @@ const IconCommentWithDotGlyph = () => {
|
|
|
29
30
|
fill: `var(--ds-background-warning-bold, ${Y300})`
|
|
30
31
|
}));
|
|
31
32
|
};
|
|
33
|
+
const IconCommentConfluenceTypeWithDotGlyph = () => {
|
|
34
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
35
|
+
width: "24",
|
|
36
|
+
height: "24",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
fill: "none",
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M4.998 11.513C4.998 8.475 8.139 6.003 12 6.003C15.861 6.003 19.002 8.475 19.002 11.513C19.002 14.552 15.861 17.023 12 17.023C8.139 17.023 4.998 14.552 4.998 11.513ZM19.838 19.284V19.282C19.838 19.282 18.274 17.022 19.071 16.166L19.034 16.186C20.261 14.902 21 13.279 21 11.513C21 7.371 16.963 4 12 4C7.037 4 3 7.37 3 11.513C3 15.656 7.037 19.027 12 19.027C13.42 19.027 14.76 18.742 15.957 18.251C16.96 19.273 18.244 19.823 19.197 19.97L19.199 19.967C19.2515 19.9867 19.3069 19.9979 19.363 20C19.448 20 19.5317 19.9789 19.6067 19.9386C19.6816 19.8984 19.7453 19.8402 19.7923 19.7693C19.8392 19.6984 19.8679 19.6169 19.8757 19.5323C19.8835 19.4476 19.8712 19.3623 19.838 19.284Z",
|
|
44
|
+
fill: "currentColor"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
d: "M16 9H8C7.44772 9 7 9.44772 7 10C7 10.5523 7.44772 11 8 11H16C16.5523 11 17 10.5523 17 10C17 9.44772 16.5523 9 16 9Z",
|
|
47
|
+
fill: "currentColor"
|
|
48
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
49
|
+
d: "M11 12H8C7.44772 12 7 12.4477 7 13C7 13.5523 7.44772 14 8 14H11C11.5523 14 12 13.5523 12 13C12 12.4477 11.5523 12 11 12Z",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
52
|
+
x: "13",
|
|
53
|
+
y: "1",
|
|
54
|
+
width: "8",
|
|
55
|
+
height: "8",
|
|
56
|
+
rx: "4",
|
|
57
|
+
stroke: `var(--ds-border-inverse, ${N0})`,
|
|
58
|
+
strokeWidth: 2,
|
|
59
|
+
fill: "var(--ds-icon-brand, #0052CC)"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
32
62
|
export const CommentWithDotIcon = props => {
|
|
33
63
|
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
34
|
-
glyph: IconCommentWithDotGlyph
|
|
64
|
+
glyph: fg('platform_editor_media_interaction_improvements') ? IconCommentConfluenceTypeWithDotGlyph : IconCommentWithDotGlyph
|
|
35
65
|
}, props));
|
|
36
66
|
};
|
|
@@ -9,6 +9,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
10
|
import { captionMessages as messages } from '@atlaskit/editor-common/media';
|
|
11
11
|
import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { Pressable, Text, xcss } from '@atlaskit/primitives';
|
|
13
14
|
import { N200 } from '@atlaskit/theme/colors';
|
|
14
15
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
@@ -24,11 +25,16 @@ const placeholderButton = xcss({
|
|
|
24
25
|
marginTop: 'space.100'
|
|
25
26
|
});
|
|
26
27
|
|
|
27
|
-
//
|
|
28
|
+
// platform_editor_typography_ugc clean up
|
|
28
29
|
// Remove this component
|
|
29
30
|
export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
|
|
30
31
|
onClick
|
|
31
32
|
}, ref) => {
|
|
33
|
+
const message = fg('platform_editor_media_interaction_improvements') ? {
|
|
34
|
+
...messages.placeholderWithDoubleClickPrompt
|
|
35
|
+
} : {
|
|
36
|
+
...messages.placeholder
|
|
37
|
+
};
|
|
32
38
|
return (
|
|
33
39
|
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
34
40
|
jsx("span", {
|
|
@@ -37,7 +43,7 @@ export const CaptionPlaceholder = /*#__PURE__*/React.forwardRef(({
|
|
|
37
43
|
onClick: onClick,
|
|
38
44
|
"data-id": CAPTION_PLACEHOLDER_ID,
|
|
39
45
|
"data-testid": "caption-placeholder"
|
|
40
|
-
}, jsx(FormattedMessage,
|
|
46
|
+
}, jsx(FormattedMessage, message))
|
|
41
47
|
);
|
|
42
48
|
});
|
|
43
49
|
export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
|
|
@@ -48,6 +54,11 @@ export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
|
|
|
48
54
|
// Hence we want to disabled it so that user can type in caption directly after click
|
|
49
55
|
e.preventDefault();
|
|
50
56
|
}, []);
|
|
57
|
+
const message = fg('platform_editor_media_interaction_improvements') ? {
|
|
58
|
+
...messages.placeholderWithDoubleClickPrompt
|
|
59
|
+
} : {
|
|
60
|
+
...messages.placeholder
|
|
61
|
+
};
|
|
51
62
|
return jsx(Pressable, {
|
|
52
63
|
ref: ref,
|
|
53
64
|
backgroundColor: "color.background.neutral.subtle",
|
|
@@ -60,5 +71,5 @@ export const CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(({
|
|
|
60
71
|
}, jsx(Text, {
|
|
61
72
|
color: "color.text.subtlest",
|
|
62
73
|
size: "large"
|
|
63
|
-
}, jsx(FormattedMessage,
|
|
74
|
+
}, jsx(FormattedMessage, message)));
|
|
64
75
|
});
|
|
@@ -233,6 +233,28 @@ export const getMediaFromSupportedMediaNodesFromSelection = state => {
|
|
|
233
233
|
return null;
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
+
export const isNodeDoubleClickSupportedInLivePagesViewMode = (isViewMode, node) => {
|
|
237
|
+
if (!node) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
// Double Click is not supported for video nodes on both views
|
|
241
|
+
if (isVideo(node.attrs.__fileMimeType)) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Double click is supported for all editor media nodes
|
|
246
|
+
if (!isViewMode) {
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Double Click is not supported for mediaGroup and mediaInline nodes that are file
|
|
251
|
+
if (node.type === node.type.schema.nodes.mediaGroup || node.type === node.type.schema.nodes.mediaInline && node.attrs.type === 'file') {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Double Click supported for all other media nodes
|
|
256
|
+
return true;
|
|
257
|
+
};
|
|
236
258
|
export const getIdentifier = attrs => {
|
|
237
259
|
if (isExternalMedia(attrs)) {
|
|
238
260
|
return {
|
|
@@ -71,7 +71,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
71
71
|
isCopying: false
|
|
72
72
|
});
|
|
73
73
|
_defineProperty(_assertThisInitialized(_this), "mediaSingleWrapperRef", /*#__PURE__*/React.createRef());
|
|
74
|
-
//
|
|
74
|
+
// platform_editor_typography_ugc clean up
|
|
75
75
|
// remove HTMLSpanElement type
|
|
76
76
|
_defineProperty(_assertThisInitialized(_this), "captionPlaceHolderRef", /*#__PURE__*/React.createRef());
|
|
77
77
|
_defineProperty(_assertThisInitialized(_this), "createOrUpdateMediaNodeUpdater", function (props) {
|
|
@@ -505,8 +505,8 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
505
505
|
isDrafting: isCurrentNodeDrafting
|
|
506
506
|
}), jsx("div", {
|
|
507
507
|
ref: this.props.forwardRef
|
|
508
|
-
}), shouldShowPlaceholder && (
|
|
509
|
-
//
|
|
508
|
+
}), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
|
|
509
|
+
// platform_editor_typography_ugc clean up
|
|
510
510
|
// remove typecasting
|
|
511
511
|
, {
|
|
512
512
|
ref: this.captionPlaceHolderRef,
|
|
@@ -511,8 +511,8 @@ export var MediaSingleNodeNext = function MediaSingleNodeNext(mediaSingleNodeNex
|
|
|
511
511
|
isDrafting: isCurrentNodeDrafting
|
|
512
512
|
}), jsx("div", {
|
|
513
513
|
ref: forwardRef
|
|
514
|
-
}), shouldShowPlaceholder && (
|
|
515
|
-
//
|
|
514
|
+
}), shouldShowPlaceholder && (fg('platform_editor_typography_ugc') ? jsx(CaptionPlaceholderButton
|
|
515
|
+
// platform_editor_typography_ugc clean up
|
|
516
516
|
// remove typecasting
|
|
517
517
|
, {
|
|
518
518
|
ref: captionPlaceHolderRef,
|
|
@@ -13,6 +13,7 @@ import React from 'react';
|
|
|
13
13
|
import ReactDOM from 'react-dom';
|
|
14
14
|
import { RawIntlProvider } from 'react-intl-next';
|
|
15
15
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
16
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
16
17
|
import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
|
|
17
18
|
import { CAPTION_PLACEHOLDER_ID, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
|
|
18
19
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -29,10 +30,10 @@ import * as helpers from '../commands/helpers';
|
|
|
29
30
|
import { updateMediaNodeAttrs } from '../commands/helpers';
|
|
30
31
|
import PickerFacade from '../picker-facade';
|
|
31
32
|
import DropPlaceholder from '../ui/Media/DropPlaceholder';
|
|
32
|
-
import { getMediaFromSupportedMediaNodesFromSelection, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
33
|
+
import { getMediaFromSupportedMediaNodesFromSelection, isNodeDoubleClickSupportedInLivePagesViewMode, removeMediaNode, splitMediaGroup } from '../utils/media-common';
|
|
33
34
|
import { insertMediaGroupNode, insertMediaInlineNode } from '../utils/media-files';
|
|
34
35
|
import { getMediaNodeInsertionType } from '../utils/media-inline';
|
|
35
|
-
import { insertMediaSingleNode
|
|
36
|
+
import { insertMediaSingleNode } from '../utils/media-single';
|
|
36
37
|
import { ACTIONS } from './actions';
|
|
37
38
|
import { MediaTaskManager } from './mediaTaskManager';
|
|
38
39
|
import { stateKey } from './plugin-key';
|
|
@@ -918,18 +919,33 @@ export var createPlugin = function createPlugin(_schema, options, getIntl, plugi
|
|
|
918
919
|
},
|
|
919
920
|
handleDoubleClickOn: function handleDoubleClickOn(view) {
|
|
920
921
|
var _pluginInjectionApi$e;
|
|
921
|
-
if (!fg('platform_editor_media_previewer_bugfix') || !fg('platform_editor_media_interaction_improvements')
|
|
922
|
+
if (!fg('platform_editor_media_previewer_bugfix') || !fg('platform_editor_media_interaction_improvements')) {
|
|
922
923
|
return;
|
|
923
924
|
}
|
|
925
|
+
var isLivePagesViewMode = (pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.editorViewMode) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.sharedState.currentState()) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.mode) === 'view';
|
|
924
926
|
|
|
925
927
|
// Double Click support for Media Viewer Nodes
|
|
926
928
|
var maybeMediaNode = getMediaFromSupportedMediaNodesFromSelection(view.state);
|
|
927
929
|
if (maybeMediaNode) {
|
|
930
|
+
var _pluginInjectionApi$a;
|
|
928
931
|
// If media type is video, do not open media viewer
|
|
929
|
-
if (
|
|
932
|
+
if (!isNodeDoubleClickSupportedInLivePagesViewMode(isLivePagesViewMode, maybeMediaNode)) {
|
|
930
933
|
return false;
|
|
931
934
|
}
|
|
935
|
+
// Show media viewer
|
|
932
936
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.media.commands.showMediaViewer(maybeMediaNode.attrs));
|
|
937
|
+
|
|
938
|
+
// Call analytics event
|
|
939
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 || _pluginInjectionApi$a.actions.fireAnalyticsEvent({
|
|
940
|
+
action: ACTION.OPENED,
|
|
941
|
+
actionSubject: ACTION_SUBJECT.MEDIA_VIEWER,
|
|
942
|
+
actionSubjectId: ACTION_SUBJECT_ID.MEDIA,
|
|
943
|
+
eventType: EVENT_TYPE.UI,
|
|
944
|
+
attributes: {
|
|
945
|
+
nodeType: maybeMediaNode.type.name,
|
|
946
|
+
inputMethod: INPUT_METHOD.DOUBLE_CLICK
|
|
947
|
+
}
|
|
948
|
+
});
|
|
933
949
|
return true;
|
|
934
950
|
}
|
|
935
951
|
return false;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Icon from '@atlaskit/icon';
|
|
4
|
-
import {
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { N0, Y300 } from '@atlaskit/theme/colors';
|
|
5
6
|
var IconCommentWithDotGlyph = function IconCommentWithDotGlyph() {
|
|
6
7
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7
8
|
width: "24",
|
|
@@ -29,8 +30,37 @@ var IconCommentWithDotGlyph = function IconCommentWithDotGlyph() {
|
|
|
29
30
|
fill: "var(--ds-background-warning-bold, ".concat(Y300, ")")
|
|
30
31
|
}));
|
|
31
32
|
};
|
|
33
|
+
var IconCommentConfluenceTypeWithDotGlyph = function IconCommentConfluenceTypeWithDotGlyph() {
|
|
34
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
35
|
+
width: "24",
|
|
36
|
+
height: "24",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
fill: "none",
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
40
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M4.998 11.513C4.998 8.475 8.139 6.003 12 6.003C15.861 6.003 19.002 8.475 19.002 11.513C19.002 14.552 15.861 17.023 12 17.023C8.139 17.023 4.998 14.552 4.998 11.513ZM19.838 19.284V19.282C19.838 19.282 18.274 17.022 19.071 16.166L19.034 16.186C20.261 14.902 21 13.279 21 11.513C21 7.371 16.963 4 12 4C7.037 4 3 7.37 3 11.513C3 15.656 7.037 19.027 12 19.027C13.42 19.027 14.76 18.742 15.957 18.251C16.96 19.273 18.244 19.823 19.197 19.97L19.199 19.967C19.2515 19.9867 19.3069 19.9979 19.363 20C19.448 20 19.5317 19.9789 19.6067 19.9386C19.6816 19.8984 19.7453 19.8402 19.7923 19.7693C19.8392 19.6984 19.8679 19.6169 19.8757 19.5323C19.8835 19.4476 19.8712 19.3623 19.838 19.284Z",
|
|
44
|
+
fill: "currentColor"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
d: "M16 9H8C7.44772 9 7 9.44772 7 10C7 10.5523 7.44772 11 8 11H16C16.5523 11 17 10.5523 17 10C17 9.44772 16.5523 9 16 9Z",
|
|
47
|
+
fill: "currentColor"
|
|
48
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
49
|
+
d: "M11 12H8C7.44772 12 7 12.4477 7 13C7 13.5523 7.44772 14 8 14H11C11.5523 14 12 13.5523 12 13C12 12.4477 11.5523 12 11 12Z",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
52
|
+
x: "13",
|
|
53
|
+
y: "1",
|
|
54
|
+
width: "8",
|
|
55
|
+
height: "8",
|
|
56
|
+
rx: "4",
|
|
57
|
+
stroke: "var(--ds-border-inverse, ".concat(N0, ")"),
|
|
58
|
+
strokeWidth: 2,
|
|
59
|
+
fill: "var(--ds-icon-brand, #0052CC)"
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
32
62
|
export var CommentWithDotIcon = function CommentWithDotIcon(props) {
|
|
33
63
|
return /*#__PURE__*/React.createElement(Icon, _extends({
|
|
34
|
-
glyph: IconCommentWithDotGlyph
|
|
64
|
+
glyph: fg('platform_editor_media_interaction_improvements') ? IconCommentConfluenceTypeWithDotGlyph : IconCommentWithDotGlyph
|
|
35
65
|
}, props));
|
|
36
66
|
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
3
|
var _templateObject;
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
3
6
|
/**
|
|
4
7
|
* @jsxRuntime classic
|
|
5
8
|
* @jsx jsx
|
|
@@ -11,6 +14,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
11
14
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
15
|
import { captionMessages as messages } from '@atlaskit/editor-common/media';
|
|
13
16
|
import { CAPTION_PLACEHOLDER_ID } from '@atlaskit/editor-common/media-single';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
18
|
import { Pressable, Text, xcss } from '@atlaskit/primitives';
|
|
15
19
|
import { N200 } from '@atlaskit/theme/colors';
|
|
16
20
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
@@ -20,10 +24,11 @@ var placeholderButton = xcss({
|
|
|
20
24
|
marginTop: 'space.100'
|
|
21
25
|
});
|
|
22
26
|
|
|
23
|
-
//
|
|
27
|
+
// platform_editor_typography_ugc clean up
|
|
24
28
|
// Remove this component
|
|
25
29
|
export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
26
30
|
var onClick = _ref.onClick;
|
|
31
|
+
var message = fg('platform_editor_media_interaction_improvements') ? _objectSpread({}, messages.placeholderWithDoubleClickPrompt) : _objectSpread({}, messages.placeholder);
|
|
27
32
|
return (
|
|
28
33
|
// eslint-disable-next-line @atlaskit/design-system/use-primitives-text
|
|
29
34
|
jsx("span", {
|
|
@@ -32,7 +37,7 @@ export var CaptionPlaceholder = /*#__PURE__*/React.forwardRef(function (_ref, re
|
|
|
32
37
|
onClick: onClick,
|
|
33
38
|
"data-id": CAPTION_PLACEHOLDER_ID,
|
|
34
39
|
"data-testid": "caption-placeholder"
|
|
35
|
-
}, jsx(FormattedMessage,
|
|
40
|
+
}, jsx(FormattedMessage, message))
|
|
36
41
|
);
|
|
37
42
|
});
|
|
38
43
|
export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
@@ -42,6 +47,7 @@ export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_r
|
|
|
42
47
|
// Hence we want to disabled it so that user can type in caption directly after click
|
|
43
48
|
e.preventDefault();
|
|
44
49
|
}, []);
|
|
50
|
+
var message = fg('platform_editor_media_interaction_improvements') ? _objectSpread({}, messages.placeholderWithDoubleClickPrompt) : _objectSpread({}, messages.placeholder);
|
|
45
51
|
return jsx(Pressable, {
|
|
46
52
|
ref: ref,
|
|
47
53
|
backgroundColor: "color.background.neutral.subtle",
|
|
@@ -54,5 +60,5 @@ export var CaptionPlaceholderButton = /*#__PURE__*/React.forwardRef(function (_r
|
|
|
54
60
|
}, jsx(Text, {
|
|
55
61
|
color: "color.text.subtlest",
|
|
56
62
|
size: "large"
|
|
57
|
-
}, jsx(FormattedMessage,
|
|
63
|
+
}, jsx(FormattedMessage, message)));
|
|
58
64
|
});
|
|
@@ -216,6 +216,28 @@ export var getMediaFromSupportedMediaNodesFromSelection = function getMediaFromS
|
|
|
216
216
|
return null;
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
|
+
export var isNodeDoubleClickSupportedInLivePagesViewMode = function isNodeDoubleClickSupportedInLivePagesViewMode(isViewMode, node) {
|
|
220
|
+
if (!node) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
// Double Click is not supported for video nodes on both views
|
|
224
|
+
if (isVideo(node.attrs.__fileMimeType)) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Double click is supported for all editor media nodes
|
|
229
|
+
if (!isViewMode) {
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Double Click is not supported for mediaGroup and mediaInline nodes that are file
|
|
234
|
+
if (node.type === node.type.schema.nodes.mediaGroup || node.type === node.type.schema.nodes.mediaInline && node.attrs.type === 'file') {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Double Click supported for all other media nodes
|
|
239
|
+
return true;
|
|
240
|
+
};
|
|
219
241
|
export var getIdentifier = function getIdentifier(attrs) {
|
|
220
242
|
if (isExternalMedia(attrs)) {
|
|
221
243
|
return {
|
|
@@ -23,6 +23,7 @@ export declare const getMediaNodeFromSelection: (state: EditorState) => PMNode |
|
|
|
23
23
|
export declare const isMediaSingleOrInlineNodeSelected: (state: EditorState) => boolean | undefined;
|
|
24
24
|
export declare const getMediaSingleOrInlineNodeFromSelection: (state: EditorState) => PMNode | null;
|
|
25
25
|
export declare const getMediaFromSupportedMediaNodesFromSelection: (state: EditorState) => PMNode | null;
|
|
26
|
+
export declare const isNodeDoubleClickSupportedInLivePagesViewMode: (isViewMode: boolean, node?: PMNode | null) => boolean;
|
|
26
27
|
export declare const getIdentifier: (attrs: MediaADFAttrs) => Identifier;
|
|
27
28
|
export declare const extractMediaNodes: (doc: ProseMirrorNode) => PMNode[];
|
|
28
29
|
export declare const createMediaIdentifierArray: (mediaNodes: ProseMirrorNode[]) => any[];
|
|
@@ -23,6 +23,7 @@ export declare const getMediaNodeFromSelection: (state: EditorState) => PMNode |
|
|
|
23
23
|
export declare const isMediaSingleOrInlineNodeSelected: (state: EditorState) => boolean | undefined;
|
|
24
24
|
export declare const getMediaSingleOrInlineNodeFromSelection: (state: EditorState) => PMNode | null;
|
|
25
25
|
export declare const getMediaFromSupportedMediaNodesFromSelection: (state: EditorState) => PMNode | null;
|
|
26
|
+
export declare const isNodeDoubleClickSupportedInLivePagesViewMode: (isViewMode: boolean, node?: PMNode | null) => boolean;
|
|
26
27
|
export declare const getIdentifier: (attrs: MediaADFAttrs) => Identifier;
|
|
27
28
|
export declare const extractMediaNodes: (doc: ProseMirrorNode) => PMNode[];
|
|
28
29
|
export declare const createMediaIdentifierArray: (mediaNodes: ProseMirrorNode[]) => any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@atlaskit/analytics-namespaced-context": "^6.12.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
38
38
|
"@atlaskit/button": "^20.3.0",
|
|
39
|
-
"@atlaskit/editor-common": "^94.
|
|
40
|
-
"@atlaskit/editor-palette": "1.6.
|
|
39
|
+
"@atlaskit/editor-common": "^94.5.0",
|
|
40
|
+
"@atlaskit/editor-palette": "1.6.3",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
42
42
|
"@atlaskit/editor-plugin-annotation": "1.21.3",
|
|
43
43
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@atlaskit/primitives": "^12.2.0",
|
|
67
67
|
"@atlaskit/textfield": "^6.5.0",
|
|
68
68
|
"@atlaskit/theme": "^14.0.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^2.10.0",
|
|
70
70
|
"@atlaskit/tokens": "^2.0.0",
|
|
71
71
|
"@atlaskit/tooltip": "^18.8.0",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
@@ -142,6 +142,9 @@
|
|
|
142
142
|
"editor_nest_media_and_codeblock_in_quotes_jira": {
|
|
143
143
|
"type": "boolean"
|
|
144
144
|
},
|
|
145
|
+
"platform_editor_typography_ugc": {
|
|
146
|
+
"type": "boolean"
|
|
147
|
+
},
|
|
145
148
|
"platform-visual-refresh-icons": {
|
|
146
149
|
"type": "boolean"
|
|
147
150
|
}
|