@atlaskit/renderer 84.1.1 → 88.0.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 +95 -0
- package/dist/cjs/actions/index.js +3 -3
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/analytics/unsupported-content.js +3 -3
- package/dist/cjs/messages.js +47 -1
- package/dist/cjs/react/hooks/use-observed-width.js +94 -0
- package/dist/cjs/react/index.js +15 -9
- package/dist/cjs/react/marks/annotation.js +2 -2
- package/dist/cjs/react/marks/breakout.js +5 -3
- package/dist/cjs/react/nodes/blockCard.js +2 -2
- package/dist/cjs/react/nodes/caption.js +2 -2
- package/dist/cjs/react/nodes/copy-text-provider.js +2 -1
- package/dist/cjs/react/nodes/date.js +6 -4
- package/dist/cjs/react/nodes/embedCard.js +5 -5
- package/dist/cjs/react/nodes/emoji.js +2 -2
- package/dist/cjs/react/nodes/extension.js +6 -4
- package/dist/cjs/react/nodes/heading-anchor.js +11 -3
- package/dist/cjs/react/nodes/index.js +80 -55
- package/dist/cjs/react/nodes/inlineCard.js +14 -3
- package/dist/cjs/react/nodes/layoutColumn.js +2 -2
- package/dist/cjs/react/nodes/media.js +5 -3
- package/dist/cjs/react/nodes/mediaGroup.js +2 -2
- package/dist/cjs/react/nodes/mediaInline.js +2 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +146 -152
- package/dist/cjs/react/nodes/mediaSingle/styles.js +2 -2
- package/dist/cjs/react/nodes/mention.js +2 -4
- package/dist/cjs/react/nodes/panel.js +18 -20
- package/dist/cjs/react/nodes/status.js +2 -1
- package/dist/cjs/react/nodes/table/colgroup.js +2 -2
- package/dist/cjs/react/nodes/table/sticky.js +4 -4
- package/dist/cjs/react/nodes/table.js +19 -13
- package/dist/cjs/react/nodes/tableCell.js +34 -21
- package/dist/cjs/react/nodes/tableRow.js +6 -4
- package/dist/cjs/react/nodes/task-item-with-providers.js +6 -2
- package/dist/cjs/react/nodes/taskItem.js +4 -3
- package/dist/cjs/render-document.js +19 -3
- package/dist/cjs/text/nodes/date.js +3 -3
- package/dist/cjs/types/smartLinksOptions.js +5 -0
- package/dist/cjs/ui/Expand.js +9 -9
- package/dist/cjs/ui/ExtensionRenderer.js +8 -4
- package/dist/cjs/ui/MediaCard.js +4 -4
- package/dist/cjs/ui/Renderer/breakout-ssr.js +50 -7
- package/dist/cjs/ui/Renderer/index.js +23 -18
- package/dist/cjs/ui/SortingIcon.js +30 -17
- package/dist/cjs/ui/annotations/draft/component.js +2 -2
- package/dist/cjs/ui/annotations/element/index.js +2 -2
- package/dist/cjs/ui/annotations/element/mark.js +4 -4
- package/dist/cjs/ui/annotations/hooks/use-events.js +11 -11
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -4
- package/dist/cjs/utils.js +4 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/analytics/unsupported-content.js +1 -1
- package/dist/es2019/messages.js +44 -0
- package/dist/es2019/react/hooks/use-observed-width.js +59 -0
- package/dist/es2019/react/index.js +4 -1
- package/dist/es2019/react/marks/breakout.js +2 -1
- package/dist/es2019/react/nodes/blockCard.js +1 -1
- package/dist/es2019/react/nodes/caption.js +1 -1
- package/dist/es2019/react/nodes/copy-text-provider.js +2 -1
- package/dist/es2019/react/nodes/date.js +2 -1
- package/dist/es2019/react/nodes/embedCard.js +1 -1
- package/dist/es2019/react/nodes/emoji.js +1 -1
- package/dist/es2019/react/nodes/extension.js +2 -1
- package/dist/es2019/react/nodes/heading-anchor.js +11 -2
- package/dist/es2019/react/nodes/index.js +32 -7
- package/dist/es2019/react/nodes/inlineCard.js +12 -2
- package/dist/es2019/react/nodes/layoutColumn.js +1 -1
- package/dist/es2019/react/nodes/media.js +2 -1
- package/dist/es2019/react/nodes/mediaInline.js +1 -1
- package/dist/es2019/react/nodes/mediaSingle/index.js +132 -112
- package/dist/es2019/react/nodes/mediaSingle/styles.js +1 -1
- package/dist/es2019/react/nodes/mention.js +1 -3
- package/dist/es2019/react/nodes/panel.js +14 -12
- package/dist/es2019/react/nodes/status.js +2 -1
- package/dist/es2019/react/nodes/table/colgroup.js +1 -1
- package/dist/es2019/react/nodes/table/sticky.js +1 -1
- package/dist/es2019/react/nodes/table.js +4 -1
- package/dist/es2019/react/nodes/tableCell.js +22 -10
- package/dist/es2019/react/nodes/tableRow.js +2 -1
- package/dist/es2019/react/nodes/task-item-with-providers.js +3 -1
- package/dist/es2019/react/nodes/taskItem.js +2 -1
- package/dist/es2019/render-document.js +18 -2
- package/dist/es2019/text/nodes/date.js +1 -1
- package/dist/es2019/types/smartLinksOptions.js +1 -0
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/ExtensionRenderer.js +3 -1
- package/dist/es2019/ui/MediaCard.js +1 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +46 -5
- package/dist/es2019/ui/Renderer/index.js +4 -1
- package/dist/es2019/ui/SortingIcon.js +23 -11
- package/dist/es2019/ui/annotations/draft/component.js +1 -1
- package/dist/es2019/ui/annotations/element/index.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +1 -1
- package/dist/es2019/ui/annotations/hooks/use-events.js +1 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/analytics/unsupported-content.js +1 -1
- package/dist/esm/messages.js +44 -0
- package/dist/esm/react/hooks/use-observed-width.js +80 -0
- package/dist/esm/react/index.js +8 -4
- package/dist/esm/react/marks/annotation.js +2 -2
- package/dist/esm/react/marks/breakout.js +2 -1
- package/dist/esm/react/nodes/blockCard.js +1 -1
- package/dist/esm/react/nodes/caption.js +1 -1
- package/dist/esm/react/nodes/copy-text-provider.js +2 -1
- package/dist/esm/react/nodes/date.js +2 -1
- package/dist/esm/react/nodes/embedCard.js +1 -1
- package/dist/esm/react/nodes/emoji.js +1 -1
- package/dist/esm/react/nodes/extension.js +2 -1
- package/dist/esm/react/nodes/heading-anchor.js +12 -3
- package/dist/esm/react/nodes/index.js +62 -7
- package/dist/esm/react/nodes/inlineCard.js +12 -2
- package/dist/esm/react/nodes/layoutColumn.js +1 -1
- package/dist/esm/react/nodes/media.js +2 -1
- package/dist/esm/react/nodes/mediaGroup.js +2 -2
- package/dist/esm/react/nodes/mediaInline.js +1 -1
- package/dist/esm/react/nodes/mediaSingle/index.js +140 -141
- package/dist/esm/react/nodes/mediaSingle/styles.js +1 -1
- package/dist/esm/react/nodes/mention.js +1 -3
- package/dist/esm/react/nodes/panel.js +14 -12
- package/dist/esm/react/nodes/status.js +2 -1
- package/dist/esm/react/nodes/table/colgroup.js +1 -1
- package/dist/esm/react/nodes/table/sticky.js +1 -1
- package/dist/esm/react/nodes/table.js +4 -1
- package/dist/esm/react/nodes/tableCell.js +19 -9
- package/dist/esm/react/nodes/tableRow.js +2 -1
- package/dist/esm/react/nodes/task-item-with-providers.js +5 -2
- package/dist/esm/react/nodes/taskItem.js +2 -1
- package/dist/esm/render-document.js +17 -2
- package/dist/esm/text/nodes/date.js +1 -1
- package/dist/esm/types/smartLinksOptions.js +1 -0
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/ExtensionRenderer.js +3 -1
- package/dist/esm/ui/MediaCard.js +3 -3
- package/dist/esm/ui/Renderer/breakout-ssr.js +48 -5
- package/dist/esm/ui/Renderer/index.js +6 -3
- package/dist/esm/ui/SortingIcon.js +21 -11
- package/dist/esm/ui/annotations/draft/component.js +1 -1
- package/dist/esm/ui/annotations/element/index.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +3 -3
- package/dist/esm/ui/annotations/hooks/use-events.js +3 -3
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +3 -3
- package/dist/esm/utils.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/analytics/enums.d.ts +2 -1
- package/dist/types/analytics/events.d.ts +5 -2
- package/dist/types/analytics/unsupported-content.d.ts +1 -1
- package/dist/types/messages.d.ts +44 -0
- package/dist/types/react/hooks/use-observed-width.d.ts +3 -0
- package/dist/types/react/index.d.ts +6 -1
- package/dist/types/react/nodes/blockCard.d.ts +1 -1
- package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
- package/dist/types/react/nodes/codeBlock.d.ts +3 -3
- package/dist/types/react/nodes/embedCard.d.ts +1 -1
- package/dist/types/react/nodes/emoji.d.ts +1 -1
- package/dist/types/react/nodes/extension.d.ts +14 -13
- package/dist/types/react/nodes/index.d.ts +39 -15
- package/dist/types/react/nodes/inlineCard.d.ts +23 -21
- package/dist/types/react/nodes/inlineExtension.d.ts +2 -1
- package/dist/types/react/nodes/media.d.ts +2 -2
- package/dist/types/react/nodes/mediaGroup.d.ts +1 -1
- package/dist/types/react/nodes/mediaInline.d.ts +1 -1
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -7
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +1 -1
- package/dist/types/react/nodes/mention.d.ts +2 -2
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +1 -1
- package/dist/types/react/nodes/table.d.ts +22 -21
- package/dist/types/react/nodes/tableCell.d.ts +7 -60
- package/dist/types/react/nodes/tableRow.d.ts +1 -1
- package/dist/types/react/nodes/task-item-with-providers.d.ts +2 -1
- package/dist/types/react/nodes/taskItem.d.ts +1 -1
- package/dist/types/react/types.d.ts +3 -1
- package/dist/types/react/utils/getCardClickHandler.d.ts +1 -1
- package/dist/types/render-document.d.ts +1 -1
- package/dist/types/types/smartLinksOptions.d.ts +3 -0
- package/dist/types/ui/ExtensionRenderer.d.ts +3 -1
- package/dist/types/ui/MediaCard.d.ts +3 -2
- package/dist/types/ui/SortingIcon.d.ts +7 -4
- package/dist/types/ui/annotations/context.d.ts +1 -1
- package/dist/types/ui/annotations/element/mark.d.ts +1 -1
- package/dist/types/ui/annotations/hooks/use-events.d.ts +2 -1
- package/dist/types/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +1 -1
- package/dist/types/ui/annotations/selection/mounter.d.ts +1 -1
- package/dist/types/ui/annotations/selection/range-validator.d.ts +1 -1
- package/dist/types/ui/annotations/types.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +8 -1
- package/dist/types/utils.d.ts +3 -1
- package/package.json +20 -21
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { buildAnnotationMarkDataAttributes } from '@atlaskit/adf-schema';
|
|
@@ -4,7 +4,8 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import {
|
|
7
|
+
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
9
10
|
export var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), blockNodesVerticalMargin);
|
|
10
11
|
export default function Breakout(props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { Card } from '@atlaskit/smart-card';
|
|
4
|
-
import { UnsupportedBlock } from '@atlaskit/editor-common';
|
|
4
|
+
import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { getPlatform } from '../../utils';
|
|
6
6
|
import { CardErrorBoundary } from './fallback';
|
|
7
7
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
@@ -79,7 +79,8 @@ var Provider = CopyTextContext.Provider,
|
|
|
79
79
|
Consumer = CopyTextContext.Consumer;
|
|
80
80
|
export var CopyArea = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
81
81
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
82
|
-
ref: ref
|
|
82
|
+
ref: ref // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
83
|
+
,
|
|
83
84
|
style: {
|
|
84
85
|
position: 'absolute',
|
|
85
86
|
left: '-9999px',
|
|
@@ -10,7 +10,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { PureComponent } from 'react';
|
|
13
|
-
import {
|
|
13
|
+
import { DateSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
14
|
+
import { isPastDate, timestampToString, timestampToTaskContext } from '@atlaskit/editor-common/utils';
|
|
14
15
|
import { injectIntl } from 'react-intl-next';
|
|
15
16
|
|
|
16
17
|
var Date = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -6,7 +6,7 @@ var _templateObject, _templateObject2;
|
|
|
6
6
|
|
|
7
7
|
import React, { useMemo, useContext, useState, useRef } from 'react';
|
|
8
8
|
import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
9
|
-
import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common';
|
|
9
|
+
import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import { getPlatform } from '../../utils';
|
|
12
12
|
import { CardErrorBoundary } from './fallback';
|
|
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { PureComponent } from 'react';
|
|
13
|
-
import { Emoji } from '@atlaskit/editor-common';
|
|
13
|
+
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
14
14
|
|
|
15
15
|
var EmojiItem = /*#__PURE__*/function (_PureComponent) {
|
|
16
16
|
_inherits(EmojiItem, _PureComponent);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import ExtensionRenderer from '../../ui/ExtensionRenderer';
|
|
4
|
-
import {
|
|
4
|
+
import { overflowShadow, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
5
|
+
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
5
6
|
import { RendererCssClassName } from '../../consts';
|
|
6
7
|
export var renderExtension = function renderExtension(content, layout) {
|
|
7
8
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -13,6 +13,8 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
13
13
|
|
|
14
14
|
var _templateObject;
|
|
15
15
|
|
|
16
|
+
var _excluded = ["children"];
|
|
17
|
+
|
|
16
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
19
|
|
|
18
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -27,7 +29,7 @@ import { headingAnchorLinkMessages } from '../../messages';
|
|
|
27
29
|
export var HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
28
30
|
var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
29
31
|
var children = props.children,
|
|
30
|
-
rest = _objectWithoutProperties(props,
|
|
32
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
31
33
|
|
|
32
34
|
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
|
33
35
|
className: HeadingAnchorWrapperClassName,
|
|
@@ -61,11 +63,17 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
61
63
|
var isClicked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
62
64
|
|
|
63
65
|
_this.setState({
|
|
66
|
+
// TODO: ED-14403 investigate why this does not translate
|
|
64
67
|
tooltipMessage: _this.props.intl.formatMessage(message),
|
|
65
68
|
isClicked: isClicked
|
|
66
69
|
});
|
|
67
70
|
});
|
|
68
71
|
|
|
72
|
+
_defineProperty(_assertThisInitialized(_this), "getCopyAriaLabel", function () {
|
|
73
|
+
var copyAriaLabel = headingAnchorLinkMessages.copyAriaLabel;
|
|
74
|
+
return _this.props.intl.formatMessage(copyAriaLabel);
|
|
75
|
+
});
|
|
76
|
+
|
|
69
77
|
_defineProperty(_assertThisInitialized(_this), "copyToClipboard", /*#__PURE__*/function () {
|
|
70
78
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
71
79
|
var copiedHeadingLinkToClipboard, failedToCopyHeadingLink;
|
|
@@ -111,9 +119,10 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
111
119
|
_defineProperty(_assertThisInitialized(_this), "renderAnchorButton", function () {
|
|
112
120
|
return /*#__PURE__*/React.createElement(CopyAnchorButton, {
|
|
113
121
|
onMouseLeave: _this.resetMessage,
|
|
114
|
-
onClick: _this.copyToClipboard
|
|
122
|
+
onClick: _this.copyToClipboard,
|
|
123
|
+
"aria-label": _this.state.tooltipMessage
|
|
115
124
|
}, /*#__PURE__*/React.createElement(LinkIcon, {
|
|
116
|
-
label:
|
|
125
|
+
label: _this.getCopyAriaLabel(),
|
|
117
126
|
size: _this.props.level > 3 ? 'small' : 'medium',
|
|
118
127
|
primaryColor: _this.state.isClicked ? B400 : N200
|
|
119
128
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import Loadable from 'react-loadable';
|
|
1
2
|
import Blockquote from './blockquote';
|
|
2
3
|
import BodiedExtension from './bodiedExtension';
|
|
3
4
|
import BulletList from './bulletList';
|
|
4
|
-
import DecisionList from './decisionList';
|
|
5
5
|
import Doc, { DocWithSelectAllTrap } from './doc';
|
|
6
6
|
import Extension from './extension';
|
|
7
7
|
import HardBreak from './hardBreak';
|
|
@@ -10,21 +10,16 @@ import InlineExtension from './inlineExtension';
|
|
|
10
10
|
import LayoutSection from './layoutSection';
|
|
11
11
|
import LayoutColumn from './layoutColumn';
|
|
12
12
|
import ListItem from './listItem';
|
|
13
|
-
import MediaSingle from './mediaSingle';
|
|
14
13
|
import Caption from './caption';
|
|
15
14
|
import OrderedList from './orderedList';
|
|
16
|
-
import Panel from './panel';
|
|
17
15
|
import Paragraph from './paragraph';
|
|
18
16
|
import Placeholder from './placeholder';
|
|
19
17
|
import Rule from './rule';
|
|
20
|
-
import TaskList from './taskList';
|
|
21
18
|
import Table from './table';
|
|
22
19
|
import { TableCell, TableHeader } from './tableCell';
|
|
23
20
|
import TableRow from './tableRow';
|
|
24
21
|
import UnknownBlock from './unknownBlock';
|
|
25
|
-
import
|
|
26
|
-
import EmbedCard from './embedCard';
|
|
27
|
-
import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common';
|
|
22
|
+
import { UnsupportedBlock, UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
28
23
|
var CodeBlock = Loadable({
|
|
29
24
|
loader: function loader() {
|
|
30
25
|
return import(
|
|
@@ -37,6 +32,18 @@ var CodeBlock = Loadable({
|
|
|
37
32
|
return null;
|
|
38
33
|
}
|
|
39
34
|
});
|
|
35
|
+
var TaskList = Loadable({
|
|
36
|
+
loader: function loader() {
|
|
37
|
+
return import(
|
|
38
|
+
/* webpackChunkName: "@atlaskit-internal_renderer-node_TaskList" */
|
|
39
|
+
'./taskList').then(function (mod) {
|
|
40
|
+
return mod.default;
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
loading: function loading() {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
40
47
|
var TaskItem = Loadable({
|
|
41
48
|
loader: function loader() {
|
|
42
49
|
return import(
|
|
@@ -49,6 +56,18 @@ var TaskItem = Loadable({
|
|
|
49
56
|
return null;
|
|
50
57
|
}
|
|
51
58
|
});
|
|
59
|
+
var DecisionList = Loadable({
|
|
60
|
+
loader: function loader() {
|
|
61
|
+
return import(
|
|
62
|
+
/* webpackChunkName: "@atlaskit-internal_renderer-node_DecisionList" */
|
|
63
|
+
'./decisionList').then(function (mod) {
|
|
64
|
+
return mod.default;
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
loading: function loading() {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
52
71
|
var DecisionItem = Loadable({
|
|
53
72
|
loader: function loader() {
|
|
54
73
|
return import(
|
|
@@ -97,6 +116,30 @@ var Emoji = Loadable({
|
|
|
97
116
|
return null;
|
|
98
117
|
}
|
|
99
118
|
});
|
|
119
|
+
var Panel = Loadable({
|
|
120
|
+
loader: function loader() {
|
|
121
|
+
return import(
|
|
122
|
+
/* webpackChunkName: "@atlaskit-internal_renderer-node_Panel" */
|
|
123
|
+
'./panel').then(function (mod) {
|
|
124
|
+
return mod.default;
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
loading: function loading() {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
var EmbedCard = Loadable({
|
|
132
|
+
loader: function loader() {
|
|
133
|
+
return import(
|
|
134
|
+
/* webpackChunkName: "@atlaskit-internal_renderer-node_EmbedCard" */
|
|
135
|
+
'./embedCard').then(function (mod) {
|
|
136
|
+
return mod.default;
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
loading: function loading() {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
100
143
|
var InlineCard = Loadable({
|
|
101
144
|
loader: function loader() {
|
|
102
145
|
return import(
|
|
@@ -157,6 +200,18 @@ var MediaInline = Loadable({
|
|
|
157
200
|
return null;
|
|
158
201
|
}
|
|
159
202
|
});
|
|
203
|
+
var MediaSingle = Loadable({
|
|
204
|
+
loader: function loader() {
|
|
205
|
+
return import(
|
|
206
|
+
/* webpackChunkName: "@atlaskit-internal_renderer-node_MediaSingle" */
|
|
207
|
+
'./mediaSingle').then(function (mod) {
|
|
208
|
+
return mod.default;
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
loading: function loading() {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
});
|
|
160
215
|
var Mention = Loadable({
|
|
161
216
|
loader: function loader() {
|
|
162
217
|
return import(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Card } from '@atlaskit/smart-card';
|
|
4
|
-
import {
|
|
4
|
+
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
5
|
+
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
5
6
|
import { CardErrorBoundary } from './fallback';
|
|
6
7
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
7
8
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
@@ -10,7 +11,8 @@ var InlineCard = function InlineCard(props) {
|
|
|
10
11
|
var url = props.url,
|
|
11
12
|
data = props.data,
|
|
12
13
|
eventHandlers = props.eventHandlers,
|
|
13
|
-
portal = props.portal
|
|
14
|
+
portal = props.portal,
|
|
15
|
+
smartLinks = props.smartLinks;
|
|
14
16
|
var onClick = getCardClickHandler(eventHandlers, url);
|
|
15
17
|
var cardProps = {
|
|
16
18
|
url: url,
|
|
@@ -18,6 +20,14 @@ var InlineCard = function InlineCard(props) {
|
|
|
18
20
|
onClick: onClick,
|
|
19
21
|
container: portal
|
|
20
22
|
};
|
|
23
|
+
|
|
24
|
+
if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(CardSSR, {
|
|
26
|
+
appearance: "inline",
|
|
27
|
+
url: url
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
return /*#__PURE__*/React.createElement("span", {
|
|
22
32
|
"data-inline-card": true,
|
|
23
33
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { WidthProvider, ClearNextSiblingMarginTop } from '@atlaskit/editor-common';
|
|
2
|
+
import { WidthProvider, ClearNextSiblingMarginTop } from '@atlaskit/editor-common/ui';
|
|
3
3
|
export default function LayoutSection(props) {
|
|
4
4
|
return /*#__PURE__*/React.createElement("div", {
|
|
5
5
|
"data-layout-column": true,
|
|
@@ -13,7 +13,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { PureComponent } from 'react';
|
|
16
|
-
import { WithProviders
|
|
16
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
17
|
+
import { MediaLink } from '@atlaskit/editor-common/ui';
|
|
17
18
|
import { MediaCard } from '../../ui/MediaCard';
|
|
18
19
|
import { getEventHandler } from '../../utils';
|
|
19
20
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
|
|
@@ -6,9 +6,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
9
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
11
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
12
|
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
|
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
6
|
-
import { WithProviders } from '@atlaskit/editor-common';
|
|
6
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
7
7
|
export var RenderMediaInline = function RenderMediaInline(props) {
|
|
8
8
|
var mediaProvider = props.mediaProvider;
|
|
9
9
|
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
|
-
|
|
10
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
|
-
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
15
|
-
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
16
|
-
import { Component, default as React } from 'react';
|
|
2
|
+
import { default as React } from 'react';
|
|
17
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
5
|
+
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
18
7
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
8
|
+
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
19
9
|
import { ExtendedUIMediaSingle } from './styles';
|
|
20
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
21
10
|
var DEFAULT_WIDTH = 250;
|
|
22
11
|
var DEFAULT_HEIGHT = 200;
|
|
23
12
|
|
|
@@ -53,146 +42,156 @@ export var getMediaContainerWidth = function getMediaContainerWidth(currentConta
|
|
|
53
42
|
return !currentContainerWidth && layout !== 'full-width' && layout !== 'wide' ? akEditorDefaultLayoutWidth : currentContainerWidth;
|
|
54
43
|
};
|
|
55
44
|
|
|
56
|
-
var MediaSingle =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
var MediaSingle = function MediaSingle(props) {
|
|
46
|
+
var _ref$current;
|
|
47
|
+
|
|
48
|
+
var rendererAppearance = props.rendererAppearance,
|
|
49
|
+
featureFlags = props.featureFlags,
|
|
50
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
51
|
+
allowDynamicTextSizing = props.allowDynamicTextSizing,
|
|
52
|
+
layout = props.layout,
|
|
53
|
+
children = props.children,
|
|
54
|
+
pctWidth = props.width;
|
|
55
|
+
var isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
|
|
56
|
+
|
|
57
|
+
var _React$useState = React.useState({
|
|
58
|
+
width: 0,
|
|
59
|
+
height: 0
|
|
60
|
+
}),
|
|
61
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
|
+
externalImageDimensions = _React$useState2[0],
|
|
63
|
+
setExternalImageDimensions = _React$useState2[1];
|
|
64
|
+
|
|
65
|
+
var ref = React.useRef(null);
|
|
66
|
+
var onExternalImageLoaded = React.useCallback(function (_ref2) {
|
|
67
|
+
var width = _ref2.width,
|
|
68
|
+
height = _ref2.height;
|
|
69
|
+
setExternalImageDimensions({
|
|
70
|
+
width: width,
|
|
71
|
+
height: height
|
|
72
|
+
});
|
|
73
|
+
}, []);
|
|
74
|
+
var observedWidthFlag = getMediaFeatureFlag('observedWidth', featureFlags);
|
|
65
75
|
|
|
66
|
-
|
|
76
|
+
var _useObservedWidth = useObservedWidth((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.parentElement, observedWidthFlag),
|
|
77
|
+
observedWidth = _useObservedWidth.width;
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
var width = _ref2.width,
|
|
70
|
-
height = _ref2.height;
|
|
79
|
+
var media;
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
81
|
+
var _React$Children$toArr3 = React.Children.toArray(children),
|
|
82
|
+
_React$Children$toArr4 = _slicedToArray(_React$Children$toArr3, 2),
|
|
83
|
+
node = _React$Children$toArr4[0],
|
|
84
|
+
caption = _React$Children$toArr4[1];
|
|
77
85
|
|
|
78
|
-
|
|
86
|
+
if (!isMediaElement(node)) {
|
|
87
|
+
var mediaElement = checkForMediaElement(node.props.children);
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
if (!mediaElement) {
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
media = mediaElement;
|
|
94
|
+
} else {
|
|
95
|
+
media = node;
|
|
83
96
|
}
|
|
84
97
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var media;
|
|
98
|
+
var _media$props = media.props,
|
|
99
|
+
_media$props$width = _media$props.width,
|
|
100
|
+
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
101
|
+
_media$props$height = _media$props.height,
|
|
102
|
+
height = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
103
|
+
type = _media$props.type;
|
|
92
104
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
caption = _React$Children$toArr4[1];
|
|
105
|
+
if (type === 'external') {
|
|
106
|
+
var stateWidth = externalImageDimensions.width,
|
|
107
|
+
stateHeight = externalImageDimensions.height;
|
|
97
108
|
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
if (width === null) {
|
|
110
|
+
width = stateWidth || DEFAULT_WIDTH;
|
|
111
|
+
}
|
|
100
112
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
if (height === null) {
|
|
114
|
+
height = stateHeight || DEFAULT_HEIGHT;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
104
117
|
|
|
105
|
-
|
|
118
|
+
if (width === null) {
|
|
119
|
+
width = DEFAULT_WIDTH;
|
|
120
|
+
height = DEFAULT_HEIGHT;
|
|
121
|
+
} // TODO: put appearance-based padding into theme instead
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
125
|
+
var isFullWidth = rendererAppearance === 'full-width';
|
|
126
|
+
|
|
127
|
+
var calcDimensions = function calcDimensions(mediaContainerWidth, mediaBreakpoint) {
|
|
128
|
+
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
129
|
+
var breakpoint = mediaBreakpoint || getBreakpoint(containerWidth);
|
|
130
|
+
var maxWidth = containerWidth;
|
|
131
|
+
var maxHeight = height / width * maxWidth;
|
|
132
|
+
var cardDimensions = {
|
|
133
|
+
width: "".concat(maxWidth, "px"),
|
|
134
|
+
height: "".concat(maxHeight, "px")
|
|
135
|
+
};
|
|
136
|
+
var nonFullWidthSize = containerWidth;
|
|
137
|
+
|
|
138
|
+
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
139
|
+
var isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
140
|
+
|
|
141
|
+
if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
|
|
142
|
+
nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
|
|
143
|
+
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
144
|
+
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
106
145
|
} else {
|
|
107
|
-
|
|
146
|
+
nonFullWidthSize = containerWidth - padding;
|
|
108
147
|
}
|
|
109
|
-
|
|
110
|
-
var _media$props = media.props,
|
|
111
|
-
_media$props$width = _media$props.width,
|
|
112
|
-
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
113
|
-
_media$props$height = _media$props.height,
|
|
114
|
-
height = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
115
|
-
type = _media$props.type;
|
|
116
|
-
|
|
117
|
-
if (type === 'external') {
|
|
118
|
-
var _this$state = this.state,
|
|
119
|
-
stateWidth = _this$state.width,
|
|
120
|
-
stateHeight = _this$state.height;
|
|
121
|
-
|
|
122
|
-
if (width === null) {
|
|
123
|
-
width = stateWidth || DEFAULT_WIDTH;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (height === null) {
|
|
127
|
-
height = stateHeight || DEFAULT_HEIGHT;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (width === null) {
|
|
132
|
-
width = DEFAULT_WIDTH;
|
|
133
|
-
height = DEFAULT_HEIGHT;
|
|
134
|
-
} // TODO: put appearance-based padding into theme instead
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var _this$props = this.props,
|
|
138
|
-
rendererAppearance = _this$props.rendererAppearance,
|
|
139
|
-
featureFlags = _this$props.featureFlags;
|
|
140
|
-
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
141
|
-
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
|
|
142
|
-
var widthConsumerValue = _ref3.width,
|
|
143
|
-
breakpoint = _ref3.breakpoint;
|
|
144
|
-
var containerWidth = getMediaContainerWidth(widthConsumerValue, props.layout);
|
|
145
|
-
var _this2$props = _this2.props,
|
|
146
|
-
isInsideOfBlockNode = _this2$props.isInsideOfBlockNode,
|
|
147
|
-
allowDynamicTextSizing = _this2$props.allowDynamicTextSizing;
|
|
148
|
-
var maxWidth = containerWidth;
|
|
149
|
-
var maxHeight = height / width * maxWidth;
|
|
150
|
-
var cardDimensions = {
|
|
151
|
-
width: "".concat(maxWidth, "px"),
|
|
152
|
-
height: "".concat(maxHeight, "px")
|
|
153
|
-
};
|
|
154
|
-
var isFullWidth = rendererAppearance === 'full-width';
|
|
155
|
-
var nonFullWidthSize = containerWidth;
|
|
156
|
-
|
|
157
|
-
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
158
|
-
var isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
159
|
-
|
|
160
|
-
if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
|
|
161
|
-
nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
|
|
162
|
-
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
163
|
-
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
164
|
-
} else {
|
|
165
|
-
nonFullWidthSize = containerWidth - padding;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
170
|
-
var originalDimensions = {
|
|
171
|
-
height: height,
|
|
172
|
-
width: width
|
|
173
|
-
};
|
|
174
|
-
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
175
|
-
resizeMode: 'stretchy-fit',
|
|
176
|
-
cardDimensions: cardDimensions,
|
|
177
|
-
originalDimensions: originalDimensions,
|
|
178
|
-
onExternalImageLoaded: _this2.onExternalImageLoaded,
|
|
179
|
-
disableOverlay: true,
|
|
180
|
-
featureFlags: featureFlags
|
|
181
|
-
});
|
|
182
|
-
return /*#__PURE__*/React.createElement(ExtendedUIMediaSingle, {
|
|
183
|
-
layout: props.layout,
|
|
184
|
-
width: width,
|
|
185
|
-
height: height,
|
|
186
|
-
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
187
|
-
containerWidth: containerWidth,
|
|
188
|
-
pctWidth: props.width,
|
|
189
|
-
fullWidthMode: isFullWidth
|
|
190
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, mediaComponent), _this2.isCaptionsFlaggedOn && caption);
|
|
191
|
-
});
|
|
192
148
|
}
|
|
193
|
-
}]);
|
|
194
149
|
|
|
195
|
-
|
|
196
|
-
|
|
150
|
+
var minWidth = Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding);
|
|
151
|
+
var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
152
|
+
return {
|
|
153
|
+
cardDimensions: cardDimensions,
|
|
154
|
+
lineLength: lineLength,
|
|
155
|
+
containerWidth: containerWidth
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var originalDimensions = {
|
|
160
|
+
height: height,
|
|
161
|
+
width: width
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var renderMediaSingle = function renderMediaSingle(renderWidth, mediaBreakpoint) {
|
|
165
|
+
var _calcDimensions = calcDimensions(renderWidth, mediaBreakpoint),
|
|
166
|
+
cardDimensions = _calcDimensions.cardDimensions,
|
|
167
|
+
lineLength = _calcDimensions.lineLength,
|
|
168
|
+
containerWidth = _calcDimensions.containerWidth;
|
|
169
|
+
|
|
170
|
+
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
171
|
+
resizeMode: 'stretchy-fit',
|
|
172
|
+
cardDimensions: cardDimensions,
|
|
173
|
+
originalDimensions: originalDimensions,
|
|
174
|
+
onExternalImageLoaded: onExternalImageLoaded,
|
|
175
|
+
disableOverlay: true,
|
|
176
|
+
featureFlags: featureFlags
|
|
177
|
+
});
|
|
178
|
+
return /*#__PURE__*/React.createElement(ExtendedUIMediaSingle, {
|
|
179
|
+
handleMediaSingleRef: ref,
|
|
180
|
+
layout: layout,
|
|
181
|
+
width: width,
|
|
182
|
+
height: height,
|
|
183
|
+
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
184
|
+
containerWidth: containerWidth,
|
|
185
|
+
pctWidth: pctWidth,
|
|
186
|
+
fullWidthMode: isFullWidth
|
|
187
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
|
|
191
|
+
var width = _ref3.width,
|
|
192
|
+
breakpoint = _ref3.breakpoint;
|
|
193
|
+
return renderMediaSingle(width, breakpoint);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
197
196
|
|
|
198
197
|
export default injectIntl(MediaSingle);
|