@atlaskit/renderer 82.0.0 → 84.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -0
- package/dist/cjs/actions/matches-utils.js +1 -1
- package/dist/cjs/analytics/enums.js +1 -1
- package/dist/cjs/analytics/events.js +1 -1
- package/dist/cjs/i18n/index.js +26 -26
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/messages.js +4 -4
- package/dist/cjs/react/index.js +32 -12
- package/dist/cjs/react/marks/annotation.js +1 -1
- package/dist/cjs/react/marks/breakout.js +1 -1
- package/dist/cjs/react/marks/code.js +26 -4
- package/dist/cjs/react/marks/fragment.js +21 -0
- package/dist/cjs/react/marks/index.js +28 -19
- package/dist/cjs/react/nodes/codeBlock.js +17 -3
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +2 -2
- package/dist/cjs/react/nodes/copy-text-provider.js +1 -1
- package/dist/cjs/react/nodes/date.js +2 -2
- package/dist/cjs/react/nodes/doc.js +1 -1
- package/dist/cjs/react/nodes/extension.js +1 -1
- package/dist/cjs/react/nodes/heading-anchor.js +2 -2
- package/dist/cjs/react/nodes/heading.js +2 -4
- package/dist/cjs/react/nodes/index.js +31 -22
- package/dist/cjs/react/nodes/media.js +4 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -3
- package/dist/cjs/react/nodes/panel.js +4 -6
- package/dist/cjs/react/nodes/table/colgroup.js +1 -1
- package/dist/cjs/react/nodes/table/sticky.js +1 -1
- package/dist/cjs/react/nodes/tableCell.js +1 -1
- package/dist/cjs/react/nodes/text-wrapper.js +5 -6
- package/dist/cjs/react/renderer-node.js +1 -1
- package/dist/cjs/react/utils/links.js +1 -1
- package/dist/cjs/renderer-context.js +1 -1
- package/dist/cjs/steps/index.js +2 -2
- package/dist/cjs/text/nodes/index.js +1 -1
- package/dist/cjs/ui/Expand.js +2 -2
- package/dist/cjs/ui/MediaCard.js +12 -6
- package/dist/cjs/ui/Renderer/breakout-ssr.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +11 -11
- package/dist/cjs/ui/Renderer/style.js +2 -2
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -1
- package/dist/cjs/ui/SortingIcon.js +2 -2
- package/dist/cjs/ui/active-header-id-provider.js +1 -1
- package/dist/cjs/ui/annotations/context.js +1 -1
- package/dist/cjs/ui/annotations/draft/component.js +7 -7
- package/dist/cjs/ui/annotations/draft/index.js +4 -4
- package/dist/cjs/ui/annotations/draft/text.js +1 -1
- package/dist/cjs/ui/annotations/hooks/index.js +8 -8
- package/dist/cjs/ui/annotations/hooks/use-events.js +4 -2
- package/dist/cjs/ui/annotations/index.js +5 -5
- package/dist/cjs/utils.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/index.js +29 -8
- package/dist/es2019/react/marks/code.js +15 -3
- package/dist/es2019/react/marks/fragment.js +10 -0
- package/dist/es2019/react/marks/index.js +4 -2
- package/dist/es2019/react/nodes/codeBlock.js +13 -3
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/es2019/react/nodes/date.js +1 -1
- package/dist/es2019/react/nodes/heading-anchor.js +1 -1
- package/dist/es2019/react/nodes/heading.js +2 -3
- package/dist/es2019/react/nodes/media.js +4 -2
- package/dist/es2019/react/nodes/mediaSingle/index.js +1 -1
- package/dist/es2019/react/nodes/panel.js +5 -6
- package/dist/es2019/react/nodes/text-wrapper.js +7 -6
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/MediaCard.js +11 -5
- package/dist/es2019/ui/Renderer/index.js +10 -10
- package/dist/es2019/ui/Renderer/style.js +1 -1
- package/dist/es2019/ui/SortingIcon.js +1 -1
- package/dist/es2019/ui/annotations/draft/component.js +6 -6
- package/dist/es2019/ui/annotations/hooks/use-events.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/index.js +31 -12
- package/dist/esm/react/marks/code.js +15 -3
- package/dist/esm/react/marks/fragment.js +10 -0
- package/dist/esm/react/marks/index.js +4 -2
- package/dist/esm/react/nodes/codeBlock.js +13 -3
- package/dist/esm/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/esm/react/nodes/date.js +1 -1
- package/dist/esm/react/nodes/heading-anchor.js +1 -1
- package/dist/esm/react/nodes/heading.js +2 -3
- package/dist/esm/react/nodes/media.js +4 -2
- package/dist/esm/react/nodes/mediaSingle/index.js +1 -1
- package/dist/esm/react/nodes/panel.js +5 -6
- package/dist/esm/react/nodes/text-wrapper.js +7 -6
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/MediaCard.js +11 -5
- package/dist/esm/ui/Renderer/index.js +10 -10
- package/dist/esm/ui/Renderer/style.js +1 -1
- package/dist/esm/ui/SortingIcon.js +1 -1
- package/dist/esm/ui/annotations/draft/component.js +6 -6
- package/dist/esm/ui/annotations/hooks/use-events.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/marks/alignment.d.ts +1 -0
- package/dist/types/react/marks/annotation.d.ts +1 -0
- package/dist/types/react/marks/code.d.ts +15 -1
- package/dist/types/react/marks/data-consumer.d.ts +1 -0
- package/dist/types/react/marks/em.d.ts +1 -0
- package/dist/types/react/marks/fragment.d.ts +4 -0
- package/dist/types/react/marks/indentation.d.ts +1 -0
- package/dist/types/react/marks/index.d.ts +2 -1
- package/dist/types/react/marks/link.d.ts +1 -0
- package/dist/types/react/marks/strike.d.ts +1 -0
- package/dist/types/react/marks/strong.d.ts +1 -0
- package/dist/types/react/marks/subsup.d.ts +1 -0
- package/dist/types/react/marks/textColor.d.ts +1 -0
- package/dist/types/react/marks/underline.d.ts +1 -0
- package/dist/types/react/marks/unsupportedMark.d.ts +1 -0
- package/dist/types/react/marks/unsupportedNodeAttribute.d.ts +1 -0
- package/dist/types/react/nodes/blockCard.d.ts +1 -0
- package/dist/types/react/nodes/caption.d.ts +1 -0
- package/dist/types/react/nodes/codeBlock.d.ts +12 -3
- package/dist/types/react/nodes/codeBlockCopyButton.d.ts +3 -3
- package/dist/types/react/nodes/date.d.ts +3 -3
- package/dist/types/react/nodes/decisionItem.d.ts +1 -0
- package/dist/types/react/nodes/doc.d.ts +1 -0
- package/dist/types/react/nodes/embedCard.d.ts +1 -0
- package/dist/types/react/nodes/heading-anchor.d.ts +4 -4
- package/dist/types/react/nodes/heading.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +8 -8
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -3
- package/dist/types/react/nodes/paragraph.d.ts +1 -0
- package/dist/types/react/nodes/placeholder.d.ts +1 -0
- package/dist/types/react/nodes/rule.d.ts +1 -0
- package/dist/types/react/nodes/table/colgroup.d.ts +1 -0
- package/dist/types/react/nodes/text-wrapper.d.ts +3 -3
- package/dist/types/renderer-context.d.ts +3 -1
- package/dist/types/types/mediaOptions.d.ts +7 -1
- package/dist/types/ui/Expand.d.ts +3 -3
- package/dist/types/ui/MediaCard.d.ts +2 -0
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -0
- package/dist/types/ui/SortingIcon.d.ts +1 -0
- package/dist/types/ui/annotations/draft/component.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +1 -1
- package/package.json +23 -23
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.ProvidersContext = exports.InlineCommentsStateContext = exports.AnnotationsDraftContextWrapper = exports.AnnotationsDraftContext = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getAnnotationIndex = exports.applyAnnotationOnText = exports.TextWithAnnotationDraft = exports.AnnotationDraft = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -83,7 +83,7 @@ exports.applyAnnotationOnText = applyAnnotationOnText;
|
|
|
83
83
|
var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
84
84
|
var startPos = _ref3.startPos,
|
|
85
85
|
endPos = _ref3.endPos,
|
|
86
|
-
|
|
86
|
+
children = _ref3.children;
|
|
87
87
|
|
|
88
88
|
var textPosition = _react.default.useMemo(function () {
|
|
89
89
|
return {
|
|
@@ -103,21 +103,21 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
103
103
|
}, [nextDraftPosition, textPosition]);
|
|
104
104
|
|
|
105
105
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
106
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
if (shouldApplyAnnotationAt === _types.InsertDraftPosition.AROUND_TEXT) {
|
|
110
110
|
return /*#__PURE__*/_react.default.createElement(AnnotationDraft, {
|
|
111
111
|
key: 0,
|
|
112
112
|
draftPosition: nextDraftPosition
|
|
113
|
-
},
|
|
113
|
+
}, children);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
var offsets = (0, _text.calcTextSplitOffset)(nextDraftPosition, textPosition,
|
|
117
|
-
var texts = (0, _text.splitText)(
|
|
116
|
+
var offsets = (0, _text.calcTextSplitOffset)(nextDraftPosition, textPosition, children);
|
|
117
|
+
var texts = (0, _text.splitText)(children, offsets);
|
|
118
118
|
|
|
119
119
|
if (!texts) {
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
var components = applyAnnotationOnText({
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _component.TextWithAnnotationDraft;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "updateWindowSelectionAroundDraft", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _dom.updateWindowSelectionAroundDraft;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.splitText = exports.calcTextSplitOffset = void 0;
|
|
7
7
|
|
|
8
8
|
var splitText = function splitText(text, _ref) {
|
|
9
9
|
var startOffset = _ref.startOffset,
|
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useEvents.useHasFocusEvent;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "useAnnotationClickEvent", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function get() {
|
|
15
9
|
return _useEvents.useAnnotationClickEvent;
|
|
16
10
|
}
|
|
17
11
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function get() {
|
|
21
|
-
return
|
|
15
|
+
return _useEvents.useHasFocusEvent;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
18
|
Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
@@ -27,6 +21,12 @@ Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
|
27
21
|
return _useInlineCommentSubscriber.useInlineCommentSubscriberContext;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "useInlineCommentsFilter", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _useInlineCommentsFilter.useInlineCommentsFilter;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
var _useEvents = require("./use-events");
|
|
32
32
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.useHasFocusEvent = exports.useAnnotationStateByTypeEvent = exports.useAnnotationClickEvent = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -46,7 +46,9 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
|
|
|
46
46
|
|
|
47
47
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
48
48
|
if (curr.annotationType === type) {
|
|
49
|
-
|
|
49
|
+
// Check for empty state to prevent additional renders
|
|
50
|
+
var isEmpty = curr.state === null || curr.state === undefined;
|
|
51
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
return acc;
|
|
@@ -5,19 +5,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "AnnotationMark", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _element.MarkElement;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
exports.AnnotationsWrapper = void 0;
|
|
15
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
15
16
|
enumerable: true,
|
|
16
17
|
get: function get() {
|
|
17
|
-
return
|
|
18
|
+
return _draft.TextWithAnnotationDraft;
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
exports.AnnotationsWrapper = void 0;
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireDefault(require("react"));
|
|
23
23
|
|
package/dist/cjs/utils.js
CHANGED
|
@@ -5,9 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.ADFEncoder = void 0;
|
|
8
9
|
exports.findHorizontalOverflowScrollParent = findHorizontalOverflowScrollParent;
|
|
9
10
|
exports.findInTree = findInTree;
|
|
10
|
-
exports.
|
|
11
|
+
exports.getText = exports.getPlatform = exports.getEventHandler = void 0;
|
|
11
12
|
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
14
|
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/messages.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getMarksByOrder, isSameMark, calcTableColumnWidths } from '@atlaskit/ed
|
|
|
10
10
|
import { getText } from '../utils';
|
|
11
11
|
import { findChildrenByType } from 'prosemirror-utils';
|
|
12
12
|
import { insideBreakoutLayout } from './renderer-node';
|
|
13
|
+
import { isCodeMark } from './marks/code';
|
|
13
14
|
|
|
14
15
|
function mergeMarks(marksAndNodes) {
|
|
15
16
|
return marksAndNodes.reduce((acc, markOrNode) => {
|
|
@@ -128,13 +129,23 @@ export default class ReactSerializer {
|
|
|
128
129
|
} = mark.attrs;
|
|
129
130
|
const extraProps = {
|
|
130
131
|
isInline: node === null || node === void 0 ? void 0 : node.isInline
|
|
131
|
-
};
|
|
132
|
+
}; // currently the only mark which has custom props is the code mark
|
|
133
|
+
|
|
134
|
+
const markSpecificProps = isCodeMark(mark) ? {
|
|
135
|
+
// The appearance being mobile indicates we are in an renderer being
|
|
136
|
+
// rendered by mobile bridge in a web view.
|
|
137
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
138
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
139
|
+
// the rendering in the mobile Native Renderer.
|
|
140
|
+
codeBidiWarningTooltipEnabled: this.appearance !== 'mobile'
|
|
141
|
+
} : {};
|
|
132
142
|
const props = {
|
|
133
143
|
eventHandlers: this.eventHandlers,
|
|
134
144
|
fireAnalyticsEvent: this.fireAnalyticsEvent,
|
|
135
145
|
markKey: key,
|
|
136
146
|
...otherAttrs,
|
|
137
147
|
...extraProps,
|
|
148
|
+
...markSpecificProps,
|
|
138
149
|
dataAttributes: {
|
|
139
150
|
'data-renderer-mark': true
|
|
140
151
|
}
|
|
@@ -299,9 +310,8 @@ export default class ReactSerializer {
|
|
|
299
310
|
return /*#__PURE__*/React.createElement(TextWrapperComponent, {
|
|
300
311
|
key: textKey,
|
|
301
312
|
startPos: startPos + parentDepth,
|
|
302
|
-
endPos: endPos + parentDepth
|
|
303
|
-
|
|
304
|
-
});
|
|
313
|
+
endPos: endPos + parentDepth
|
|
314
|
+
}, mark.text);
|
|
305
315
|
}
|
|
306
316
|
|
|
307
317
|
return mark.text || '';
|
|
@@ -369,6 +379,8 @@ export default class ReactSerializer {
|
|
|
369
379
|
}
|
|
370
380
|
|
|
371
381
|
getMediaProps(node, path = []) {
|
|
382
|
+
var _this$media;
|
|
383
|
+
|
|
372
384
|
const {
|
|
373
385
|
marks: {
|
|
374
386
|
link
|
|
@@ -382,7 +394,8 @@ export default class ReactSerializer {
|
|
|
382
394
|
isLinkMark,
|
|
383
395
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
384
396
|
featureFlags: this.media && this.media.featureFlags,
|
|
385
|
-
shouldOpenMediaViewer: this.shouldOpenMediaViewer
|
|
397
|
+
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
398
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
386
399
|
};
|
|
387
400
|
}
|
|
388
401
|
|
|
@@ -403,13 +416,14 @@ export default class ReactSerializer {
|
|
|
403
416
|
}
|
|
404
417
|
|
|
405
418
|
getMediaGroupProps(node) {
|
|
406
|
-
var _this$
|
|
419
|
+
var _this$media2, _this$media3;
|
|
407
420
|
|
|
408
421
|
return { ...this.getProps(node),
|
|
409
422
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
410
423
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
411
424
|
featureFlags: this.media && this.media.featureFlags,
|
|
412
|
-
enableDownloadButton: (_this$
|
|
425
|
+
enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
|
|
426
|
+
ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
|
|
413
427
|
};
|
|
414
428
|
}
|
|
415
429
|
|
|
@@ -438,8 +452,15 @@ export default class ReactSerializer {
|
|
|
438
452
|
}
|
|
439
453
|
|
|
440
454
|
getCodeBlockProps(node) {
|
|
455
|
+
// The appearance being mobile indicates we are in an renderer being
|
|
456
|
+
// rendered by mobile bridge in a web view.
|
|
457
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
458
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
459
|
+
// the rendering in the mobile Native Renderer.
|
|
460
|
+
const codeBidiWarningTooltipEnabled = this.appearance !== 'mobile';
|
|
441
461
|
return { ...this.getProps(node),
|
|
442
|
-
text: node.textContent
|
|
462
|
+
text: node.textContent,
|
|
463
|
+
codeBidiWarningTooltipEnabled
|
|
443
464
|
};
|
|
444
465
|
}
|
|
445
466
|
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
4
|
import AkCode from '@atlaskit/code/inline';
|
|
4
|
-
|
|
5
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
7
|
+
export const isCodeMark = mark => {
|
|
8
|
+
return mark && mark.type && mark.type.name === 'code';
|
|
9
|
+
};
|
|
10
|
+
export function CodeWithIntl(props) {
|
|
11
|
+
const featureFlags = useFeatureFlags();
|
|
12
|
+
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
5
13
|
return /*#__PURE__*/React.createElement(AkCode, _extends({
|
|
6
|
-
className: "code"
|
|
14
|
+
className: "code",
|
|
15
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
16
|
+
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
17
|
+
codeBidiWarningTooltipEnabled: props.codeBidiWarningTooltipEnabled
|
|
7
18
|
}, props.dataAttributes), props.children);
|
|
8
|
-
}
|
|
19
|
+
}
|
|
20
|
+
export default injectIntl(CodeWithIntl);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function FragmentMark(props) {
|
|
4
|
+
const WrapperElement = props.isInline ? 'span' : 'div';
|
|
5
|
+
return /*#__PURE__*/React.createElement(WrapperElement, _extends({
|
|
6
|
+
"data-localId": props.localId,
|
|
7
|
+
"data-name": props.name,
|
|
8
|
+
"data-mark-type": "fragment"
|
|
9
|
+
}, props.dataAttributes), props.children);
|
|
10
|
+
}
|
|
@@ -12,6 +12,7 @@ import Indentation from './indentation';
|
|
|
12
12
|
import UnsupportedMark from './unsupportedMark';
|
|
13
13
|
import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
|
|
14
14
|
import DataConsumer from './data-consumer';
|
|
15
|
+
import FragmentMark from './fragment';
|
|
15
16
|
import Annotation, { isAnnotationMark } from './annotation'; // Stage0
|
|
16
17
|
|
|
17
18
|
import ConfluenceInlineComment from './confluence-inline-comment';
|
|
@@ -32,9 +33,10 @@ export const markToReact = {
|
|
|
32
33
|
indentation: Indentation,
|
|
33
34
|
unsupportedMark: UnsupportedMark,
|
|
34
35
|
unsupportedNodeAttribute: UnsupportedNodeAttribute,
|
|
35
|
-
dataConsumer: DataConsumer
|
|
36
|
+
dataConsumer: DataConsumer,
|
|
37
|
+
fragment: FragmentMark
|
|
36
38
|
};
|
|
37
39
|
export const toReact = mark => {
|
|
38
40
|
return markToReact[mark.type.name];
|
|
39
41
|
};
|
|
40
|
-
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer };
|
|
42
|
+
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark };
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
4
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
6
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
6
7
|
import { themed } from '@atlaskit/theme/components';
|
|
7
8
|
import { fontSize, gridSize } from '@atlaskit/theme/constants';
|
|
9
|
+
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
10
|
+
import { useFeatureFlags } from '../../use-feature-flags';
|
|
8
11
|
import CopyButton from './codeBlockCopyButton';
|
|
9
12
|
|
|
10
13
|
function CodeBlock(props) {
|
|
11
14
|
const {
|
|
12
15
|
text,
|
|
13
16
|
language,
|
|
14
|
-
allowCopyToClipboard = false
|
|
17
|
+
allowCopyToClipboard = false,
|
|
18
|
+
codeBidiWarningTooltipEnabled
|
|
15
19
|
} = props;
|
|
20
|
+
const featureFlags = useFeatureFlags();
|
|
21
|
+
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
16
22
|
const className = ['code-block', props.className].join(' ');
|
|
17
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
24
|
className: className
|
|
@@ -20,11 +26,15 @@ function CodeBlock(props) {
|
|
|
20
26
|
content: text
|
|
21
27
|
}) : null, /*#__PURE__*/React.createElement(AkCodeBlock, {
|
|
22
28
|
language: language,
|
|
23
|
-
text: text
|
|
29
|
+
text: text,
|
|
30
|
+
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
31
|
+
codeBidiWarningLabel: codeBidiWarningLabel,
|
|
32
|
+
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
24
33
|
}));
|
|
25
34
|
}
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
const IntlCodeBlock = injectIntl(CodeBlock);
|
|
37
|
+
export default styled(IntlCodeBlock)`
|
|
28
38
|
tab-size: 4;
|
|
29
39
|
[data-ds--code--code-block] {
|
|
30
40
|
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { isPastDate, timestampToString, timestampToTaskContext, DateSharedCssClassName } from '@atlaskit/editor-common';
|
|
4
|
-
import { injectIntl } from 'react-intl';
|
|
4
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
|
|
6
6
|
class Date extends PureComponent {
|
|
7
7
|
render() {
|
|
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
|
|
5
5
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
-
import { injectIntl } from 'react-intl';
|
|
8
|
+
import { injectIntl } from 'react-intl-next';
|
|
9
9
|
import { headingAnchorLinkMessages } from '../../messages';
|
|
10
10
|
export const HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
11
11
|
const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import HeadingAnchor from './heading-anchor';
|
|
4
|
-
import Url from 'url-parse';
|
|
5
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
|
|
6
5
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
7
6
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
8
7
|
|
|
9
8
|
const getCurrentUrlWithHash = (hash = '') => {
|
|
10
|
-
const url = new
|
|
11
|
-
url.
|
|
9
|
+
const url = new URL(window.location.href);
|
|
10
|
+
url.hash = encodeURIComponent(hash);
|
|
12
11
|
return url.href;
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -21,7 +21,8 @@ export default class Media extends PureComponent {
|
|
|
21
21
|
alt,
|
|
22
22
|
featureFlags,
|
|
23
23
|
shouldOpenMediaViewer: allowMediaViewer,
|
|
24
|
-
enableDownloadButton
|
|
24
|
+
enableDownloadButton,
|
|
25
|
+
ssr
|
|
25
26
|
} = this.props;
|
|
26
27
|
const linkMark = this.props.marks.find(this.props.isLinkMark);
|
|
27
28
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
@@ -35,7 +36,8 @@ export default class Media extends PureComponent {
|
|
|
35
36
|
eventHandlers: eventHandlers,
|
|
36
37
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
37
38
|
featureFlags: featureFlags,
|
|
38
|
-
shouldEnableDownloadButton: enableDownloadButton
|
|
39
|
+
shouldEnableDownloadButton: enableDownloadButton,
|
|
40
|
+
ssr: ssr
|
|
39
41
|
}));
|
|
40
42
|
return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
|
|
41
43
|
href: linkHref,
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
3
3
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { Component, default as React } from 'react';
|
|
5
|
-
import { injectIntl } from 'react-intl';
|
|
5
|
+
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
7
7
|
import { ExtendedUIMediaSingle } from './styles';
|
|
8
8
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
@@ -13,21 +13,20 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
|
|
|
13
13
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
14
14
|
|
|
15
15
|
import { themed } from '@atlaskit/theme';
|
|
16
|
+
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
|
|
16
17
|
const PanelStyled = styled.div`
|
|
17
18
|
${props => {
|
|
18
19
|
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
19
20
|
return '';
|
|
20
|
-
}
|
|
21
|
+
} // Similar to mainDynamicStyles()
|
|
21
22
|
|
|
22
|
-
const border = themed({
|
|
23
|
-
light: 'none',
|
|
24
|
-
dark: `1px solid rgba(255, 255, 255, 0.4)`
|
|
25
|
-
})(props); // Similar to mainDynamicStyles()
|
|
26
23
|
|
|
27
24
|
return `
|
|
28
25
|
&[data-panel-type=${PanelType.CUSTOM}] {
|
|
29
26
|
background-color: ${props.backgroundColor};
|
|
30
|
-
|
|
27
|
+
${themed({
|
|
28
|
+
dark: getPanelBackgroundDarkModeColors
|
|
29
|
+
})};
|
|
31
30
|
}
|
|
32
31
|
`;
|
|
33
32
|
}}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TextWithAnnotationDraft } from '../../ui/annotations';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
const TextWrapper = props => {
|
|
4
5
|
const {
|
|
5
6
|
startPos,
|
|
6
7
|
endPos
|
|
7
8
|
} = props;
|
|
8
9
|
const {
|
|
9
|
-
|
|
10
|
+
children
|
|
10
11
|
} = props;
|
|
11
12
|
|
|
12
|
-
if (!
|
|
13
|
+
if (!children) {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
return /*#__PURE__*/React.createElement(TextWithAnnotationDraft, {
|
|
17
|
-
text: text,
|
|
18
18
|
startPos: startPos,
|
|
19
19
|
endPos: endPos
|
|
20
|
-
});
|
|
21
|
-
}
|
|
20
|
+
}, children);
|
|
21
|
+
};
|
|
22
|
+
|
|
22
23
|
export default TextWrapper;
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -8,7 +8,7 @@ import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, E
|
|
|
8
8
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
11
|
-
import { injectIntl } from 'react-intl';
|
|
11
|
+
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
13
13
|
import _uniqueId from 'lodash/uniqueId';
|
|
14
14
|
const Title = styled.span`
|
|
@@ -174,7 +174,8 @@ export class MediaCardInternal extends Component {
|
|
|
174
174
|
imageStatus,
|
|
175
175
|
disableOverlay,
|
|
176
176
|
alt,
|
|
177
|
-
featureFlags
|
|
177
|
+
featureFlags,
|
|
178
|
+
ssr
|
|
178
179
|
} = this.props;
|
|
179
180
|
|
|
180
181
|
if (imageStatus === 'loading' || !url) {
|
|
@@ -200,7 +201,8 @@ export class MediaCardInternal extends Component {
|
|
|
200
201
|
mediaViewerDataSource: {
|
|
201
202
|
list: Array.from(mediaIdentifierMap.values())
|
|
202
203
|
},
|
|
203
|
-
featureFlags: featureFlags
|
|
204
|
+
featureFlags: featureFlags,
|
|
205
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
208
|
/**
|
|
@@ -214,7 +216,7 @@ export class MediaCardInternal extends Component {
|
|
|
214
216
|
render() {
|
|
215
217
|
const {
|
|
216
218
|
contextIdentifierProvider,
|
|
217
|
-
mediaClientConfig,
|
|
219
|
+
mediaClientConfig: mediaClientConfigInState,
|
|
218
220
|
fileState
|
|
219
221
|
} = this.state;
|
|
220
222
|
const {
|
|
@@ -231,7 +233,8 @@ export class MediaCardInternal extends Component {
|
|
|
231
233
|
originalDimensions,
|
|
232
234
|
shouldOpenMediaViewer: forceOpenMediaViewer,
|
|
233
235
|
featureFlags,
|
|
234
|
-
shouldEnableDownloadButton
|
|
236
|
+
shouldEnableDownloadButton,
|
|
237
|
+
ssr
|
|
235
238
|
} = this.props;
|
|
236
239
|
const isMobile = rendererAppearance === 'mobile';
|
|
237
240
|
const shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
@@ -247,6 +250,8 @@ export class MediaCardInternal extends Component {
|
|
|
247
250
|
return null;
|
|
248
251
|
}
|
|
249
252
|
|
|
253
|
+
const mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
254
|
+
|
|
250
255
|
if (!mediaClientConfig || !id) {
|
|
251
256
|
return this.renderLoadingCard();
|
|
252
257
|
}
|
|
@@ -288,7 +293,8 @@ export class MediaCardInternal extends Component {
|
|
|
288
293
|
list: Array.from(mediaIdentifierMap.values())
|
|
289
294
|
},
|
|
290
295
|
featureFlags: featureFlags,
|
|
291
|
-
shouldEnableDownloadButton: shouldEnableDownloadButton
|
|
296
|
+
shouldEnableDownloadButton: shouldEnableDownloadButton,
|
|
297
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
292
298
|
}));
|
|
293
299
|
}
|
|
294
300
|
|