@atlaskit/renderer 119.0.0 → 119.0.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 +6 -0
- package/dist/cjs/react/marks/breakout.js +2 -2
- package/dist/cjs/ui/Renderer/breakout-ssr.js +9 -5
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/hover/mounter.js +20 -1
- package/dist/cjs/ui/annotations/selection/mounter.js +18 -1
- package/dist/es2019/react/marks/breakout.js +2 -2
- package/dist/es2019/ui/Renderer/breakout-ssr.js +9 -5
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/hover/mounter.js +20 -1
- package/dist/es2019/ui/annotations/selection/mounter.js +18 -1
- package/dist/esm/react/marks/breakout.js +2 -2
- package/dist/esm/ui/Renderer/breakout-ssr.js +9 -5
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/hover/mounter.js +20 -1
- package/dist/esm/ui/annotations/selection/mounter.js +18 -1
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +4 -1
- package/dist/types-ts4.5/ui/Renderer/breakout-ssr.d.ts +4 -1
- package/package.json +8 -5
package/CHANGELOG.md
CHANGED
|
@@ -30,10 +30,10 @@ var getWidth = function getWidth(width, mode) {
|
|
|
30
30
|
return "min(".concat(width, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
31
31
|
} else {
|
|
32
32
|
if (mode === 'full-width') {
|
|
33
|
-
return "max(".concat(_editorSharedStyles.akEditorDefaultLayoutWidth, "px, min(").concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width)))
|
|
33
|
+
return "max(".concat(_editorSharedStyles.akEditorDefaultLayoutWidth, "px, min(").concat(_editorSharedStyles.akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width)))");
|
|
34
34
|
}
|
|
35
35
|
if (mode === 'wide') {
|
|
36
|
-
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))
|
|
36
|
+
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))";
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
};
|
|
@@ -33,19 +33,23 @@ function BreakoutSSRInlineScript(_ref) {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
36
|
+
var shouldSkipScript = {
|
|
37
|
+
table: (0, _platformFeatureFlags.fg)('platform-ssr-table-resize'),
|
|
38
|
+
breakout: (0, _platformFeatureFlags.fg)('platform_breakout_cls')
|
|
39
|
+
};
|
|
36
40
|
return /*#__PURE__*/_react.default.createElement("script", {
|
|
37
41
|
"data-breakout-script-id": id
|
|
38
42
|
// To investigate if we can replace this.
|
|
39
43
|
// eslint-disable-next-line react/no-danger
|
|
40
44
|
,
|
|
41
45
|
dangerouslySetInnerHTML: {
|
|
42
|
-
__html:
|
|
46
|
+
__html: createBreakoutInlineScript(id, shouldSkipScript)
|
|
43
47
|
},
|
|
44
48
|
"data-testid": "breakout-ssr-inline-script"
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
51
|
function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
48
|
-
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(shouldSkipScript
|
|
52
|
+
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ");\n })(window);\n");
|
|
49
53
|
}
|
|
50
54
|
var breakoutInlineScriptContext = exports.breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(_utils.breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(_utils.breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(_utils.breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(_utils.breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcBreakoutWithCustomWidth = ").concat(_utils.breakoutConsts.calcBreakoutWithCustomWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(_utils.breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(_utils.breakoutConsts.calcWideWidth.toString(), ";\n breakoutConsts.FullPagePadding = ").concat(_style.FullPagePadding.toString(), ";\n");
|
|
51
55
|
|
|
@@ -98,10 +102,10 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
// When flag is on we are using CSS to calculate the table width thus don't need logic below to set the width and left.
|
|
101
|
-
if (shouldSkipBreakoutScript && node.classList.contains('pm-table-container')) {
|
|
105
|
+
if (shouldSkipBreakoutScript.table && node.classList.contains('pm-table-container')) {
|
|
102
106
|
return;
|
|
103
107
|
}
|
|
104
|
-
if (shouldSkipBreakoutScript && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
108
|
+
if (shouldSkipBreakoutScript.breakout && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
105
109
|
return;
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -113,7 +117,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
113
117
|
var effectiveWidth = rendererWidth - breakoutConsts.padding;
|
|
114
118
|
width = "".concat(Math.min(parseInt(node.style.width), effectiveWidth), "px");
|
|
115
119
|
} else if (resizedBreakout) {
|
|
116
|
-
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, node.dataset.width || null,
|
|
120
|
+
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, Number(node.dataset.width) || null,
|
|
117
121
|
// Ignored via go/ees005
|
|
118
122
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
119
123
|
renderer.offsetWidth);
|
|
@@ -62,7 +62,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
62
62
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
63
63
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
64
64
|
var packageName = "@atlaskit/renderer";
|
|
65
|
-
var packageVersion = "
|
|
65
|
+
var packageVersion = "119.0.0";
|
|
66
66
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
67
67
|
containerName: 'ak-renderer-wrapper',
|
|
68
68
|
containerType: 'inline-size'
|
|
@@ -12,6 +12,7 @@ var _types = require("@atlaskit/analytics-listeners/types");
|
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _RendererActionsContext = require("../../RendererActionsContext");
|
|
14
14
|
var _AnnotationRangeContext = require("../contexts/AnnotationRangeContext");
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
17
|
var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props) {
|
|
17
18
|
var Component = props.component,
|
|
@@ -67,7 +68,10 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
|
|
|
67
68
|
action: _analytics.ACTION.CREATE_NOT_ALLOWED,
|
|
68
69
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
69
70
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
70
|
-
attributes: {
|
|
71
|
+
attributes: {
|
|
72
|
+
documentPosition: documentPosition,
|
|
73
|
+
isAnnotationAllowed: isAnnotationAllowed
|
|
74
|
+
},
|
|
71
75
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
72
76
|
}).fire(_types.FabricChannel.editor);
|
|
73
77
|
}
|
|
@@ -98,6 +102,21 @@ var Mounter = exports.Mounter = /*#__PURE__*/_react.default.memo(function (props
|
|
|
98
102
|
});
|
|
99
103
|
var positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
|
|
100
104
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
105
|
+
if ((0, _platformFeatureFlags.fg)('cc_comments_improve_apply_draft_errors')) {
|
|
106
|
+
if (createAnalyticsEvent) {
|
|
107
|
+
createAnalyticsEvent({
|
|
108
|
+
action: _analytics.ACTION.CREATE_NOT_ALLOWED,
|
|
109
|
+
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
110
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
111
|
+
attributes: {
|
|
112
|
+
positionToAnnotate: positionToAnnotate,
|
|
113
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
114
|
+
annotationId: options.annotationId
|
|
115
|
+
},
|
|
116
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
117
|
+
}).fire(_types.FabricChannel.editor);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
101
120
|
return false;
|
|
102
121
|
}
|
|
103
122
|
var annotation = {
|
|
@@ -113,7 +113,9 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
|
|
|
113
113
|
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
114
114
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
115
115
|
attributes: {
|
|
116
|
-
inlineNodeNames: inlineNodeTypes
|
|
116
|
+
inlineNodeNames: inlineNodeTypes,
|
|
117
|
+
documentPosition: documentPosition,
|
|
118
|
+
isAnnotationAllowed: isAnnotationAllowed
|
|
117
119
|
},
|
|
118
120
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
119
121
|
}).fire(_types.FabricChannel.editor);
|
|
@@ -151,6 +153,21 @@ var SelectionInlineCommentMounter = exports.SelectionInlineCommentMounter = /*#_
|
|
|
151
153
|
// use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
|
|
152
154
|
var positionToAnnotate = (0, _platformFeatureFlags.fg)('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
|
|
153
155
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
156
|
+
if ((0, _platformFeatureFlags.fg)('cc_comments_improve_apply_draft_errors')) {
|
|
157
|
+
if (createAnalyticsEvent) {
|
|
158
|
+
createAnalyticsEvent({
|
|
159
|
+
action: _analytics.ACTION.CREATE_NOT_ALLOWED,
|
|
160
|
+
actionSubject: _analytics.ACTION_SUBJECT.ANNOTATION,
|
|
161
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
162
|
+
attributes: {
|
|
163
|
+
positionToAnnotate: positionToAnnotate,
|
|
164
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
165
|
+
annotationId: options.annotationId
|
|
166
|
+
},
|
|
167
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
168
|
+
}).fire(_types.FabricChannel.editor);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
154
171
|
return false;
|
|
155
172
|
}
|
|
156
173
|
var annotation = {
|
|
@@ -22,10 +22,10 @@ const getWidth = (width, mode) => {
|
|
|
22
22
|
return `min(${width}px, var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
23
23
|
} else {
|
|
24
24
|
if (mode === 'full-width') {
|
|
25
|
-
return `max(${akEditorDefaultLayoutWidth}px, min(${akEditorFullWidthLayoutWidth}px, var(--ak-editor--breakout-container-without-gutter-width)))
|
|
25
|
+
return `max(${akEditorDefaultLayoutWidth}px, min(${akEditorFullWidthLayoutWidth}px, var(--ak-editor--breakout-container-without-gutter-width)))`;
|
|
26
26
|
}
|
|
27
27
|
if (mode === 'wide') {
|
|
28
|
-
return `min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))
|
|
28
|
+
return `min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))`;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
};
|
|
@@ -25,13 +25,17 @@ export function BreakoutSSRInlineScript({
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
const id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
28
|
+
const shouldSkipScript = {
|
|
29
|
+
table: fg('platform-ssr-table-resize'),
|
|
30
|
+
breakout: fg('platform_breakout_cls')
|
|
31
|
+
};
|
|
28
32
|
return /*#__PURE__*/React.createElement("script", {
|
|
29
33
|
"data-breakout-script-id": id
|
|
30
34
|
// To investigate if we can replace this.
|
|
31
35
|
// eslint-disable-next-line react/no-danger
|
|
32
36
|
,
|
|
33
37
|
dangerouslySetInnerHTML: {
|
|
34
|
-
__html:
|
|
38
|
+
__html: createBreakoutInlineScript(id, shouldSkipScript)
|
|
35
39
|
},
|
|
36
40
|
"data-testid": "breakout-ssr-inline-script"
|
|
37
41
|
});
|
|
@@ -43,7 +47,7 @@ export function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
|
43
47
|
return;
|
|
44
48
|
}
|
|
45
49
|
${breakoutInlineScriptContext};
|
|
46
|
-
(${applyBreakoutAfterSSR.toString()})("${id}", breakoutConsts, ${shouldSkipScript
|
|
50
|
+
(${applyBreakoutAfterSSR.toString()})("${id}", breakoutConsts, ${JSON.stringify(shouldSkipScript)});
|
|
47
51
|
})(window);
|
|
48
52
|
`;
|
|
49
53
|
}
|
|
@@ -107,10 +111,10 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
// When flag is on we are using CSS to calculate the table width thus don't need logic below to set the width and left.
|
|
110
|
-
if (shouldSkipBreakoutScript && node.classList.contains('pm-table-container')) {
|
|
114
|
+
if (shouldSkipBreakoutScript.table && node.classList.contains('pm-table-container')) {
|
|
111
115
|
return;
|
|
112
116
|
}
|
|
113
|
-
if (shouldSkipBreakoutScript && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
117
|
+
if (shouldSkipBreakoutScript.breakout && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
114
118
|
return;
|
|
115
119
|
}
|
|
116
120
|
|
|
@@ -122,7 +126,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
122
126
|
const effectiveWidth = rendererWidth - breakoutConsts.padding;
|
|
123
127
|
width = `${Math.min(parseInt(node.style.width), effectiveWidth)}px`;
|
|
124
128
|
} else if (resizedBreakout) {
|
|
125
|
-
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, node.dataset.width || null,
|
|
129
|
+
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, Number(node.dataset.width) || null,
|
|
126
130
|
// Ignored via go/ees005
|
|
127
131
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
128
132
|
renderer.offsetWidth);
|
|
@@ -48,7 +48,7 @@ import { PortalContext } from './PortalContext';
|
|
|
48
48
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
49
49
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
50
50
|
const packageName = "@atlaskit/renderer";
|
|
51
|
-
const packageVersion = "
|
|
51
|
+
const packageVersion = "119.0.0";
|
|
52
52
|
const setAsQueryContainerStyles = css({
|
|
53
53
|
containerName: 'ak-renderer-wrapper',
|
|
54
54
|
containerType: 'inline-size'
|
|
@@ -5,6 +5,7 @@ import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
7
7
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
export const Mounter = /*#__PURE__*/React.memo(props => {
|
|
9
10
|
const {
|
|
10
11
|
component: Component,
|
|
@@ -63,7 +64,10 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
|
|
|
63
64
|
action: ACTION.CREATE_NOT_ALLOWED,
|
|
64
65
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
65
66
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
66
|
-
attributes: {
|
|
67
|
+
attributes: {
|
|
68
|
+
documentPosition,
|
|
69
|
+
isAnnotationAllowed: isAnnotationAllowed
|
|
70
|
+
},
|
|
67
71
|
eventType: EVENT_TYPE.TRACK
|
|
68
72
|
}).fire(FabricChannel.editor);
|
|
69
73
|
}
|
|
@@ -94,6 +98,21 @@ export const Mounter = /*#__PURE__*/React.memo(props => {
|
|
|
94
98
|
});
|
|
95
99
|
const positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
|
|
96
100
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
101
|
+
if (fg('cc_comments_improve_apply_draft_errors')) {
|
|
102
|
+
if (createAnalyticsEvent) {
|
|
103
|
+
createAnalyticsEvent({
|
|
104
|
+
action: ACTION.CREATE_NOT_ALLOWED,
|
|
105
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
106
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
107
|
+
attributes: {
|
|
108
|
+
positionToAnnotate,
|
|
109
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
110
|
+
annotationId: options.annotationId
|
|
111
|
+
},
|
|
112
|
+
eventType: EVENT_TYPE.TRACK
|
|
113
|
+
}).fire(FabricChannel.editor);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
97
116
|
return false;
|
|
98
117
|
}
|
|
99
118
|
const annotation = {
|
|
@@ -110,7 +110,9 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
110
110
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
111
111
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
112
112
|
attributes: {
|
|
113
|
-
inlineNodeNames: inlineNodeTypes
|
|
113
|
+
inlineNodeNames: inlineNodeTypes,
|
|
114
|
+
documentPosition,
|
|
115
|
+
isAnnotationAllowed
|
|
114
116
|
},
|
|
115
117
|
eventType: EVENT_TYPE.TRACK
|
|
116
118
|
}).fire(FabricChannel.editor);
|
|
@@ -148,6 +150,21 @@ export const SelectionInlineCommentMounter = /*#__PURE__*/React.memo(props => {
|
|
|
148
150
|
// use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
|
|
149
151
|
const positionToAnnotate = fg('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
|
|
150
152
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
153
|
+
if (fg('cc_comments_improve_apply_draft_errors')) {
|
|
154
|
+
if (createAnalyticsEvent) {
|
|
155
|
+
createAnalyticsEvent({
|
|
156
|
+
action: ACTION.CREATE_NOT_ALLOWED,
|
|
157
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
158
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
159
|
+
attributes: {
|
|
160
|
+
positionToAnnotate,
|
|
161
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
162
|
+
annotationId: options.annotationId
|
|
163
|
+
},
|
|
164
|
+
eventType: EVENT_TYPE.TRACK
|
|
165
|
+
}).fire(FabricChannel.editor);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
151
168
|
return false;
|
|
152
169
|
}
|
|
153
170
|
const annotation = {
|
|
@@ -22,10 +22,10 @@ var getWidth = function getWidth(width, mode) {
|
|
|
22
22
|
return "min(".concat(width, "px, var(--ak-editor--breakout-container-without-gutter-width))");
|
|
23
23
|
} else {
|
|
24
24
|
if (mode === 'full-width') {
|
|
25
|
-
return "max(".concat(akEditorDefaultLayoutWidth, "px, min(").concat(akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width)))
|
|
25
|
+
return "max(".concat(akEditorDefaultLayoutWidth, "px, min(").concat(akEditorFullWidthLayoutWidth, "px, var(--ak-editor--breakout-container-without-gutter-width)))");
|
|
26
26
|
}
|
|
27
27
|
if (mode === 'wide') {
|
|
28
|
-
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))
|
|
28
|
+
return "min(var(--ak-editor--breakout-wide-layout-width), var(--ak-editor--breakout-container-without-gutter-width))";
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
};
|
|
@@ -24,19 +24,23 @@ export function BreakoutSSRInlineScript(_ref) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
var id = Math.floor(Math.random() * (9999999999 - 9999 + 1)) + 9999;
|
|
27
|
+
var shouldSkipScript = {
|
|
28
|
+
table: fg('platform-ssr-table-resize'),
|
|
29
|
+
breakout: fg('platform_breakout_cls')
|
|
30
|
+
};
|
|
27
31
|
return /*#__PURE__*/React.createElement("script", {
|
|
28
32
|
"data-breakout-script-id": id
|
|
29
33
|
// To investigate if we can replace this.
|
|
30
34
|
// eslint-disable-next-line react/no-danger
|
|
31
35
|
,
|
|
32
36
|
dangerouslySetInnerHTML: {
|
|
33
|
-
__html:
|
|
37
|
+
__html: createBreakoutInlineScript(id, shouldSkipScript)
|
|
34
38
|
},
|
|
35
39
|
"data-testid": "breakout-ssr-inline-script"
|
|
36
40
|
});
|
|
37
41
|
}
|
|
38
42
|
export function createBreakoutInlineScript(id, shouldSkipScript) {
|
|
39
|
-
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(shouldSkipScript
|
|
43
|
+
return "\n\t (function(window){\n\t\tif(typeof window !== 'undefined' && window.__RENDERER_BYPASS_BREAKOUT_SSR__) {\n\t\t\treturn;\n\t\t}\n ".concat(breakoutInlineScriptContext, ";\n (").concat(applyBreakoutAfterSSR.toString(), ")(\"").concat(id, "\", breakoutConsts, ").concat(JSON.stringify(shouldSkipScript), ");\n })(window);\n");
|
|
40
44
|
}
|
|
41
45
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcBreakoutWithCustomWidth = ").concat(breakoutConsts.calcBreakoutWithCustomWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n breakoutConsts.FullPagePadding = ").concat(FullPagePadding.toString(), ";\n");
|
|
42
46
|
|
|
@@ -89,10 +93,10 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
// When flag is on we are using CSS to calculate the table width thus don't need logic below to set the width and left.
|
|
92
|
-
if (shouldSkipBreakoutScript && node.classList.contains('pm-table-container')) {
|
|
96
|
+
if (shouldSkipBreakoutScript.table && node.classList.contains('pm-table-container')) {
|
|
93
97
|
return;
|
|
94
98
|
}
|
|
95
|
-
if (shouldSkipBreakoutScript && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
99
|
+
if (shouldSkipBreakoutScript.breakout && node.classList.contains('fabric-editor-breakout-mark')) {
|
|
96
100
|
return;
|
|
97
101
|
}
|
|
98
102
|
|
|
@@ -104,7 +108,7 @@ function applyBreakoutAfterSSR(id, breakoutConsts, shouldSkipBreakoutScript) {
|
|
|
104
108
|
var effectiveWidth = rendererWidth - breakoutConsts.padding;
|
|
105
109
|
width = "".concat(Math.min(parseInt(node.style.width), effectiveWidth), "px");
|
|
106
110
|
} else if (resizedBreakout) {
|
|
107
|
-
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, node.dataset.width || null,
|
|
111
|
+
width = breakoutConsts.calcBreakoutWithCustomWidth(mode, Number(node.dataset.width) || null,
|
|
108
112
|
// Ignored via go/ees005
|
|
109
113
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
110
114
|
renderer.offsetWidth);
|
|
@@ -53,7 +53,7 @@ import { PortalContext } from './PortalContext';
|
|
|
53
53
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
54
54
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
55
55
|
var packageName = "@atlaskit/renderer";
|
|
56
|
-
var packageVersion = "
|
|
56
|
+
var packageVersion = "119.0.0";
|
|
57
57
|
var setAsQueryContainerStyles = css({
|
|
58
58
|
containerName: 'ak-renderer-wrapper',
|
|
59
59
|
containerType: 'inline-size'
|
|
@@ -5,6 +5,7 @@ import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { RendererContext as ActionsContext } from '../../RendererActionsContext';
|
|
7
7
|
import { useAnnotationRangeDispatch, useAnnotationRangeState } from '../contexts/AnnotationRangeContext';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
export var Mounter = /*#__PURE__*/React.memo(function (props) {
|
|
9
10
|
var Component = props.component,
|
|
10
11
|
range = props.range,
|
|
@@ -59,7 +60,10 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
|
|
|
59
60
|
action: ACTION.CREATE_NOT_ALLOWED,
|
|
60
61
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
61
62
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
62
|
-
attributes: {
|
|
63
|
+
attributes: {
|
|
64
|
+
documentPosition: documentPosition,
|
|
65
|
+
isAnnotationAllowed: isAnnotationAllowed
|
|
66
|
+
},
|
|
63
67
|
eventType: EVENT_TYPE.TRACK
|
|
64
68
|
}).fire(FabricChannel.editor);
|
|
65
69
|
}
|
|
@@ -90,6 +94,21 @@ export var Mounter = /*#__PURE__*/React.memo(function (props) {
|
|
|
90
94
|
});
|
|
91
95
|
var positionToAnnotate = hoverDraftDocumentPosition || documentPosition;
|
|
92
96
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
97
|
+
if (fg('cc_comments_improve_apply_draft_errors')) {
|
|
98
|
+
if (createAnalyticsEvent) {
|
|
99
|
+
createAnalyticsEvent({
|
|
100
|
+
action: ACTION.CREATE_NOT_ALLOWED,
|
|
101
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
102
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
103
|
+
attributes: {
|
|
104
|
+
positionToAnnotate: positionToAnnotate,
|
|
105
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
106
|
+
annotationId: options.annotationId
|
|
107
|
+
},
|
|
108
|
+
eventType: EVENT_TYPE.TRACK
|
|
109
|
+
}).fire(FabricChannel.editor);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
93
112
|
return false;
|
|
94
113
|
}
|
|
95
114
|
var annotation = {
|
|
@@ -104,7 +104,9 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
104
104
|
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
105
105
|
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
106
106
|
attributes: {
|
|
107
|
-
inlineNodeNames: inlineNodeTypes
|
|
107
|
+
inlineNodeNames: inlineNodeTypes,
|
|
108
|
+
documentPosition: documentPosition,
|
|
109
|
+
isAnnotationAllowed: isAnnotationAllowed
|
|
108
110
|
},
|
|
109
111
|
eventType: EVENT_TYPE.TRACK
|
|
110
112
|
}).fire(FabricChannel.editor);
|
|
@@ -142,6 +144,21 @@ export var SelectionInlineCommentMounter = /*#__PURE__*/React.memo(function (pro
|
|
|
142
144
|
// use platform_editor_comments_api_manager here so we can clear the code path when the flag is removed
|
|
143
145
|
var positionToAnnotate = fg('platform_editor_comments_api_manager') ? documentPosition : selectionDraftDocumentPosition || documentPosition;
|
|
144
146
|
if (!positionToAnnotate || !applyAnnotation || !options.annotationId) {
|
|
147
|
+
if (fg('cc_comments_improve_apply_draft_errors')) {
|
|
148
|
+
if (createAnalyticsEvent) {
|
|
149
|
+
createAnalyticsEvent({
|
|
150
|
+
action: ACTION.CREATE_NOT_ALLOWED,
|
|
151
|
+
actionSubject: ACTION_SUBJECT.ANNOTATION,
|
|
152
|
+
actionSubjectId: ACTION_SUBJECT_ID.INLINE_COMMENT,
|
|
153
|
+
attributes: {
|
|
154
|
+
positionToAnnotate: positionToAnnotate,
|
|
155
|
+
applyAnnotationMissing: !applyAnnotation,
|
|
156
|
+
annotationId: options.annotationId
|
|
157
|
+
},
|
|
158
|
+
eventType: EVENT_TYPE.TRACK
|
|
159
|
+
}).fire(FabricChannel.editor);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
145
162
|
return false;
|
|
146
163
|
}
|
|
147
164
|
var annotation = {
|
|
@@ -12,6 +12,9 @@ declare global {
|
|
|
12
12
|
export declare function BreakoutSSRInlineScript({ noOpSSRInlineScript }: {
|
|
13
13
|
noOpSSRInlineScript: Boolean;
|
|
14
14
|
}): React.JSX.Element | null;
|
|
15
|
-
export declare function createBreakoutInlineScript(id: number, shouldSkipScript
|
|
15
|
+
export declare function createBreakoutInlineScript(id: number, shouldSkipScript: {
|
|
16
|
+
table: boolean;
|
|
17
|
+
breakout: boolean;
|
|
18
|
+
}): string;
|
|
16
19
|
export declare const breakoutInlineScriptContext: string;
|
|
17
20
|
export declare const calcLineLength: () => number;
|
|
@@ -12,6 +12,9 @@ declare global {
|
|
|
12
12
|
export declare function BreakoutSSRInlineScript({ noOpSSRInlineScript }: {
|
|
13
13
|
noOpSSRInlineScript: Boolean;
|
|
14
14
|
}): React.JSX.Element | null;
|
|
15
|
-
export declare function createBreakoutInlineScript(id: number, shouldSkipScript
|
|
15
|
+
export declare function createBreakoutInlineScript(id: number, shouldSkipScript: {
|
|
16
|
+
table: boolean;
|
|
17
|
+
breakout: boolean;
|
|
18
|
+
}): string;
|
|
16
19
|
export declare const breakoutInlineScriptContext: string;
|
|
17
20
|
export declare const calcLineLength: () => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "119.0.
|
|
3
|
+
"version": "119.0.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
54
54
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
55
|
-
"@atlaskit/smart-card": "^38.
|
|
55
|
+
"@atlaskit/smart-card": "^38.13.0",
|
|
56
56
|
"@atlaskit/status": "^3.0.0",
|
|
57
57
|
"@atlaskit/task-decision": "^19.2.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
60
|
-
"@atlaskit/tokens": "^5.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^8.0.0",
|
|
60
|
+
"@atlaskit/tokens": "^5.3.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
62
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
63
63
|
"@babel/runtime": "^7.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@atlaskit/css-reset": "^7.3.0",
|
|
84
84
|
"@atlaskit/link-provider": "^3.3.0",
|
|
85
85
|
"@atlaskit/link-test-helpers": "^8.0.0",
|
|
86
|
-
"@atlaskit/linking-common": "^9.
|
|
86
|
+
"@atlaskit/linking-common": "^9.1.0",
|
|
87
87
|
"@atlaskit/media-core": "^37.0.0",
|
|
88
88
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
89
89
|
"@atlaskit/media-test-helpers": "^37.0.0",
|
|
@@ -130,6 +130,9 @@
|
|
|
130
130
|
"confluence_frontend_table_scrollbar_ttvc_fix": {
|
|
131
131
|
"type": "boolean"
|
|
132
132
|
},
|
|
133
|
+
"cc_comments_improve_apply_draft_errors": {
|
|
134
|
+
"type": "boolean"
|
|
135
|
+
},
|
|
133
136
|
"platform-ssr-table-resize": {
|
|
134
137
|
"type": "boolean"
|
|
135
138
|
},
|