@atlaskit/editor-common 110.14.2 → 110.15.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 +22 -0
- package/dist/cjs/messages/block-type.js +0 -10
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/HoverLinkOverlay/index.js +192 -14
- package/dist/es2019/messages/block-type.js +0 -10
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/HoverLinkOverlay/index.js +176 -14
- package/dist/esm/messages/block-type.js +0 -10
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/HoverLinkOverlay/index.js +192 -14
- package/dist/types/analytics/types/insert-events.d.ts +0 -1
- package/dist/types/messages/block-type.d.ts +0 -10
- package/dist/types/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types/types/editor-appearance.d.ts +1 -1
- package/dist/types/ui/HoverLinkOverlay/index.d.ts +13 -3
- package/dist/types-ts4.5/analytics/types/insert-events.d.ts +0 -1
- package/dist/types-ts4.5/messages/block-type.d.ts +0 -10
- package/dist/types-ts4.5/provider-factory/quick-insert-provider.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-appearance.d.ts +1 -1
- package/dist/types-ts4.5/ui/HoverLinkOverlay/index.d.ts +13 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 110.15.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`f34518606af3d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f34518606af3d) -
|
|
8
|
+
[ux] Fixes UI issues of the HoverLinkOverlay when it is shown on a heading and on a mulitline
|
|
9
|
+
smartlink.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 110.15.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [`18aec70029328`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/18aec70029328) -
|
|
17
|
+
EDITOR-2420 Rename parameter values of `dense` contentMode to `compact`
|
|
18
|
+
- [`a4fbfc862e34f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4fbfc862e34f) -
|
|
19
|
+
[ux] ED-29557 Clean up plain text quick insert as it's not needed
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 110.14.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -91,16 +91,6 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
91
91
|
defaultMessage: 'Display code with syntax highlighting',
|
|
92
92
|
description: 'Insert a snippet/segment of code (code block)'
|
|
93
93
|
},
|
|
94
|
-
plainTextCodeblock: {
|
|
95
|
-
id: 'fabric.editor.plainTextCodeblock',
|
|
96
|
-
defaultMessage: 'Plain text',
|
|
97
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
98
|
-
},
|
|
99
|
-
plainTextCodeblockDescription: {
|
|
100
|
-
id: 'fabric.editor.plainTextCodeblock.description',
|
|
101
|
-
defaultMessage: 'Insert code block for plain text',
|
|
102
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
103
|
-
},
|
|
104
94
|
infoPanel: {
|
|
105
95
|
id: 'fabric.editor.infoPanel',
|
|
106
96
|
defaultMessage: 'Info panel',
|
|
@@ -16,7 +16,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
16
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); }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "110.
|
|
19
|
+
var packageVersion = "110.15.0";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "110.
|
|
27
|
+
var packageVersion = "110.15.0";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -14,7 +14,9 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
14
14
|
var _growDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/grow-diagonal"));
|
|
15
15
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
16
16
|
var _panelRight = _interopRequireDefault(require("@atlaskit/icon/core/panel-right"));
|
|
17
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
17
18
|
var _primitives = require("@atlaskit/primitives");
|
|
19
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
20
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
21
|
var _analytics = require("../../analytics");
|
|
20
22
|
var _messages = require("../../messages");
|
|
@@ -32,26 +34,34 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
32
34
|
|
|
33
35
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
34
36
|
|
|
35
|
-
var
|
|
37
|
+
var containerStylesOld = (0, _react2.css)({
|
|
36
38
|
position: 'relative'
|
|
37
39
|
});
|
|
38
|
-
var
|
|
40
|
+
var containerStyles = (0, _react2.css)({
|
|
41
|
+
position: 'relative',
|
|
42
|
+
whiteSpace: 'nowrap'
|
|
43
|
+
});
|
|
44
|
+
var iconWrapperStylesOld = (0, _primitives.xcss)({
|
|
39
45
|
display: 'inline-flex',
|
|
40
46
|
justifyContent: 'center',
|
|
41
47
|
alignItems: 'center',
|
|
42
48
|
height: '17px',
|
|
43
49
|
width: '17px'
|
|
44
50
|
});
|
|
51
|
+
var iconWrapperStyles = (0, _primitives.xcss)({
|
|
52
|
+
display: 'inline-flex',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
alignItems: 'center'
|
|
55
|
+
});
|
|
45
56
|
var hiddenTextStyle = (0, _react2.css)({
|
|
46
57
|
overflow: 'hidden',
|
|
47
58
|
whiteSpace: 'nowrap',
|
|
48
59
|
position: 'absolute',
|
|
49
60
|
visibility: 'hidden'
|
|
50
61
|
});
|
|
51
|
-
var
|
|
62
|
+
var linkStylesCommon = (0, _primitives.xcss)({
|
|
52
63
|
position: 'absolute',
|
|
53
64
|
left: 'space.025',
|
|
54
|
-
top: '-1px',
|
|
55
65
|
display: 'inline-flex',
|
|
56
66
|
alignItems: 'center',
|
|
57
67
|
verticalAlign: 'middle',
|
|
@@ -71,10 +81,31 @@ var linkStyles = (0, _primitives.xcss)({
|
|
|
71
81
|
textDecoration: 'none'
|
|
72
82
|
}
|
|
73
83
|
});
|
|
84
|
+
var linkStylesOld = (0, _primitives.xcss)({
|
|
85
|
+
top: '-1px'
|
|
86
|
+
});
|
|
87
|
+
var linkStylesHeightFix = (0, _primitives.xcss)({
|
|
88
|
+
top: '0px',
|
|
89
|
+
height: '1.2em'
|
|
90
|
+
});
|
|
91
|
+
var linkStylesNewWithHeightFix = (0, _primitives.xcss)({
|
|
92
|
+
top: '0px',
|
|
93
|
+
visibility: 'hidden',
|
|
94
|
+
height: '1.2em'
|
|
95
|
+
});
|
|
96
|
+
var linkStylesVisible = (0, _primitives.xcss)({
|
|
97
|
+
visibility: 'visible'
|
|
98
|
+
});
|
|
99
|
+
var iconAndLabelStyles = (0, _primitives.xcss)({
|
|
100
|
+
display: 'flex',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
height: '100%',
|
|
103
|
+
gap: 'space.025'
|
|
104
|
+
});
|
|
74
105
|
var MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
75
106
|
var ICON_WIDTH = 16;
|
|
76
107
|
var DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
77
|
-
|
|
108
|
+
var MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY = 30;
|
|
78
109
|
var visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi, inputMethod) {
|
|
79
110
|
return function (state, dispatch) {
|
|
80
111
|
if (!(state.selection instanceof _state.NodeSelection)) {
|
|
@@ -89,7 +120,7 @@ var visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi,
|
|
|
89
120
|
return true;
|
|
90
121
|
};
|
|
91
122
|
};
|
|
92
|
-
var
|
|
123
|
+
var HoverLinkOverlayOriginal = function HoverLinkOverlayOriginal(_ref) {
|
|
93
124
|
var children = _ref.children,
|
|
94
125
|
_ref$isVisible = _ref.isVisible,
|
|
95
126
|
isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
|
|
@@ -123,7 +154,6 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
123
154
|
}
|
|
124
155
|
var cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
125
156
|
var openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
126
|
-
|
|
127
157
|
// Get the hidden text width
|
|
128
158
|
if (!openTextWidthRef.current) {
|
|
129
159
|
var hiddenText = hiddenTextRef.current;
|
|
@@ -171,14 +201,14 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
171
201
|
sendVisitLinkAnalytics(_analytics.INPUT_METHOD.BUTTON);
|
|
172
202
|
}
|
|
173
203
|
};
|
|
174
|
-
var
|
|
175
|
-
var label =
|
|
204
|
+
var isPreviewButton = showPanelButton && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true);
|
|
205
|
+
var label = isPreviewButton ? formatMessage(_messages.cardMessages.previewButtonTitle) : formatMessage(_messages.cardMessages.openButtonTitle);
|
|
176
206
|
var icon = null;
|
|
177
|
-
if (
|
|
207
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
178
208
|
icon = (0, _react2.jsx)(_panelRight.default, {
|
|
179
209
|
label: ""
|
|
180
210
|
});
|
|
181
|
-
} else if (
|
|
211
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
182
212
|
icon = (0, _react2.jsx)(_growDiagonal.default, {
|
|
183
213
|
label: ""
|
|
184
214
|
});
|
|
@@ -191,7 +221,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
191
221
|
// eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
|
|
192
222
|
(0, _react2.jsx)("span", {
|
|
193
223
|
ref: containerRef,
|
|
194
|
-
css:
|
|
224
|
+
css: containerStylesOld,
|
|
195
225
|
onDoubleClick: handleDoubleClick
|
|
196
226
|
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
197
227
|
,
|
|
@@ -212,7 +242,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
212
242
|
maxLines: 1
|
|
213
243
|
}, label)), isHovered && (0, _react2.jsx)(_primitives.Anchor, {
|
|
214
244
|
ref: hoverLinkButtonRef,
|
|
215
|
-
xcss:
|
|
245
|
+
xcss: [linkStylesCommon, (0, _expValEquals.expValEquals)('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_changes_only') ? linkStylesHeightFix : linkStylesOld],
|
|
216
246
|
href: url,
|
|
217
247
|
target: "_blank",
|
|
218
248
|
style: {
|
|
@@ -221,7 +251,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
221
251
|
onClick: handleClick,
|
|
222
252
|
testId: "inline-card-hoverlink-overlay"
|
|
223
253
|
}, (0, _react2.jsx)(_primitives.Box, {
|
|
224
|
-
xcss:
|
|
254
|
+
xcss: iconWrapperStylesOld,
|
|
225
255
|
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
226
256
|
testId: "inline-card-hoverlink-overlay-icon"
|
|
227
257
|
}, icon), showLabel && (0, _react2.jsx)(_primitives.Text, {
|
|
@@ -232,4 +262,152 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
232
262
|
}, label)))
|
|
233
263
|
);
|
|
234
264
|
};
|
|
265
|
+
var HoverLinkOverlayNew = function HoverLinkOverlayNew(_ref2) {
|
|
266
|
+
var children = _ref2.children,
|
|
267
|
+
_ref2$isVisible = _ref2.isVisible,
|
|
268
|
+
isVisible = _ref2$isVisible === void 0 ? false : _ref2$isVisible,
|
|
269
|
+
url = _ref2.url,
|
|
270
|
+
_ref2$compactPadding = _ref2.compactPadding,
|
|
271
|
+
compactPadding = _ref2$compactPadding === void 0 ? false : _ref2$compactPadding,
|
|
272
|
+
editorAnalyticsApi = _ref2.editorAnalyticsApi,
|
|
273
|
+
view = _ref2.view,
|
|
274
|
+
onClick = _ref2.onClick,
|
|
275
|
+
_ref2$showPanelButton = _ref2.showPanelButton,
|
|
276
|
+
showPanelButton = _ref2$showPanelButton === void 0 ? false : _ref2$showPanelButton,
|
|
277
|
+
showPanelButtonIcon = _ref2.showPanelButtonIcon;
|
|
278
|
+
var _useIntl2 = (0, _reactIntlNext.useIntl)(),
|
|
279
|
+
formatMessage = _useIntl2.formatMessage;
|
|
280
|
+
var containerRef = (0, _react.useRef)(null);
|
|
281
|
+
var iconRef = (0, _react.useRef)(null);
|
|
282
|
+
var iconLeftRef = (0, _react.useRef)(0);
|
|
283
|
+
var iconAndLabelRef = (0, _react.useRef)(null);
|
|
284
|
+
var minMaxWidthRef = (0, _react.useRef)();
|
|
285
|
+
var _useState5 = (0, _react.useState)(false),
|
|
286
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
287
|
+
showLabel = _useState6[0],
|
|
288
|
+
setShowLabel = _useState6[1];
|
|
289
|
+
var _useState7 = (0, _react.useState)(false),
|
|
290
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
291
|
+
isHovered = _useState8[0],
|
|
292
|
+
setHovered = _useState8[1];
|
|
293
|
+
var _useState9 = (0, _react.useState)(false),
|
|
294
|
+
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
295
|
+
showOverlay = _useState0[0],
|
|
296
|
+
setShowOverlay = _useState0[1];
|
|
297
|
+
(0, _react.useLayoutEffect)(function () {
|
|
298
|
+
if (!isVisible && !isHovered) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (!containerRef.current) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (iconRef.current && iconAndLabelRef.current) {
|
|
305
|
+
var iconRect = iconRef.current.getBoundingClientRect();
|
|
306
|
+
iconLeftRef.current = iconRect.left;
|
|
307
|
+
minMaxWidthRef.current = {
|
|
308
|
+
min: iconRect.width,
|
|
309
|
+
max: iconAndLabelRef.current.getBoundingClientRect().width
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
if (!iconLeftRef.current || !minMaxWidthRef.current) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
var containerDomRect = containerRef.current.getBoundingClientRect();
|
|
316
|
+
var containerStyles = getComputedStyle(containerRef.current);
|
|
317
|
+
var containerHeight = containerDomRect.height - parseFloat(containerStyles.paddingTop) - parseFloat(containerStyles.paddingBottom) - parseFloat(containerStyles.borderTopWidth) - parseFloat(containerStyles.borderBottomWidth);
|
|
318
|
+
var oneLine = parseFloat(containerStyles.lineHeight) >= containerHeight;
|
|
319
|
+
var firstLineWidth = containerDomRect.right - iconLeftRef.current;
|
|
320
|
+
|
|
321
|
+
// We don't want HoverLinkOverlay to cover the entire card if it is oneline. It allows the user to click on the card itself.
|
|
322
|
+
var reservedWidth = oneLine ? MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY : 0;
|
|
323
|
+
var availableWidth = firstLineWidth - reservedWidth;
|
|
324
|
+
|
|
325
|
+
// True when icon and label can be shown
|
|
326
|
+
setShowLabel(availableWidth >= minMaxWidthRef.current.max);
|
|
327
|
+
// True when at least an icon can be shown
|
|
328
|
+
setShowOverlay(availableWidth >= minMaxWidthRef.current.min);
|
|
329
|
+
}, [isVisible, isHovered]);
|
|
330
|
+
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
331
|
+
setHovered(isHovered);
|
|
332
|
+
};
|
|
333
|
+
var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
|
|
334
|
+
if (editorAnalyticsApi && view) {
|
|
335
|
+
visitCardLinkAnalytics(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
var handleDoubleClick = function handleDoubleClick() {
|
|
339
|
+
if (!showPanelButton) {
|
|
340
|
+
sendVisitLinkAnalytics(_analytics.INPUT_METHOD.DOUBLE_CLICK);
|
|
341
|
+
|
|
342
|
+
// Double click opens the link in a new tab
|
|
343
|
+
window.open(url, '_blank');
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
var handleClick = function handleClick(event) {
|
|
347
|
+
if (showPanelButton && onClick) {
|
|
348
|
+
onClick(event);
|
|
349
|
+
} else {
|
|
350
|
+
sendVisitLinkAnalytics(_analytics.INPUT_METHOD.BUTTON);
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
var isPreviewButton = showPanelButton && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true);
|
|
354
|
+
var label = isPreviewButton ? formatMessage(_messages.cardMessages.previewButtonTitle) : formatMessage(_messages.cardMessages.openButtonTitle);
|
|
355
|
+
var icon = null;
|
|
356
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
357
|
+
icon = (0, _react2.jsx)(_panelRight.default, {
|
|
358
|
+
label: ""
|
|
359
|
+
});
|
|
360
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
361
|
+
icon = (0, _react2.jsx)(_growDiagonal.default, {
|
|
362
|
+
label: ""
|
|
363
|
+
});
|
|
364
|
+
} else {
|
|
365
|
+
icon = (0, _react2.jsx)(_linkExternal.default, {
|
|
366
|
+
label: ""
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
return (0, _react2.jsx)("span", {
|
|
370
|
+
ref: containerRef,
|
|
371
|
+
css: containerStyles,
|
|
372
|
+
onDoubleClick: handleDoubleClick,
|
|
373
|
+
onMouseEnter: function onMouseEnter() {
|
|
374
|
+
return handleOverlayChange(true);
|
|
375
|
+
},
|
|
376
|
+
onMouseLeave: function onMouseLeave() {
|
|
377
|
+
return handleOverlayChange(false);
|
|
378
|
+
},
|
|
379
|
+
role: "presentation" // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
380
|
+
,
|
|
381
|
+
onFocus: function onFocus() {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
382
|
+
,
|
|
383
|
+
onBlur: function onBlur() {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
384
|
+
}, isHovered && (0, _react2.jsx)(_primitives.Anchor, {
|
|
385
|
+
xcss: [linkStylesCommon, linkStylesNewWithHeightFix, showOverlay && linkStylesVisible],
|
|
386
|
+
href: url,
|
|
387
|
+
target: "_blank",
|
|
388
|
+
style: {
|
|
389
|
+
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
390
|
+
},
|
|
391
|
+
onClick: handleClick,
|
|
392
|
+
testId: "inline-card-hoverlink-overlay"
|
|
393
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
394
|
+
as: "span",
|
|
395
|
+
xcss: iconAndLabelStyles,
|
|
396
|
+
ref: iconAndLabelRef
|
|
397
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
398
|
+
ref: iconRef,
|
|
399
|
+
as: "span",
|
|
400
|
+
xcss: iconWrapperStyles,
|
|
401
|
+
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
402
|
+
testId: "inline-card-hoverlink-overlay-icon"
|
|
403
|
+
}, icon), (showLabel || !minMaxWidthRef.current) && (0, _react2.jsx)(_primitives.Text, {
|
|
404
|
+
size: "small",
|
|
405
|
+
color: "color.text.subtle",
|
|
406
|
+
maxLines: 1,
|
|
407
|
+
testId: "inline-card-hoverlink-overlay-label"
|
|
408
|
+
}, label))), children);
|
|
409
|
+
};
|
|
410
|
+
var HoverLinkOverlay = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
411
|
+
return (0, _expValEquals.expValEquals)('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_js_changes');
|
|
412
|
+
}, HoverLinkOverlayNew, HoverLinkOverlayOriginal);
|
|
235
413
|
var _default = exports.default = HoverLinkOverlay;
|
|
@@ -85,16 +85,6 @@ export const messages = defineMessages({
|
|
|
85
85
|
defaultMessage: 'Display code with syntax highlighting',
|
|
86
86
|
description: 'Insert a snippet/segment of code (code block)'
|
|
87
87
|
},
|
|
88
|
-
plainTextCodeblock: {
|
|
89
|
-
id: 'fabric.editor.plainTextCodeblock',
|
|
90
|
-
defaultMessage: 'Plain text',
|
|
91
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
92
|
-
},
|
|
93
|
-
plainTextCodeblockDescription: {
|
|
94
|
-
id: 'fabric.editor.plainTextCodeblock.description',
|
|
95
|
-
defaultMessage: 'Insert code block for plain text',
|
|
96
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
97
|
-
},
|
|
98
88
|
infoPanel: {
|
|
99
89
|
id: 'fabric.editor.infoPanel',
|
|
100
90
|
defaultMessage: 'Info panel',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "110.
|
|
4
|
+
const packageVersion = "110.15.0";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "110.
|
|
17
|
+
const packageVersion = "110.15.0";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -12,31 +12,41 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
12
12
|
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
13
13
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
14
14
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
15
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
15
16
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
16
17
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
18
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
19
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
20
|
import { buildVisitedNonHyperLinkPayload, INPUT_METHOD } from '../../analytics';
|
|
19
21
|
import { cardMessages } from '../../messages';
|
|
20
|
-
const
|
|
22
|
+
const containerStylesOld = css({
|
|
21
23
|
position: 'relative'
|
|
22
24
|
});
|
|
23
|
-
const
|
|
25
|
+
const containerStyles = css({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
whiteSpace: 'nowrap'
|
|
28
|
+
});
|
|
29
|
+
const iconWrapperStylesOld = xcss({
|
|
24
30
|
display: 'inline-flex',
|
|
25
31
|
justifyContent: 'center',
|
|
26
32
|
alignItems: 'center',
|
|
27
33
|
height: '17px',
|
|
28
34
|
width: '17px'
|
|
29
35
|
});
|
|
36
|
+
const iconWrapperStyles = xcss({
|
|
37
|
+
display: 'inline-flex',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
alignItems: 'center'
|
|
40
|
+
});
|
|
30
41
|
const hiddenTextStyle = css({
|
|
31
42
|
overflow: 'hidden',
|
|
32
43
|
whiteSpace: 'nowrap',
|
|
33
44
|
position: 'absolute',
|
|
34
45
|
visibility: 'hidden'
|
|
35
46
|
});
|
|
36
|
-
const
|
|
47
|
+
const linkStylesCommon = xcss({
|
|
37
48
|
position: 'absolute',
|
|
38
49
|
left: 'space.025',
|
|
39
|
-
top: '-1px',
|
|
40
50
|
display: 'inline-flex',
|
|
41
51
|
alignItems: 'center',
|
|
42
52
|
verticalAlign: 'middle',
|
|
@@ -56,10 +66,31 @@ const linkStyles = xcss({
|
|
|
56
66
|
textDecoration: 'none'
|
|
57
67
|
}
|
|
58
68
|
});
|
|
69
|
+
const linkStylesOld = xcss({
|
|
70
|
+
top: '-1px'
|
|
71
|
+
});
|
|
72
|
+
const linkStylesHeightFix = xcss({
|
|
73
|
+
top: '0px',
|
|
74
|
+
height: '1.2em'
|
|
75
|
+
});
|
|
76
|
+
const linkStylesNewWithHeightFix = xcss({
|
|
77
|
+
top: '0px',
|
|
78
|
+
visibility: 'hidden',
|
|
79
|
+
height: '1.2em'
|
|
80
|
+
});
|
|
81
|
+
const linkStylesVisible = xcss({
|
|
82
|
+
visibility: 'visible'
|
|
83
|
+
});
|
|
84
|
+
const iconAndLabelStyles = xcss({
|
|
85
|
+
display: 'flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
height: '100%',
|
|
88
|
+
gap: 'space.025'
|
|
89
|
+
});
|
|
59
90
|
const MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
60
91
|
const ICON_WIDTH = 16;
|
|
61
92
|
const DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
62
|
-
|
|
93
|
+
const MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY = 30;
|
|
63
94
|
const visitCardLinkAnalytics = (editorAnalyticsApi, inputMethod) => (state, dispatch) => {
|
|
64
95
|
if (!(state.selection instanceof NodeSelection)) {
|
|
65
96
|
return false;
|
|
@@ -76,7 +107,7 @@ const visitCardLinkAnalytics = (editorAnalyticsApi, inputMethod) => (state, disp
|
|
|
76
107
|
}
|
|
77
108
|
return true;
|
|
78
109
|
};
|
|
79
|
-
const
|
|
110
|
+
const HoverLinkOverlayOriginal = ({
|
|
80
111
|
children,
|
|
81
112
|
isVisible = false,
|
|
82
113
|
url,
|
|
@@ -103,7 +134,6 @@ const HoverLinkOverlay = ({
|
|
|
103
134
|
}
|
|
104
135
|
const cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
105
136
|
const openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
106
|
-
|
|
107
137
|
// Get the hidden text width
|
|
108
138
|
if (!openTextWidthRef.current) {
|
|
109
139
|
const hiddenText = hiddenTextRef.current;
|
|
@@ -151,14 +181,14 @@ const HoverLinkOverlay = ({
|
|
|
151
181
|
sendVisitLinkAnalytics(INPUT_METHOD.BUTTON);
|
|
152
182
|
}
|
|
153
183
|
};
|
|
154
|
-
const
|
|
155
|
-
const label =
|
|
184
|
+
const isPreviewButton = showPanelButton && editorExperiment('platform_editor_preview_panel_linking_exp', true);
|
|
185
|
+
const label = isPreviewButton ? formatMessage(cardMessages.previewButtonTitle) : formatMessage(cardMessages.openButtonTitle);
|
|
156
186
|
let icon = null;
|
|
157
|
-
if (
|
|
187
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
158
188
|
icon = jsx(PanelRightIcon, {
|
|
159
189
|
label: ""
|
|
160
190
|
});
|
|
161
|
-
} else if (
|
|
191
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
162
192
|
icon = jsx(GrowDiagonalIcon, {
|
|
163
193
|
label: ""
|
|
164
194
|
});
|
|
@@ -171,7 +201,7 @@ const HoverLinkOverlay = ({
|
|
|
171
201
|
// eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
|
|
172
202
|
jsx("span", {
|
|
173
203
|
ref: containerRef,
|
|
174
|
-
css:
|
|
204
|
+
css: containerStylesOld,
|
|
175
205
|
onDoubleClick: handleDoubleClick
|
|
176
206
|
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
177
207
|
,
|
|
@@ -188,7 +218,7 @@ const HoverLinkOverlay = ({
|
|
|
188
218
|
maxLines: 1
|
|
189
219
|
}, label)), isHovered && jsx(Anchor, {
|
|
190
220
|
ref: hoverLinkButtonRef,
|
|
191
|
-
xcss:
|
|
221
|
+
xcss: [linkStylesCommon, expValEquals('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_changes_only') ? linkStylesHeightFix : linkStylesOld],
|
|
192
222
|
href: url,
|
|
193
223
|
target: "_blank",
|
|
194
224
|
style: {
|
|
@@ -197,7 +227,7 @@ const HoverLinkOverlay = ({
|
|
|
197
227
|
onClick: handleClick,
|
|
198
228
|
testId: "inline-card-hoverlink-overlay"
|
|
199
229
|
}, jsx(Box, {
|
|
200
|
-
xcss:
|
|
230
|
+
xcss: iconWrapperStylesOld,
|
|
201
231
|
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
202
232
|
testId: "inline-card-hoverlink-overlay-icon"
|
|
203
233
|
}, icon), showLabel && jsx(Text, {
|
|
@@ -208,4 +238,136 @@ const HoverLinkOverlay = ({
|
|
|
208
238
|
}, label)))
|
|
209
239
|
);
|
|
210
240
|
};
|
|
241
|
+
const HoverLinkOverlayNew = ({
|
|
242
|
+
children,
|
|
243
|
+
isVisible = false,
|
|
244
|
+
url,
|
|
245
|
+
compactPadding = false,
|
|
246
|
+
editorAnalyticsApi,
|
|
247
|
+
view,
|
|
248
|
+
onClick,
|
|
249
|
+
showPanelButton = false,
|
|
250
|
+
showPanelButtonIcon
|
|
251
|
+
}) => {
|
|
252
|
+
const {
|
|
253
|
+
formatMessage
|
|
254
|
+
} = useIntl();
|
|
255
|
+
const containerRef = useRef(null);
|
|
256
|
+
const iconRef = useRef(null);
|
|
257
|
+
const iconLeftRef = useRef(0);
|
|
258
|
+
const iconAndLabelRef = useRef(null);
|
|
259
|
+
const minMaxWidthRef = useRef();
|
|
260
|
+
const [showLabel, setShowLabel] = useState(false);
|
|
261
|
+
const [isHovered, setHovered] = useState(false);
|
|
262
|
+
const [showOverlay, setShowOverlay] = useState(false);
|
|
263
|
+
useLayoutEffect(() => {
|
|
264
|
+
if (!isVisible && !isHovered) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (!containerRef.current) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
if (iconRef.current && iconAndLabelRef.current) {
|
|
271
|
+
const iconRect = iconRef.current.getBoundingClientRect();
|
|
272
|
+
iconLeftRef.current = iconRect.left;
|
|
273
|
+
minMaxWidthRef.current = {
|
|
274
|
+
min: iconRect.width,
|
|
275
|
+
max: iconAndLabelRef.current.getBoundingClientRect().width
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
if (!iconLeftRef.current || !minMaxWidthRef.current) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
const containerDomRect = containerRef.current.getBoundingClientRect();
|
|
282
|
+
const containerStyles = getComputedStyle(containerRef.current);
|
|
283
|
+
const containerHeight = containerDomRect.height - parseFloat(containerStyles.paddingTop) - parseFloat(containerStyles.paddingBottom) - parseFloat(containerStyles.borderTopWidth) - parseFloat(containerStyles.borderBottomWidth);
|
|
284
|
+
const oneLine = parseFloat(containerStyles.lineHeight) >= containerHeight;
|
|
285
|
+
const firstLineWidth = containerDomRect.right - iconLeftRef.current;
|
|
286
|
+
|
|
287
|
+
// We don't want HoverLinkOverlay to cover the entire card if it is oneline. It allows the user to click on the card itself.
|
|
288
|
+
const reservedWidth = oneLine ? MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY : 0;
|
|
289
|
+
const availableWidth = firstLineWidth - reservedWidth;
|
|
290
|
+
|
|
291
|
+
// True when icon and label can be shown
|
|
292
|
+
setShowLabel(availableWidth >= minMaxWidthRef.current.max);
|
|
293
|
+
// True when at least an icon can be shown
|
|
294
|
+
setShowOverlay(availableWidth >= minMaxWidthRef.current.min);
|
|
295
|
+
}, [isVisible, isHovered]);
|
|
296
|
+
const handleOverlayChange = isHovered => {
|
|
297
|
+
setHovered(isHovered);
|
|
298
|
+
};
|
|
299
|
+
const sendVisitLinkAnalytics = inputMethod => {
|
|
300
|
+
if (editorAnalyticsApi && view) {
|
|
301
|
+
visitCardLinkAnalytics(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
const handleDoubleClick = () => {
|
|
305
|
+
if (!showPanelButton) {
|
|
306
|
+
sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
|
|
307
|
+
|
|
308
|
+
// Double click opens the link in a new tab
|
|
309
|
+
window.open(url, '_blank');
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
const handleClick = event => {
|
|
313
|
+
if (showPanelButton && onClick) {
|
|
314
|
+
onClick(event);
|
|
315
|
+
} else {
|
|
316
|
+
sendVisitLinkAnalytics(INPUT_METHOD.BUTTON);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const isPreviewButton = showPanelButton && editorExperiment('platform_editor_preview_panel_linking_exp', true);
|
|
320
|
+
const label = isPreviewButton ? formatMessage(cardMessages.previewButtonTitle) : formatMessage(cardMessages.openButtonTitle);
|
|
321
|
+
let icon = null;
|
|
322
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
323
|
+
icon = jsx(PanelRightIcon, {
|
|
324
|
+
label: ""
|
|
325
|
+
});
|
|
326
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
327
|
+
icon = jsx(GrowDiagonalIcon, {
|
|
328
|
+
label: ""
|
|
329
|
+
});
|
|
330
|
+
} else {
|
|
331
|
+
icon = jsx(LinkExternalIcon, {
|
|
332
|
+
label: ""
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
return jsx("span", {
|
|
336
|
+
ref: containerRef,
|
|
337
|
+
css: containerStyles,
|
|
338
|
+
onDoubleClick: handleDoubleClick,
|
|
339
|
+
onMouseEnter: () => handleOverlayChange(true),
|
|
340
|
+
onMouseLeave: () => handleOverlayChange(false),
|
|
341
|
+
role: "presentation" // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
342
|
+
,
|
|
343
|
+
onFocus: () => {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
344
|
+
,
|
|
345
|
+
onBlur: () => {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
346
|
+
}, isHovered && jsx(Anchor, {
|
|
347
|
+
xcss: [linkStylesCommon, linkStylesNewWithHeightFix, showOverlay && linkStylesVisible],
|
|
348
|
+
href: url,
|
|
349
|
+
target: "_blank",
|
|
350
|
+
style: {
|
|
351
|
+
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
352
|
+
},
|
|
353
|
+
onClick: handleClick,
|
|
354
|
+
testId: "inline-card-hoverlink-overlay"
|
|
355
|
+
}, jsx(Box, {
|
|
356
|
+
as: "span",
|
|
357
|
+
xcss: iconAndLabelStyles,
|
|
358
|
+
ref: iconAndLabelRef
|
|
359
|
+
}, jsx(Box, {
|
|
360
|
+
ref: iconRef,
|
|
361
|
+
as: "span",
|
|
362
|
+
xcss: iconWrapperStyles,
|
|
363
|
+
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
364
|
+
testId: "inline-card-hoverlink-overlay-icon"
|
|
365
|
+
}, icon), (showLabel || !minMaxWidthRef.current) && jsx(Text, {
|
|
366
|
+
size: "small",
|
|
367
|
+
color: "color.text.subtle",
|
|
368
|
+
maxLines: 1,
|
|
369
|
+
testId: "inline-card-hoverlink-overlay-label"
|
|
370
|
+
}, label))), children);
|
|
371
|
+
};
|
|
372
|
+
const HoverLinkOverlay = componentWithCondition(() => expValEquals('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_js_changes'), HoverLinkOverlayNew, HoverLinkOverlayOriginal);
|
|
211
373
|
export default HoverLinkOverlay;
|
|
@@ -85,16 +85,6 @@ export var messages = defineMessages({
|
|
|
85
85
|
defaultMessage: 'Display code with syntax highlighting',
|
|
86
86
|
description: 'Insert a snippet/segment of code (code block)'
|
|
87
87
|
},
|
|
88
|
-
plainTextCodeblock: {
|
|
89
|
-
id: 'fabric.editor.plainTextCodeblock',
|
|
90
|
-
defaultMessage: 'Plain text',
|
|
91
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
92
|
-
},
|
|
93
|
-
plainTextCodeblockDescription: {
|
|
94
|
-
id: 'fabric.editor.plainTextCodeblock.description',
|
|
95
|
-
defaultMessage: 'Insert code block for plain text',
|
|
96
|
-
description: 'Insert a snippet/segment of code block as plain text'
|
|
97
|
-
},
|
|
98
88
|
infoPanel: {
|
|
99
89
|
id: 'fabric.editor.infoPanel',
|
|
100
90
|
defaultMessage: 'Info panel',
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "110.
|
|
10
|
+
var packageVersion = "110.15.0";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "110.
|
|
24
|
+
var packageVersion = "110.15.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -13,31 +13,41 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
13
13
|
import GrowDiagonalIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
14
14
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
15
15
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
16
|
+
import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
|
|
16
17
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
17
18
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
19
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
21
|
import { buildVisitedNonHyperLinkPayload, INPUT_METHOD } from '../../analytics';
|
|
20
22
|
import { cardMessages } from '../../messages';
|
|
21
|
-
var
|
|
23
|
+
var containerStylesOld = css({
|
|
22
24
|
position: 'relative'
|
|
23
25
|
});
|
|
24
|
-
var
|
|
26
|
+
var containerStyles = css({
|
|
27
|
+
position: 'relative',
|
|
28
|
+
whiteSpace: 'nowrap'
|
|
29
|
+
});
|
|
30
|
+
var iconWrapperStylesOld = xcss({
|
|
25
31
|
display: 'inline-flex',
|
|
26
32
|
justifyContent: 'center',
|
|
27
33
|
alignItems: 'center',
|
|
28
34
|
height: '17px',
|
|
29
35
|
width: '17px'
|
|
30
36
|
});
|
|
37
|
+
var iconWrapperStyles = xcss({
|
|
38
|
+
display: 'inline-flex',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
alignItems: 'center'
|
|
41
|
+
});
|
|
31
42
|
var hiddenTextStyle = css({
|
|
32
43
|
overflow: 'hidden',
|
|
33
44
|
whiteSpace: 'nowrap',
|
|
34
45
|
position: 'absolute',
|
|
35
46
|
visibility: 'hidden'
|
|
36
47
|
});
|
|
37
|
-
var
|
|
48
|
+
var linkStylesCommon = xcss({
|
|
38
49
|
position: 'absolute',
|
|
39
50
|
left: 'space.025',
|
|
40
|
-
top: '-1px',
|
|
41
51
|
display: 'inline-flex',
|
|
42
52
|
alignItems: 'center',
|
|
43
53
|
verticalAlign: 'middle',
|
|
@@ -57,10 +67,31 @@ var linkStyles = xcss({
|
|
|
57
67
|
textDecoration: 'none'
|
|
58
68
|
}
|
|
59
69
|
});
|
|
70
|
+
var linkStylesOld = xcss({
|
|
71
|
+
top: '-1px'
|
|
72
|
+
});
|
|
73
|
+
var linkStylesHeightFix = xcss({
|
|
74
|
+
top: '0px',
|
|
75
|
+
height: '1.2em'
|
|
76
|
+
});
|
|
77
|
+
var linkStylesNewWithHeightFix = xcss({
|
|
78
|
+
top: '0px',
|
|
79
|
+
visibility: 'hidden',
|
|
80
|
+
height: '1.2em'
|
|
81
|
+
});
|
|
82
|
+
var linkStylesVisible = xcss({
|
|
83
|
+
visibility: 'visible'
|
|
84
|
+
});
|
|
85
|
+
var iconAndLabelStyles = xcss({
|
|
86
|
+
display: 'flex',
|
|
87
|
+
alignItems: 'center',
|
|
88
|
+
height: '100%',
|
|
89
|
+
gap: 'space.025'
|
|
90
|
+
});
|
|
60
91
|
var MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
61
92
|
var ICON_WIDTH = 16;
|
|
62
93
|
var DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
63
|
-
|
|
94
|
+
var MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY = 30;
|
|
64
95
|
var visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi, inputMethod) {
|
|
65
96
|
return function (state, dispatch) {
|
|
66
97
|
if (!(state.selection instanceof NodeSelection)) {
|
|
@@ -75,7 +106,7 @@ var visitCardLinkAnalytics = function visitCardLinkAnalytics(editorAnalyticsApi,
|
|
|
75
106
|
return true;
|
|
76
107
|
};
|
|
77
108
|
};
|
|
78
|
-
var
|
|
109
|
+
var HoverLinkOverlayOriginal = function HoverLinkOverlayOriginal(_ref) {
|
|
79
110
|
var children = _ref.children,
|
|
80
111
|
_ref$isVisible = _ref.isVisible,
|
|
81
112
|
isVisible = _ref$isVisible === void 0 ? false : _ref$isVisible,
|
|
@@ -109,7 +140,6 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
109
140
|
}
|
|
110
141
|
var cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
111
142
|
var openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
112
|
-
|
|
113
143
|
// Get the hidden text width
|
|
114
144
|
if (!openTextWidthRef.current) {
|
|
115
145
|
var hiddenText = hiddenTextRef.current;
|
|
@@ -157,14 +187,14 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
157
187
|
sendVisitLinkAnalytics(INPUT_METHOD.BUTTON);
|
|
158
188
|
}
|
|
159
189
|
};
|
|
160
|
-
var
|
|
161
|
-
var label =
|
|
190
|
+
var isPreviewButton = showPanelButton && editorExperiment('platform_editor_preview_panel_linking_exp', true);
|
|
191
|
+
var label = isPreviewButton ? formatMessage(cardMessages.previewButtonTitle) : formatMessage(cardMessages.openButtonTitle);
|
|
162
192
|
var icon = null;
|
|
163
|
-
if (
|
|
193
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
164
194
|
icon = jsx(PanelRightIcon, {
|
|
165
195
|
label: ""
|
|
166
196
|
});
|
|
167
|
-
} else if (
|
|
197
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
168
198
|
icon = jsx(GrowDiagonalIcon, {
|
|
169
199
|
label: ""
|
|
170
200
|
});
|
|
@@ -177,7 +207,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
177
207
|
// eslint-disable-next-line @atlassian/a11y/no-static-element-interactions
|
|
178
208
|
jsx("span", {
|
|
179
209
|
ref: containerRef,
|
|
180
|
-
css:
|
|
210
|
+
css: containerStylesOld,
|
|
181
211
|
onDoubleClick: handleDoubleClick
|
|
182
212
|
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
183
213
|
,
|
|
@@ -198,7 +228,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
198
228
|
maxLines: 1
|
|
199
229
|
}, label)), isHovered && jsx(Anchor, {
|
|
200
230
|
ref: hoverLinkButtonRef,
|
|
201
|
-
xcss:
|
|
231
|
+
xcss: [linkStylesCommon, expValEquals('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_changes_only') ? linkStylesHeightFix : linkStylesOld],
|
|
202
232
|
href: url,
|
|
203
233
|
target: "_blank",
|
|
204
234
|
style: {
|
|
@@ -207,7 +237,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
207
237
|
onClick: handleClick,
|
|
208
238
|
testId: "inline-card-hoverlink-overlay"
|
|
209
239
|
}, jsx(Box, {
|
|
210
|
-
xcss:
|
|
240
|
+
xcss: iconWrapperStylesOld,
|
|
211
241
|
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
212
242
|
testId: "inline-card-hoverlink-overlay-icon"
|
|
213
243
|
}, icon), showLabel && jsx(Text, {
|
|
@@ -218,4 +248,152 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
218
248
|
}, label)))
|
|
219
249
|
);
|
|
220
250
|
};
|
|
251
|
+
var HoverLinkOverlayNew = function HoverLinkOverlayNew(_ref2) {
|
|
252
|
+
var children = _ref2.children,
|
|
253
|
+
_ref2$isVisible = _ref2.isVisible,
|
|
254
|
+
isVisible = _ref2$isVisible === void 0 ? false : _ref2$isVisible,
|
|
255
|
+
url = _ref2.url,
|
|
256
|
+
_ref2$compactPadding = _ref2.compactPadding,
|
|
257
|
+
compactPadding = _ref2$compactPadding === void 0 ? false : _ref2$compactPadding,
|
|
258
|
+
editorAnalyticsApi = _ref2.editorAnalyticsApi,
|
|
259
|
+
view = _ref2.view,
|
|
260
|
+
onClick = _ref2.onClick,
|
|
261
|
+
_ref2$showPanelButton = _ref2.showPanelButton,
|
|
262
|
+
showPanelButton = _ref2$showPanelButton === void 0 ? false : _ref2$showPanelButton,
|
|
263
|
+
showPanelButtonIcon = _ref2.showPanelButtonIcon;
|
|
264
|
+
var _useIntl2 = useIntl(),
|
|
265
|
+
formatMessage = _useIntl2.formatMessage;
|
|
266
|
+
var containerRef = useRef(null);
|
|
267
|
+
var iconRef = useRef(null);
|
|
268
|
+
var iconLeftRef = useRef(0);
|
|
269
|
+
var iconAndLabelRef = useRef(null);
|
|
270
|
+
var minMaxWidthRef = useRef();
|
|
271
|
+
var _useState5 = useState(false),
|
|
272
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
273
|
+
showLabel = _useState6[0],
|
|
274
|
+
setShowLabel = _useState6[1];
|
|
275
|
+
var _useState7 = useState(false),
|
|
276
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
277
|
+
isHovered = _useState8[0],
|
|
278
|
+
setHovered = _useState8[1];
|
|
279
|
+
var _useState9 = useState(false),
|
|
280
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
281
|
+
showOverlay = _useState0[0],
|
|
282
|
+
setShowOverlay = _useState0[1];
|
|
283
|
+
useLayoutEffect(function () {
|
|
284
|
+
if (!isVisible && !isHovered) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (!containerRef.current) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (iconRef.current && iconAndLabelRef.current) {
|
|
291
|
+
var iconRect = iconRef.current.getBoundingClientRect();
|
|
292
|
+
iconLeftRef.current = iconRect.left;
|
|
293
|
+
minMaxWidthRef.current = {
|
|
294
|
+
min: iconRect.width,
|
|
295
|
+
max: iconAndLabelRef.current.getBoundingClientRect().width
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
if (!iconLeftRef.current || !minMaxWidthRef.current) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
var containerDomRect = containerRef.current.getBoundingClientRect();
|
|
302
|
+
var containerStyles = getComputedStyle(containerRef.current);
|
|
303
|
+
var containerHeight = containerDomRect.height - parseFloat(containerStyles.paddingTop) - parseFloat(containerStyles.paddingBottom) - parseFloat(containerStyles.borderTopWidth) - parseFloat(containerStyles.borderBottomWidth);
|
|
304
|
+
var oneLine = parseFloat(containerStyles.lineHeight) >= containerHeight;
|
|
305
|
+
var firstLineWidth = containerDomRect.right - iconLeftRef.current;
|
|
306
|
+
|
|
307
|
+
// We don't want HoverLinkOverlay to cover the entire card if it is oneline. It allows the user to click on the card itself.
|
|
308
|
+
var reservedWidth = oneLine ? MIN_CARD_WIDTH_NOT_COVERED_BY_OVERLAY : 0;
|
|
309
|
+
var availableWidth = firstLineWidth - reservedWidth;
|
|
310
|
+
|
|
311
|
+
// True when icon and label can be shown
|
|
312
|
+
setShowLabel(availableWidth >= minMaxWidthRef.current.max);
|
|
313
|
+
// True when at least an icon can be shown
|
|
314
|
+
setShowOverlay(availableWidth >= minMaxWidthRef.current.min);
|
|
315
|
+
}, [isVisible, isHovered]);
|
|
316
|
+
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
317
|
+
setHovered(isHovered);
|
|
318
|
+
};
|
|
319
|
+
var sendVisitLinkAnalytics = function sendVisitLinkAnalytics(inputMethod) {
|
|
320
|
+
if (editorAnalyticsApi && view) {
|
|
321
|
+
visitCardLinkAnalytics(editorAnalyticsApi, inputMethod)(view.state, view.dispatch);
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
var handleDoubleClick = function handleDoubleClick() {
|
|
325
|
+
if (!showPanelButton) {
|
|
326
|
+
sendVisitLinkAnalytics(INPUT_METHOD.DOUBLE_CLICK);
|
|
327
|
+
|
|
328
|
+
// Double click opens the link in a new tab
|
|
329
|
+
window.open(url, '_blank');
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
var handleClick = function handleClick(event) {
|
|
333
|
+
if (showPanelButton && onClick) {
|
|
334
|
+
onClick(event);
|
|
335
|
+
} else {
|
|
336
|
+
sendVisitLinkAnalytics(INPUT_METHOD.BUTTON);
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
var isPreviewButton = showPanelButton && editorExperiment('platform_editor_preview_panel_linking_exp', true);
|
|
340
|
+
var label = isPreviewButton ? formatMessage(cardMessages.previewButtonTitle) : formatMessage(cardMessages.openButtonTitle);
|
|
341
|
+
var icon = null;
|
|
342
|
+
if (isPreviewButton && showPanelButtonIcon === 'panel') {
|
|
343
|
+
icon = jsx(PanelRightIcon, {
|
|
344
|
+
label: ""
|
|
345
|
+
});
|
|
346
|
+
} else if (isPreviewButton && showPanelButtonIcon === 'modal') {
|
|
347
|
+
icon = jsx(GrowDiagonalIcon, {
|
|
348
|
+
label: ""
|
|
349
|
+
});
|
|
350
|
+
} else {
|
|
351
|
+
icon = jsx(LinkExternalIcon, {
|
|
352
|
+
label: ""
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return jsx("span", {
|
|
356
|
+
ref: containerRef,
|
|
357
|
+
css: containerStyles,
|
|
358
|
+
onDoubleClick: handleDoubleClick,
|
|
359
|
+
onMouseEnter: function onMouseEnter() {
|
|
360
|
+
return handleOverlayChange(true);
|
|
361
|
+
},
|
|
362
|
+
onMouseLeave: function onMouseLeave() {
|
|
363
|
+
return handleOverlayChange(false);
|
|
364
|
+
},
|
|
365
|
+
role: "presentation" // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
366
|
+
,
|
|
367
|
+
onFocus: function onFocus() {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
368
|
+
,
|
|
369
|
+
onBlur: function onBlur() {} // remove as part of platform_editor_hoverlink_ui_fixes_exp cleanup
|
|
370
|
+
}, isHovered && jsx(Anchor, {
|
|
371
|
+
xcss: [linkStylesCommon, linkStylesNewWithHeightFix, showOverlay && linkStylesVisible],
|
|
372
|
+
href: url,
|
|
373
|
+
target: "_blank",
|
|
374
|
+
style: {
|
|
375
|
+
paddingBlock: compactPadding ? '1px' : "var(--ds-space-025, 2px)"
|
|
376
|
+
},
|
|
377
|
+
onClick: handleClick,
|
|
378
|
+
testId: "inline-card-hoverlink-overlay"
|
|
379
|
+
}, jsx(Box, {
|
|
380
|
+
as: "span",
|
|
381
|
+
xcss: iconAndLabelStyles,
|
|
382
|
+
ref: iconAndLabelRef
|
|
383
|
+
}, jsx(Box, {
|
|
384
|
+
ref: iconRef,
|
|
385
|
+
as: "span",
|
|
386
|
+
xcss: iconWrapperStyles,
|
|
387
|
+
"data-inlinecard-button-overlay": "icon-wrapper-line-height",
|
|
388
|
+
testId: "inline-card-hoverlink-overlay-icon"
|
|
389
|
+
}, icon), (showLabel || !minMaxWidthRef.current) && jsx(Text, {
|
|
390
|
+
size: "small",
|
|
391
|
+
color: "color.text.subtle",
|
|
392
|
+
maxLines: 1,
|
|
393
|
+
testId: "inline-card-hoverlink-overlay-label"
|
|
394
|
+
}, label))), children);
|
|
395
|
+
};
|
|
396
|
+
var HoverLinkOverlay = componentWithCondition(function () {
|
|
397
|
+
return expValEquals('platform_editor_hoverlink_ui_fixes_exp', 'cohort', 'css_js_changes');
|
|
398
|
+
}, HoverLinkOverlayNew, HoverLinkOverlayOriginal);
|
|
221
399
|
export default HoverLinkOverlay;
|
|
@@ -42,7 +42,6 @@ type InsertPanelAEP = InsertAEP<ACTION_SUBJECT_ID.PANEL, {
|
|
|
42
42
|
}, undefined>;
|
|
43
43
|
type InsertCodeBlockAEP = InsertAEP<ACTION_SUBJECT_ID.CODE_BLOCK, {
|
|
44
44
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.INSERT_MENU;
|
|
45
|
-
language?: string;
|
|
46
45
|
}, undefined>;
|
|
47
46
|
type InsertTableAEP = InsertAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
48
47
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.PICKER | INPUT_METHOD.SHORTCUT;
|
|
@@ -84,16 +84,6 @@ export declare const messages: {
|
|
|
84
84
|
defaultMessage: string;
|
|
85
85
|
description: string;
|
|
86
86
|
};
|
|
87
|
-
plainTextCodeblock: {
|
|
88
|
-
id: string;
|
|
89
|
-
defaultMessage: string;
|
|
90
|
-
description: string;
|
|
91
|
-
};
|
|
92
|
-
plainTextCodeblockDescription: {
|
|
93
|
-
id: string;
|
|
94
|
-
defaultMessage: string;
|
|
95
|
-
description: string;
|
|
96
|
-
};
|
|
97
87
|
infoPanel: {
|
|
98
88
|
id: string;
|
|
99
89
|
defaultMessage: string;
|
|
@@ -5,7 +5,7 @@ import type { TypeAheadItem } from '../types/type-ahead';
|
|
|
5
5
|
export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
|
|
6
6
|
selectInlineNode?: boolean;
|
|
7
7
|
}) => Transaction;
|
|
8
|
-
export type QuickInsertItemId = 'hyperlink' | 'table' | 'helpdialog' | 'date' | 'media' | 'media-insert' | 'blockquote' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'codeblock' | 'unorderedList' | 'feedbackdialog' | 'orderedList' | 'rule' | 'status' | 'mention' | 'emoji' | 'action' | 'decision' | 'infopanel' | 'notepanel' | 'successpanel' | 'warningpanel' | 'errorpanel' | 'custompanel' | 'layout' | 'expand' | 'placeholderText' | 'datasource' | 'loom' | 'onecolumnlayout' | 'twocolumnslayout' | 'threecolumnslayout' | 'fourcolumnslayout' | 'fivecolumnslayout' | 'syncBlock'
|
|
8
|
+
export type QuickInsertItemId = 'hyperlink' | 'table' | 'helpdialog' | 'date' | 'media' | 'media-insert' | 'blockquote' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'codeblock' | 'unorderedList' | 'feedbackdialog' | 'orderedList' | 'rule' | 'status' | 'mention' | 'emoji' | 'action' | 'decision' | 'infopanel' | 'notepanel' | 'successpanel' | 'warningpanel' | 'errorpanel' | 'custompanel' | 'layout' | 'expand' | 'placeholderText' | 'datasource' | 'loom' | 'onecolumnlayout' | 'twocolumnslayout' | 'threecolumnslayout' | 'fourcolumnslayout' | 'fivecolumnslayout' | 'syncBlock';
|
|
9
9
|
export type QuickInsertItem = TypeAheadItem & {
|
|
10
10
|
/**
|
|
11
11
|
* What to do on insert
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type EditorAppearance = 'comment' | 'full-page' | 'full-width' | 'chromeless';
|
|
2
|
-
export type EditorContentMode = 'standard' | 'dense';
|
|
2
|
+
export type EditorContentMode = 'standard' | 'dense' | 'compact';
|
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { type EditorAnalyticsAPI } from '../../analytics';
|
|
7
|
+
declare const HoverLinkOverlay: React.FC<React.HTMLAttributes<HTMLSpanElement> & {
|
|
8
|
+
compactPadding?: boolean;
|
|
9
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
10
|
+
isVisible?: boolean;
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
12
|
+
showPanelButton?: boolean;
|
|
13
|
+
showPanelButtonIcon?: "panel" | "modal";
|
|
14
|
+
url: string;
|
|
15
|
+
view?: import("prosemirror-view").EditorView;
|
|
16
|
+
} & {
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
}>;
|
|
9
19
|
export default HoverLinkOverlay;
|
|
@@ -42,7 +42,6 @@ type InsertPanelAEP = InsertAEP<ACTION_SUBJECT_ID.PANEL, {
|
|
|
42
42
|
}, undefined>;
|
|
43
43
|
type InsertCodeBlockAEP = InsertAEP<ACTION_SUBJECT_ID.CODE_BLOCK, {
|
|
44
44
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.INSERT_MENU;
|
|
45
|
-
language?: string;
|
|
46
45
|
}, undefined>;
|
|
47
46
|
type InsertTableAEP = InsertAEP<ACTION_SUBJECT_ID.TABLE, {
|
|
48
47
|
inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.FORMATTING | INPUT_METHOD.PICKER | INPUT_METHOD.SHORTCUT;
|
|
@@ -84,16 +84,6 @@ export declare const messages: {
|
|
|
84
84
|
defaultMessage: string;
|
|
85
85
|
description: string;
|
|
86
86
|
};
|
|
87
|
-
plainTextCodeblock: {
|
|
88
|
-
id: string;
|
|
89
|
-
defaultMessage: string;
|
|
90
|
-
description: string;
|
|
91
|
-
};
|
|
92
|
-
plainTextCodeblockDescription: {
|
|
93
|
-
id: string;
|
|
94
|
-
defaultMessage: string;
|
|
95
|
-
description: string;
|
|
96
|
-
};
|
|
97
87
|
infoPanel: {
|
|
98
88
|
id: string;
|
|
99
89
|
defaultMessage: string;
|
|
@@ -5,7 +5,7 @@ import type { TypeAheadItem } from '../types/type-ahead';
|
|
|
5
5
|
export type QuickInsertActionInsert = (node?: Node | Record<string, any> | string, opts?: {
|
|
6
6
|
selectInlineNode?: boolean;
|
|
7
7
|
}) => Transaction;
|
|
8
|
-
export type QuickInsertItemId = 'hyperlink' | 'table' | 'helpdialog' | 'date' | 'media' | 'media-insert' | 'blockquote' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'codeblock' | 'unorderedList' | 'feedbackdialog' | 'orderedList' | 'rule' | 'status' | 'mention' | 'emoji' | 'action' | 'decision' | 'infopanel' | 'notepanel' | 'successpanel' | 'warningpanel' | 'errorpanel' | 'custompanel' | 'layout' | 'expand' | 'placeholderText' | 'datasource' | 'loom' | 'onecolumnlayout' | 'twocolumnslayout' | 'threecolumnslayout' | 'fourcolumnslayout' | 'fivecolumnslayout' | 'syncBlock'
|
|
8
|
+
export type QuickInsertItemId = 'hyperlink' | 'table' | 'helpdialog' | 'date' | 'media' | 'media-insert' | 'blockquote' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'codeblock' | 'unorderedList' | 'feedbackdialog' | 'orderedList' | 'rule' | 'status' | 'mention' | 'emoji' | 'action' | 'decision' | 'infopanel' | 'notepanel' | 'successpanel' | 'warningpanel' | 'errorpanel' | 'custompanel' | 'layout' | 'expand' | 'placeholderText' | 'datasource' | 'loom' | 'onecolumnlayout' | 'twocolumnslayout' | 'threecolumnslayout' | 'fourcolumnslayout' | 'fivecolumnslayout' | 'syncBlock';
|
|
9
9
|
export type QuickInsertItem = TypeAheadItem & {
|
|
10
10
|
/**
|
|
11
11
|
* What to do on insert
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type EditorAppearance = 'comment' | 'full-page' | 'full-width' | 'chromeless';
|
|
2
|
-
export type EditorContentMode = 'standard' | 'dense';
|
|
2
|
+
export type EditorContentMode = 'standard' | 'dense' | 'compact';
|
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { type EditorAnalyticsAPI } from '../../analytics';
|
|
7
|
+
declare const HoverLinkOverlay: React.FC<React.HTMLAttributes<HTMLSpanElement> & {
|
|
8
|
+
compactPadding?: boolean;
|
|
9
|
+
editorAnalyticsApi?: EditorAnalyticsAPI;
|
|
10
|
+
isVisible?: boolean;
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
12
|
+
showPanelButton?: boolean;
|
|
13
|
+
showPanelButtonIcon?: "panel" | "modal";
|
|
14
|
+
url: string;
|
|
15
|
+
view?: import("prosemirror-view").EditorView;
|
|
16
|
+
} & {
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
}>;
|
|
9
19
|
export default HoverLinkOverlay;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.
|
|
3
|
+
"version": "110.15.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@atlaskit/task-decision": "^19.2.0",
|
|
83
83
|
"@atlaskit/textfield": "^8.0.0",
|
|
84
84
|
"@atlaskit/theme": "^21.0.0",
|
|
85
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
85
|
+
"@atlaskit/tmp-editor-statsig": "^13.15.0",
|
|
86
86
|
"@atlaskit/tokens": "^7.0.0",
|
|
87
87
|
"@atlaskit/tooltip": "^20.6.0",
|
|
88
88
|
"@atlaskit/width-detector": "^5.0.0",
|