@atlaskit/editor-plugin-media 1.37.3 → 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 +25 -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/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +556 -5
- 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/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +546 -4
- 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/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +552 -4
- package/dist/esm/utils/media-common.js +22 -0
- package/dist/types/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +3 -56
- package/dist/types/utils/media-common.d.ts +1 -0
- package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +3 -56
- package/dist/types-ts4.5/utils/media-common.d.ts +1 -0
- package/package.json +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
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
|
+
|
|
19
|
+
## 1.37.4
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- [#156360](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156360)
|
|
24
|
+
[`7125e8ac235ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7125e8ac235ea) -
|
|
25
|
+
[ED-25348] Refactor Media ResizeNext React Class component into Function Component
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 1.37.3
|
|
4
29
|
|
|
5
30
|
### 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
|
});
|