@atlaskit/renderer 149.0.5 → 149.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/react/nodes/extension.js +56 -27
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/extension.js +41 -18
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/extension.js +50 -23
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 149.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5f335f67f55d9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5f335f67f55d9) -
|
|
8
|
+
[ux] Separate existing extension comment viewing from creation in the renderer behind
|
|
9
|
+
`cc_maui_annotations_on_extensions`. Add an optional `canCreateCommentOnBlockNode` provider
|
|
10
|
+
predicate that controls whether a supported extension can be targeted for new comments, so
|
|
11
|
+
Confluence can keep existing chart threads accessible while `cc_maui_comments_on_charts_exp`
|
|
12
|
+
disables new-thread creation.
|
|
13
|
+
|
|
14
|
+
Avoid subscribing extension nodes to annotation contexts when `cc_maui_annotations_on_extensions`
|
|
15
|
+
is disabled, preventing annotation hover updates from rerendering unrelated extensions.
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 149.0.5
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -6,8 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.renderExtension = exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _react2 = require("@emotion/react");
|
|
13
14
|
var _enums = require("@atlaskit/editor-common/analytics/types/enums");
|
|
@@ -21,12 +22,15 @@ var _AnnotationRangeContext = require("../../ui/annotations/contexts/AnnotationR
|
|
|
21
22
|
var _ExtensionRenderer = _interopRequireDefault(require("../../ui/ExtensionRenderer"));
|
|
22
23
|
var _breakout = require("../utils/breakout");
|
|
23
24
|
var _extensionComments = require("./extension-comments");
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
25
|
+
var _excluded = ["commentProps", "commentTargetOptions"];
|
|
26
|
+
/**
|
|
27
27
|
* @jsxRuntime classic
|
|
28
28
|
* @jsx jsx
|
|
29
|
-
*/
|
|
29
|
+
*/
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
31
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
32
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
33
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
34
|
var FORGE_EXTENSION_TYPE = 'com.atlassian.ecosystem';
|
|
31
35
|
/**
|
|
32
36
|
* Mirrors `FORGE_INLINE_BODIED_PARAM` in `@atlassian/xen-editor-provider`. Duplicated rather than
|
|
@@ -194,20 +198,8 @@ var renderExtension = exports.renderExtension = function renderExtension(content
|
|
|
194
198
|
className: _consts.RendererCssClassName.STICKY_SAFE_CENTER_WRAPPER + ' ' + _consts.RendererCssClassName.FLEX_CENTER_WRAPPER
|
|
195
199
|
}, extensionDiv) : extensionDiv;
|
|
196
200
|
};
|
|
197
|
-
var
|
|
198
|
-
var _providers$inlineComm, _props$dataAttributes;
|
|
199
|
-
var text = props.text,
|
|
200
|
-
_props$layout = props.layout,
|
|
201
|
-
layout = _props$layout === void 0 ? 'default' : _props$layout,
|
|
202
|
-
handleRef = props.handleRef,
|
|
203
|
-
shadowClassNames = props.shadowClassNames,
|
|
204
|
-
_props$path = props.path,
|
|
205
|
-
path = _props$path === void 0 ? [] : _props$path,
|
|
206
|
-
extensionViewportSizes = props.extensionViewportSizes,
|
|
207
|
-
parameters = props.parameters,
|
|
208
|
-
nodeHeight = props.nodeHeight,
|
|
209
|
-
localId = props.localId,
|
|
210
|
-
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
201
|
+
var ExtensionWithAnnotations = function ExtensionWithAnnotations(props) {
|
|
202
|
+
var _providers$inlineComm, _providers$inlineComm2, _props$dataAttributes;
|
|
211
203
|
var providers = (0, _react.useContext)(_context.ProvidersContext);
|
|
212
204
|
var _useAnnotationRangeDi = (0, _AnnotationRangeContext.useAnnotationRangeDispatch)(),
|
|
213
205
|
setHoverTarget = _useAnnotationRangeDi.setHoverTarget;
|
|
@@ -216,9 +208,13 @@ var Extension = function Extension(props) {
|
|
|
216
208
|
initiateTimeout = _useAnnotationHoverDi.initiateTimeout,
|
|
217
209
|
setIsWithinRange = _useAnnotationHoverDi.setIsWithinRange;
|
|
218
210
|
var isBlockNodeSupported = providers === null || providers === void 0 || (_providers$inlineComm = providers.inlineComment) === null || _providers$inlineComm === void 0 ? void 0 : _providers$inlineComm.isBlockNodeSupported;
|
|
219
|
-
var
|
|
220
|
-
return Boolean(
|
|
211
|
+
var supportsComments = (0, _react.useMemo)(function () {
|
|
212
|
+
return Boolean(props.extensionNode && (isBlockNodeSupported === null || isBlockNodeSupported === void 0 ? void 0 : isBlockNodeSupported(props.extensionNode)) === true);
|
|
221
213
|
}, [props.extensionNode, isBlockNodeSupported]);
|
|
214
|
+
var canCreateCommentOnBlockNode = providers === null || providers === void 0 || (_providers$inlineComm2 = providers.inlineComment) === null || _providers$inlineComm2 === void 0 ? void 0 : _providers$inlineComm2.canCreateCommentOnBlockNode;
|
|
215
|
+
var isCommentTarget = (0, _react.useMemo)(function () {
|
|
216
|
+
return Boolean(supportsComments && props.extensionNode && (!canCreateCommentOnBlockNode || canCreateCommentOnBlockNode(props.extensionNode)));
|
|
217
|
+
}, [supportsComments, props.extensionNode, canCreateCommentOnBlockNode]);
|
|
222
218
|
var isFullPageRenderer = props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width';
|
|
223
219
|
var onMouseEnter = (0, _react.useCallback)(function (event) {
|
|
224
220
|
cancelTimeout();
|
|
@@ -253,21 +249,45 @@ var Extension = function Extension(props) {
|
|
|
253
249
|
isCommentTarget: isCommentTarget
|
|
254
250
|
};
|
|
255
251
|
var commentProps = {
|
|
256
|
-
enabled:
|
|
257
|
-
allowAnnotations: props.allowAnnotations
|
|
258
|
-
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode,
|
|
252
|
+
enabled: supportsComments,
|
|
253
|
+
allowAnnotations: props.allowAnnotations,
|
|
254
|
+
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode && isCommentTarget,
|
|
259
255
|
startPos: (_props$dataAttributes = props.dataAttributes) === null || _props$dataAttributes === void 0 ? void 0 : _props$dataAttributes['data-renderer-start-pos'],
|
|
260
256
|
marks: props.marks
|
|
261
257
|
};
|
|
258
|
+
return (0, _react2.jsx)(ExtensionContent
|
|
259
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
260
|
+
, (0, _extends2.default)({}, props, {
|
|
261
|
+
commentProps: commentProps,
|
|
262
|
+
commentTargetOptions: commentTargetOptions
|
|
263
|
+
}));
|
|
264
|
+
};
|
|
265
|
+
var ExtensionContent = function ExtensionContent(_ref3) {
|
|
266
|
+
var _ref3$commentProps = _ref3.commentProps,
|
|
267
|
+
commentProps = _ref3$commentProps === void 0 ? {} : _ref3$commentProps,
|
|
268
|
+
commentTargetOptions = _ref3.commentTargetOptions,
|
|
269
|
+
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
270
|
+
var text = props.text,
|
|
271
|
+
_props$layout = props.layout,
|
|
272
|
+
layout = _props$layout === void 0 ? 'default' : _props$layout,
|
|
273
|
+
handleRef = props.handleRef,
|
|
274
|
+
shadowClassNames = props.shadowClassNames,
|
|
275
|
+
_props$path = props.path,
|
|
276
|
+
path = _props$path === void 0 ? [] : _props$path,
|
|
277
|
+
extensionViewportSizes = props.extensionViewportSizes,
|
|
278
|
+
parameters = props.parameters,
|
|
279
|
+
nodeHeight = props.nodeHeight,
|
|
280
|
+
localId = props.localId,
|
|
281
|
+
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
262
282
|
return (0, _react2.jsx)(_ExtensionRenderer.default
|
|
263
283
|
// Ignored via go/ees005
|
|
264
284
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
265
285
|
, (0, _extends2.default)({}, props, {
|
|
266
286
|
type: "extension"
|
|
267
|
-
}), function (
|
|
287
|
+
}), function (_ref4) {
|
|
268
288
|
var _props$hideExtensionK;
|
|
269
|
-
var isExtensionProviderPending =
|
|
270
|
-
result =
|
|
289
|
+
var isExtensionProviderPending = _ref4.isExtensionProviderPending,
|
|
290
|
+
result = _ref4.result;
|
|
271
291
|
try {
|
|
272
292
|
// Return the result directly if it's a valid JSX.Element
|
|
273
293
|
if (result && /*#__PURE__*/_react.default.isValidElement(result)) {
|
|
@@ -312,6 +332,15 @@ var Extension = function Extension(props) {
|
|
|
312
332
|
}, commentTargetOptions), undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
313
333
|
});
|
|
314
334
|
};
|
|
335
|
+
var Extension = function Extension(props) {
|
|
336
|
+
// Keep annotation context subscriptions out of the gate-off render path.
|
|
337
|
+
if ((0, _fg.fg)('cc_maui_annotations_on_extensions')) {
|
|
338
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
339
|
+
return (0, _react2.jsx)(ExtensionWithAnnotations, props);
|
|
340
|
+
}
|
|
341
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
342
|
+
return (0, _react2.jsx)(ExtensionContent, props);
|
|
343
|
+
};
|
|
315
344
|
var _default_1 = (0, _OverflowShadow.default)(Extension, {
|
|
316
345
|
overflowSelector: ".".concat(_consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
317
346
|
});
|
|
@@ -79,7 +79,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
79
79
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
80
80
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
81
81
|
var packageName = "@atlaskit/renderer";
|
|
82
|
-
var packageVersion = "149.0.
|
|
82
|
+
var packageVersion = "149.0.5";
|
|
83
83
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
84
84
|
containerName: 'ak-renderer-wrapper',
|
|
85
85
|
containerType: 'inline-size'
|
|
@@ -176,20 +176,8 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
|
|
|
176
176
|
className: RendererCssClassName.STICKY_SAFE_CENTER_WRAPPER + ' ' + RendererCssClassName.FLEX_CENTER_WRAPPER
|
|
177
177
|
}, extensionDiv) : extensionDiv;
|
|
178
178
|
};
|
|
179
|
-
const
|
|
180
|
-
var _providers$inlineComm, _props$dataAttributes;
|
|
181
|
-
const {
|
|
182
|
-
text,
|
|
183
|
-
layout = 'default',
|
|
184
|
-
handleRef,
|
|
185
|
-
shadowClassNames,
|
|
186
|
-
path = [],
|
|
187
|
-
extensionViewportSizes,
|
|
188
|
-
parameters,
|
|
189
|
-
nodeHeight,
|
|
190
|
-
localId,
|
|
191
|
-
isInsideOfInlineExtension
|
|
192
|
-
} = props;
|
|
179
|
+
const ExtensionWithAnnotations = props => {
|
|
180
|
+
var _providers$inlineComm, _providers$inlineComm2, _props$dataAttributes;
|
|
193
181
|
const providers = useContext(ProvidersContext);
|
|
194
182
|
const {
|
|
195
183
|
setHoverTarget
|
|
@@ -200,7 +188,9 @@ const Extension = props => {
|
|
|
200
188
|
setIsWithinRange
|
|
201
189
|
} = useAnnotationHoverDispatch();
|
|
202
190
|
const isBlockNodeSupported = providers === null || providers === void 0 ? void 0 : (_providers$inlineComm = providers.inlineComment) === null || _providers$inlineComm === void 0 ? void 0 : _providers$inlineComm.isBlockNodeSupported;
|
|
203
|
-
const
|
|
191
|
+
const supportsComments = useMemo(() => Boolean(props.extensionNode && (isBlockNodeSupported === null || isBlockNodeSupported === void 0 ? void 0 : isBlockNodeSupported(props.extensionNode)) === true), [props.extensionNode, isBlockNodeSupported]);
|
|
192
|
+
const canCreateCommentOnBlockNode = providers === null || providers === void 0 ? void 0 : (_providers$inlineComm2 = providers.inlineComment) === null || _providers$inlineComm2 === void 0 ? void 0 : _providers$inlineComm2.canCreateCommentOnBlockNode;
|
|
193
|
+
const isCommentTarget = useMemo(() => Boolean(supportsComments && props.extensionNode && (!canCreateCommentOnBlockNode || canCreateCommentOnBlockNode(props.extensionNode))), [supportsComments, props.extensionNode, canCreateCommentOnBlockNode]);
|
|
204
194
|
const isFullPageRenderer = props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width';
|
|
205
195
|
const onMouseEnter = useCallback(event => {
|
|
206
196
|
cancelTimeout();
|
|
@@ -233,12 +223,36 @@ const Extension = props => {
|
|
|
233
223
|
isCommentTarget
|
|
234
224
|
};
|
|
235
225
|
const commentProps = {
|
|
236
|
-
enabled:
|
|
237
|
-
allowAnnotations: props.allowAnnotations
|
|
238
|
-
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode,
|
|
226
|
+
enabled: supportsComments,
|
|
227
|
+
allowAnnotations: props.allowAnnotations,
|
|
228
|
+
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode && isCommentTarget,
|
|
239
229
|
startPos: (_props$dataAttributes = props.dataAttributes) === null || _props$dataAttributes === void 0 ? void 0 : _props$dataAttributes['data-renderer-start-pos'],
|
|
240
230
|
marks: props.marks
|
|
241
231
|
};
|
|
232
|
+
return jsx(ExtensionContent
|
|
233
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
234
|
+
, _extends({}, props, {
|
|
235
|
+
commentProps: commentProps,
|
|
236
|
+
commentTargetOptions: commentTargetOptions
|
|
237
|
+
}));
|
|
238
|
+
};
|
|
239
|
+
const ExtensionContent = ({
|
|
240
|
+
commentProps = {},
|
|
241
|
+
commentTargetOptions,
|
|
242
|
+
...props
|
|
243
|
+
}) => {
|
|
244
|
+
const {
|
|
245
|
+
text,
|
|
246
|
+
layout = 'default',
|
|
247
|
+
handleRef,
|
|
248
|
+
shadowClassNames,
|
|
249
|
+
path = [],
|
|
250
|
+
extensionViewportSizes,
|
|
251
|
+
parameters,
|
|
252
|
+
nodeHeight,
|
|
253
|
+
localId,
|
|
254
|
+
isInsideOfInlineExtension
|
|
255
|
+
} = props;
|
|
242
256
|
return jsx(ExtensionRenderer
|
|
243
257
|
// Ignored via go/ees005
|
|
244
258
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
@@ -295,6 +309,15 @@ const Extension = props => {
|
|
|
295
309
|
}, undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
296
310
|
});
|
|
297
311
|
};
|
|
312
|
+
const Extension = props => {
|
|
313
|
+
// Keep annotation context subscriptions out of the gate-off render path.
|
|
314
|
+
if (fg('cc_maui_annotations_on_extensions')) {
|
|
315
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
316
|
+
return jsx(ExtensionWithAnnotations, props);
|
|
317
|
+
}
|
|
318
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
319
|
+
return jsx(ExtensionContent, props);
|
|
320
|
+
};
|
|
298
321
|
const _default_1 = overflowShadow(Extension, {
|
|
299
322
|
overflowSelector: `.${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER}`
|
|
300
323
|
});
|
|
@@ -64,7 +64,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
64
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
65
65
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
66
|
const packageName = "@atlaskit/renderer";
|
|
67
|
-
const packageVersion = "149.0.
|
|
67
|
+
const packageVersion = "149.0.5";
|
|
68
68
|
const setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
var _excluded = ["commentProps", "commentTargetOptions"];
|
|
3
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
7
|
/**
|
|
@@ -189,20 +191,8 @@ export var renderExtension = function renderExtension(content, layout) {
|
|
|
189
191
|
className: RendererCssClassName.STICKY_SAFE_CENTER_WRAPPER + ' ' + RendererCssClassName.FLEX_CENTER_WRAPPER
|
|
190
192
|
}, extensionDiv) : extensionDiv;
|
|
191
193
|
};
|
|
192
|
-
var
|
|
193
|
-
var _providers$inlineComm, _props$dataAttributes;
|
|
194
|
-
var text = props.text,
|
|
195
|
-
_props$layout = props.layout,
|
|
196
|
-
layout = _props$layout === void 0 ? 'default' : _props$layout,
|
|
197
|
-
handleRef = props.handleRef,
|
|
198
|
-
shadowClassNames = props.shadowClassNames,
|
|
199
|
-
_props$path = props.path,
|
|
200
|
-
path = _props$path === void 0 ? [] : _props$path,
|
|
201
|
-
extensionViewportSizes = props.extensionViewportSizes,
|
|
202
|
-
parameters = props.parameters,
|
|
203
|
-
nodeHeight = props.nodeHeight,
|
|
204
|
-
localId = props.localId,
|
|
205
|
-
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
194
|
+
var ExtensionWithAnnotations = function ExtensionWithAnnotations(props) {
|
|
195
|
+
var _providers$inlineComm, _providers$inlineComm2, _props$dataAttributes;
|
|
206
196
|
var providers = useContext(ProvidersContext);
|
|
207
197
|
var _useAnnotationRangeDi = useAnnotationRangeDispatch(),
|
|
208
198
|
setHoverTarget = _useAnnotationRangeDi.setHoverTarget;
|
|
@@ -211,9 +201,13 @@ var Extension = function Extension(props) {
|
|
|
211
201
|
initiateTimeout = _useAnnotationHoverDi.initiateTimeout,
|
|
212
202
|
setIsWithinRange = _useAnnotationHoverDi.setIsWithinRange;
|
|
213
203
|
var isBlockNodeSupported = providers === null || providers === void 0 || (_providers$inlineComm = providers.inlineComment) === null || _providers$inlineComm === void 0 ? void 0 : _providers$inlineComm.isBlockNodeSupported;
|
|
214
|
-
var
|
|
215
|
-
return Boolean(
|
|
204
|
+
var supportsComments = useMemo(function () {
|
|
205
|
+
return Boolean(props.extensionNode && (isBlockNodeSupported === null || isBlockNodeSupported === void 0 ? void 0 : isBlockNodeSupported(props.extensionNode)) === true);
|
|
216
206
|
}, [props.extensionNode, isBlockNodeSupported]);
|
|
207
|
+
var canCreateCommentOnBlockNode = providers === null || providers === void 0 || (_providers$inlineComm2 = providers.inlineComment) === null || _providers$inlineComm2 === void 0 ? void 0 : _providers$inlineComm2.canCreateCommentOnBlockNode;
|
|
208
|
+
var isCommentTarget = useMemo(function () {
|
|
209
|
+
return Boolean(supportsComments && props.extensionNode && (!canCreateCommentOnBlockNode || canCreateCommentOnBlockNode(props.extensionNode)));
|
|
210
|
+
}, [supportsComments, props.extensionNode, canCreateCommentOnBlockNode]);
|
|
217
211
|
var isFullPageRenderer = props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width';
|
|
218
212
|
var onMouseEnter = useCallback(function (event) {
|
|
219
213
|
cancelTimeout();
|
|
@@ -248,21 +242,45 @@ var Extension = function Extension(props) {
|
|
|
248
242
|
isCommentTarget: isCommentTarget
|
|
249
243
|
};
|
|
250
244
|
var commentProps = {
|
|
251
|
-
enabled:
|
|
252
|
-
allowAnnotations: props.allowAnnotations
|
|
253
|
-
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode,
|
|
245
|
+
enabled: supportsComments,
|
|
246
|
+
allowAnnotations: props.allowAnnotations,
|
|
247
|
+
allowAnnotationsDraftMode: props.allowAnnotationsDraftMode && isCommentTarget,
|
|
254
248
|
startPos: (_props$dataAttributes = props.dataAttributes) === null || _props$dataAttributes === void 0 ? void 0 : _props$dataAttributes['data-renderer-start-pos'],
|
|
255
249
|
marks: props.marks
|
|
256
250
|
};
|
|
251
|
+
return jsx(ExtensionContent
|
|
252
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
253
|
+
, _extends({}, props, {
|
|
254
|
+
commentProps: commentProps,
|
|
255
|
+
commentTargetOptions: commentTargetOptions
|
|
256
|
+
}));
|
|
257
|
+
};
|
|
258
|
+
var ExtensionContent = function ExtensionContent(_ref3) {
|
|
259
|
+
var _ref3$commentProps = _ref3.commentProps,
|
|
260
|
+
commentProps = _ref3$commentProps === void 0 ? {} : _ref3$commentProps,
|
|
261
|
+
commentTargetOptions = _ref3.commentTargetOptions,
|
|
262
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
263
|
+
var text = props.text,
|
|
264
|
+
_props$layout = props.layout,
|
|
265
|
+
layout = _props$layout === void 0 ? 'default' : _props$layout,
|
|
266
|
+
handleRef = props.handleRef,
|
|
267
|
+
shadowClassNames = props.shadowClassNames,
|
|
268
|
+
_props$path = props.path,
|
|
269
|
+
path = _props$path === void 0 ? [] : _props$path,
|
|
270
|
+
extensionViewportSizes = props.extensionViewportSizes,
|
|
271
|
+
parameters = props.parameters,
|
|
272
|
+
nodeHeight = props.nodeHeight,
|
|
273
|
+
localId = props.localId,
|
|
274
|
+
isInsideOfInlineExtension = props.isInsideOfInlineExtension;
|
|
257
275
|
return jsx(ExtensionRenderer
|
|
258
276
|
// Ignored via go/ees005
|
|
259
277
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
260
278
|
, _extends({}, props, {
|
|
261
279
|
type: "extension"
|
|
262
|
-
}), function (
|
|
280
|
+
}), function (_ref4) {
|
|
263
281
|
var _props$hideExtensionK;
|
|
264
|
-
var isExtensionProviderPending =
|
|
265
|
-
result =
|
|
282
|
+
var isExtensionProviderPending = _ref4.isExtensionProviderPending,
|
|
283
|
+
result = _ref4.result;
|
|
266
284
|
try {
|
|
267
285
|
// Return the result directly if it's a valid JSX.Element
|
|
268
286
|
if (result && /*#__PURE__*/React.isValidElement(result)) {
|
|
@@ -307,6 +325,15 @@ var Extension = function Extension(props) {
|
|
|
307
325
|
}, commentTargetOptions), undefined, parameters === null || parameters === void 0 ? void 0 : parameters.extensionId, extensionViewportSizes, nodeHeight, localId, undefined, undefined, isInsideOfInlineExtension);
|
|
308
326
|
});
|
|
309
327
|
};
|
|
328
|
+
var Extension = function Extension(props) {
|
|
329
|
+
// Keep annotation context subscriptions out of the gate-off render path.
|
|
330
|
+
if (fg('cc_maui_annotations_on_extensions')) {
|
|
331
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
332
|
+
return jsx(ExtensionWithAnnotations, props);
|
|
333
|
+
}
|
|
334
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
335
|
+
return jsx(ExtensionContent, props);
|
|
336
|
+
};
|
|
310
337
|
var _default_1 = overflowShadow(Extension, {
|
|
311
338
|
overflowSelector: ".".concat(RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER)
|
|
312
339
|
});
|
|
@@ -69,7 +69,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
69
69
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
70
70
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
71
71
|
var packageName = "@atlaskit/renderer";
|
|
72
|
-
var packageVersion = "149.0.
|
|
72
|
+
var packageVersion = "149.0.5";
|
|
73
73
|
var setAsQueryContainerStyles = css({
|
|
74
74
|
containerName: 'ak-renderer-wrapper',
|
|
75
75
|
containerType: 'inline-size'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "149.0.
|
|
3
|
+
"version": "149.0.6",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"uuid": "^11.1.1"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@atlaskit/editor-common": "^130.
|
|
91
|
+
"@atlaskit/editor-common": "^130.4.0",
|
|
92
92
|
"@atlaskit/link-provider": "^6.0.0",
|
|
93
93
|
"@atlaskit/media-core": "^39.0.0",
|
|
94
94
|
"react": "^18.2.0 || ^19.2.0",
|