@atlaskit/renderer 109.6.3 → 109.7.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 +10 -0
- package/dist/cjs/react/index.js +2 -0
- package/dist/cjs/react/nodes/embedCard.js +20 -6
- package/dist/cjs/react/nodes/mediaSingle/index.js +20 -19
- package/dist/cjs/ui/ExtensionRenderer.js +27 -7
- package/dist/cjs/ui/Renderer/index.js +6 -3
- package/dist/es2019/react/index.js +2 -0
- package/dist/es2019/react/nodes/embedCard.js +19 -20
- package/dist/es2019/react/nodes/mediaSingle/index.js +19 -19
- package/dist/es2019/ui/ExtensionRenderer.js +25 -6
- package/dist/es2019/ui/Renderer/index.js +6 -3
- package/dist/esm/react/index.js +2 -0
- package/dist/esm/react/nodes/embedCard.js +19 -6
- package/dist/esm/react/nodes/mediaSingle/index.js +20 -19
- package/dist/esm/ui/ExtensionRenderer.js +24 -6
- package/dist/esm/ui/Renderer/index.js +6 -3
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/nodes/embedCard.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types/react/types.d.ts +7 -7
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/dist/types-ts4.5/react/index.d.ts +2 -0
- package/dist/types-ts4.5/react/nodes/embedCard.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/index.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types-ts4.5/react/types.d.ts +7 -7
- package/dist/types-ts4.5/ui/renderer-props.d.ts +1 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#63691](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63691) [`02293e70771b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/02293e70771b) - add allowWidthDetector option to be used to skip width detector in renderer, to make media single works in inline extension like excerpt include
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
3
13
|
## 109.6.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -181,6 +181,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
181
181
|
this.allowSelectAllTrap = init.allowSelectAllTrap;
|
|
182
182
|
this.nodeComponents = init.nodeComponents;
|
|
183
183
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
184
|
+
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
184
185
|
}
|
|
185
186
|
(0, _createClass2.default)(ReactSerializer, [{
|
|
186
187
|
key: "resetState",
|
|
@@ -520,6 +521,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
|
|
|
520
521
|
nodeType: node.type.name,
|
|
521
522
|
marks: node.marks,
|
|
522
523
|
smartLinks: this.smartLinks,
|
|
524
|
+
isInsideOfInlineExtension: this.isInsideOfInlineExtension,
|
|
523
525
|
dataAttributes: {
|
|
524
526
|
// We need to account for depth (path.length gives up depth) here
|
|
525
527
|
// but depth doesnt increment the pos, only accounted for.
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = EmbedCard;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
10
|
var _react = require("@emotion/react");
|
|
12
11
|
var _react2 = require("react");
|
|
13
12
|
var _smartCard = require("@atlaskit/smart-card");
|
|
@@ -20,10 +19,23 @@ var _fallback = require("./fallback");
|
|
|
20
19
|
var _style = require("../../ui/Renderer/style");
|
|
21
20
|
var _getCardClickHandler = require("../utils/getCardClickHandler");
|
|
22
21
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
23
|
-
var _templateObject, _templateObject2;
|
|
24
22
|
/** @jsx jsx */
|
|
25
|
-
|
|
26
|
-
var
|
|
23
|
+
|
|
24
|
+
var embedCardWrapperStyles = (0, _react.css)({
|
|
25
|
+
width: '100%',
|
|
26
|
+
height: '100%',
|
|
27
|
+
'> div': {
|
|
28
|
+
height: '100%'
|
|
29
|
+
},
|
|
30
|
+
'.loader-wrapper': {
|
|
31
|
+
height: '100%'
|
|
32
|
+
},
|
|
33
|
+
margin: '0 auto'
|
|
34
|
+
});
|
|
35
|
+
var uIMediaSingleLayoutStyles = (0, _react.css)({
|
|
36
|
+
marginLeft: '50%',
|
|
37
|
+
transform: 'translateX(-50%)'
|
|
38
|
+
});
|
|
27
39
|
function EmbedCard(props) {
|
|
28
40
|
var _smartLinks$frameStyl;
|
|
29
41
|
var url = props.url,
|
|
@@ -34,7 +46,8 @@ function EmbedCard(props) {
|
|
|
34
46
|
width = props.width,
|
|
35
47
|
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
36
48
|
rendererAppearance = props.rendererAppearance,
|
|
37
|
-
smartLinks = props.smartLinks
|
|
49
|
+
smartLinks = props.smartLinks,
|
|
50
|
+
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
38
51
|
var embedIframeRef = (0, _react2.useRef)(null);
|
|
39
52
|
var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
|
|
40
53
|
var _ref = smartLinks || {},
|
|
@@ -148,7 +161,8 @@ function EmbedCard(props) {
|
|
|
148
161
|
fullWidthMode: isFullWidth,
|
|
149
162
|
nodeType: "embedCard",
|
|
150
163
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
151
|
-
hasFallbackContainer: hasPreview
|
|
164
|
+
hasFallbackContainer: hasPreview,
|
|
165
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
152
166
|
}, (0, _react.jsx)("div", {
|
|
153
167
|
css: embedCardWrapperStyles
|
|
154
168
|
}, (0, _react.jsx)("div", {
|
|
@@ -45,19 +45,18 @@ var checkForMediaElement = function checkForMediaElement(children) {
|
|
|
45
45
|
// returns the existing container width if available (non SSR mode), otherwise
|
|
46
46
|
// we return a default width value
|
|
47
47
|
var getMediaContainerWidth = exports.getMediaContainerWidth = function getMediaContainerWidth(currentContainerWidth, layout) {
|
|
48
|
-
if (currentContainerWidth) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
default:
|
|
59
|
-
return _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
48
|
+
if (!currentContainerWidth) {
|
|
49
|
+
// SSR mode fallback to default layout width
|
|
50
|
+
switch (layout) {
|
|
51
|
+
case 'full-width':
|
|
52
|
+
return _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
53
|
+
case 'wide':
|
|
54
|
+
return _editorSharedStyles.akEditorWideLayoutWidth;
|
|
55
|
+
default:
|
|
56
|
+
return _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
57
|
+
}
|
|
60
58
|
}
|
|
59
|
+
return currentContainerWidth;
|
|
61
60
|
};
|
|
62
61
|
var MediaSingle = function MediaSingle(props) {
|
|
63
62
|
var rendererAppearance = props.rendererAppearance,
|
|
@@ -68,7 +67,9 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
68
67
|
widthAttr = props.width,
|
|
69
68
|
widthType = props.widthType,
|
|
70
69
|
_props$allowCaptions = props.allowCaptions,
|
|
71
|
-
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions
|
|
70
|
+
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions,
|
|
71
|
+
_props$isInsideOfInli = props.isInsideOfInlineExtension,
|
|
72
|
+
isInsideOfInlineExtension = _props$isInsideOfInli === void 0 ? false : _props$isInsideOfInli;
|
|
72
73
|
var _React$useState = _react.default.useState({
|
|
73
74
|
width: 0,
|
|
74
75
|
height: 0
|
|
@@ -145,8 +146,7 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
145
146
|
var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
146
147
|
return {
|
|
147
148
|
cardDimensions: cardDimensions,
|
|
148
|
-
lineLength: lineLength
|
|
149
|
-
containerWidth: containerWidth
|
|
149
|
+
lineLength: lineLength
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
var originalDimensions = {
|
|
@@ -154,10 +154,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
154
154
|
width: width
|
|
155
155
|
};
|
|
156
156
|
var renderMediaSingle = function renderMediaSingle(renderWidth) {
|
|
157
|
-
var
|
|
157
|
+
var containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
158
|
+
var _calcDimensions = calcDimensions(containerWidth),
|
|
158
159
|
cardDimensions = _calcDimensions.cardDimensions,
|
|
159
|
-
lineLength = _calcDimensions.lineLength
|
|
160
|
-
containerWidth = _calcDimensions.containerWidth;
|
|
160
|
+
lineLength = _calcDimensions.lineLength;
|
|
161
161
|
var mediaComponent = /*#__PURE__*/_react.default.cloneElement(media, {
|
|
162
162
|
resizeMode: 'stretchy-fit',
|
|
163
163
|
cardDimensions: cardDimensions,
|
|
@@ -179,7 +179,8 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
179
179
|
width: widthAttr,
|
|
180
180
|
widthType: widthType
|
|
181
181
|
},
|
|
182
|
-
fullWidthMode: isFullWidth
|
|
182
|
+
fullWidthMode: isFullWidth,
|
|
183
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
183
184
|
}, (0, _react2.jsx)(_react.Fragment, null, mediaComponent), allowCaptions && caption);
|
|
184
185
|
};
|
|
185
186
|
return (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref3) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -12,13 +13,22 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _react =
|
|
16
|
+
var _react = require("@emotion/react");
|
|
17
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
16
18
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
17
19
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
18
20
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
19
21
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
|
-
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; } }
|
|
26
|
+
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; } } /** @jsx jsx */
|
|
27
|
+
var inlineExtensionStyle = (0, _react.css)({
|
|
28
|
+
'& .rich-media-item': {
|
|
29
|
+
maxWidth: '100%'
|
|
30
|
+
}
|
|
31
|
+
});
|
|
22
32
|
var ExtensionRenderer = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
23
33
|
(0, _inherits2.default)(ExtensionRenderer, _React$Component);
|
|
24
34
|
var _super = _createSuper(ExtensionRenderer);
|
|
@@ -76,14 +86,14 @@ var ExtensionRenderer = exports.default = /*#__PURE__*/function (_React$Componen
|
|
|
76
86
|
if (!result && extensionProvider) {
|
|
77
87
|
var NodeRenderer = _this.getNodeRenderer(extensionProvider, extensionType, extensionKey);
|
|
78
88
|
if (node.type === 'multiBodiedExtension') {
|
|
79
|
-
result =
|
|
89
|
+
result = (0, _react.jsx)(NodeRenderer, {
|
|
80
90
|
node: node,
|
|
81
91
|
actions: actions
|
|
82
92
|
});
|
|
83
93
|
} else {
|
|
84
|
-
result =
|
|
94
|
+
result = (0, _react.jsx)(InlineNodeRendererWrapper, null, (0, _react.jsx)(NodeRenderer, {
|
|
85
95
|
node: node
|
|
86
|
-
});
|
|
96
|
+
}));
|
|
87
97
|
}
|
|
88
98
|
}
|
|
89
99
|
} catch (e) {
|
|
@@ -120,7 +130,7 @@ var ExtensionRenderer = exports.default = /*#__PURE__*/function (_React$Componen
|
|
|
120
130
|
if (!providers) {
|
|
121
131
|
return this.setupAndRenderExtensionNode({});
|
|
122
132
|
}
|
|
123
|
-
return
|
|
133
|
+
return (0, _react.jsx)(_providerFactory.WithProviders, {
|
|
124
134
|
providers: ['extensionProvider'],
|
|
125
135
|
providerFactory: providers,
|
|
126
136
|
renderNode: this.setupAndRenderExtensionNode
|
|
@@ -128,4 +138,14 @@ var ExtensionRenderer = exports.default = /*#__PURE__*/function (_React$Componen
|
|
|
128
138
|
}
|
|
129
139
|
}]);
|
|
130
140
|
return ExtensionRenderer;
|
|
131
|
-
}(
|
|
141
|
+
}(_react2.default.Component);
|
|
142
|
+
var InlineNodeRendererWrapper = function InlineNodeRendererWrapper(_ref) {
|
|
143
|
+
var children = _ref.children;
|
|
144
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn')) {
|
|
145
|
+
return (0, _react.jsx)("div", {
|
|
146
|
+
className: "inline-extension-renderer",
|
|
147
|
+
css: inlineExtensionStyle
|
|
148
|
+
}, children);
|
|
149
|
+
}
|
|
150
|
+
return (0, _react.jsx)(_react2.Fragment, null, children);
|
|
151
|
+
};
|
|
@@ -21,6 +21,7 @@ var _traverse = require("@atlaskit/adf-utils/traverse");
|
|
|
21
21
|
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
22
22
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
24
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
25
|
var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
|
|
25
26
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
26
27
|
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
@@ -54,7 +55,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
54
55
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
56
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
57
|
var packageName = "@atlaskit/renderer";
|
|
57
|
-
var packageVersion = "109.
|
|
58
|
+
var packageVersion = "109.7.0";
|
|
58
59
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
59
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
60
61
|
var _super = _createSuper(Renderer);
|
|
@@ -279,7 +280,8 @@ var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
279
280
|
allowPlaceholderText: props.allowPlaceholderText,
|
|
280
281
|
nodeComponents: props.nodeComponents,
|
|
281
282
|
// does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
|
|
282
|
-
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock
|
|
283
|
+
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
284
|
+
isInsideOfInlineExtension: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension
|
|
283
285
|
};
|
|
284
286
|
}
|
|
285
287
|
}, {
|
|
@@ -526,7 +528,8 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
526
528
|
}, [innerRef, addTelepointer]);
|
|
527
529
|
return (0, _react2.jsx)(_ui.WidthProvider, {
|
|
528
530
|
className: "ak-renderer-wrapper is-".concat(appearance),
|
|
529
|
-
"data-appearance": appearance
|
|
531
|
+
"data-appearance": appearance,
|
|
532
|
+
shouldCheckExistingValue: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.inline_extension.extended_lcqdn') || false
|
|
530
533
|
}, (0, _react2.jsx)(_ui.BaseTheme, {
|
|
531
534
|
baseFontSize: appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
|
|
532
535
|
}, (0, _react2.jsx)(_EditorMediaClientProvider.EditorMediaClientProvider, {
|
|
@@ -166,6 +166,7 @@ export default class ReactSerializer {
|
|
|
166
166
|
this.allowSelectAllTrap = init.allowSelectAllTrap;
|
|
167
167
|
this.nodeComponents = init.nodeComponents;
|
|
168
168
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
169
|
+
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
169
170
|
}
|
|
170
171
|
resetState() {
|
|
171
172
|
this.headingIds = [];
|
|
@@ -454,6 +455,7 @@ export default class ReactSerializer {
|
|
|
454
455
|
nodeType: node.type.name,
|
|
455
456
|
marks: node.marks,
|
|
456
457
|
smartLinks: this.smartLinks,
|
|
458
|
+
isInsideOfInlineExtension: this.isInsideOfInlineExtension,
|
|
457
459
|
dataAttributes: {
|
|
458
460
|
// We need to account for depth (path.length gives up depth) here
|
|
459
461
|
// but depth doesnt increment the pos, only accounted for.
|
|
@@ -12,24 +12,21 @@ import { CardErrorBoundary } from './fallback';
|
|
|
12
12
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
13
13
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
14
14
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
15
|
-
const embedCardWrapperStyles = css
|
|
16
|
-
width: 100
|
|
17
|
-
height: 100
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
margin-left: 50%;
|
|
31
|
-
transform: translateX(-50%);
|
|
32
|
-
`;
|
|
15
|
+
const embedCardWrapperStyles = css({
|
|
16
|
+
width: '100%',
|
|
17
|
+
height: '100%',
|
|
18
|
+
'> div': {
|
|
19
|
+
height: '100%'
|
|
20
|
+
},
|
|
21
|
+
'.loader-wrapper': {
|
|
22
|
+
height: '100%'
|
|
23
|
+
},
|
|
24
|
+
margin: '0 auto'
|
|
25
|
+
});
|
|
26
|
+
const uIMediaSingleLayoutStyles = css({
|
|
27
|
+
marginLeft: '50%',
|
|
28
|
+
transform: 'translateX(-50%)'
|
|
29
|
+
});
|
|
33
30
|
export default function EmbedCard(props) {
|
|
34
31
|
var _smartLinks$frameStyl;
|
|
35
32
|
const {
|
|
@@ -41,7 +38,8 @@ export default function EmbedCard(props) {
|
|
|
41
38
|
width,
|
|
42
39
|
isInsideOfBlockNode,
|
|
43
40
|
rendererAppearance,
|
|
44
|
-
smartLinks
|
|
41
|
+
smartLinks,
|
|
42
|
+
isInsideOfInlineExtension
|
|
45
43
|
} = props;
|
|
46
44
|
const embedIframeRef = useRef(null);
|
|
47
45
|
const onClick = getCardClickHandler(eventHandlers, url);
|
|
@@ -149,7 +147,8 @@ export default function EmbedCard(props) {
|
|
|
149
147
|
fullWidthMode: isFullWidth,
|
|
150
148
|
nodeType: "embedCard",
|
|
151
149
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
152
|
-
hasFallbackContainer: hasPreview
|
|
150
|
+
hasFallbackContainer: hasPreview,
|
|
151
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
153
152
|
}, jsx("div", {
|
|
154
153
|
css: embedCardWrapperStyles
|
|
155
154
|
}, jsx("div", {
|
|
@@ -33,19 +33,18 @@ const checkForMediaElement = children => {
|
|
|
33
33
|
// returns the existing container width if available (non SSR mode), otherwise
|
|
34
34
|
// we return a default width value
|
|
35
35
|
export const getMediaContainerWidth = (currentContainerWidth, layout) => {
|
|
36
|
-
if (currentContainerWidth) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default:
|
|
47
|
-
return akEditorDefaultLayoutWidth;
|
|
36
|
+
if (!currentContainerWidth) {
|
|
37
|
+
// SSR mode fallback to default layout width
|
|
38
|
+
switch (layout) {
|
|
39
|
+
case 'full-width':
|
|
40
|
+
return akEditorFullWidthLayoutWidth;
|
|
41
|
+
case 'wide':
|
|
42
|
+
return akEditorWideLayoutWidth;
|
|
43
|
+
default:
|
|
44
|
+
return akEditorDefaultLayoutWidth;
|
|
45
|
+
}
|
|
48
46
|
}
|
|
47
|
+
return currentContainerWidth;
|
|
49
48
|
};
|
|
50
49
|
const MediaSingle = props => {
|
|
51
50
|
const {
|
|
@@ -56,7 +55,8 @@ const MediaSingle = props => {
|
|
|
56
55
|
children,
|
|
57
56
|
width: widthAttr,
|
|
58
57
|
widthType,
|
|
59
|
-
allowCaptions = false
|
|
58
|
+
allowCaptions = false,
|
|
59
|
+
isInsideOfInlineExtension = false
|
|
60
60
|
} = props;
|
|
61
61
|
const [externalImageDimensions, setExternalImageDimensions] = React.useState({
|
|
62
62
|
width: 0,
|
|
@@ -130,8 +130,7 @@ const MediaSingle = props => {
|
|
|
130
130
|
const lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
131
131
|
return {
|
|
132
132
|
cardDimensions,
|
|
133
|
-
lineLength
|
|
134
|
-
containerWidth
|
|
133
|
+
lineLength
|
|
135
134
|
};
|
|
136
135
|
};
|
|
137
136
|
const originalDimensions = {
|
|
@@ -139,11 +138,11 @@ const MediaSingle = props => {
|
|
|
139
138
|
width
|
|
140
139
|
};
|
|
141
140
|
const renderMediaSingle = renderWidth => {
|
|
141
|
+
const containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
142
142
|
const {
|
|
143
143
|
cardDimensions,
|
|
144
|
-
lineLength
|
|
145
|
-
|
|
146
|
-
} = calcDimensions(renderWidth);
|
|
144
|
+
lineLength
|
|
145
|
+
} = calcDimensions(containerWidth);
|
|
147
146
|
const mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
148
147
|
resizeMode: 'stretchy-fit',
|
|
149
148
|
cardDimensions,
|
|
@@ -165,7 +164,8 @@ const MediaSingle = props => {
|
|
|
165
164
|
width: widthAttr,
|
|
166
165
|
widthType
|
|
167
166
|
},
|
|
168
|
-
fullWidthMode: isFullWidth
|
|
167
|
+
fullWidthMode: isFullWidth,
|
|
168
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
169
169
|
}, jsx(Fragment, null, mediaComponent), allowCaptions && caption);
|
|
170
170
|
};
|
|
171
171
|
return jsx(WidthConsumer, null, ({
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
4
|
+
import React, { Fragment } from 'react';
|
|
3
5
|
import memoizeOne from 'memoize-one';
|
|
4
6
|
import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
|
|
5
7
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
6
8
|
import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
|
|
9
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
const inlineExtensionStyle = css({
|
|
11
|
+
'& .rich-media-item': {
|
|
12
|
+
maxWidth: '100%'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
7
15
|
export default class ExtensionRenderer extends React.Component {
|
|
8
16
|
constructor(...args) {
|
|
9
17
|
super(...args);
|
|
@@ -55,14 +63,14 @@ export default class ExtensionRenderer extends React.Component {
|
|
|
55
63
|
if (!result && extensionProvider) {
|
|
56
64
|
const NodeRenderer = this.getNodeRenderer(extensionProvider, extensionType, extensionKey);
|
|
57
65
|
if (node.type === 'multiBodiedExtension') {
|
|
58
|
-
result =
|
|
66
|
+
result = jsx(NodeRenderer, {
|
|
59
67
|
node: node,
|
|
60
68
|
actions: actions
|
|
61
69
|
});
|
|
62
70
|
} else {
|
|
63
|
-
result =
|
|
71
|
+
result = jsx(InlineNodeRendererWrapper, null, jsx(NodeRenderer, {
|
|
64
72
|
node: node
|
|
65
|
-
});
|
|
73
|
+
}));
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
76
|
} catch (e) {
|
|
@@ -96,10 +104,21 @@ export default class ExtensionRenderer extends React.Component {
|
|
|
96
104
|
if (!providers) {
|
|
97
105
|
return this.setupAndRenderExtensionNode({});
|
|
98
106
|
}
|
|
99
|
-
return
|
|
107
|
+
return jsx(WithProviders, {
|
|
100
108
|
providers: ['extensionProvider'],
|
|
101
109
|
providerFactory: providers,
|
|
102
110
|
renderNode: this.setupAndRenderExtensionNode
|
|
103
111
|
});
|
|
104
112
|
}
|
|
105
|
-
}
|
|
113
|
+
}
|
|
114
|
+
const InlineNodeRendererWrapper = ({
|
|
115
|
+
children
|
|
116
|
+
}) => {
|
|
117
|
+
if (getBooleanFF('platform.editor.inline_extension.extended_lcqdn')) {
|
|
118
|
+
return jsx("div", {
|
|
119
|
+
className: "inline-extension-renderer",
|
|
120
|
+
css: inlineExtensionStyle
|
|
121
|
+
}, children);
|
|
122
|
+
}
|
|
123
|
+
return jsx(Fragment, null, children);
|
|
124
|
+
};
|
|
@@ -8,6 +8,7 @@ import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
|
8
8
|
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
9
9
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
10
10
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
12
13
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
13
14
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
@@ -35,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
35
36
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
37
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
38
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "109.
|
|
39
|
+
const packageVersion = "109.7.0";
|
|
39
40
|
export class Renderer extends PureComponent {
|
|
40
41
|
constructor(props) {
|
|
41
42
|
super(props);
|
|
@@ -258,7 +259,8 @@ export class Renderer extends PureComponent {
|
|
|
258
259
|
allowPlaceholderText: props.allowPlaceholderText,
|
|
259
260
|
nodeComponents: props.nodeComponents,
|
|
260
261
|
// does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
|
|
261
|
-
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock
|
|
262
|
+
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
263
|
+
isInsideOfInlineExtension: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension
|
|
262
264
|
};
|
|
263
265
|
}
|
|
264
266
|
render() {
|
|
@@ -498,7 +500,8 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
|
|
|
498
500
|
}, [innerRef, addTelepointer]);
|
|
499
501
|
return jsx(WidthProvider, {
|
|
500
502
|
className: `ak-renderer-wrapper is-${appearance}`,
|
|
501
|
-
"data-appearance": appearance
|
|
503
|
+
"data-appearance": appearance,
|
|
504
|
+
shouldCheckExistingValue: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') || false
|
|
502
505
|
}, jsx(BaseTheme, {
|
|
503
506
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
504
507
|
}, jsx(EditorMediaClientProvider, {
|
package/dist/esm/react/index.js
CHANGED
|
@@ -174,6 +174,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
174
174
|
this.allowSelectAllTrap = init.allowSelectAllTrap;
|
|
175
175
|
this.nodeComponents = init.nodeComponents;
|
|
176
176
|
this.allowWindowedCodeBlock = init.allowWindowedCodeBlock;
|
|
177
|
+
this.isInsideOfInlineExtension = init.isInsideOfInlineExtension;
|
|
177
178
|
}
|
|
178
179
|
_createClass(ReactSerializer, [{
|
|
179
180
|
key: "resetState",
|
|
@@ -513,6 +514,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
513
514
|
nodeType: node.type.name,
|
|
514
515
|
marks: node.marks,
|
|
515
516
|
smartLinks: this.smartLinks,
|
|
517
|
+
isInsideOfInlineExtension: this.isInsideOfInlineExtension,
|
|
516
518
|
dataAttributes: {
|
|
517
519
|
// We need to account for depth (path.length gives up depth) here
|
|
518
520
|
// but depth doesnt increment the pos, only accounted for.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
-
var _templateObject, _templateObject2;
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
7
5
|
import { useMemo, useContext, useState, useRef } from 'react';
|
|
@@ -15,8 +13,21 @@ import { CardErrorBoundary } from './fallback';
|
|
|
15
13
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
16
14
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
17
15
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
18
|
-
var embedCardWrapperStyles = css(
|
|
19
|
-
|
|
16
|
+
var embedCardWrapperStyles = css({
|
|
17
|
+
width: '100%',
|
|
18
|
+
height: '100%',
|
|
19
|
+
'> div': {
|
|
20
|
+
height: '100%'
|
|
21
|
+
},
|
|
22
|
+
'.loader-wrapper': {
|
|
23
|
+
height: '100%'
|
|
24
|
+
},
|
|
25
|
+
margin: '0 auto'
|
|
26
|
+
});
|
|
27
|
+
var uIMediaSingleLayoutStyles = css({
|
|
28
|
+
marginLeft: '50%',
|
|
29
|
+
transform: 'translateX(-50%)'
|
|
30
|
+
});
|
|
20
31
|
export default function EmbedCard(props) {
|
|
21
32
|
var _smartLinks$frameStyl;
|
|
22
33
|
var url = props.url,
|
|
@@ -27,7 +38,8 @@ export default function EmbedCard(props) {
|
|
|
27
38
|
width = props.width,
|
|
28
39
|
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
29
40
|
rendererAppearance = props.rendererAppearance,
|
|
30
|
-
smartLinks = props.smartLinks
|
|
41
|
+
smartLinks = props.smartLinks,
|
|
42
|
+
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
31
43
|
var embedIframeRef = useRef(null);
|
|
32
44
|
var onClick = getCardClickHandler(eventHandlers, url);
|
|
33
45
|
var _ref = smartLinks || {},
|
|
@@ -141,7 +153,8 @@ export default function EmbedCard(props) {
|
|
|
141
153
|
fullWidthMode: isFullWidth,
|
|
142
154
|
nodeType: "embedCard",
|
|
143
155
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
144
|
-
hasFallbackContainer: hasPreview
|
|
156
|
+
hasFallbackContainer: hasPreview,
|
|
157
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
145
158
|
}, jsx("div", {
|
|
146
159
|
css: embedCardWrapperStyles
|
|
147
160
|
}, jsx("div", {
|
|
@@ -35,19 +35,18 @@ var checkForMediaElement = function checkForMediaElement(children) {
|
|
|
35
35
|
// returns the existing container width if available (non SSR mode), otherwise
|
|
36
36
|
// we return a default width value
|
|
37
37
|
export var getMediaContainerWidth = function getMediaContainerWidth(currentContainerWidth, layout) {
|
|
38
|
-
if (currentContainerWidth) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
return akEditorDefaultLayoutWidth;
|
|
38
|
+
if (!currentContainerWidth) {
|
|
39
|
+
// SSR mode fallback to default layout width
|
|
40
|
+
switch (layout) {
|
|
41
|
+
case 'full-width':
|
|
42
|
+
return akEditorFullWidthLayoutWidth;
|
|
43
|
+
case 'wide':
|
|
44
|
+
return akEditorWideLayoutWidth;
|
|
45
|
+
default:
|
|
46
|
+
return akEditorDefaultLayoutWidth;
|
|
47
|
+
}
|
|
50
48
|
}
|
|
49
|
+
return currentContainerWidth;
|
|
51
50
|
};
|
|
52
51
|
var MediaSingle = function MediaSingle(props) {
|
|
53
52
|
var rendererAppearance = props.rendererAppearance,
|
|
@@ -58,7 +57,9 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
58
57
|
widthAttr = props.width,
|
|
59
58
|
widthType = props.widthType,
|
|
60
59
|
_props$allowCaptions = props.allowCaptions,
|
|
61
|
-
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions
|
|
60
|
+
allowCaptions = _props$allowCaptions === void 0 ? false : _props$allowCaptions,
|
|
61
|
+
_props$isInsideOfInli = props.isInsideOfInlineExtension,
|
|
62
|
+
isInsideOfInlineExtension = _props$isInsideOfInli === void 0 ? false : _props$isInsideOfInli;
|
|
62
63
|
var _React$useState = React.useState({
|
|
63
64
|
width: 0,
|
|
64
65
|
height: 0
|
|
@@ -135,8 +136,7 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
135
136
|
var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
136
137
|
return {
|
|
137
138
|
cardDimensions: cardDimensions,
|
|
138
|
-
lineLength: lineLength
|
|
139
|
-
containerWidth: containerWidth
|
|
139
|
+
lineLength: lineLength
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
var originalDimensions = {
|
|
@@ -144,10 +144,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
144
144
|
width: width
|
|
145
145
|
};
|
|
146
146
|
var renderMediaSingle = function renderMediaSingle(renderWidth) {
|
|
147
|
-
var
|
|
147
|
+
var containerWidth = getMediaContainerWidth(renderWidth, layout);
|
|
148
|
+
var _calcDimensions = calcDimensions(containerWidth),
|
|
148
149
|
cardDimensions = _calcDimensions.cardDimensions,
|
|
149
|
-
lineLength = _calcDimensions.lineLength
|
|
150
|
-
containerWidth = _calcDimensions.containerWidth;
|
|
150
|
+
lineLength = _calcDimensions.lineLength;
|
|
151
151
|
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
152
152
|
resizeMode: 'stretchy-fit',
|
|
153
153
|
cardDimensions: cardDimensions,
|
|
@@ -169,7 +169,8 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
169
169
|
width: widthAttr,
|
|
170
170
|
widthType: widthType
|
|
171
171
|
},
|
|
172
|
-
fullWidthMode: isFullWidth
|
|
172
|
+
fullWidthMode: isFullWidth,
|
|
173
|
+
isInsideOfInlineExtension: isInsideOfInlineExtension
|
|
173
174
|
}, jsx(Fragment, null, mediaComponent), allowCaptions && caption);
|
|
174
175
|
};
|
|
175
176
|
return jsx(WidthConsumer, null, function (_ref3) {
|
|
@@ -7,11 +7,19 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
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); }; }
|
|
9
9
|
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; } }
|
|
10
|
-
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
import { css, jsx } from '@emotion/react';
|
|
12
|
+
import React, { Fragment } from 'react';
|
|
11
13
|
import memoizeOne from 'memoize-one';
|
|
12
14
|
import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
|
|
13
15
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
14
16
|
import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
|
|
17
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
|
+
var inlineExtensionStyle = css({
|
|
19
|
+
'& .rich-media-item': {
|
|
20
|
+
maxWidth: '100%'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
15
23
|
var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
16
24
|
_inherits(ExtensionRenderer, _React$Component);
|
|
17
25
|
var _super = _createSuper(ExtensionRenderer);
|
|
@@ -69,14 +77,14 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
69
77
|
if (!result && extensionProvider) {
|
|
70
78
|
var NodeRenderer = _this.getNodeRenderer(extensionProvider, extensionType, extensionKey);
|
|
71
79
|
if (node.type === 'multiBodiedExtension') {
|
|
72
|
-
result =
|
|
80
|
+
result = jsx(NodeRenderer, {
|
|
73
81
|
node: node,
|
|
74
82
|
actions: actions
|
|
75
83
|
});
|
|
76
84
|
} else {
|
|
77
|
-
result =
|
|
85
|
+
result = jsx(InlineNodeRendererWrapper, null, jsx(NodeRenderer, {
|
|
78
86
|
node: node
|
|
79
|
-
});
|
|
87
|
+
}));
|
|
80
88
|
}
|
|
81
89
|
}
|
|
82
90
|
} catch (e) {
|
|
@@ -113,7 +121,7 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
113
121
|
if (!providers) {
|
|
114
122
|
return this.setupAndRenderExtensionNode({});
|
|
115
123
|
}
|
|
116
|
-
return
|
|
124
|
+
return jsx(WithProviders, {
|
|
117
125
|
providers: ['extensionProvider'],
|
|
118
126
|
providerFactory: providers,
|
|
119
127
|
renderNode: this.setupAndRenderExtensionNode
|
|
@@ -122,4 +130,14 @@ var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
|
122
130
|
}]);
|
|
123
131
|
return ExtensionRenderer;
|
|
124
132
|
}(React.Component);
|
|
125
|
-
export { ExtensionRenderer as default };
|
|
133
|
+
export { ExtensionRenderer as default };
|
|
134
|
+
var InlineNodeRendererWrapper = function InlineNodeRendererWrapper(_ref) {
|
|
135
|
+
var children = _ref.children;
|
|
136
|
+
if (getBooleanFF('platform.editor.inline_extension.extended_lcqdn')) {
|
|
137
|
+
return jsx("div", {
|
|
138
|
+
className: "inline-extension-renderer",
|
|
139
|
+
css: inlineExtensionStyle
|
|
140
|
+
}, children);
|
|
141
|
+
}
|
|
142
|
+
return jsx(Fragment, null, children);
|
|
143
|
+
};
|
|
@@ -18,6 +18,7 @@ import { reduce } from '@atlaskit/adf-utils/traverse';
|
|
|
18
18
|
import { ProviderFactory, ProviderFactoryProvider } from '@atlaskit/editor-common/provider-factory';
|
|
19
19
|
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
20
20
|
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI, getDistortedDurationMonitor, browser } from '@atlaskit/editor-common/utils';
|
|
21
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
21
22
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
22
23
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
23
24
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
@@ -45,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
45
46
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
47
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
48
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "109.
|
|
49
|
+
var packageVersion = "109.7.0";
|
|
49
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
51
|
_inherits(Renderer, _PureComponent);
|
|
51
52
|
var _super = _createSuper(Renderer);
|
|
@@ -270,7 +271,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
270
271
|
allowPlaceholderText: props.allowPlaceholderText,
|
|
271
272
|
nodeComponents: props.nodeComponents,
|
|
272
273
|
// does not currently support SSR, should not be enabled in environments where Renderer is SSR-ed
|
|
273
|
-
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock
|
|
274
|
+
allowWindowedCodeBlock: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.allowWindowedCodeBlock,
|
|
275
|
+
isInsideOfInlineExtension: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') && props.isInsideOfInlineExtension
|
|
274
276
|
};
|
|
275
277
|
}
|
|
276
278
|
}, {
|
|
@@ -517,7 +519,8 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
517
519
|
}, [innerRef, addTelepointer]);
|
|
518
520
|
return jsx(WidthProvider, {
|
|
519
521
|
className: "ak-renderer-wrapper is-".concat(appearance),
|
|
520
|
-
"data-appearance": appearance
|
|
522
|
+
"data-appearance": appearance,
|
|
523
|
+
shouldCheckExistingValue: getBooleanFF('platform.editor.inline_extension.extended_lcqdn') || false
|
|
521
524
|
}, jsx(BaseTheme, {
|
|
522
525
|
baseFontSize: appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
|
|
523
526
|
}, jsx(EditorMediaClientProvider, {
|
|
@@ -39,6 +39,7 @@ export interface ReactSerializerInit {
|
|
|
39
39
|
allowSelectAllTrap?: boolean;
|
|
40
40
|
nodeComponents?: NodeComponentsProps;
|
|
41
41
|
allowWindowedCodeBlock?: boolean;
|
|
42
|
+
isInsideOfInlineExtension?: boolean;
|
|
42
43
|
}
|
|
43
44
|
interface ParentInfo {
|
|
44
45
|
parentIsIncompleteTask: boolean;
|
|
@@ -84,6 +85,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
84
85
|
private allowSelectAllTrap?;
|
|
85
86
|
private nodeComponents?;
|
|
86
87
|
private allowWindowedCodeBlock?;
|
|
88
|
+
private isInsideOfInlineExtension?;
|
|
87
89
|
constructor(init: ReactSerializerInit);
|
|
88
90
|
private resetState;
|
|
89
91
|
private getNodeProps;
|
|
@@ -50,6 +50,7 @@ declare const EmbedCard: React.ComponentType<{
|
|
|
50
50
|
rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
|
|
51
51
|
isInsideOfBlockNode?: boolean | undefined;
|
|
52
52
|
smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
|
|
53
|
+
isInsideOfInlineExtension?: boolean | undefined;
|
|
53
54
|
}> & Loadable.LoadableComponent;
|
|
54
55
|
declare const InlineCard: React.ComponentType<import("@atlaskit/editor-common/utils").Diff<import("./inlineCard").InlineCardProps & import("../../ui/SmartCardStorage").WithSmartCardStorageProps, import("../../ui/SmartCardStorage").WithSmartCardStorageProps>> & Loadable.LoadableComponent;
|
|
55
56
|
declare const BlockCard: React.ComponentType<{
|
|
@@ -16,6 +16,7 @@ export interface Props {
|
|
|
16
16
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
17
17
|
featureFlags?: MediaFeatureFlags;
|
|
18
18
|
allowCaptions?: boolean;
|
|
19
|
+
isInsideOfInlineExtension?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const getMediaContainerWidth: (currentContainerWidth: number, layout: MediaSingleLayout) => number;
|
|
21
22
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
4
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { AnalyticsEventPayload } from '../analytics/events';
|
|
7
|
-
import { Serializer } from '../index';
|
|
8
|
-
import { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
|
|
9
|
-
import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
|
|
6
|
+
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
7
|
+
import type { Serializer } from '../index';
|
|
8
|
+
import type { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
|
|
9
|
+
import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
|
|
10
10
|
export interface RendererContext {
|
|
11
11
|
objectAri?: string;
|
|
12
12
|
containerAri?: string;
|
|
@@ -71,6 +71,7 @@ export interface RendererProps {
|
|
|
71
71
|
allowSelectAllTrap?: boolean;
|
|
72
72
|
unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
|
|
73
73
|
nodeComponents?: NodeComponentsProps;
|
|
74
|
+
isInsideOfInlineExtension?: boolean;
|
|
74
75
|
/**
|
|
75
76
|
* When enabled a trailing telepointer will be added to the rendered document
|
|
76
77
|
* following content updates.
|
|
@@ -39,6 +39,7 @@ export interface ReactSerializerInit {
|
|
|
39
39
|
allowSelectAllTrap?: boolean;
|
|
40
40
|
nodeComponents?: NodeComponentsProps;
|
|
41
41
|
allowWindowedCodeBlock?: boolean;
|
|
42
|
+
isInsideOfInlineExtension?: boolean;
|
|
42
43
|
}
|
|
43
44
|
interface ParentInfo {
|
|
44
45
|
parentIsIncompleteTask: boolean;
|
|
@@ -84,6 +85,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
84
85
|
private allowSelectAllTrap?;
|
|
85
86
|
private nodeComponents?;
|
|
86
87
|
private allowWindowedCodeBlock?;
|
|
88
|
+
private isInsideOfInlineExtension?;
|
|
87
89
|
constructor(init: ReactSerializerInit);
|
|
88
90
|
private resetState;
|
|
89
91
|
private getNodeProps;
|
|
@@ -50,6 +50,7 @@ declare const EmbedCard: React.ComponentType<{
|
|
|
50
50
|
rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
|
|
51
51
|
isInsideOfBlockNode?: boolean | undefined;
|
|
52
52
|
smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
|
|
53
|
+
isInsideOfInlineExtension?: boolean | undefined;
|
|
53
54
|
}> & Loadable.LoadableComponent;
|
|
54
55
|
declare const InlineCard: React.ComponentType<import("@atlaskit/editor-common/utils").Diff<import("./inlineCard").InlineCardProps & import("../../ui/SmartCardStorage").WithSmartCardStorageProps, import("../../ui/SmartCardStorage").WithSmartCardStorageProps>> & Loadable.LoadableComponent;
|
|
55
56
|
declare const BlockCard: React.ComponentType<{
|
|
@@ -16,6 +16,7 @@ export interface Props {
|
|
|
16
16
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
17
17
|
featureFlags?: MediaFeatureFlags;
|
|
18
18
|
allowCaptions?: boolean;
|
|
19
|
+
isInsideOfInlineExtension?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare const getMediaContainerWidth: (currentContainerWidth: number, layout: MediaSingleLayout) => number;
|
|
21
22
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { Node as PMNode, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
4
|
-
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { AnalyticsEventPayload } from '../analytics/events';
|
|
7
|
-
import { Serializer } from '../index';
|
|
8
|
-
import { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
|
|
9
|
-
import { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
|
|
6
|
+
import type { AnalyticsEventPayload } from '../analytics/events';
|
|
7
|
+
import type { Serializer } from '../index';
|
|
8
|
+
import type { RendererAppearance, HeadingAnchorLinksProps } from '../ui/Renderer/types';
|
|
9
|
+
import type { AnnotationId, AnnotationTypes } from '@atlaskit/adf-schema';
|
|
10
10
|
export interface RendererContext {
|
|
11
11
|
objectAri?: string;
|
|
12
12
|
containerAri?: string;
|
|
@@ -71,6 +71,7 @@ export interface RendererProps {
|
|
|
71
71
|
allowSelectAllTrap?: boolean;
|
|
72
72
|
unsupportedContentLevelsTracking?: UnsupportedContentLevelsTracking;
|
|
73
73
|
nodeComponents?: NodeComponentsProps;
|
|
74
|
+
isInsideOfInlineExtension?: boolean;
|
|
74
75
|
/**
|
|
75
76
|
* When enabled a trailing telepointer will be added to the rendered document
|
|
76
77
|
* following content updates.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.
|
|
3
|
+
"version": "109.7.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"website": {
|
|
22
22
|
"name": "Renderer"
|
|
23
23
|
},
|
|
24
|
-
"runReact18":
|
|
24
|
+
"runReact18": true
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-schema": "^35.5.2",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
32
32
|
"@atlaskit/button": "^17.6.0",
|
|
33
33
|
"@atlaskit/code": "^15.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^78.
|
|
34
|
+
"@atlaskit/editor-common": "^78.11.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.2",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
@@ -128,6 +128,9 @@
|
|
|
128
128
|
},
|
|
129
129
|
"platform.editor.show-embed-card-frame-renderer": {
|
|
130
130
|
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"platform.editor.inline_extension.extended_lcqdn": {
|
|
133
|
+
"type": "boolean"
|
|
131
134
|
}
|
|
132
135
|
},
|
|
133
136
|
"af:exports": {
|