@atlaskit/renderer 107.1.0 → 107.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/cjs/analytics/enums.js +61 -1
- package/dist/cjs/react/index.js +10 -1
- package/dist/cjs/react/nodes/blockCard.js +6 -2
- package/dist/cjs/react/nodes/codeBlock/codeBlock.js +18 -6
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockButtonContainer.js +67 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +15 -8
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockCopyButton.js +71 -0
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockWrapButton.js +76 -0
- package/dist/cjs/react/nodes/codeBlock/windowedCodeBlock.js +13 -2
- package/dist/cjs/react/nodes/inlineCard.js +5 -2
- package/dist/cjs/react/nodes/media.js +18 -1
- package/dist/cjs/react/nodes/mediaInline.js +19 -4
- package/dist/cjs/react/nodes/tableCell.js +6 -1
- package/dist/cjs/ui/Renderer/index.js +5 -1
- package/dist/cjs/ui/Renderer/style.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +55 -1
- package/dist/es2019/react/index.js +7 -1
- package/dist/es2019/react/nodes/blockCard.js +7 -2
- package/dist/es2019/react/nodes/codeBlock/codeBlock.js +10 -3
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockButtonContainer.js +59 -0
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +25 -8
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockCopyButton.js +52 -0
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockWrapButton.js +67 -0
- package/dist/es2019/react/nodes/codeBlock/windowedCodeBlock.js +9 -4
- package/dist/es2019/react/nodes/inlineCard.js +5 -2
- package/dist/es2019/react/nodes/media.js +18 -1
- package/dist/es2019/react/nodes/mediaInline.js +19 -4
- package/dist/es2019/react/nodes/tableCell.js +6 -1
- package/dist/es2019/ui/Renderer/index.js +5 -1
- package/dist/es2019/ui/Renderer/style.js +9 -11
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +55 -1
- package/dist/esm/react/index.js +10 -1
- package/dist/esm/react/nodes/blockCard.js +6 -2
- package/dist/esm/react/nodes/codeBlock/codeBlock.js +15 -3
- package/dist/esm/react/nodes/codeBlock/components/codeBlockButtonContainer.js +58 -0
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +15 -9
- package/dist/esm/react/nodes/codeBlock/components/codeBlockCopyButton.js +59 -0
- package/dist/esm/react/nodes/codeBlock/components/codeBlockWrapButton.js +67 -0
- package/dist/esm/react/nodes/codeBlock/windowedCodeBlock.js +14 -4
- package/dist/esm/react/nodes/inlineCard.js +5 -2
- package/dist/esm/react/nodes/media.js +18 -1
- package/dist/esm/react/nodes/mediaInline.js +19 -4
- package/dist/esm/react/nodes/tableCell.js +6 -1
- package/dist/esm/ui/Renderer/index.js +5 -1
- package/dist/esm/ui/Renderer/style.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +51 -0
- package/dist/types/analytics/events.d.ts +5 -1
- package/dist/types/react/index.d.ts +2 -0
- package/dist/types/react/nodes/blockCard.d.ts +2 -0
- package/dist/types/react/nodes/codeBlock/codeBlock.d.ts +1 -0
- package/dist/types/react/nodes/codeBlock/components/codeBlockButtonContainer.d.ts +12 -0
- package/dist/types/react/nodes/codeBlock/components/codeBlockContainer.d.ts +5 -7
- package/dist/types/react/nodes/codeBlock/components/codeBlockWrapButton.d.ts +11 -0
- package/dist/types/react/nodes/codeBlock/windowedCodeBlock.d.ts +1 -1
- package/dist/types/react/nodes/index.d.ts +1 -0
- package/dist/types/react/nodes/media.d.ts +3 -2
- package/dist/types/react/nodes/mediaInline.d.ts +6 -0
- package/dist/types/react/types.d.ts +1 -0
- package/dist/types/types/smartLinksOptions.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +1 -0
- package/package.json +20 -20
- package/report.api.md +21 -2
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +0 -64
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +0 -86
- package/dist/esm/react/nodes/codeBlockCopyButton.js +0 -54
- /package/dist/types/react/nodes/{codeBlockCopyButton.d.ts → codeBlock/components/codeBlockCopyButton.d.ts} +0 -0
|
@@ -15,6 +15,7 @@ import { jsx } from '@emotion/react';
|
|
|
15
15
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
16
16
|
import { mediaLinkStyle } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { MediaCard } from '../../ui/MediaCard';
|
|
18
|
+
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
|
18
19
|
import { getEventHandler } from '../../utils';
|
|
19
20
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
20
21
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
@@ -29,6 +30,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
29
30
|
}
|
|
30
31
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
32
|
_defineProperty(_assertThisInitialized(_this), "renderCard", function () {
|
|
33
|
+
var _borderMark$attrs$col, _borderMark$attrs$siz;
|
|
32
34
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33
35
|
var mediaProvider = providers.mediaProvider,
|
|
34
36
|
contextIdentifierProvider = providers.contextIdentifierProvider;
|
|
@@ -39,6 +41,9 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
39
41
|
allowMediaViewer = _this$props.shouldOpenMediaViewer,
|
|
40
42
|
enableDownloadButton = _this$props.enableDownloadButton,
|
|
41
43
|
ssr = _this$props.ssr;
|
|
44
|
+
var borderMark = _this.props.marks.find(_this.props.isBorderMark);
|
|
45
|
+
var borderColor = (_borderMark$attrs$col = borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.color) !== null && _borderMark$attrs$col !== void 0 ? _borderMark$attrs$col : '';
|
|
46
|
+
var borderWidth = (_borderMark$attrs$siz = borderMark === null || borderMark === void 0 ? void 0 : borderMark.attrs.size) !== null && _borderMark$attrs$siz !== void 0 ? _borderMark$attrs$siz : 0;
|
|
42
47
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
43
48
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
44
49
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
@@ -54,13 +59,25 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
54
59
|
shouldEnableDownloadButton: enableDownloadButton,
|
|
55
60
|
ssr: ssr
|
|
56
61
|
}));
|
|
62
|
+
var paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
|
|
63
|
+
var mediaComponentWithBorder = borderMark ? jsx("div", {
|
|
64
|
+
"data-mark-type": "border",
|
|
65
|
+
"data-color": borderColor,
|
|
66
|
+
"data-size": borderWidth,
|
|
67
|
+
style: {
|
|
68
|
+
borderColor: paletteColorValue,
|
|
69
|
+
borderWidth: "".concat(borderWidth, "px"),
|
|
70
|
+
borderStyle: 'solid',
|
|
71
|
+
borderRadius: "".concat(borderWidth * 2, "px")
|
|
72
|
+
}
|
|
73
|
+
}, mediaComponent) : mediaComponent;
|
|
57
74
|
return linkHref ? jsx("a", {
|
|
58
75
|
href: linkHref,
|
|
59
76
|
rel: "noreferrer noopener",
|
|
60
77
|
onClick: _this.handleMediaLinkClick,
|
|
61
78
|
"data-block-link": linkHref,
|
|
62
79
|
css: mediaLinkStyle
|
|
63
|
-
},
|
|
80
|
+
}, mediaComponentWithBorder) : mediaComponentWithBorder;
|
|
64
81
|
});
|
|
65
82
|
_defineProperty(_assertThisInitialized(_this), "handleMediaLinkClick", function (event) {
|
|
66
83
|
var _this$props2 = _this.props,
|
|
@@ -9,7 +9,8 @@ import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
|
9
9
|
import { getClipboardAttrs } from '../../ui/MediaCard';
|
|
10
10
|
import { createIntl, injectIntl } from 'react-intl-next';
|
|
11
11
|
export var RenderMediaInline = function RenderMediaInline(props) {
|
|
12
|
-
var mediaProvider = props.mediaProvider
|
|
12
|
+
var mediaProvider = props.mediaProvider,
|
|
13
|
+
rendererAppearance = props.rendererAppearance;
|
|
13
14
|
var _useState = useState(),
|
|
14
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15
16
|
viewMediaClientConfigState = _useState2[0],
|
|
@@ -55,9 +56,20 @@ export var RenderMediaInline = function RenderMediaInline(props) {
|
|
|
55
56
|
isSelected: false
|
|
56
57
|
});
|
|
57
58
|
}
|
|
59
|
+
var handleMediaInlineClick = function handleMediaInlineClick(result) {
|
|
60
|
+
var _props$eventHandlers, _props$eventHandlers$;
|
|
61
|
+
if ((_props$eventHandlers = props.eventHandlers) !== null && _props$eventHandlers !== void 0 && (_props$eventHandlers$ = _props$eventHandlers.media) !== null && _props$eventHandlers$ !== void 0 && _props$eventHandlers$.onClick) {
|
|
62
|
+
var _props$eventHandlers2, _props$eventHandlers3;
|
|
63
|
+
(_props$eventHandlers2 = props.eventHandlers) === null || _props$eventHandlers2 === void 0 ? void 0 : (_props$eventHandlers3 = _props$eventHandlers2.media) === null || _props$eventHandlers3 === void 0 ? void 0 : _props$eventHandlers3.onClick(result);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var shouldOpenMediaViewer = rendererAppearance !== 'mobile';
|
|
67
|
+
var shouldDisplayToolTip = rendererAppearance !== 'mobile';
|
|
58
68
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
59
69
|
identifier: props.identifier,
|
|
60
|
-
|
|
70
|
+
onClick: handleMediaInlineClick,
|
|
71
|
+
shouldOpenMediaViewer: shouldOpenMediaViewer,
|
|
72
|
+
shouldDisplayToolTip: shouldDisplayToolTip,
|
|
61
73
|
mediaClientConfig: viewMediaClientConfigState
|
|
62
74
|
});
|
|
63
75
|
};
|
|
@@ -65,7 +77,8 @@ var MediaInline = function MediaInline(props) {
|
|
|
65
77
|
var collection = props.collection,
|
|
66
78
|
id = props.id,
|
|
67
79
|
providers = props.providers,
|
|
68
|
-
intl = props.intl
|
|
80
|
+
intl = props.intl,
|
|
81
|
+
rendererAppearance = props.rendererAppearance;
|
|
69
82
|
var identifier = {
|
|
70
83
|
id: id,
|
|
71
84
|
mediaItemType: 'file',
|
|
@@ -91,7 +104,9 @@ var MediaInline = function MediaInline(props) {
|
|
|
91
104
|
}
|
|
92
105
|
return /*#__PURE__*/React.createElement(RenderMediaInline, {
|
|
93
106
|
identifier: identifier,
|
|
94
|
-
mediaProvider: mediaProvider
|
|
107
|
+
mediaProvider: mediaProvider,
|
|
108
|
+
eventHandlers: props.eventHandlers,
|
|
109
|
+
rendererAppearance: rendererAppearance
|
|
95
110
|
});
|
|
96
111
|
}
|
|
97
112
|
}));
|
|
@@ -12,6 +12,8 @@ import React from 'react';
|
|
|
12
12
|
import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
|
|
13
13
|
import { compose } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
15
|
+
import { hexToEditorBackgroundPaletteColorTokenName } from '@atlaskit/editor-palette';
|
|
16
|
+
import { getTokenValue } from '@atlaskit/tokens';
|
|
15
17
|
import SortingIcon from '../../ui/SortingIcon';
|
|
16
18
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
17
19
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
@@ -74,7 +76,10 @@ var getStyle = function getStyle(background, colGroupWidth, offsetTop) {
|
|
|
74
76
|
if (background &&
|
|
75
77
|
// ignore setting inline styles if ds neutral token is detected
|
|
76
78
|
!background.includes('--ds-background-neutral')) {
|
|
77
|
-
|
|
79
|
+
var tokenName = hexToEditorBackgroundPaletteColorTokenName(background);
|
|
80
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
81
|
+
var tokenColor = tokenName ? getTokenValue(tokenName) : background;
|
|
82
|
+
style.backgroundColor = tokenColor;
|
|
78
83
|
}
|
|
79
84
|
if (colGroupWidth) {
|
|
80
85
|
style.width = colGroupWidth;
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "107.
|
|
48
|
+
var packageVersion = "107.3.0";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
|
@@ -257,6 +257,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
257
257
|
emojiResourceConfig: props.emojiResourceConfig,
|
|
258
258
|
smartLinks: props.smartLinks,
|
|
259
259
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
260
|
+
allowWrapCodeBlock: props.allowWrapCodeBlock,
|
|
260
261
|
allowCustomPanels: props.allowCustomPanels,
|
|
261
262
|
allowAnnotations: props.allowAnnotations,
|
|
262
263
|
allowSelectAllTrap: props.allowSelectAllTrap,
|
|
@@ -284,6 +285,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
284
285
|
allowPlaceholderText = _this$props.allowPlaceholderText,
|
|
285
286
|
allowColumnSorting = _this$props.allowColumnSorting,
|
|
286
287
|
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
288
|
+
allowWrapCodeBlock = _this$props.allowWrapCodeBlock,
|
|
287
289
|
allowCustomPanels = _this$props.allowCustomPanels;
|
|
288
290
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
289
291
|
/**
|
|
@@ -356,6 +358,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
356
358
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
357
359
|
allowColumnSorting: allowColumnSorting,
|
|
358
360
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
361
|
+
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
359
362
|
allowCustomPanels: allowCustomPanels,
|
|
360
363
|
allowPlaceholderText: allowPlaceholderText,
|
|
361
364
|
innerRef: this.editorRef,
|
|
@@ -386,6 +389,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
386
389
|
return jsx(RendererWrapper, {
|
|
387
390
|
appearance: appearance,
|
|
388
391
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
392
|
+
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
389
393
|
allowPlaceholderText: allowPlaceholderText,
|
|
390
394
|
allowColumnSorting: allowColumnSorting,
|
|
391
395
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
@@ -80,7 +80,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
80
80
|
var themeProps = {
|
|
81
81
|
theme: theme
|
|
82
82
|
};
|
|
83
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n
|
|
83
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), editorFontSize(themeProps), themed({
|
|
84
84
|
light: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
85
85
|
dark: "var(--ds-text, #B8C7E0)"
|
|
86
86
|
})(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
@@ -116,6 +116,6 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
116
116
|
})(themeProps), themed({
|
|
117
117
|
light: "var(--ds-border, ".concat(akEditorTableToolbar, ")"),
|
|
118
118
|
dark: "var(--ds-border, ".concat(akEditorTableToolbarDark, ")")
|
|
119
|
-
})(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
|
|
119
|
+
})(themeProps), borderRadius(), blockNodesVerticalMargin, getLightWeightCodeBlockStylesForRootRendererStyleSheet(), columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth, blockNodesVerticalMargin, blockNodesVerticalMargin, blockNodesVerticalMargin, browser.safari ? codeBlockInListSafariFix : '');
|
|
120
120
|
};
|
|
121
121
|
};
|
package/dist/esm/version.json
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
+
export declare enum EVENT_TYPE {
|
|
2
|
+
OPERATIONAL = "operational",
|
|
3
|
+
SCREEN = "screen",
|
|
4
|
+
TRACK = "track",
|
|
5
|
+
UI = "ui"
|
|
6
|
+
}
|
|
7
|
+
export declare enum ACTION {
|
|
8
|
+
STARTED = "started",
|
|
9
|
+
RENDERED = "rendered",
|
|
10
|
+
RE_RENDERED = "reRendered",
|
|
11
|
+
RENDERER_TTI = "tti",
|
|
12
|
+
CRASHED = "unhandledErrorCaught",
|
|
13
|
+
INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
|
|
14
|
+
SELECT_ALL_CAUGHT = "selectAllCaught",
|
|
15
|
+
SELECT_ALL_ESCAPED = "selectAllEscaped",
|
|
16
|
+
CLICKED = "clicked",
|
|
17
|
+
VIEWED = "viewed",
|
|
18
|
+
VISITED = "visited",
|
|
19
|
+
SORT_COLUMN = "sortedColumn",
|
|
20
|
+
SORT_COLUMN_NOT_ALLOWED = "sortColumnNotAllowed",
|
|
21
|
+
TOGGLE_EXPAND = "toggleExpand",
|
|
22
|
+
INSERTED = "inserted",
|
|
23
|
+
OPENED = "opened",
|
|
24
|
+
CLOSED = "closed",
|
|
25
|
+
DELETED = "deleted",
|
|
26
|
+
EDITED = "edited",
|
|
27
|
+
RESOLVED = "resolved",
|
|
28
|
+
CREATE_NOT_ALLOWED = "createNotAllowed",
|
|
29
|
+
UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED = "unsupportedContentLevelsTrackingSucceeded",
|
|
30
|
+
UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED = "unsupportedContentLevelsTrackingErrored",
|
|
31
|
+
MEDIA_LINK_TRANSFORMED = "mediaLinkTransformed"
|
|
32
|
+
}
|
|
33
|
+
export declare enum ACTION_SUBJECT {
|
|
34
|
+
RENDERER = "renderer",
|
|
35
|
+
BUTTON = "button",
|
|
36
|
+
ANCHOR_LINK = "anchorLink",
|
|
37
|
+
TABLE = "table",
|
|
38
|
+
EXPAND = "expand",
|
|
39
|
+
NESTED_EXPAND = "nestedExpand",
|
|
40
|
+
MEDIA_SINGLE = "mediaSingle",
|
|
41
|
+
LINK = "link",
|
|
42
|
+
ANNOTATION = "annotation",
|
|
43
|
+
MEDIA = "media"
|
|
44
|
+
}
|
|
45
|
+
export declare enum ACTION_SUBJECT_ID {
|
|
46
|
+
HEADING_ANCHOR_LINK = "headingAnchorLink",
|
|
47
|
+
LINK = "link",
|
|
48
|
+
INLINE_COMMENT = "inlineComment",
|
|
49
|
+
CODEBLOCK_COPY = "codeBlockCopy",
|
|
50
|
+
CODEBLOCK_WRAP = "codeBlockWrap"
|
|
51
|
+
}
|
|
1
52
|
export declare type AEP<Action, ActionSubject, ActionSubjectID, Attributes, EventType> = {
|
|
2
53
|
action: Action;
|
|
3
54
|
actionSubject: ActionSubject;
|
|
@@ -65,6 +65,10 @@ declare type AnchorLinkAEP = UIAEP<ACTION.VIEWED, ACTION_SUBJECT.ANCHOR_LINK, un
|
|
|
65
65
|
platform: PLATFORM.WEB;
|
|
66
66
|
mode: MODE.RENDERER;
|
|
67
67
|
}>;
|
|
68
|
+
declare type CodeBlockCopyAEP = ButtonAEP<ACTION_SUBJECT_ID.CODEBLOCK_COPY, undefined>;
|
|
69
|
+
declare type CodeBlockWrapAEP = ButtonAEP<ACTION_SUBJECT_ID.CODEBLOCK_WRAP, {
|
|
70
|
+
wrapped: boolean;
|
|
71
|
+
}>;
|
|
68
72
|
declare type HeadingAnchorLinkButtonAEP = ButtonAEP<ACTION_SUBJECT_ID.HEADING_ANCHOR_LINK, undefined>;
|
|
69
73
|
declare type TableSortColumnNotAllowedAEP = AEP<ACTION.SORT_COLUMN_NOT_ALLOWED, ACTION_SUBJECT.TABLE, undefined, {
|
|
70
74
|
platform: PLATFORM.WEB;
|
|
@@ -110,5 +114,5 @@ declare type RendererTTIAEP = AEP<ACTION.RENDERER_TTI, ACTION_SUBJECT.RENDERER,
|
|
|
110
114
|
ttiFromInvocation: number;
|
|
111
115
|
canceled: boolean;
|
|
112
116
|
}, EVENT_TYPE.OPERATIONAL>;
|
|
113
|
-
export declare type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | RendererReRenderedAEP<T> | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | RendererTTIAEP;
|
|
117
|
+
export declare type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | RendererReRenderedAEP<T> | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | CodeBlockCopyAEP | CodeBlockWrapAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | RendererTTIAEP;
|
|
114
118
|
export {};
|
|
@@ -32,6 +32,7 @@ export interface ReactSerializerInit {
|
|
|
32
32
|
emojiResourceConfig?: EmojiResourceConfig;
|
|
33
33
|
smartLinks?: SmartLinksOptions;
|
|
34
34
|
allowCopyToClipboard?: boolean;
|
|
35
|
+
allowWrapCodeBlock?: boolean;
|
|
35
36
|
allowPlaceholderText?: boolean;
|
|
36
37
|
allowCustomPanels?: boolean;
|
|
37
38
|
allowAnnotations?: boolean;
|
|
@@ -66,6 +67,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
66
67
|
private allowHeadingAnchorLinks?;
|
|
67
68
|
private allowColumnSorting?;
|
|
68
69
|
private allowCopyToClipboard?;
|
|
70
|
+
private allowWrapCodeBlock?;
|
|
69
71
|
private allowPlaceholderText?;
|
|
70
72
|
private allowCustomPanels?;
|
|
71
73
|
private fireAnalyticsEvent?;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
3
3
|
import { RendererAppearance } from '../../ui/Renderer/types';
|
|
4
|
+
import { SmartLinksOptions } from '../../types/smartLinksOptions';
|
|
4
5
|
export default function BlockCard(props: {
|
|
5
6
|
url?: string;
|
|
6
7
|
data?: object;
|
|
7
8
|
eventHandlers?: EventHandlers;
|
|
8
9
|
portal?: HTMLElement;
|
|
9
10
|
rendererAppearance?: RendererAppearance;
|
|
11
|
+
smartLinks?: SmartLinksOptions;
|
|
10
12
|
}): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
4
|
+
export interface CodeBlockButtonContainerProps {
|
|
5
|
+
allowCopyToClipboard?: boolean;
|
|
6
|
+
allowWrapCodeBlock?: boolean;
|
|
7
|
+
setWrapLongLines: Dispatch<SetStateAction<boolean>>;
|
|
8
|
+
text: string;
|
|
9
|
+
wrapLongLines: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const CodeBlockButtonContainer: ({ allowCopyToClipboard, allowWrapCodeBlock, setWrapLongLines, text, wrapLongLines, }: CodeBlockButtonContainerProps) => jsx.JSX.Element;
|
|
12
|
+
export default CodeBlockButtonContainer;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
2
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
text: CodeBlockProps['text'];
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import type { CodeBlockButtonContainerProps } from './codeBlockButtonContainer';
|
|
5
|
+
interface ContainerProps extends CodeBlockButtonContainerProps {
|
|
8
6
|
children: ReactNode;
|
|
9
|
-
|
|
7
|
+
className?: string;
|
|
10
8
|
}
|
|
11
|
-
declare const CodeBlockContainer: ({
|
|
9
|
+
declare const CodeBlockContainer: ({ allowCopyToClipboard, allowWrapCodeBlock, children, className, setWrapLongLines, text, wrapLongLines, }: ContainerProps) => jsx.JSX.Element;
|
|
12
10
|
export default CodeBlockContainer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
setWrapLongLines: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
wrapLongLines?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
9
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { Props as CodeBlockProps } from './codeBlock';
|
|
3
|
-
declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, codeBidiWarningTooltipEnabled, className: rootClassName, }: CodeBlockProps) => jsx.JSX.Element;
|
|
3
|
+
declare const WindowedCodeBlock: ({ text, language, allowCopyToClipboard, allowWrapCodeBlock, codeBidiWarningTooltipEnabled, className: rootClassName, }: CodeBlockProps) => jsx.JSX.Element;
|
|
4
4
|
export default WindowedCodeBlock;
|
|
@@ -51,6 +51,7 @@ declare const BlockCard: React.ComponentType<{
|
|
|
51
51
|
eventHandlers?: import("@atlaskit/editor-common/ui").EventHandlers | undefined;
|
|
52
52
|
portal?: HTMLElement | undefined;
|
|
53
53
|
rendererAppearance?: import("../../ui/Renderer/types").RendererAppearance;
|
|
54
|
+
smartLinks?: import("../../types/smartLinksOptions").SmartLinksOptions | undefined;
|
|
54
55
|
}> & Loadable.LoadableComponent;
|
|
55
56
|
declare const Media: React.ComponentType<import("./media").MediaProps> & Loadable.LoadableComponent;
|
|
56
57
|
declare const MediaGroup: React.ComponentType<import("./mediaGroup").MediaGroupProps> & Loadable.LoadableComponent;
|
|
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
7
7
|
import { MediaCardProps } from '../../ui/MediaCard';
|
|
8
|
-
import { LinkDefinition } from '@atlaskit/adf-schema';
|
|
8
|
+
import { LinkDefinition, BorderMarkDefinition } from '@atlaskit/adf-schema';
|
|
9
9
|
import type { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
10
10
|
import { AnalyticsEventPayload } from '../../analytics/events';
|
|
11
11
|
export declare type MediaProps = MediaCardProps & {
|
|
@@ -13,7 +13,8 @@ export declare type MediaProps = MediaCardProps & {
|
|
|
13
13
|
allowAltTextOnImages?: boolean;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
isInsideOfBlockNode?: boolean;
|
|
16
|
-
marks: Array<LinkDefinition>;
|
|
16
|
+
marks: Array<LinkDefinition | BorderMarkDefinition>;
|
|
17
|
+
isBorderMark: () => boolean;
|
|
17
18
|
isLinkMark: () => boolean;
|
|
18
19
|
fireAnalyticsEvent?: (event: AnalyticsEventPayload) => void;
|
|
19
20
|
featureFlags?: MediaFeatureFlags;
|
|
@@ -3,15 +3,21 @@ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
3
3
|
import { FileIdentifier } from '@atlaskit/media-client';
|
|
4
4
|
import { MediaProvider } from '../../ui/MediaCard';
|
|
5
5
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
6
|
+
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { RendererAppearance } from '../../ui/Renderer/types';
|
|
6
8
|
export declare type RenderMediaInlineProps = {
|
|
7
9
|
identifier: FileIdentifier;
|
|
8
10
|
mediaProvider: Promise<MediaProvider>;
|
|
9
11
|
children?: React.ReactNode;
|
|
12
|
+
eventHandlers?: EventHandlers;
|
|
13
|
+
rendererAppearance?: RendererAppearance;
|
|
10
14
|
};
|
|
11
15
|
export declare type MediaInlineProps = {
|
|
12
16
|
id: string;
|
|
13
17
|
collection?: string;
|
|
14
18
|
providers: ProviderFactory;
|
|
19
|
+
eventHandlers?: EventHandlers;
|
|
20
|
+
rendererAppearance?: RendererAppearance;
|
|
15
21
|
};
|
|
16
22
|
export declare const RenderMediaInline: React.FC<RenderMediaInlineProps>;
|
|
17
23
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<MediaInlineProps & WrappedComponentProps<"intl">>> & {
|
|
@@ -26,6 +26,7 @@ export interface NodeMeta {
|
|
|
26
26
|
} | null;
|
|
27
27
|
allowHeadingAnchorLinks?: HeadingAnchorLinksProps;
|
|
28
28
|
allowCopyToClipboard?: boolean;
|
|
29
|
+
allowWrapCodeBlock?: boolean;
|
|
29
30
|
allowPlaceholderText?: boolean;
|
|
30
31
|
allowCustomPanels?: boolean;
|
|
31
32
|
rendererAppearance?: RendererAppearance;
|
|
@@ -59,6 +59,7 @@ export interface RendererProps {
|
|
|
59
59
|
innerRef?: React.RefObject<HTMLDivElement>;
|
|
60
60
|
useSpecBasedValidator?: boolean;
|
|
61
61
|
allowCopyToClipboard?: boolean;
|
|
62
|
+
allowWrapCodeBlock?: boolean;
|
|
62
63
|
allowCustomPanels?: boolean;
|
|
63
64
|
analyticsEventSeverityTracking?: {
|
|
64
65
|
enabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "107.
|
|
3
|
+
"version": "107.3.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -24,29 +24,29 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaskit/adf-schema": "^25.
|
|
28
|
-
"@atlaskit/adf-utils": "^18.
|
|
27
|
+
"@atlaskit/adf-schema": "^25.4.0",
|
|
28
|
+
"@atlaskit/adf-utils": "^18.1.0",
|
|
29
29
|
"@atlaskit/analytics-listeners": "^8.5.0",
|
|
30
30
|
"@atlaskit/analytics-namespaced-context": "^6.6.0",
|
|
31
31
|
"@atlaskit/analytics-next": "^9.0.0",
|
|
32
|
-
"@atlaskit/button": "^16.
|
|
33
|
-
"@atlaskit/code": "^14.5.
|
|
34
|
-
"@atlaskit/editor-common": "^72.
|
|
32
|
+
"@atlaskit/button": "^16.6.0",
|
|
33
|
+
"@atlaskit/code": "^14.5.3",
|
|
34
|
+
"@atlaskit/editor-common": "^72.7.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.8.0",
|
|
36
|
-
"@atlaskit/editor-palette": "1.
|
|
36
|
+
"@atlaskit/editor-palette": "1.2.0",
|
|
37
37
|
"@atlaskit/editor-shared-styles": "^2.3.0",
|
|
38
|
-
"@atlaskit/emoji": "^67.
|
|
38
|
+
"@atlaskit/emoji": "^67.3.0",
|
|
39
39
|
"@atlaskit/icon": "^21.11.0",
|
|
40
40
|
"@atlaskit/media-card": "^74.7.0",
|
|
41
|
-
"@atlaskit/media-client": "^20.
|
|
42
|
-
"@atlaskit/media-common": "^
|
|
41
|
+
"@atlaskit/media-client": "^20.2.0",
|
|
42
|
+
"@atlaskit/media-common": "^4.0.0",
|
|
43
43
|
"@atlaskit/media-filmstrip": "^46.1.0",
|
|
44
44
|
"@atlaskit/media-ui": "^22.3.0",
|
|
45
45
|
"@atlaskit/media-viewer": "^47.5.0",
|
|
46
|
-
"@atlaskit/smart-card": "^25.
|
|
46
|
+
"@atlaskit/smart-card": "^25.2.0",
|
|
47
47
|
"@atlaskit/status": "^1.2.0",
|
|
48
48
|
"@atlaskit/task-decision": "^17.5.0",
|
|
49
|
-
"@atlaskit/theme": "^12.
|
|
49
|
+
"@atlaskit/theme": "^12.3.0",
|
|
50
50
|
"@atlaskit/tokens": "^1.2.0",
|
|
51
51
|
"@atlaskit/tooltip": "^17.7.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"uuid": "^3.1.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@atlaskit/link-provider": "^1.5.
|
|
64
|
+
"@atlaskit/link-provider": "^1.5.1",
|
|
65
65
|
"@atlaskit/media-core": "^34.0.2",
|
|
66
66
|
"react": "^16.8.0",
|
|
67
67
|
"react-dom": "^16.8.0"
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
"@atlaskit/avatar": "^21.2.0",
|
|
72
72
|
"@atlaskit/css-reset": "^6.3.0",
|
|
73
73
|
"@atlaskit/docs": "*",
|
|
74
|
-
"@atlaskit/editor-core": "^
|
|
75
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
74
|
+
"@atlaskit/editor-core": "^182.0.0",
|
|
75
|
+
"@atlaskit/editor-test-helpers": "^18.2.0",
|
|
76
76
|
"@atlaskit/link-provider": "^1.5.0",
|
|
77
77
|
"@atlaskit/logo": "^13.11.0",
|
|
78
78
|
"@atlaskit/media-core": "^34.0.0",
|
|
79
79
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
80
|
-
"@atlaskit/media-test-helpers": "^
|
|
81
|
-
"@atlaskit/mention": "^
|
|
80
|
+
"@atlaskit/media-test-helpers": "^31.0.0",
|
|
81
|
+
"@atlaskit/mention": "^22.0.0",
|
|
82
82
|
"@atlaskit/navigation-next": "^9.0.0",
|
|
83
|
-
"@atlaskit/profilecard": "^
|
|
83
|
+
"@atlaskit/profilecard": "^19.2.0",
|
|
84
84
|
"@atlaskit/radio": "^5.4.0",
|
|
85
85
|
"@atlaskit/range": "^7.0.0",
|
|
86
86
|
"@atlaskit/ssr": "*",
|
|
87
|
-
"@atlaskit/util-data-test": "^17.
|
|
87
|
+
"@atlaskit/util-data-test": "^17.7.0",
|
|
88
88
|
"@atlaskit/visual-regression": "*",
|
|
89
89
|
"@atlaskit/webdriver-runner": "*",
|
|
90
90
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
@@ -119,4 +119,4 @@
|
|
|
119
119
|
]
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
}
|
|
122
|
+
}
|
package/report.api.md
CHANGED
|
@@ -69,6 +69,8 @@ type AnalyticsEventPayload<T = void> =
|
|
|
69
69
|
| AnchorLinkAEP
|
|
70
70
|
| AnnotationAEP
|
|
71
71
|
| AnnotationDeleteAEP
|
|
72
|
+
| CodeBlockCopyAEP
|
|
73
|
+
| CodeBlockWrapAEP
|
|
72
74
|
| ComponentCrashErrorAEP
|
|
73
75
|
| ExpandAEP
|
|
74
76
|
| HeadingAnchorLinkButtonAEP
|
|
@@ -152,6 +154,17 @@ type ButtonAEP<ActionSubjectID, Attributes> = UIAEP<
|
|
|
152
154
|
Attributes
|
|
153
155
|
>;
|
|
154
156
|
|
|
157
|
+
// @public (undocumented)
|
|
158
|
+
type CodeBlockCopyAEP = ButtonAEP<ACTION_SUBJECT_ID.CODEBLOCK_COPY, undefined>;
|
|
159
|
+
|
|
160
|
+
// @public (undocumented)
|
|
161
|
+
type CodeBlockWrapAEP = ButtonAEP<
|
|
162
|
+
ACTION_SUBJECT_ID.CODEBLOCK_WRAP,
|
|
163
|
+
{
|
|
164
|
+
wrapped: boolean;
|
|
165
|
+
}
|
|
166
|
+
>;
|
|
167
|
+
|
|
155
168
|
// @public (undocumented)
|
|
156
169
|
type ComponentCrashErrorAEP = OperationalAEP<
|
|
157
170
|
ACTION.CRASHED,
|
|
@@ -325,6 +338,8 @@ interface ReactSerializerInit {
|
|
|
325
338
|
// (undocumented)
|
|
326
339
|
allowWindowedCodeBlock?: boolean;
|
|
327
340
|
// (undocumented)
|
|
341
|
+
allowWrapCodeBlock?: boolean;
|
|
342
|
+
// (undocumented)
|
|
328
343
|
appearance?: RendererAppearance;
|
|
329
344
|
// (undocumented)
|
|
330
345
|
disableActions?: boolean;
|
|
@@ -416,6 +431,8 @@ export interface RendererProps {
|
|
|
416
431
|
// (undocumented)
|
|
417
432
|
allowUgcScrubber?: boolean;
|
|
418
433
|
// (undocumented)
|
|
434
|
+
allowWrapCodeBlock?: boolean;
|
|
435
|
+
// (undocumented)
|
|
419
436
|
analyticsEventSeverityTracking?: {
|
|
420
437
|
enabled: boolean;
|
|
421
438
|
severityNormalThreshold: number;
|
|
@@ -631,6 +648,8 @@ interface SmartLinksOptions {
|
|
|
631
648
|
// (undocumented)
|
|
632
649
|
showAuthTooltip?: boolean;
|
|
633
650
|
// (undocumented)
|
|
651
|
+
showServerActions?: boolean;
|
|
652
|
+
// (undocumented)
|
|
634
653
|
ssr?: boolean;
|
|
635
654
|
}
|
|
636
655
|
|
|
@@ -740,8 +759,8 @@ type VisitMediaLinkAEP = AEP<
|
|
|
740
759
|
|
|
741
760
|
```json
|
|
742
761
|
{
|
|
743
|
-
"@atlaskit/link-provider": "^1.
|
|
744
|
-
"@atlaskit/media-core": "^34.0.
|
|
762
|
+
"@atlaskit/link-provider": "^1.5.1",
|
|
763
|
+
"@atlaskit/media-core": "^34.0.2",
|
|
745
764
|
"react": "^16.8.0",
|
|
746
765
|
"react-dom": "^16.8.0"
|
|
747
766
|
}
|