@atlaskit/renderer 114.11.0 → 114.11.2
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 +20 -0
- package/dist/cjs/actions/index.js +165 -3
- package/dist/cjs/react/marks/alignment.js +3 -15
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -10
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -53
- package/dist/cjs/react/nodes/layoutColumn.js +3 -11
- package/dist/cjs/react/nodes/media/index.js +28 -58
- package/dist/cjs/react/nodes/panel.js +2 -26
- package/dist/cjs/react/nodes/table/sticky.js +3 -57
- package/dist/cjs/ui/Expand.js +12 -62
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +20 -43
- package/dist/cjs/ui/Renderer/index.js +14 -9
- package/dist/cjs/ui/Renderer/style.js +2 -208
- package/dist/cjs/ui/annotations/draft/component.js +2 -17
- package/dist/cjs/ui/annotations/element/mark.js +12 -61
- package/dist/cjs/ui/annotations/selection/mounter.js +16 -0
- package/dist/es2019/actions/index.js +163 -1
- package/dist/es2019/react/marks/alignment.js +2 -17
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -39
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +5 -50
- package/dist/es2019/react/nodes/layoutColumn.js +4 -12
- package/dist/es2019/react/nodes/media/index.js +3 -36
- package/dist/es2019/react/nodes/panel.js +2 -41
- package/dist/es2019/react/nodes/table/sticky.js +3 -70
- package/dist/es2019/ui/Expand.js +11 -67
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +21 -44
- package/dist/es2019/ui/Renderer/index.js +12 -9
- package/dist/es2019/ui/Renderer/style.js +1 -889
- package/dist/es2019/ui/annotations/draft/component.js +2 -15
- package/dist/es2019/ui/annotations/element/mark.js +9 -71
- package/dist/es2019/ui/annotations/selection/mounter.js +16 -0
- package/dist/esm/actions/index.js +165 -3
- package/dist/esm/react/marks/alignment.js +2 -16
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -11
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -52
- package/dist/esm/react/nodes/layoutColumn.js +4 -12
- package/dist/esm/react/nodes/media/index.js +28 -58
- package/dist/esm/react/nodes/panel.js +3 -27
- package/dist/esm/react/nodes/table/sticky.js +3 -57
- package/dist/esm/ui/Expand.js +12 -62
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +21 -44
- package/dist/esm/ui/Renderer/index.js +14 -9
- package/dist/esm/ui/Renderer/style.js +1 -203
- package/dist/esm/ui/annotations/draft/component.js +2 -17
- package/dist/esm/ui/annotations/element/mark.js +9 -56
- package/dist/esm/ui/annotations/selection/mounter.js +16 -0
- package/dist/types/actions/index.d.ts +1 -0
- package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
- package/dist/types/ui/Renderer/style.d.ts +0 -11
- package/dist/types/ui/annotations/element/mark.d.ts +30 -6
- package/dist/types-ts4.5/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
- package/dist/types-ts4.5/ui/Renderer/style.d.ts +0 -11
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +30 -6
- package/package.json +13 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 114.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#147828](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147828)
|
|
8
|
+
[`874be077a3f5f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/874be077a3f5f) -
|
|
9
|
+
Wrap RendererFunctionalComponent into memo
|
|
10
|
+
|
|
11
|
+
## 114.11.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#147372](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147372)
|
|
16
|
+
[`9a77b2e8909a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a77b2e8909a2) -
|
|
17
|
+
Adding anlytics to help identify root cause of why annotaiton are not applied on some ranges
|
|
18
|
+
- [#147400](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147400)
|
|
19
|
+
[`800ff50276ed7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/800ff50276ed7) -
|
|
20
|
+
Clean up experiment platform_editor_nested_non_bodied_macros
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 114.11.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -33,6 +33,54 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
33
33
|
// This module can only be used when wrapped with
|
|
34
34
|
// the <RendererContext> component for now.
|
|
35
35
|
(0, _defineProperty2.default)(this, "initFromContext", false);
|
|
36
|
+
// TODO: EDITOR-595 - This method is temporary and should be removed once the following issue
|
|
37
|
+
// has been identified and fixed: https://atlassian.slack.com/archives/C08JK0WSCH5/p1745902609966999
|
|
38
|
+
// This is a copy of the original canApplyAnnotationOnRange. If that returns false this is run to figure out exactly why
|
|
39
|
+
// the annotation cannot be applied to the range.
|
|
40
|
+
(0, _defineProperty2.default)(this, "_privateWhyCannotApplyAnnotationOnRange", function (pos, doc, schema) {
|
|
41
|
+
var from = pos.from,
|
|
42
|
+
to = pos.to;
|
|
43
|
+
if (isNaN(from + to) || to - from <= 0 || to < 0 || from < 0) {
|
|
44
|
+
return 'position invalid';
|
|
45
|
+
}
|
|
46
|
+
var reasons = [];
|
|
47
|
+
doc.nodesBetween(from, to, function (node, _pos, parent) {
|
|
48
|
+
// Special exception for hardBreak nodes
|
|
49
|
+
if (schema.nodes.hardBreak === node.type) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// For block elements or text nodes, we want to check
|
|
54
|
+
// if annotations are allowed inside this tree
|
|
55
|
+
// or if we're leaf and not text
|
|
56
|
+
if ((0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes')) {
|
|
57
|
+
var isAllowedInlineNode = ['emoji', 'status', 'date', 'mention', 'inlineCard'].includes(node.type.name);
|
|
58
|
+
if (node.isInline && !node.isText && !isAllowedInlineNode) {
|
|
59
|
+
reasons.push("Err 1 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf));
|
|
60
|
+
return false;
|
|
61
|
+
} else if (node.isLeaf && !node.isText && !isAllowedInlineNode) {
|
|
62
|
+
reasons.push("Err 2 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf));
|
|
63
|
+
return false;
|
|
64
|
+
} else if (node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
65
|
+
reasons.push("Err 3 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf, ", parent: ").concat(parent === null || parent === void 0 ? void 0 : parent.type.name));
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
if (node.isInline && !node.isText) {
|
|
70
|
+
reasons.push("Err 4 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf));
|
|
71
|
+
return false;
|
|
72
|
+
} else if (node.isLeaf && !node.isText) {
|
|
73
|
+
reasons.push("Err 5 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf));
|
|
74
|
+
return false;
|
|
75
|
+
} else if (node.isText && !(parent !== null && parent !== void 0 && parent.type.allowsMarkType(schema.marks.annotation))) {
|
|
76
|
+
reasons.push("Err 6 - type: ".concat(node.type.name, ", isInline: ").concat(node.isInline, ", isText: ").concat(node.isText, ", isLeaf: ").concat(node.isLeaf, ", parent: ").concat(parent === null || parent === void 0 ? void 0 : parent.type.name));
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
});
|
|
82
|
+
return reasons.join(', ');
|
|
83
|
+
});
|
|
36
84
|
this.initFromContext = initFromContext;
|
|
37
85
|
this.transformer = new _editorJsonTransformer.JSONTransformer();
|
|
38
86
|
}
|
|
@@ -67,21 +115,82 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
67
115
|
key: "_privateValidatePositionsForAnnotation",
|
|
68
116
|
value: function _privateValidatePositionsForAnnotation(from, to) {
|
|
69
117
|
if (!this.doc || !this.schema) {
|
|
118
|
+
if (this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
119
|
+
this.onAnalyticsEvent({
|
|
120
|
+
// @ts-ignore
|
|
121
|
+
action: 'failed',
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
actionSubject: 'applyAnnotation',
|
|
124
|
+
// @ts-ignore
|
|
125
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
126
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
127
|
+
attributes: {
|
|
128
|
+
// @ts-ignore
|
|
129
|
+
reason: "Annotation Position validation failed - Missing doc or schema",
|
|
130
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes'),
|
|
131
|
+
isDocValid: !!this.doc,
|
|
132
|
+
isSchemaValid: !!this.schema
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
70
136
|
return false;
|
|
71
137
|
}
|
|
72
138
|
var currentSelection = _state.TextSelection.create(this.doc, from, to);
|
|
73
139
|
if ((0, _utils.isEmptyTextSelection)(currentSelection, this.schema)) {
|
|
140
|
+
if (this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
141
|
+
this.onAnalyticsEvent({
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
action: 'failed',
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
actionSubject: 'applyAnnotation',
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
148
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
149
|
+
attributes: {
|
|
150
|
+
// @ts-ignore
|
|
151
|
+
reason: "Annotation Position validation - Empty Text Selection",
|
|
152
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes'),
|
|
153
|
+
from: from,
|
|
154
|
+
to: to
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
74
158
|
return false;
|
|
75
159
|
}
|
|
76
|
-
|
|
160
|
+
var result = (0, _utils.canApplyAnnotationOnRange)({
|
|
77
161
|
from: from,
|
|
78
162
|
to: to
|
|
79
163
|
}, this.doc, this.schema);
|
|
164
|
+
if (!result && this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
165
|
+
this.onAnalyticsEvent({
|
|
166
|
+
// @ts-ignore
|
|
167
|
+
action: 'failed',
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
actionSubject: 'applyAnnotation',
|
|
170
|
+
// @ts-ignore
|
|
171
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
172
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
173
|
+
attributes: {
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
reason: "Annotation canApplyAnnotationOnRange failed",
|
|
176
|
+
details: this._privateWhyCannotApplyAnnotationOnRange({
|
|
177
|
+
from: from,
|
|
178
|
+
to: to
|
|
179
|
+
}, this.doc, this.schema),
|
|
180
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes'),
|
|
181
|
+
from: from,
|
|
182
|
+
to: to
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
80
187
|
}
|
|
81
|
-
//#endregion
|
|
82
188
|
}, {
|
|
83
189
|
key: "deleteAnnotation",
|
|
84
|
-
value:
|
|
190
|
+
value:
|
|
191
|
+
//#endregion
|
|
192
|
+
|
|
193
|
+
function deleteAnnotation(annotationId, annotationType) {
|
|
85
194
|
if (!this.doc || !this.schema || !this.schema.marks.annotation) {
|
|
86
195
|
return false;
|
|
87
196
|
}
|
|
@@ -232,6 +341,24 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
232
341
|
key: "isValidAnnotationPosition",
|
|
233
342
|
value: function isValidAnnotationPosition(pos) {
|
|
234
343
|
if (!pos || !this.doc) {
|
|
344
|
+
if (this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
345
|
+
this.onAnalyticsEvent({
|
|
346
|
+
// @ts-ignore
|
|
347
|
+
action: 'failed',
|
|
348
|
+
// @ts-ignore
|
|
349
|
+
actionSubject: 'applyAnnotation',
|
|
350
|
+
// @ts-ignore
|
|
351
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
352
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
353
|
+
attributes: {
|
|
354
|
+
// @ts-ignore
|
|
355
|
+
reason: "Annotation Position validation failed - Missing doc or position",
|
|
356
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes'),
|
|
357
|
+
isPosValid: !!pos,
|
|
358
|
+
isDocValid: !!this.doc
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
235
362
|
return false;
|
|
236
363
|
}
|
|
237
364
|
return this._privateValidatePositionsForAnnotation(pos.from, pos.to);
|
|
@@ -293,6 +420,25 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
293
420
|
key: "applyAnnotation",
|
|
294
421
|
value: function applyAnnotation(pos, annotation) {
|
|
295
422
|
if (!this.doc || !pos || !this.schema) {
|
|
423
|
+
if (this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
424
|
+
this.onAnalyticsEvent({
|
|
425
|
+
// @ts-ignore
|
|
426
|
+
action: 'failed',
|
|
427
|
+
// @ts-ignore
|
|
428
|
+
actionSubject: 'applyAnnotation',
|
|
429
|
+
// @ts-ignore
|
|
430
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
431
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
432
|
+
attributes: {
|
|
433
|
+
// @ts-ignore
|
|
434
|
+
reason: "Annotation applyAnnotation failed - Missing doc, position or schema",
|
|
435
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes'),
|
|
436
|
+
isPosValid: !!pos,
|
|
437
|
+
isDocValid: !!this.doc,
|
|
438
|
+
isSchemaValid: !!this.schema
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
296
442
|
return false;
|
|
297
443
|
}
|
|
298
444
|
var from = pos.from,
|
|
@@ -326,6 +472,22 @@ var RendererActions = exports.default = /*#__PURE__*/function () {
|
|
|
326
472
|
doc = _step$apply2.doc,
|
|
327
473
|
failed = _step$apply2.failed;
|
|
328
474
|
if (failed || !doc) {
|
|
475
|
+
if (this.onAnalyticsEvent && (0, _platformFeatureFlags.fg)('platform_renderer_annotations_create_debug_logging')) {
|
|
476
|
+
this.onAnalyticsEvent({
|
|
477
|
+
// @ts-ignore
|
|
478
|
+
action: 'failed',
|
|
479
|
+
// @ts-ignore
|
|
480
|
+
actionSubject: 'applyAnnotation',
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
actionSubjectId: 'inlineCommentFailureReason',
|
|
483
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
484
|
+
attributes: {
|
|
485
|
+
// @ts-ignore
|
|
486
|
+
reason: "Annotation applyAnnotation failed - ".concat(failed),
|
|
487
|
+
commentsOnInlineNodesAllowed: (0, _platformFeatureFlags.fg)('editor_inline_comments_on_inline_nodes')
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
329
491
|
return false;
|
|
330
492
|
}
|
|
331
493
|
var originalSelection = doc.textBetween(from, to);
|
|
@@ -6,28 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = Alignment;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _react = _interopRequireDefault(require("react"));
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
11
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
14
|
-
var _templateObject;
|
|
15
12
|
/**
|
|
16
13
|
* @jsxRuntime classic
|
|
17
14
|
* @jsx jsx
|
|
18
15
|
*/
|
|
16
|
+
|
|
19
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\ttext-align: ", ";\n\t\t\t"])), _adfSchema.alignmentPositionMap[props['data-align']]) : '';
|
|
23
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
24
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
25
|
-
css: styles
|
|
26
|
-
// Ignored via go/ees005
|
|
27
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
28
|
-
}, props), props.children);
|
|
29
|
-
};
|
|
30
|
-
var MarkWrapperNew = function MarkWrapperNew(props) {
|
|
18
|
+
|
|
19
|
+
var MarkWrapper = function MarkWrapper(props) {
|
|
31
20
|
var dataAlign = props['data-align'] ? _adfSchema.alignmentPositionMap[props['data-align']] : undefined;
|
|
32
21
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
33
22
|
style: {
|
|
@@ -37,7 +26,6 @@ var MarkWrapperNew = function MarkWrapperNew(props) {
|
|
|
37
26
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
38
27
|
}, props), props.children);
|
|
39
28
|
};
|
|
40
|
-
var MarkWrapper = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_emotion_refactor_renderer', MarkWrapperNew, MarkWrapperOld);
|
|
41
29
|
function Alignment(props) {
|
|
42
30
|
return (0, _react2.jsx)(MarkWrapper
|
|
43
31
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -6,24 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
9
|
var _react = require("@emotion/react");
|
|
11
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
12
|
var _codeBlockButtonContainer = _interopRequireDefault(require("./codeBlockButtonContainer"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _templateObject;
|
|
17
13
|
/**
|
|
18
14
|
* @jsxRuntime classic
|
|
19
15
|
* @jsx jsx
|
|
20
16
|
*/
|
|
21
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
25
|
-
}));
|
|
26
|
-
var codeBlockStyleOverridesNew = (0, _react.css)((0, _defineProperty2.default)({
|
|
18
|
+
|
|
19
|
+
var codeBlockStyleOverrides = (0, _react.css)((0, _defineProperty2.default)({
|
|
27
20
|
tabSize: 4,
|
|
28
21
|
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N20, ")"),
|
|
29
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -57,7 +50,7 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
57
50
|
return (0, _react.jsx)("div", {
|
|
58
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
59
52
|
className: className,
|
|
60
|
-
css:
|
|
53
|
+
css: codeBlockStyleOverrides
|
|
61
54
|
}, (0, _react.jsx)(_codeBlockButtonContainer.default, {
|
|
62
55
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
63
56
|
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
@@ -12,10 +12,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
|
-
var
|
|
15
|
+
var _useBidiWarnings2 = require("../../../hooks/use-bidi-warnings");
|
|
16
16
|
var _consts = require("../../../../consts");
|
|
17
|
-
var
|
|
18
|
-
var _templateObject, _templateObject2;
|
|
17
|
+
var _templateObject;
|
|
19
18
|
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
20
19
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
21
20
|
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
@@ -26,7 +25,7 @@ var _templateObject, _templateObject2;
|
|
|
26
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
27
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
var
|
|
28
|
+
var codeBlockSharedStyles = (0, _react2.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, "\n\t\t> .").concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
|
|
30
29
|
marginRight: "var(--ds-space-100, 8px)",
|
|
31
30
|
code: {
|
|
32
31
|
display: 'block',
|
|
@@ -125,10 +124,7 @@ var codeBlockSharedStylesNew = (0, _react2.css)((0, _defineProperty2.default)((0
|
|
|
125
124
|
color: "var(--ds-text-subtlest, #505F79)",
|
|
126
125
|
boxSizing: 'content-box'
|
|
127
126
|
})));
|
|
128
|
-
|
|
129
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
130
|
-
var lightWeightCodeBlockStylesOld = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tcursor: text;\n\t}\n"])), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER);
|
|
131
|
-
var lightWeightCodeBlockStylesNew = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), {
|
|
127
|
+
var lightWeightCodeBlockStyles = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), {
|
|
132
128
|
cursor: 'text'
|
|
133
129
|
}));
|
|
134
130
|
var LightWeightCodeBlockCssClassName = exports.LightWeightCodeBlockCssClassName = {
|
|
@@ -147,9 +143,9 @@ var getLightWeightCodeBlockStylesForRootRendererStyleSheet = exports.getLightWei
|
|
|
147
143
|
// NOTE: This must be added after other .code-block styles in the root
|
|
148
144
|
// Renderer stylesheet.
|
|
149
145
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
150
|
-
return (0, _react2.css)(
|
|
146
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t.", "\n\t\t\t> .", "\n\t\t\t.", " {\n\t\t\tmargin-top: ", ";\n\t\t}\n\t"])), _consts.RendererCssClassName.DOCUMENT, LightWeightCodeBlockCssClassName.CONTAINER, _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, _editorSharedStyles.blockNodesVerticalMargin);
|
|
151
147
|
};
|
|
152
|
-
var
|
|
148
|
+
var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
153
149
|
var text = _ref.text,
|
|
154
150
|
_ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
|
|
155
151
|
codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
|
|
@@ -157,51 +153,11 @@ var LightWeightCodeBlockOld = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
157
153
|
var textRows = (0, _react.useMemo)(function () {
|
|
158
154
|
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
159
155
|
}, [text]);
|
|
160
|
-
var _useBidiWarnings = (0,
|
|
156
|
+
var _useBidiWarnings = (0, _useBidiWarnings2.useBidiWarnings)({
|
|
161
157
|
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
162
158
|
}),
|
|
163
159
|
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
164
160
|
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
165
|
-
return (0, _react2.jsx)("div", {
|
|
166
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
167
|
-
className: classNames,
|
|
168
|
-
ref: ref
|
|
169
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
170
|
-
,
|
|
171
|
-
css: [(0, _styles.codeBlockSharedStyles)(), lightWeightCodeBlockStylesOld]
|
|
172
|
-
}, (0, _react2.jsx)("div", {
|
|
173
|
-
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
174
|
-
}, (0, _react2.jsx)("div", {
|
|
175
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
176
|
-
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
|
|
177
|
-
}, (0, _react2.jsx)("div", {
|
|
178
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
179
|
-
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
|
|
180
|
-
}, textRows.map(function (_, index) {
|
|
181
|
-
return (
|
|
182
|
-
// Ignored via go/ees005
|
|
183
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
184
|
-
(0, _react2.jsx)("span", {
|
|
185
|
-
key: index
|
|
186
|
-
})
|
|
187
|
-
);
|
|
188
|
-
})), (0, _react2.jsx)("div", {
|
|
189
|
-
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
190
|
-
}, (0, _react2.jsx)("code", null, renderBidiWarnings(text))))));
|
|
191
|
-
});
|
|
192
|
-
var LightWeightCodeBlockNew = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
193
|
-
var text = _ref2.text,
|
|
194
|
-
_ref2$codeBidiWarning = _ref2.codeBidiWarningTooltipEnabled,
|
|
195
|
-
codeBidiWarningTooltipEnabled = _ref2$codeBidiWarning === void 0 ? true : _ref2$codeBidiWarning,
|
|
196
|
-
className = _ref2.className;
|
|
197
|
-
var textRows = (0, _react.useMemo)(function () {
|
|
198
|
-
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
199
|
-
}, [text]);
|
|
200
|
-
var _useBidiWarnings2 = (0, _useBidiWarnings3.useBidiWarnings)({
|
|
201
|
-
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
202
|
-
}),
|
|
203
|
-
renderBidiWarnings = _useBidiWarnings2.renderBidiWarnings;
|
|
204
|
-
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
205
161
|
var codeBlockBackgroundImage = (0, _editorSharedStyles.overflowShadow)({
|
|
206
162
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
207
163
|
});
|
|
@@ -211,7 +167,7 @@ var LightWeightCodeBlockNew = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
211
167
|
ref: ref
|
|
212
168
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
213
169
|
,
|
|
214
|
-
css: [
|
|
170
|
+
css: [codeBlockSharedStyles, lightWeightCodeBlockStyles],
|
|
215
171
|
style: {
|
|
216
172
|
'--ak-renderer-codeblock-content-wrapper-bg-img': codeBlockBackgroundImage
|
|
217
173
|
}
|
|
@@ -235,5 +191,4 @@ var LightWeightCodeBlockNew = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
|
|
|
235
191
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
236
192
|
}, (0, _react2.jsx)("code", null, renderBidiWarnings(text))))));
|
|
237
193
|
});
|
|
238
|
-
var LightWeightCodeBlock = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_emotion_refactor_renderer', LightWeightCodeBlockNew, LightWeightCodeBlockOld);
|
|
239
194
|
var _default = exports.default = LightWeightCodeBlock;
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
/**
|
|
14
13
|
* @jsxRuntime classic
|
|
15
14
|
* @jsx jsx
|
|
@@ -18,7 +17,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
18
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
18
|
|
|
20
19
|
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
21
|
-
var
|
|
20
|
+
var clearNextSiblingMarginTopStyle = (0, _react2.css)({
|
|
22
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
23
22
|
'& + *': {
|
|
24
23
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
@@ -27,17 +26,10 @@ var clearNextSiblingMarginTopStyleNew = (0, _react2.css)({
|
|
|
27
26
|
});
|
|
28
27
|
|
|
29
28
|
// localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
|
|
30
|
-
var
|
|
29
|
+
var clearNextSiblingBlockMarkMarginTopStyle = (0, _react2.css)((0, _defineProperty2.default)({}, "+ .fabric-editor-block-mark > p,\n\t + .fabric-editor-block-mark > h1,\n\t + .fabric-editor-block-mark > h2,\n\t + .fabric-editor-block-mark > h3,\n\t + .fabric-editor-block-mark > h4,\n\t + .fabric-editor-block-mark > h5,\n\t + .fabric-editor-block-mark > h6\n\t", {
|
|
31
30
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
32
31
|
marginTop: '0 !important'
|
|
33
32
|
}));
|
|
34
|
-
|
|
35
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
36
|
-
var layoutColumnClearMarginTopStyles = (0, _react2.css)(
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
38
|
-
_ui.clearNextSiblingMarginTopStyle,
|
|
39
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
40
|
-
_ui.clearNextSiblingBlockMarkMarginTopStyle);
|
|
41
33
|
function LayoutSection(props) {
|
|
42
34
|
return (0, _react2.jsx)("div", {
|
|
43
35
|
"data-layout-column": true,
|
|
@@ -46,6 +38,6 @@ function LayoutSection(props) {
|
|
|
46
38
|
flexBasis: "".concat(props.width, "%")
|
|
47
39
|
}
|
|
48
40
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
49
|
-
css:
|
|
41
|
+
css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
|
|
50
42
|
}), props.children));
|
|
51
43
|
}
|
|
@@ -15,7 +15,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
18
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
19
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
20
19
|
var _react2 = require("@emotion/react");
|
|
21
20
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
@@ -36,10 +35,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
36
35
|
var _useInlineCommentsFilter = require("../../../ui/annotations/hooks/use-inline-comments-filter");
|
|
37
36
|
var _useInlineCommentSubscriber = require("../../../ui/annotations/hooks/use-inline-comment-subscriber");
|
|
38
37
|
var _types = require("@atlaskit/editor-common/types");
|
|
39
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
40
38
|
var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
|
|
41
39
|
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
42
|
-
var _templateObject;
|
|
43
40
|
/**
|
|
44
41
|
* @jsxRuntime classic
|
|
45
42
|
* @jsx jsx
|
|
@@ -65,19 +62,14 @@ var linkStyle = (0, _react2.css)({
|
|
|
65
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
66
63
|
height: '100% !important'
|
|
67
64
|
});
|
|
68
|
-
|
|
69
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
|
|
70
|
-
var borderStyleOld = function borderStyleOld(color, width) {
|
|
71
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tposition: absolute;\n\twidth: 100% !important;\n\theight: 100% !important;\n\tborder-radius: ", "px;\n\tbox-shadow: 0 0 0 ", "px ", ";\n"])), width, width, color);
|
|
72
|
-
};
|
|
73
|
-
var borderStyleNew = (0, _react2.css)({
|
|
65
|
+
var borderStyle = (0, _react2.css)({
|
|
74
66
|
position: 'absolute',
|
|
75
67
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
76
68
|
width: '100% !important',
|
|
77
69
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
78
70
|
height: '100% !important'
|
|
79
71
|
});
|
|
80
|
-
var
|
|
72
|
+
var MediaBorder = function MediaBorder(_ref) {
|
|
81
73
|
var _mark$attrs$color, _mark$attrs$size;
|
|
82
74
|
var mark = _ref.mark,
|
|
83
75
|
children = _ref.children;
|
|
@@ -87,32 +79,11 @@ var MediaBorderOld = function MediaBorderOld(_ref) {
|
|
|
87
79
|
var borderColor = (_mark$attrs$color = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color !== void 0 ? _mark$attrs$color : '';
|
|
88
80
|
var borderWidth = (_mark$attrs$size = mark === null || mark === void 0 ? void 0 : mark.attrs.size) !== null && _mark$attrs$size !== void 0 ? _mark$attrs$size : 0;
|
|
89
81
|
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(borderColor) || borderColor;
|
|
90
|
-
return (0, _react2.jsx)("div", {
|
|
91
|
-
"data-mark-type": "border",
|
|
92
|
-
"data-color": borderColor,
|
|
93
|
-
"data-size": borderWidth
|
|
94
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
95
|
-
,
|
|
96
|
-
css: borderStyleOld(paletteColorValue, borderWidth)
|
|
97
|
-
}, (0, _react2.jsx)(_ui.MediaBorderGapFiller, {
|
|
98
|
-
borderColor: borderColor
|
|
99
|
-
}), children);
|
|
100
|
-
};
|
|
101
|
-
var MediaBorderNew = function MediaBorderNew(_ref2) {
|
|
102
|
-
var _mark$attrs$color2, _mark$attrs$size2;
|
|
103
|
-
var mark = _ref2.mark,
|
|
104
|
-
children = _ref2.children;
|
|
105
|
-
if (!mark) {
|
|
106
|
-
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
107
|
-
}
|
|
108
|
-
var borderColor = (_mark$attrs$color2 = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color2 !== void 0 ? _mark$attrs$color2 : '';
|
|
109
|
-
var borderWidth = (_mark$attrs$size2 = mark === null || mark === void 0 ? void 0 : mark.attrs.size) !== null && _mark$attrs$size2 !== void 0 ? _mark$attrs$size2 : 0;
|
|
110
|
-
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(borderColor) || borderColor;
|
|
111
82
|
return (0, _react2.jsx)("div", {
|
|
112
83
|
"data-mark-type": "border",
|
|
113
84
|
"data-color": borderColor,
|
|
114
85
|
"data-size": borderWidth,
|
|
115
|
-
css:
|
|
86
|
+
css: borderStyle,
|
|
116
87
|
style: {
|
|
117
88
|
borderRadius: "".concat(borderWidth, "px"),
|
|
118
89
|
boxShadow: "0 0 0 ".concat(borderWidth, "px ").concat(paletteColorValue)
|
|
@@ -121,11 +92,10 @@ var MediaBorderNew = function MediaBorderNew(_ref2) {
|
|
|
121
92
|
borderColor: borderColor
|
|
122
93
|
}), children);
|
|
123
94
|
};
|
|
124
|
-
var
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
onClick = _ref3.onClick;
|
|
95
|
+
var MediaLink = function MediaLink(_ref2) {
|
|
96
|
+
var mark = _ref2.mark,
|
|
97
|
+
children = _ref2.children,
|
|
98
|
+
onClick = _ref2.onClick;
|
|
129
99
|
if (!mark) {
|
|
130
100
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
131
101
|
}
|
|
@@ -138,9 +108,9 @@ var MediaLink = function MediaLink(_ref3) {
|
|
|
138
108
|
css: linkStyle
|
|
139
109
|
}, children);
|
|
140
110
|
};
|
|
141
|
-
var MediaAnnotation = function MediaAnnotation(
|
|
142
|
-
var mark =
|
|
143
|
-
children =
|
|
111
|
+
var MediaAnnotation = function MediaAnnotation(_ref3) {
|
|
112
|
+
var mark = _ref3.mark,
|
|
113
|
+
children = _ref3.children;
|
|
144
114
|
if (!mark) {
|
|
145
115
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
146
116
|
}
|
|
@@ -158,10 +128,10 @@ var MediaAnnotation = function MediaAnnotation(_ref4) {
|
|
|
158
128
|
useBlockLevel: true
|
|
159
129
|
}, children);
|
|
160
130
|
};
|
|
161
|
-
var _MediaAnnotations = function MediaAnnotations(
|
|
162
|
-
var
|
|
163
|
-
marks =
|
|
164
|
-
children =
|
|
131
|
+
var _MediaAnnotations = function MediaAnnotations(_ref4) {
|
|
132
|
+
var _ref4$marks = _ref4.marks,
|
|
133
|
+
marks = _ref4$marks === void 0 ? [] : _ref4$marks,
|
|
134
|
+
children = _ref4.children;
|
|
165
135
|
// Early Exit
|
|
166
136
|
if (marks.length === 0) {
|
|
167
137
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
@@ -178,13 +148,13 @@ var _MediaAnnotations = function MediaAnnotations(_ref5) {
|
|
|
178
148
|
}, children) : (0, _react2.jsx)(_react.Fragment, null, children)));
|
|
179
149
|
};
|
|
180
150
|
var CommentBadge = (0, _reactIntlNext.injectIntl)(_mediaSingle.CommentBadge);
|
|
181
|
-
var CommentBadgeWrapper = function CommentBadgeWrapper(
|
|
151
|
+
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
182
152
|
var _marks$map;
|
|
183
|
-
var marks =
|
|
184
|
-
mediaSingleElement =
|
|
185
|
-
|
|
186
|
-
isDrafting =
|
|
187
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
153
|
+
var marks = _ref5.marks,
|
|
154
|
+
mediaSingleElement = _ref5.mediaSingleElement,
|
|
155
|
+
_ref5$isDrafting = _ref5.isDrafting,
|
|
156
|
+
isDrafting = _ref5$isDrafting === void 0 ? false : _ref5$isDrafting,
|
|
157
|
+
rest = (0, _objectWithoutProperties2.default)(_ref5, _excluded);
|
|
188
158
|
var _useState = (0, _react.useState)('default'),
|
|
189
159
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
190
160
|
status = _useState2[0],
|
|
@@ -261,13 +231,13 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref6) {
|
|
|
261
231
|
* when clean up platform_editor_add_media_from_url feature flag
|
|
262
232
|
*/
|
|
263
233
|
|
|
264
|
-
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(
|
|
234
|
+
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref6) {
|
|
265
235
|
var _marks$map2;
|
|
266
|
-
var marks =
|
|
267
|
-
mediaSingleElement =
|
|
268
|
-
|
|
269
|
-
isDrafting =
|
|
270
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
236
|
+
var marks = _ref6.marks,
|
|
237
|
+
mediaSingleElement = _ref6.mediaSingleElement,
|
|
238
|
+
_ref6$isDrafting = _ref6.isDrafting,
|
|
239
|
+
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
240
|
+
rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
|
|
271
241
|
var _useState5 = (0, _react.useState)('default'),
|
|
272
242
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
273
243
|
status = _useState6[0],
|
|
@@ -386,8 +356,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
386
356
|
mediaWidth: width,
|
|
387
357
|
mediaHeight: height,
|
|
388
358
|
useMinimumZIndex: true
|
|
389
|
-
}, function (
|
|
390
|
-
var visible =
|
|
359
|
+
}, function (_ref8) {
|
|
360
|
+
var visible = _ref8.visible;
|
|
391
361
|
return (0, _react2.jsx)(_react.default.Fragment, null, visible && (0, _react2.jsx)(_mediaSingle.ExternalImageBadge, {
|
|
392
362
|
type: _this.props.type,
|
|
393
363
|
url: _this.props.type === 'external' ? _this.props.url : undefined
|