@atlaskit/renderer 109.9.0 → 109.10.1
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 +17 -0
- package/actions/package.json +1 -1
- package/consts/package.json +1 -1
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -0
- package/dist/cjs/react/nodes/mediaSingle/index.js +4 -2
- package/dist/cjs/ui/MediaCard.js +16 -3
- package/dist/cjs/ui/Renderer/index.js +6 -6
- package/dist/cjs/ui/annotations/contexts/AnnotationRangeContext.js +136 -0
- package/dist/cjs/ui/annotations/element/mark.js +1 -1
- package/dist/cjs/ui/annotations/hooks/user-selection.js +10 -12
- package/dist/cjs/ui/annotations/hover/index.js +12 -0
- package/dist/cjs/ui/annotations/hover/mounter.js +134 -0
- package/dist/cjs/ui/annotations/hover/range-validator.js +43 -0
- package/dist/cjs/ui/annotations/index.js +7 -3
- package/dist/cjs/ui/annotations/selection/index.js +3 -3
- package/dist/cjs/ui/annotations/{selection/wrapper.js → wrapper.js} +15 -7
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -0
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -0
- package/dist/es2019/react/nodes/mediaSingle/index.js +4 -2
- package/dist/es2019/ui/MediaCard.js +17 -3
- package/dist/es2019/ui/Renderer/index.js +6 -6
- package/dist/es2019/ui/annotations/contexts/AnnotationRangeContext.js +112 -0
- package/dist/es2019/ui/annotations/element/mark.js +5 -1
- package/dist/es2019/ui/annotations/hooks/user-selection.js +13 -8
- package/dist/es2019/ui/annotations/hover/index.js +1 -0
- package/dist/es2019/ui/annotations/hover/mounter.js +121 -0
- package/dist/es2019/ui/annotations/hover/range-validator.js +38 -0
- package/dist/es2019/ui/annotations/index.js +7 -3
- package/dist/es2019/ui/annotations/selection/index.js +1 -1
- package/dist/es2019/ui/annotations/{selection/wrapper.js → wrapper.js} +14 -6
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +2 -0
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +2 -0
- package/dist/esm/react/nodes/mediaSingle/index.js +4 -2
- package/dist/esm/ui/MediaCard.js +16 -3
- package/dist/esm/ui/Renderer/index.js +6 -6
- package/dist/esm/ui/annotations/contexts/AnnotationRangeContext.js +126 -0
- package/dist/esm/ui/annotations/element/mark.js +2 -2
- package/dist/esm/ui/annotations/hooks/user-selection.js +11 -12
- package/dist/esm/ui/annotations/hover/index.js +1 -0
- package/dist/esm/ui/annotations/hover/mounter.js +124 -0
- package/dist/esm/ui/annotations/hover/range-validator.js +34 -0
- package/dist/esm/ui/annotations/index.js +7 -3
- package/dist/esm/ui/annotations/selection/index.js +1 -1
- package/dist/esm/ui/annotations/{selection/wrapper.js → wrapper.js} +14 -6
- package/dist/types/react/marks/code.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock/codeBlock.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +3 -3
- package/dist/types/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +3 -3
- package/dist/types/react/nodes/date.d.ts +2 -2
- package/dist/types/react/nodes/index.d.ts +4 -4
- package/dist/types/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -2
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/MediaCard.d.ts +1 -0
- package/dist/types/ui/SortingIcon.d.ts +2 -2
- package/dist/types/ui/annotations/contexts/AnnotationRangeContext.d.ts +22 -0
- package/dist/types/ui/annotations/hover/index.d.ts +1 -0
- package/dist/types/ui/annotations/hover/mounter.d.ts +20 -0
- package/dist/types/ui/annotations/hover/range-validator.d.ts +13 -0
- package/dist/types/ui/annotations/selection/index.d.ts +1 -1
- package/dist/{types-ts4.5/ui/annotations/selection → types/ui/annotations}/wrapper.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types-ts4.5/react/marks/code.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/codeBlock/codeBlock.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockCopyButton.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +3 -3
- package/dist/types-ts4.5/react/nodes/date.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/index.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/mediaInline.d.ts +2 -2
- package/dist/types-ts4.5/react/nodes/mediaSingle/index.d.ts +3 -2
- package/dist/types-ts4.5/ui/Expand.d.ts +2 -2
- package/dist/types-ts4.5/ui/MediaCard.d.ts +1 -0
- package/dist/types-ts4.5/ui/SortingIcon.d.ts +2 -2
- package/dist/types-ts4.5/ui/annotations/contexts/AnnotationRangeContext.d.ts +22 -0
- package/dist/types-ts4.5/ui/annotations/hover/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/annotations/hover/mounter.d.ts +20 -0
- package/dist/types-ts4.5/ui/annotations/hover/range-validator.d.ts +13 -0
- package/dist/types-ts4.5/ui/annotations/selection/index.d.ts +1 -1
- package/dist/{types/ui/annotations/selection → types-ts4.5/ui/annotations}/wrapper.d.ts +1 -1
- package/dist/types-ts4.5/utils.d.ts +1 -1
- package/messages/package.json +1 -1
- package/package.json +8 -7
- package/render-document/package.json +1 -1
- package/renderer-context/package.json +1 -1
- package/serializer/package.json +1 -1
- package/text-serializer/package.json +1 -1
- package/use-feature-flags/package.json +1 -1
- package/utils/package.json +1 -1
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -17,6 +17,7 @@ import { filter } from '@atlaskit/adf-utils/traverse';
|
|
|
17
17
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
18
18
|
import { MediaClientContext } from '@atlaskit/media-client-react';
|
|
19
19
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
20
|
+
import { useAnnotationRangeDispatch } from './annotations/contexts/AnnotationRangeContext';
|
|
20
21
|
export var mediaIdentifierMap = new Map();
|
|
21
22
|
export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
22
23
|
if (!doc) {
|
|
@@ -257,7 +258,8 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
257
258
|
featureFlags = _this$props5.featureFlags,
|
|
258
259
|
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
259
260
|
ssr = _this$props5.ssr,
|
|
260
|
-
mediaClient = _this$props5.mediaClient
|
|
261
|
+
mediaClient = _this$props5.mediaClient,
|
|
262
|
+
setHoverTarget = _this$props5.setHoverTarget;
|
|
261
263
|
var isMobile = rendererAppearance === 'mobile';
|
|
262
264
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
263
265
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -285,13 +287,21 @@ export var MediaCardView = /*#__PURE__*/function (_Component) {
|
|
|
285
287
|
collectionName: collection,
|
|
286
288
|
occurrenceKey: occurrenceKey
|
|
287
289
|
};
|
|
288
|
-
return /*#__PURE__*/React.createElement("div", getClipboardAttrs({
|
|
290
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, getClipboardAttrs({
|
|
289
291
|
id: id,
|
|
290
292
|
alt: alt,
|
|
291
293
|
collection: collection,
|
|
292
294
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
293
295
|
originalDimensions: originalDimensions,
|
|
294
296
|
fileState: fileState
|
|
297
|
+
}), {
|
|
298
|
+
onMouseEnter: function onMouseEnter(event) {
|
|
299
|
+
// We will not allow a hover target to be set if any mouse button is depressed during the mouse enter state.
|
|
300
|
+
// This could be due to the user trying to select text across the document.
|
|
301
|
+
if (event.buttons === 0) {
|
|
302
|
+
setHoverTarget && setHoverTarget(event.target);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
295
305
|
}), /*#__PURE__*/React.createElement(Card, {
|
|
296
306
|
identifier: identifier,
|
|
297
307
|
alt: alt,
|
|
@@ -350,8 +360,11 @@ export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
|
350
360
|
};
|
|
351
361
|
export var MediaCardInternal = function MediaCardInternal(props) {
|
|
352
362
|
var mediaClient = useContext(MediaClientContext);
|
|
363
|
+
var _useAnnotationRangeDi = useAnnotationRangeDispatch(),
|
|
364
|
+
setHoverTarget = _useAnnotationRangeDi.setHoverTarget;
|
|
353
365
|
return /*#__PURE__*/React.createElement(MediaCardView, _extends({}, props, {
|
|
354
|
-
mediaClient: mediaClient
|
|
366
|
+
mediaClient: mediaClient,
|
|
367
|
+
setHoverTarget: setHoverTarget
|
|
355
368
|
}));
|
|
356
369
|
};
|
|
357
370
|
export var MediaCard = withImageLoader(MediaCardInternal);
|
|
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
46
46
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
47
47
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
48
48
|
var packageName = "@atlaskit/renderer";
|
|
49
|
-
var packageVersion = "109.
|
|
49
|
+
var packageVersion = "109.10.1";
|
|
50
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
51
51
|
_inherits(Renderer, _PureComponent);
|
|
52
52
|
var _super = _createSuper(Renderer);
|
|
@@ -344,7 +344,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
346
|
try {
|
|
347
|
-
var _featureFlags$feature,
|
|
347
|
+
var _featureFlags$feature, _featureFlags$feature2;
|
|
348
348
|
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
349
349
|
var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
350
350
|
result = _renderDocument.result,
|
|
@@ -354,7 +354,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
354
354
|
onComplete(stat);
|
|
355
355
|
}
|
|
356
356
|
var rendererOutput = jsx(RendererContextProvider, {
|
|
357
|
-
value:
|
|
357
|
+
value: featureFlags
|
|
358
358
|
}, jsx(ActiveHeaderIdProvider, {
|
|
359
359
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
360
360
|
}, jsx(AnalyticsContext.Provider, {
|
|
@@ -389,7 +389,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
389
389
|
height: maxHeight,
|
|
390
390
|
fadeHeight: fadeOutHeight
|
|
391
391
|
}, rendererOutput) : rendererOutput;
|
|
392
|
-
var rendererRenderTracking =
|
|
392
|
+
var rendererRenderTracking = featureFlags === null || featureFlags === void 0 || (_featureFlags$feature2 = featureFlags.featureFlags) === null || _featureFlags$feature2 === void 0 || (_featureFlags$feature2 = _featureFlags$feature2.rendererRenderTracking) === null || _featureFlags$feature2 === void 0 ? void 0 : _featureFlags$feature2[ACTION_SUBJECT.RENDERER];
|
|
393
393
|
var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && jsx(RenderTracking, {
|
|
394
394
|
componentProps: this.props,
|
|
395
395
|
action: ACTION.RE_RENDERED,
|
|
@@ -399,7 +399,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
399
399
|
});
|
|
400
400
|
return jsx(Fragment, null, reRenderTracking, rendererResult);
|
|
401
401
|
} catch (e) {
|
|
402
|
-
var _featureFlags$
|
|
402
|
+
var _featureFlags$feature3;
|
|
403
403
|
if (onError) {
|
|
404
404
|
onError(e);
|
|
405
405
|
}
|
|
@@ -410,7 +410,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
410
410
|
allowPlaceholderText: allowPlaceholderText,
|
|
411
411
|
allowColumnSorting: allowColumnSorting,
|
|
412
412
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
413
|
-
useBlockRenderForCodeBlock: (_featureFlags$
|
|
413
|
+
useBlockRenderForCodeBlock: (_featureFlags$feature3 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature3 !== void 0 ? _featureFlags$feature3 : true,
|
|
414
414
|
addTelepointer: this.props.addTelepointer,
|
|
415
415
|
onClick: handleWrapperOnClick
|
|
416
416
|
}, jsx(UnsupportedBlock, null));
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react';
|
|
3
|
+
function reducer(state, action) {
|
|
4
|
+
switch (action.type) {
|
|
5
|
+
case 'clear':
|
|
6
|
+
if (!!state.range || !!state.type) {
|
|
7
|
+
return {
|
|
8
|
+
range: null,
|
|
9
|
+
type: null
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return state;
|
|
13
|
+
case 'clearSelection':
|
|
14
|
+
if (state.type === 'selection') {
|
|
15
|
+
return {
|
|
16
|
+
range: null,
|
|
17
|
+
type: null
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return state;
|
|
21
|
+
case 'clearHover':
|
|
22
|
+
if (state.type === 'hover') {
|
|
23
|
+
return {
|
|
24
|
+
range: null,
|
|
25
|
+
type: null
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return state;
|
|
29
|
+
case 'setSelection':
|
|
30
|
+
if (state.range !== action.range || state.type !== 'selection') {
|
|
31
|
+
return {
|
|
32
|
+
range: action.range,
|
|
33
|
+
type: 'selection'
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return state;
|
|
37
|
+
case 'setHover':
|
|
38
|
+
if (state.range !== action.range || state.type !== 'hover') {
|
|
39
|
+
return {
|
|
40
|
+
range: action.range,
|
|
41
|
+
type: 'hover'
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
return state;
|
|
47
|
+
}
|
|
48
|
+
export var AnnotationRangeStateContext = /*#__PURE__*/createContext({
|
|
49
|
+
range: null,
|
|
50
|
+
type: null
|
|
51
|
+
});
|
|
52
|
+
export var AnnotationRangeDispatchContext = /*#__PURE__*/createContext({
|
|
53
|
+
clearRange: function clearRange() {},
|
|
54
|
+
clearSelectionRange: function clearSelectionRange() {},
|
|
55
|
+
clearHoverRange: function clearHoverRange() {},
|
|
56
|
+
setRange: function setRange() {}
|
|
57
|
+
});
|
|
58
|
+
export var AnnotationRangeProvider = function AnnotationRangeProvider(_ref) {
|
|
59
|
+
var children = _ref.children,
|
|
60
|
+
allowCommentsOnMedia = _ref.allowCommentsOnMedia;
|
|
61
|
+
var _useReducer = useReducer(reducer, {
|
|
62
|
+
range: null,
|
|
63
|
+
type: null
|
|
64
|
+
}),
|
|
65
|
+
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
66
|
+
_useReducer2$ = _useReducer2[0],
|
|
67
|
+
range = _useReducer2$.range,
|
|
68
|
+
type = _useReducer2$.type,
|
|
69
|
+
dispatch = _useReducer2[1];
|
|
70
|
+
var clearRange = useCallback(function () {
|
|
71
|
+
return dispatch({
|
|
72
|
+
type: 'clear'
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
75
|
+
var clearSelectionRange = useCallback(function () {
|
|
76
|
+
return dispatch({
|
|
77
|
+
type: 'clearSelection'
|
|
78
|
+
});
|
|
79
|
+
}, []);
|
|
80
|
+
var clearHoverRange = useCallback(function () {
|
|
81
|
+
return dispatch({
|
|
82
|
+
type: 'clearHover'
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
85
|
+
var setRange = useCallback(function (range) {
|
|
86
|
+
return dispatch({
|
|
87
|
+
type: 'setSelection',
|
|
88
|
+
range: range
|
|
89
|
+
});
|
|
90
|
+
}, []);
|
|
91
|
+
var setHoverTarget = useCallback(function (target) {
|
|
92
|
+
var range = document.createRange();
|
|
93
|
+
range.setStartBefore(target);
|
|
94
|
+
range.setEndAfter(target);
|
|
95
|
+
dispatch({
|
|
96
|
+
type: 'setHover',
|
|
97
|
+
range: range
|
|
98
|
+
});
|
|
99
|
+
}, []);
|
|
100
|
+
var stateData = useMemo(function () {
|
|
101
|
+
return {
|
|
102
|
+
range: range,
|
|
103
|
+
type: type
|
|
104
|
+
};
|
|
105
|
+
}, [range, type]);
|
|
106
|
+
var dispatchData = useMemo(function () {
|
|
107
|
+
return {
|
|
108
|
+
clearRange: clearRange,
|
|
109
|
+
clearSelectionRange: clearSelectionRange,
|
|
110
|
+
clearHoverRange: clearHoverRange,
|
|
111
|
+
setRange: setRange,
|
|
112
|
+
setHoverTarget: !!allowCommentsOnMedia ? setHoverTarget : undefined
|
|
113
|
+
};
|
|
114
|
+
}, [allowCommentsOnMedia, clearRange, clearSelectionRange, clearHoverRange, setRange, setHoverTarget]);
|
|
115
|
+
return /*#__PURE__*/React.createElement(AnnotationRangeStateContext.Provider, {
|
|
116
|
+
value: stateData
|
|
117
|
+
}, /*#__PURE__*/React.createElement(AnnotationRangeDispatchContext.Provider, {
|
|
118
|
+
value: dispatchData
|
|
119
|
+
}, children));
|
|
120
|
+
};
|
|
121
|
+
export var useAnnotationRangeState = function useAnnotationRangeState() {
|
|
122
|
+
return useContext(AnnotationRangeStateContext);
|
|
123
|
+
};
|
|
124
|
+
export var useAnnotationRangeDispatch = function useAnnotationRangeDispatch() {
|
|
125
|
+
return useContext(AnnotationRangeDispatchContext);
|
|
126
|
+
};
|
|
@@ -9,13 +9,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
|
|
10
10
|
import React, { useMemo, useCallback } from 'react';
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
12
|
-
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
12
|
+
import { AnnotationSharedCSSByState, mediaAnnotationStyles } from '@atlaskit/editor-common/styles';
|
|
13
13
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
14
14
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
17
17
|
var markStyles = function markStyles() {
|
|
18
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus);
|
|
18
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n\n & div.rich-media-item {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus, mediaAnnotationStyles);
|
|
19
19
|
};
|
|
20
20
|
export var MarkComponent = function MarkComponent(_ref) {
|
|
21
21
|
var annotationParentIds = _ref.annotationParentIds,
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { useContext, useEffect } from 'react';
|
|
2
|
+
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
3
3
|
import { AnnotationsDraftContext } from '../context';
|
|
4
4
|
import { isRangeInsideOfRendererContainer } from './utils';
|
|
5
5
|
export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
6
6
|
var rendererDOM = props.rendererRef.current;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var _useAnnotationRangeDi = useAnnotationRangeDispatch(),
|
|
8
|
+
clearSelectionRange = _useAnnotationRangeDi.clearSelectionRange,
|
|
9
|
+
setRange = _useAnnotationRangeDi.setRange;
|
|
10
|
+
var _useAnnotationRangeSt = useAnnotationRangeState(),
|
|
11
|
+
range = _useAnnotationRangeSt.range,
|
|
12
|
+
type = _useAnnotationRangeSt.type;
|
|
11
13
|
var annotationDraftPosition = useContext(AnnotationsDraftContext);
|
|
12
14
|
var hasAnnotationDraft = !!annotationDraftPosition;
|
|
13
15
|
useEffect(function () {
|
|
@@ -27,11 +29,8 @@ export var useUserSelectionRange = function useUserSelectionRange(props) {
|
|
|
27
29
|
document.addEventListener('selectionchange', onSelectionChange);
|
|
28
30
|
return function () {
|
|
29
31
|
document.removeEventListener('selectionchange', onSelectionChange);
|
|
30
|
-
|
|
32
|
+
clearSelectionRange();
|
|
31
33
|
};
|
|
32
|
-
}, [rendererDOM, hasAnnotationDraft]);
|
|
33
|
-
|
|
34
|
-
setRange(null);
|
|
35
|
-
}, []);
|
|
36
|
-
return [range, clearRange];
|
|
34
|
+
}, [rendererDOM, hasAnnotationDraft, setRange, clearSelectionRange]);
|
|
35
|
+
return [type === 'selection' ? range : null, clearSelectionRange];
|
|
37
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RangeValidator as HoverRangeValidator } from './range-validator';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useCallback, useState, useContext } from 'react';
|
|
3
|
+
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
4
|
+
import { updateWindowSelectionAroundDraft } from '../draft';
|
|
5
|
+
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
6
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
8
|
+
export var Mounter = /*#__PURE__*/React.memo(function (props) {
|
|
9
|
+
var Component = props.component,
|
|
10
|
+
range = props.range,
|
|
11
|
+
isAnnotationAllowed = props.isAnnotationAllowed,
|
|
12
|
+
wrapperDOM = props.wrapperDOM,
|
|
13
|
+
onCloseProps = props.onClose,
|
|
14
|
+
clearAnnotationDraft = props.clearAnnotationDraft,
|
|
15
|
+
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
16
|
+
documentPosition = props.documentPosition,
|
|
17
|
+
applyAnnotation = props.applyAnnotation,
|
|
18
|
+
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
19
|
+
generateIndexMatch = props.generateIndexMatch;
|
|
20
|
+
var _useState = useState(),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
draftDocumentPosition = _useState2[0],
|
|
23
|
+
setDraftDocumentPosition = _useState2[1];
|
|
24
|
+
var actions = useContext(ActionsContext);
|
|
25
|
+
var onCreateCallback = useCallback(function (annotationId) {
|
|
26
|
+
if (!isAnnotationAllowed || !documentPosition || !applyAnnotation) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
var annotation = {
|
|
30
|
+
annotationId: annotationId,
|
|
31
|
+
annotationType: AnnotationTypes.INLINE_COMMENT
|
|
32
|
+
};
|
|
33
|
+
if (createAnalyticsEvent) {
|
|
34
|
+
createAnalyticsEvent({
|
|
35
|
+
action: ACTION.INSERTED,
|
|
36
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
37
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
38
|
+
attributes: {},
|
|
39
|
+
eventType: EVENT_TYPE.TRACK
|
|
40
|
+
}).fire(FabricChannel.editor);
|
|
41
|
+
}
|
|
42
|
+
return applyAnnotation(draftDocumentPosition || documentPosition, annotation);
|
|
43
|
+
}, [isAnnotationAllowed, documentPosition, applyAnnotation, draftDocumentPosition, createAnalyticsEvent]);
|
|
44
|
+
var createIndexCallback = useCallback(function () {
|
|
45
|
+
if (!documentPosition || !generateIndexMatch) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
var result = generateIndexMatch(documentPosition);
|
|
49
|
+
if (!result) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}, [documentPosition, generateIndexMatch]);
|
|
54
|
+
var applyDraftModeCallback = useCallback(function () {
|
|
55
|
+
var keepNativeSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
56
|
+
if (!documentPosition || !isAnnotationAllowed) {
|
|
57
|
+
if (createAnalyticsEvent) {
|
|
58
|
+
createAnalyticsEvent({
|
|
59
|
+
action: ACTION.CREATE_NOT_ALLOWED,
|
|
60
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
61
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
62
|
+
attributes: {},
|
|
63
|
+
eventType: EVENT_TYPE.TRACK
|
|
64
|
+
}).fire(FabricChannel.editor);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
setDraftDocumentPosition(documentPosition);
|
|
69
|
+
applyAnnotationDraftAt(documentPosition);
|
|
70
|
+
if (createAnalyticsEvent) {
|
|
71
|
+
var uniqueAnnotationsInRange = actions.getAnnotationsByPosition(range);
|
|
72
|
+
createAnalyticsEvent({
|
|
73
|
+
action: ACTION.OPENED,
|
|
74
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
75
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
76
|
+
eventType: EVENT_TYPE.TRACK,
|
|
77
|
+
attributes: {
|
|
78
|
+
overlap: uniqueAnnotationsInRange.length
|
|
79
|
+
}
|
|
80
|
+
}).fire(FabricChannel.editor);
|
|
81
|
+
}
|
|
82
|
+
window.requestAnimationFrame(function () {
|
|
83
|
+
if (keepNativeSelection) {
|
|
84
|
+
updateWindowSelectionAroundDraft(documentPosition);
|
|
85
|
+
} else {
|
|
86
|
+
var sel = window.getSelection();
|
|
87
|
+
if (sel) {
|
|
88
|
+
sel.removeAllRanges();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}, [documentPosition, isAnnotationAllowed, applyAnnotationDraftAt, createAnalyticsEvent, actions, range]);
|
|
93
|
+
var removeDraftModeCallback = useCallback(function () {
|
|
94
|
+
clearAnnotationDraft();
|
|
95
|
+
setDraftDocumentPosition(null);
|
|
96
|
+
var sel = window.getSelection();
|
|
97
|
+
if (sel) {
|
|
98
|
+
sel.removeAllRanges();
|
|
99
|
+
}
|
|
100
|
+
}, [clearAnnotationDraft]);
|
|
101
|
+
var onCloseCallback = useCallback(function () {
|
|
102
|
+
if (createAnalyticsEvent) {
|
|
103
|
+
createAnalyticsEvent({
|
|
104
|
+
action: ACTION.CLOSED,
|
|
105
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
106
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
107
|
+
eventType: EVENT_TYPE.TRACK,
|
|
108
|
+
attributes: {}
|
|
109
|
+
}).fire(FabricChannel.editor);
|
|
110
|
+
}
|
|
111
|
+
removeDraftModeCallback();
|
|
112
|
+
onCloseProps();
|
|
113
|
+
}, [onCloseProps, removeDraftModeCallback, createAnalyticsEvent]);
|
|
114
|
+
return /*#__PURE__*/React.createElement(Component, {
|
|
115
|
+
range: range,
|
|
116
|
+
wrapperDOM: wrapperDOM.current,
|
|
117
|
+
isAnnotationAllowed: isAnnotationAllowed,
|
|
118
|
+
onClose: onCloseCallback,
|
|
119
|
+
onCreate: onCreateCallback,
|
|
120
|
+
getAnnotationIndexMatch: createIndexCallback,
|
|
121
|
+
applyDraftMode: applyDraftModeCallback,
|
|
122
|
+
removeDraftMode: removeDraftModeCallback
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { Mounter } from './mounter';
|
|
3
|
+
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
4
|
+
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
5
|
+
export var RangeValidator = function RangeValidator(props) {
|
|
6
|
+
var component = props.component,
|
|
7
|
+
rendererRef = props.rendererRef,
|
|
8
|
+
applyAnnotationDraftAt = props.applyAnnotationDraftAt,
|
|
9
|
+
clearAnnotationDraft = props.clearAnnotationDraft,
|
|
10
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
11
|
+
var actions = useContext(ActionsContext);
|
|
12
|
+
var _useAnnotationRangeDi = useAnnotationRangeDispatch(),
|
|
13
|
+
clearHoverRange = _useAnnotationRangeDi.clearHoverRange;
|
|
14
|
+
var _useAnnotationRangeSt = useAnnotationRangeState(),
|
|
15
|
+
range = _useAnnotationRangeSt.range,
|
|
16
|
+
type = _useAnnotationRangeSt.type;
|
|
17
|
+
if (!range || type !== 'hover') {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
var documentPosition = actions.getPositionFromRange(range);
|
|
21
|
+
return /*#__PURE__*/React.createElement(Mounter, {
|
|
22
|
+
range: range,
|
|
23
|
+
wrapperDOM: rendererRef,
|
|
24
|
+
component: component,
|
|
25
|
+
onClose: clearHoverRange,
|
|
26
|
+
documentPosition: documentPosition,
|
|
27
|
+
isAnnotationAllowed: true,
|
|
28
|
+
applyAnnotation: actions.applyAnnotation.bind(actions),
|
|
29
|
+
applyAnnotationDraftAt: applyAnnotationDraftAt,
|
|
30
|
+
generateIndexMatch: actions.generateAnnotationIndexMatch.bind(actions),
|
|
31
|
+
clearAnnotationDraft: clearAnnotationDraft,
|
|
32
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
33
|
+
});
|
|
34
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
3
3
|
import { AnnotationView } from './view';
|
|
4
|
-
import {
|
|
4
|
+
import { AnnotationsContextWrapper } from './wrapper';
|
|
5
5
|
import { ProvidersContext, InlineCommentsStateContext } from './context';
|
|
6
6
|
import { useLoadAnnotations } from './hooks/use-load-annotations';
|
|
7
7
|
import { useAnnotationStateByTypeEvent } from './hooks/use-events';
|
|
8
8
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
9
|
+
import { AnnotationRangeProvider } from './contexts/AnnotationRangeContext';
|
|
9
10
|
var LoadAnnotations = /*#__PURE__*/React.memo(function (_ref) {
|
|
10
11
|
var adfDocument = _ref.adfDocument;
|
|
11
12
|
useLoadAnnotations({
|
|
@@ -14,6 +15,7 @@ var LoadAnnotations = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
14
15
|
return null;
|
|
15
16
|
});
|
|
16
17
|
export var AnnotationsWrapper = function AnnotationsWrapper(props) {
|
|
18
|
+
var _annotationProvider$i, _annotationProvider$i2;
|
|
17
19
|
var children = props.children,
|
|
18
20
|
annotationProvider = props.annotationProvider,
|
|
19
21
|
rendererRef = props.rendererRef,
|
|
@@ -29,14 +31,16 @@ export var AnnotationsWrapper = function AnnotationsWrapper(props) {
|
|
|
29
31
|
value: annotationProvider
|
|
30
32
|
}, /*#__PURE__*/React.createElement(InlineCommentsStateContext.Provider, {
|
|
31
33
|
value: inlineCommentAnnotationsState
|
|
32
|
-
}, /*#__PURE__*/React.createElement(
|
|
34
|
+
}, /*#__PURE__*/React.createElement(AnnotationRangeProvider, {
|
|
35
|
+
allowCommentsOnMedia: (_annotationProvider$i = annotationProvider === null || annotationProvider === void 0 || (_annotationProvider$i2 = annotationProvider.inlineComment) === null || _annotationProvider$i2 === void 0 ? void 0 : _annotationProvider$i2.allowCommentsOnMedia) !== null && _annotationProvider$i !== void 0 ? _annotationProvider$i : false
|
|
36
|
+
}, /*#__PURE__*/React.createElement(AnnotationsContextWrapper, {
|
|
33
37
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
34
38
|
rendererRef: rendererRef
|
|
35
39
|
}, /*#__PURE__*/React.createElement(LoadAnnotations, {
|
|
36
40
|
adfDocument: adfDocument
|
|
37
41
|
}), /*#__PURE__*/React.createElement(AnnotationView, {
|
|
38
42
|
createAnalyticsEvent: createAnalyticsEvent
|
|
39
|
-
}), children)));
|
|
43
|
+
}), children))));
|
|
40
44
|
};
|
|
41
45
|
export { TextWithAnnotationDraft } from './draft';
|
|
42
46
|
export { MarkElement as AnnotationMark } from './element';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { SelectionRangeValidator } from './range-validator';
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import React, { useCallback, useContext } from 'react';
|
|
2
|
-
import { AnnotationsDraftContextWrapper, ProvidersContext } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { AnnotationsDraftContextWrapper, ProvidersContext } from './context';
|
|
3
|
+
import { HoverRangeValidator } from './hover';
|
|
4
|
+
import { SelectionRangeValidator } from './selection';
|
|
5
|
+
export var AnnotationsContextWrapper = function AnnotationsContextWrapper(props) {
|
|
5
6
|
var providers = useContext(ProvidersContext);
|
|
6
7
|
var rendererRef = props.rendererRef,
|
|
7
8
|
createAnalyticsEvent = props.createAnalyticsEvent,
|
|
8
9
|
children = props.children;
|
|
9
10
|
var inlineCommentProvider = providers && providers.inlineComment;
|
|
10
11
|
var selectionComponent = inlineCommentProvider && inlineCommentProvider.selectionComponent;
|
|
12
|
+
var hoverComponent = inlineCommentProvider && inlineCommentProvider.hoverComponent;
|
|
11
13
|
var render = useCallback(function (_ref) {
|
|
12
14
|
var applyAnnotationDraftAt = _ref.applyAnnotationDraftAt,
|
|
13
15
|
clearAnnotationDraft = _ref.clearAnnotationDraft;
|
|
14
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, !!hoverComponent && /*#__PURE__*/React.createElement(HoverRangeValidator, {
|
|
17
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
18
|
+
rendererRef: rendererRef,
|
|
19
|
+
component: hoverComponent,
|
|
20
|
+
applyAnnotationDraftAt: applyAnnotationDraftAt,
|
|
21
|
+
clearAnnotationDraft: clearAnnotationDraft
|
|
22
|
+
}), !!selectionComponent && /*#__PURE__*/React.createElement(SelectionRangeValidator, {
|
|
15
23
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
16
24
|
rendererRef: rendererRef,
|
|
17
25
|
selectionComponent: selectionComponent,
|
|
18
26
|
applyAnnotationDraftAt: applyAnnotationDraftAt,
|
|
19
27
|
clearAnnotationDraft: clearAnnotationDraft
|
|
20
28
|
}));
|
|
21
|
-
}, [selectionComponent, children, rendererRef, createAnalyticsEvent]);
|
|
22
|
-
if (!selectionComponent) {
|
|
29
|
+
}, [hoverComponent, selectionComponent, children, rendererRef, createAnalyticsEvent]);
|
|
30
|
+
if (!selectionComponent && !hoverComponent) {
|
|
23
31
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
24
32
|
}
|
|
25
33
|
return /*#__PURE__*/React.createElement(AnnotationsDraftContextWrapper, null, render);
|
|
@@ -8,9 +8,9 @@ export declare function CodeWithIntl(props: MarkProps<{
|
|
|
8
8
|
}> & WrappedComponentProps): JSX.Element;
|
|
9
9
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
10
10
|
codeBidiWarningTooltipEnabled: boolean;
|
|
11
|
-
} & import("../types").MarkMeta & WrappedComponentProps
|
|
11
|
+
} & import("../types").MarkMeta & WrappedComponentProps>> & {
|
|
12
12
|
WrappedComponent: React.ComponentType<{
|
|
13
13
|
codeBidiWarningTooltipEnabled: boolean;
|
|
14
|
-
} & import("../types").MarkMeta & WrappedComponentProps
|
|
14
|
+
} & import("../types").MarkMeta & WrappedComponentProps>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
@@ -9,7 +9,7 @@ export interface Props {
|
|
|
9
9
|
codeBidiWarningTooltipEnabled: boolean;
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
13
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps
|
|
12
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
13
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
type Props = {
|
|
4
4
|
content: string;
|
|
5
5
|
};
|
|
6
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
7
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps
|
|
6
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
7
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
2
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
type Props = {
|
|
4
4
|
setWrapLongLines: Dispatch<SetStateAction<boolean>>;
|
|
5
5
|
wrapLongLines?: boolean;
|
|
6
6
|
};
|
|
7
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
8
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps
|
|
7
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
8
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -4,8 +4,8 @@ export interface Props {
|
|
|
4
4
|
timestamp: string;
|
|
5
5
|
parentIsIncompleteTask?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const DateComponent: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
8
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
7
|
+
export declare const DateComponent: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
8
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
9
9
|
};
|
|
10
10
|
declare function DateWithFormatContext(props: Props): JSX.Element;
|
|
11
11
|
export default DateWithFormatContext;
|
|
@@ -29,7 +29,7 @@ import TableRow from './tableRow';
|
|
|
29
29
|
import UnknownBlock from './unknownBlock';
|
|
30
30
|
import type { NodeComponentsProps } from '../../ui/Renderer/types';
|
|
31
31
|
declare const WindowedCodeBlock: React.ComponentType<import("./codeBlock/codeBlock").Props> & Loadable.LoadableComponent;
|
|
32
|
-
declare const CodeBlock: React.ComponentType<import("react-intl-next").WithIntlProps<import("./codeBlock/codeBlock").Props & import("react-intl-next").WrappedComponentProps
|
|
32
|
+
declare const CodeBlock: React.ComponentType<import("react-intl-next").WithIntlProps<import("./codeBlock/codeBlock").Props & import("react-intl-next").WrappedComponentProps>> & Loadable.LoadableComponent;
|
|
33
33
|
declare const TaskList: React.ComponentType<import("./taskList").Props> & Loadable.LoadableComponent;
|
|
34
34
|
declare const TaskItem: React.ComponentType<import("../types").NodeProps<import("./taskItem").Props>> & Loadable.LoadableComponent;
|
|
35
35
|
declare const DecisionList: React.ComponentType<import("./decisionList").Props> & Loadable.LoadableComponent;
|
|
@@ -66,10 +66,10 @@ declare const BlockCard: React.ComponentType<{
|
|
|
66
66
|
}> & Loadable.LoadableComponent;
|
|
67
67
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
68
68
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
|
69
|
-
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps
|
|
70
|
-
declare const MediaSingle: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaSingle").Props & import("react-intl-next").WrappedComponentProps
|
|
69
|
+
declare const MediaInline: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaInline").MediaInlineProps & import("react-intl-next").WrappedComponentProps & import("@atlaskit/editor-common/media-inline").MediaInlineAttrs>> & Loadable.LoadableComponent;
|
|
70
|
+
declare const MediaSingle: React.ComponentType<import("react-intl-next").WithIntlProps<import("./mediaSingle").Props & import("react-intl-next").WrappedComponentProps>> & Loadable.LoadableComponent;
|
|
71
71
|
declare const Mention: React.ComponentType<import("./mention").Props> & Loadable.LoadableComponent;
|
|
72
|
-
declare const Expand: React.ComponentType<import("react-intl-next").WithIntlProps<import("../../ui/Expand").ExpandProps & import("react-intl-next").WrappedComponentProps
|
|
72
|
+
declare const Expand: React.ComponentType<import("react-intl-next").WithIntlProps<import("../../ui/Expand").ExpandProps & import("react-intl-next").WrappedComponentProps>> & Loadable.LoadableComponent;
|
|
73
73
|
export declare const nodeToReact: {
|
|
74
74
|
[key: string]: React.ComponentType<React.PropsWithChildren<any>>;
|
|
75
75
|
};
|
|
@@ -32,7 +32,7 @@ export type MediaInlineProps = {
|
|
|
32
32
|
ssr?: MediaSSR;
|
|
33
33
|
};
|
|
34
34
|
export declare const RenderMediaInline: ({ rendererAppearance, clipboardAttrs, collection: collectionName, eventHandlers, identifier, }: RenderMediaInlineProps) => JSX.Element;
|
|
35
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps
|
|
36
|
-
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps
|
|
35
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps & MediaInlineAttrs>> & {
|
|
36
|
+
WrappedComponent: React.ComponentType<MediaInlineProps & WrappedComponentProps & MediaInlineAttrs>;
|
|
37
37
|
};
|
|
38
38
|
export default _default;
|