@atlaskit/renderer 113.1.2 → 113.2.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 +24 -0
- package/dist/cjs/react/index.js +12 -0
- package/dist/cjs/react/nodes/TableStickyScrollbar.js +3 -4
- package/dist/cjs/react/nodes/bodiedExtension.js +5 -3
- package/dist/cjs/react/nodes/extension.js +31 -5
- package/dist/cjs/ui/Renderer/RendererStyleContainer.js +1369 -0
- package/dist/cjs/ui/Renderer/get-base-font-size.js +10 -0
- package/dist/cjs/ui/Renderer/index.js +15 -16
- package/dist/cjs/ui/Renderer/style.js +1 -1
- package/dist/es2019/react/index.js +10 -0
- package/dist/es2019/react/nodes/TableStickyScrollbar.js +3 -4
- package/dist/es2019/react/nodes/bodiedExtension.js +5 -3
- package/dist/es2019/react/nodes/extension.js +28 -6
- package/dist/es2019/ui/Renderer/RendererStyleContainer.js +1742 -0
- package/dist/es2019/ui/Renderer/get-base-font-size.js +4 -0
- package/dist/es2019/ui/Renderer/index.js +16 -17
- package/dist/es2019/ui/Renderer/style.js +3 -3
- package/dist/esm/react/index.js +12 -0
- package/dist/esm/react/nodes/TableStickyScrollbar.js +3 -4
- package/dist/esm/react/nodes/bodiedExtension.js +5 -3
- package/dist/esm/react/nodes/extension.js +31 -5
- package/dist/esm/ui/Renderer/RendererStyleContainer.js +1362 -0
- package/dist/esm/ui/Renderer/get-base-font-size.js +4 -0
- package/dist/esm/ui/Renderer/index.js +16 -17
- package/dist/esm/ui/Renderer/style.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/react/index.d.ts +4 -1
- package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
- package/dist/types/react/nodes/extension.d.ts +4 -3
- package/dist/types/react/types.d.ts +4 -0
- package/dist/types/ui/Renderer/RendererStyleContainer.d.ts +11 -0
- package/dist/types/ui/Renderer/get-base-font-size.d.ts +2 -0
- package/dist/types/ui/Renderer/index.d.ts +23 -0
- package/dist/types/ui/renderer-props.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/react/index.d.ts +4 -1
- package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +2 -1
- package/dist/types-ts4.5/react/nodes/extension.d.ts +4 -3
- package/dist/types-ts4.5/react/types.d.ts +4 -0
- package/dist/types-ts4.5/ui/Renderer/RendererStyleContainer.d.ts +11 -0
- package/dist/types-ts4.5/ui/Renderer/get-base-font-size.d.ts +2 -0
- package/dist/types-ts4.5/ui/Renderer/index.d.ts +23 -0
- package/dist/types-ts4.5/ui/renderer-props.d.ts +2 -1
- package/package.json +18 -12
|
@@ -31,7 +31,6 @@ import { FabricChannel } from '@atlaskit/analytics-listeners/types';
|
|
|
31
31
|
import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
32
32
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
33
33
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
34
|
-
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
35
34
|
import memoizeOne from 'memoize-one';
|
|
36
35
|
import uuid from 'uuid/v4';
|
|
37
36
|
import { ReactSerializer, renderDocument } from '../../';
|
|
@@ -49,13 +48,15 @@ import { ErrorBoundary } from './ErrorBoundary';
|
|
|
49
48
|
import { BreakoutSSRInlineScript } from './breakout-ssr';
|
|
50
49
|
import { isInteractiveElement } from './click-to-edit';
|
|
51
50
|
import { countNodes } from './count-nodes';
|
|
52
|
-
import { TELEPOINTER_ID
|
|
51
|
+
import { TELEPOINTER_ID } from './style';
|
|
53
52
|
import { TruncatedWrapper } from './truncated-wrapper';
|
|
54
53
|
import { ValidationContext } from './ValidationContext';
|
|
54
|
+
import { RendererStyleContainer } from './RendererStyleContainer';
|
|
55
|
+
import { getBaseFontSize } from './get-base-font-size';
|
|
55
56
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
57
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
58
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "113.1
|
|
59
|
+
var packageVersion = "113.2.1";
|
|
59
60
|
var setAsQueryContainerStyles = css({
|
|
60
61
|
containerName: 'ak-renderer-wrapper',
|
|
61
62
|
containerType: 'inline-size',
|
|
@@ -283,6 +284,7 @@ export var __RendererClassComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
283
284
|
media: props.media,
|
|
284
285
|
emojiResourceConfig: props.emojiResourceConfig,
|
|
285
286
|
smartLinks: props.smartLinks,
|
|
287
|
+
extensionViewportSizes: props.extensionViewportSizes,
|
|
286
288
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
287
289
|
allowWrapCodeBlock: props.allowWrapCodeBlock,
|
|
288
290
|
allowCustomPanels: props.allowCustomPanels,
|
|
@@ -618,6 +620,7 @@ var RendererFunctionalComponent = function RendererFunctionalComponent(props) {
|
|
|
618
620
|
media: props.media,
|
|
619
621
|
emojiResourceConfig: props.emojiResourceConfig,
|
|
620
622
|
smartLinks: props.smartLinks,
|
|
623
|
+
extensionViewportSizes: props.extensionViewportSizes,
|
|
621
624
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
622
625
|
allowWrapCodeBlock: props.allowWrapCodeBlock,
|
|
623
626
|
allowCustomPanels: props.allowCustomPanels,
|
|
@@ -951,23 +954,19 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
|
|
|
951
954
|
"data-appearance": appearance,
|
|
952
955
|
shouldCheckExistingValue: isInsideOfInlineExtension
|
|
953
956
|
}, jsx(BaseTheme, {
|
|
954
|
-
baseFontSize: appearance
|
|
957
|
+
baseFontSize: getBaseFontSize(appearance)
|
|
955
958
|
}, jsx(EditorMediaClientProvider, {
|
|
956
959
|
ssr: ssr
|
|
957
|
-
}, jsx(
|
|
958
|
-
|
|
960
|
+
}, jsx(RendererStyleContainer, {
|
|
961
|
+
innerRef: innerRef,
|
|
959
962
|
onClick: onClick,
|
|
960
|
-
onMouseDown: onMouseDown
|
|
961
|
-
|
|
962
|
-
,
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock,
|
|
968
|
-
allowAnnotations: props.allowAnnotations,
|
|
969
|
-
allowTableResizing: allowTableResizing
|
|
970
|
-
})
|
|
963
|
+
onMouseDown: onMouseDown,
|
|
964
|
+
appearance: appearance,
|
|
965
|
+
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
966
|
+
allowColumnSorting: !!allowColumnSorting,
|
|
967
|
+
useBlockRenderForCodeBlock: useBlockRenderForCodeBlock,
|
|
968
|
+
allowAnnotations: props.allowAnnotations,
|
|
969
|
+
allowTableResizing: allowTableResizing
|
|
971
970
|
}, children))));
|
|
972
971
|
|
|
973
972
|
// We can only make the wrapper div query container when we have a known width.
|
|
@@ -118,7 +118,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
118
118
|
if (allowNestedHeaderLinks) {
|
|
119
119
|
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
120
120
|
}
|
|
121
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t.", " {\n\t\t\tpadding: 0;\n\n\t\t\t.", " {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tborder-width: 1.5px;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: transparent;\n\n\t\t\t\t> *:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t@supports selector(:focus-visible) {\n\t\t\t\t\t&:focus {\n\t\t\t\t\t\toutline: unset;\n\t\t\t\t\t}\n\t\t\t\t\t&:focus-visible {\n\t\t\t\t\t\tborder-color: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t"])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, "var(--ds-border-focused, ".concat(colors.B300, ")"), headingsCss, fg('platform_editor_nested_tables_renderer_styles') ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n\t\t\t\t\t\t// New styles\n\t\t\t\t\t\t> .", "\n\t\t\t\t\t\t\t> .", " {\n\t\t\t\t\t\t\tmargin: 0;\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t> .", "\n\t\t\t\t\t\t\t> .", " {\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t\t\t&:focus {\n\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&:hover:not(\n\t\t\t\t\t\t\t\t:has(\n\t\t\t\t\t\t\t\t\t
|
|
121
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t\t.", " {\n\t\t\tpadding: 0;\n\n\t\t\t.", " {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tpadding: ", "px;\n\t\t\t\tborder-width: 1.5px;\n\t\t\t\tborder-style: solid;\n\t\t\t\tborder-color: transparent;\n\n\t\t\t\t> *:first-child {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t> .ProseMirror-gapcursor:first-child + span + *,\n\t\t\t\t> style:first-child + .ProseMirror-gapcursor + span + * {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t}\n\n\t\t\t\t@supports selector(:focus-visible) {\n\t\t\t\t\t&:focus {\n\t\t\t\t\t\toutline: unset;\n\t\t\t\t\t}\n\t\t\t\t\t&:focus-visible {\n\t\t\t\t\t\tborder-color: ", ";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\t"])), RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, tableCellPadding, "var(--ds-border-focused, ".concat(colors.B300, ")"), headingsCss, fg('platform_editor_nested_tables_renderer_styles') ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n\t\t\t\t\t\t// New styles\n\t\t\t\t\t\t> .", "\n\t\t\t\t\t\t\t> .", " {\n\t\t\t\t\t\t\tmargin: 0;\n\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t> .", "\n\t\t\t\t\t\t\t> .", " {\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t\t\t&:focus {\n\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&:hover:not(\n\t\t\t\t\t\t\t\t:has(\n\t\t\t\t\t\t\t\t\t.", "\n\t\t\t\t\t\t\t\t\t\t.", ":hover\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t> .", "\n\t\t\t\t\t\t\t> .", " {\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t"])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN_WRAPPER, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME) : css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t\t\t\t\t\t// old styles\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\ttransition: opacity 0.2s ease-in-out;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\t\t\t&:focus {\n\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\t.", " {\n\t\t\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t"])), RendererCssClassName.SORTABLE_COLUMN_ICON_WRAPPER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, SORTABLE_COLUMN_ICON_CLASSNAME));
|
|
122
122
|
};
|
|
123
123
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
124
124
|
var appearance = _ref3.appearance;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { ValidationContextProvider } from './ui/Renderer/ValidationContext';
|
|
|
7
7
|
export type { Serializer } from './serializer';
|
|
8
8
|
export type { HeadingAnchorLinksProps, RendererAppearance, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
9
9
|
export type { RendererProps } from './ui/renderer-props';
|
|
10
|
-
export type { RendererContext, NodeProps } from './react/types';
|
|
10
|
+
export type { RendererContext, NodeProps, ExtensionViewportSize } from './react/types';
|
|
11
11
|
export { ADFEncoder } from './utils';
|
|
12
12
|
export { renderDocument } from './render-document';
|
|
13
13
|
export type { RenderOutputStat } from './render-document';
|
|
@@ -7,7 +7,7 @@ import type { TextWrapper } from './nodes';
|
|
|
7
7
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
8
8
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
9
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import type { RendererContext, TextHighlighter } from './types';
|
|
10
|
+
import type { RendererContext, TextHighlighter, ExtensionViewportSize } from './types';
|
|
11
11
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
12
12
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
13
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
@@ -37,6 +37,7 @@ export interface ReactSerializerInit {
|
|
|
37
37
|
media?: MediaOptions;
|
|
38
38
|
emojiResourceConfig?: EmojiResourceConfig;
|
|
39
39
|
smartLinks?: SmartLinksOptions;
|
|
40
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
40
41
|
allowCopyToClipboard?: boolean;
|
|
41
42
|
allowWrapCodeBlock?: boolean;
|
|
42
43
|
allowPlaceholderText?: boolean;
|
|
@@ -91,6 +92,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
91
92
|
private media?;
|
|
92
93
|
private emojiResourceConfig?;
|
|
93
94
|
private smartLinks?;
|
|
95
|
+
private extensionViewportSizes?;
|
|
94
96
|
private allowAnnotations;
|
|
95
97
|
private allowSelectAllTrap?;
|
|
96
98
|
private nodeComponents?;
|
|
@@ -114,6 +116,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
114
116
|
private getDateProps;
|
|
115
117
|
private getMediaSingleProps;
|
|
116
118
|
private getMediaProps;
|
|
119
|
+
private getExtensionProps;
|
|
117
120
|
private getEmojiProps;
|
|
118
121
|
private getEmbedCardProps;
|
|
119
122
|
private getBlockCardProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Mark as PMMark, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { RendererContext } from '../types';
|
|
3
|
+
import type { RendererContext, ExtensionViewportSize } from '../types';
|
|
4
4
|
import type { Serializer } from '../../serializer';
|
|
5
5
|
import type { ExtensionLayout } from '@atlaskit/adf-schema';
|
|
6
6
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
localId?: string;
|
|
21
21
|
marks?: PMMark[];
|
|
22
22
|
startPos: number;
|
|
23
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
23
24
|
}
|
|
24
25
|
declare const BodiedExtension: (props: React.PropsWithChildren<Props>) => React.JSX.Element;
|
|
25
26
|
export default BodiedExtension;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Mark as PMMark, type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { type RendererContext } from '../types';
|
|
3
|
+
import { type RendererContext, type ExtensionViewportSize } from '../types';
|
|
4
4
|
import { type ExtensionLayout } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
6
6
|
import { type ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
layout?: ExtensionLayout;
|
|
18
18
|
localId?: string;
|
|
19
19
|
marks?: PMMark[];
|
|
20
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
20
21
|
}
|
|
21
22
|
type AllOrNone<T> = T | {
|
|
22
23
|
[K in keyof T]?: never;
|
|
@@ -24,7 +25,7 @@ type AllOrNone<T> = T | {
|
|
|
24
25
|
type RenderExtensionOptions = {
|
|
25
26
|
isTopLevel?: boolean;
|
|
26
27
|
} & AllOrNone<OverflowShadowProps>;
|
|
27
|
-
export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean) => React.JSX.Element;
|
|
28
|
+
export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[]) => React.JSX.Element;
|
|
28
29
|
declare const _default: {
|
|
29
30
|
new (props: Props | Readonly<Props>): {
|
|
30
31
|
overflowContainer?: HTMLElement | null | undefined;
|
|
@@ -75,7 +76,7 @@ declare const _default: {
|
|
|
75
76
|
state: {
|
|
76
77
|
showLeftShadow: boolean;
|
|
77
78
|
showRightShadow: boolean;
|
|
78
|
-
};
|
|
79
|
+
};
|
|
79
80
|
componentWillUnmount(): void;
|
|
80
81
|
componentDidUpdate(): void;
|
|
81
82
|
handleScroll: (event: Event) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import { type RendererWrapperProps } from './index';
|
|
7
|
+
type RendererStyleContainerProps = Pick<RendererWrapperProps, 'onClick' | 'onMouseDown' | 'appearance' | 'allowNestedHeaderLinks' | 'allowColumnSorting' | 'useBlockRenderForCodeBlock' | 'allowAnnotations' | 'allowTableResizing' | 'innerRef' | 'children'> & {
|
|
8
|
+
testId?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const RendererStyleContainer: (props: RendererStyleContainerProps) => jsx.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { PureComponent } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
import type { MediaSSR } from '../../';
|
|
7
8
|
import type { RendererProps } from '../renderer-props';
|
|
9
|
+
import type { RendererAppearance } from './types';
|
|
8
10
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
9
11
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
10
12
|
/**
|
|
@@ -44,5 +46,26 @@ export declare class __RendererClassComponent extends PureComponent<RendererProp
|
|
|
44
46
|
}
|
|
45
47
|
export declare function Renderer(props: RendererProps): jsx.JSX.Element;
|
|
46
48
|
export declare const RendererWithAnalytics: React.MemoExoticComponent<(props: RendererProps) => jsx.JSX.Element>;
|
|
49
|
+
export type RendererWrapperProps = {
|
|
50
|
+
allowAnnotations?: boolean;
|
|
51
|
+
appearance: RendererAppearance;
|
|
52
|
+
innerRef?: React.RefObject<HTMLDivElement>;
|
|
53
|
+
allowColumnSorting?: boolean;
|
|
54
|
+
allowCopyToClipboard?: boolean;
|
|
55
|
+
allowWrapCodeBlock?: boolean;
|
|
56
|
+
allowPlaceholderText?: boolean;
|
|
57
|
+
allowCustomPanels?: boolean;
|
|
58
|
+
addTelepointer?: boolean;
|
|
59
|
+
allowNestedHeaderLinks: boolean;
|
|
60
|
+
useBlockRenderForCodeBlock: boolean;
|
|
61
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
62
|
+
onMouseDown?: (event: React.MouseEvent) => void;
|
|
63
|
+
ssr?: MediaSSR;
|
|
64
|
+
isInsideOfInlineExtension?: boolean;
|
|
65
|
+
allowTableResizing?: boolean;
|
|
66
|
+
isTopLevelRenderer?: boolean;
|
|
67
|
+
} & {
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
};
|
|
47
70
|
declare const RendererWithAnnotationSelection: (props: RendererProps) => jsx.JSX.Element;
|
|
48
71
|
export default RendererWithAnnotationSelection;
|
|
@@ -10,7 +10,7 @@ import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
|
10
10
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
12
12
|
import type { RendererContext } from '../';
|
|
13
|
-
import type { TextHighlighter } from '../react/types';
|
|
13
|
+
import type { TextHighlighter, ExtensionViewportSize } from '../react/types';
|
|
14
14
|
import type { RenderOutputStat } from '../render-document';
|
|
15
15
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
16
16
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
@@ -47,6 +47,7 @@ export interface RendererProps {
|
|
|
47
47
|
media?: MediaOptions;
|
|
48
48
|
emojiResourceConfig?: EmojiResourceConfig;
|
|
49
49
|
smartLinks?: SmartLinksOptions;
|
|
50
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
50
51
|
allowAnnotations?: boolean;
|
|
51
52
|
annotationProvider?: AnnotationProviders | null;
|
|
52
53
|
innerRef?: React.RefObject<HTMLDivElement>;
|
|
@@ -7,7 +7,7 @@ export { ValidationContextProvider } from './ui/Renderer/ValidationContext';
|
|
|
7
7
|
export type { Serializer } from './serializer';
|
|
8
8
|
export type { HeadingAnchorLinksProps, RendererAppearance, StickyHeaderProps, NodeComponentsProps, } from './ui/Renderer/types';
|
|
9
9
|
export type { RendererProps } from './ui/renderer-props';
|
|
10
|
-
export type { RendererContext, NodeProps } from './react/types';
|
|
10
|
+
export type { RendererContext, NodeProps, ExtensionViewportSize } from './react/types';
|
|
11
11
|
export { ADFEncoder } from './utils';
|
|
12
12
|
export { renderDocument } from './render-document';
|
|
13
13
|
export type { RenderOutputStat } from './render-document';
|
|
@@ -7,7 +7,7 @@ import type { TextWrapper } from './nodes';
|
|
|
7
7
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
8
8
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
9
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import type { RendererContext, TextHighlighter } from './types';
|
|
10
|
+
import type { RendererContext, TextHighlighter, ExtensionViewportSize } from './types';
|
|
11
11
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
12
12
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
13
13
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
@@ -37,6 +37,7 @@ export interface ReactSerializerInit {
|
|
|
37
37
|
media?: MediaOptions;
|
|
38
38
|
emojiResourceConfig?: EmojiResourceConfig;
|
|
39
39
|
smartLinks?: SmartLinksOptions;
|
|
40
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
40
41
|
allowCopyToClipboard?: boolean;
|
|
41
42
|
allowWrapCodeBlock?: boolean;
|
|
42
43
|
allowPlaceholderText?: boolean;
|
|
@@ -91,6 +92,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
91
92
|
private media?;
|
|
92
93
|
private emojiResourceConfig?;
|
|
93
94
|
private smartLinks?;
|
|
95
|
+
private extensionViewportSizes?;
|
|
94
96
|
private allowAnnotations;
|
|
95
97
|
private allowSelectAllTrap?;
|
|
96
98
|
private nodeComponents?;
|
|
@@ -114,6 +116,7 @@ export default class ReactSerializer implements Serializer<JSX.Element> {
|
|
|
114
116
|
private getDateProps;
|
|
115
117
|
private getMediaSingleProps;
|
|
116
118
|
private getMediaProps;
|
|
119
|
+
private getExtensionProps;
|
|
117
120
|
private getEmojiProps;
|
|
118
121
|
private getEmbedCardProps;
|
|
119
122
|
private getBlockCardProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Mark as PMMark, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { RendererContext } from '../types';
|
|
3
|
+
import type { RendererContext, ExtensionViewportSize } from '../types';
|
|
4
4
|
import type { Serializer } from '../../serializer';
|
|
5
5
|
import type { ExtensionLayout } from '@atlaskit/adf-schema';
|
|
6
6
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
@@ -20,6 +20,7 @@ interface Props {
|
|
|
20
20
|
localId?: string;
|
|
21
21
|
marks?: PMMark[];
|
|
22
22
|
startPos: number;
|
|
23
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
23
24
|
}
|
|
24
25
|
declare const BodiedExtension: (props: React.PropsWithChildren<Props>) => React.JSX.Element;
|
|
25
26
|
export default BodiedExtension;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Mark as PMMark, type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import { type RendererContext } from '../types';
|
|
3
|
+
import { type RendererContext, type ExtensionViewportSize } from '../types';
|
|
4
4
|
import { type ExtensionLayout } from '@atlaskit/adf-schema';
|
|
5
5
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
6
6
|
import { type ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -17,6 +17,7 @@ interface Props {
|
|
|
17
17
|
layout?: ExtensionLayout;
|
|
18
18
|
localId?: string;
|
|
19
19
|
marks?: PMMark[];
|
|
20
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
20
21
|
}
|
|
21
22
|
type AllOrNone<T> = T | {
|
|
22
23
|
[K in keyof T]?: never;
|
|
@@ -24,7 +25,7 @@ type AllOrNone<T> = T | {
|
|
|
24
25
|
type RenderExtensionOptions = {
|
|
25
26
|
isTopLevel?: boolean;
|
|
26
27
|
} & AllOrNone<OverflowShadowProps>;
|
|
27
|
-
export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean) => React.JSX.Element;
|
|
28
|
+
export declare const renderExtension: (content: any, layout: string, options?: RenderExtensionOptions, removeOverflow?: boolean, extensionId?: string, extensionViewportSizes?: ExtensionViewportSize[]) => React.JSX.Element;
|
|
28
29
|
declare const _default: {
|
|
29
30
|
new (props: Props | Readonly<Props>): {
|
|
30
31
|
overflowContainer?: HTMLElement | null | undefined;
|
|
@@ -75,7 +76,7 @@ declare const _default: {
|
|
|
75
76
|
state: {
|
|
76
77
|
showLeftShadow: boolean;
|
|
77
78
|
showRightShadow: boolean;
|
|
78
|
-
};
|
|
79
|
+
};
|
|
79
80
|
componentWillUnmount(): void;
|
|
80
81
|
componentDidUpdate(): void;
|
|
81
82
|
handleScroll: (event: Event) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
6
|
+
import { type RendererWrapperProps } from './index';
|
|
7
|
+
type RendererStyleContainerProps = Pick<RendererWrapperProps, 'onClick' | 'onMouseDown' | 'appearance' | 'allowNestedHeaderLinks' | 'allowColumnSorting' | 'useBlockRenderForCodeBlock' | 'allowAnnotations' | 'allowTableResizing' | 'innerRef' | 'children'> & {
|
|
8
|
+
testId?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const RendererStyleContainer: (props: RendererStyleContainerProps) => jsx.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { PureComponent } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
+
import type { MediaSSR } from '../../';
|
|
7
8
|
import type { RendererProps } from '../renderer-props';
|
|
9
|
+
import type { RendererAppearance } from './types';
|
|
8
10
|
export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
9
11
|
export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
10
12
|
/**
|
|
@@ -44,5 +46,26 @@ export declare class __RendererClassComponent extends PureComponent<RendererProp
|
|
|
44
46
|
}
|
|
45
47
|
export declare function Renderer(props: RendererProps): jsx.JSX.Element;
|
|
46
48
|
export declare const RendererWithAnalytics: React.MemoExoticComponent<(props: RendererProps) => jsx.JSX.Element>;
|
|
49
|
+
export type RendererWrapperProps = {
|
|
50
|
+
allowAnnotations?: boolean;
|
|
51
|
+
appearance: RendererAppearance;
|
|
52
|
+
innerRef?: React.RefObject<HTMLDivElement>;
|
|
53
|
+
allowColumnSorting?: boolean;
|
|
54
|
+
allowCopyToClipboard?: boolean;
|
|
55
|
+
allowWrapCodeBlock?: boolean;
|
|
56
|
+
allowPlaceholderText?: boolean;
|
|
57
|
+
allowCustomPanels?: boolean;
|
|
58
|
+
addTelepointer?: boolean;
|
|
59
|
+
allowNestedHeaderLinks: boolean;
|
|
60
|
+
useBlockRenderForCodeBlock: boolean;
|
|
61
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
62
|
+
onMouseDown?: (event: React.MouseEvent) => void;
|
|
63
|
+
ssr?: MediaSSR;
|
|
64
|
+
isInsideOfInlineExtension?: boolean;
|
|
65
|
+
allowTableResizing?: boolean;
|
|
66
|
+
isTopLevelRenderer?: boolean;
|
|
67
|
+
} & {
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
};
|
|
47
70
|
declare const RendererWithAnnotationSelection: (props: RendererProps) => jsx.JSX.Element;
|
|
48
71
|
export default RendererWithAnnotationSelection;
|
|
@@ -10,7 +10,7 @@ import type { ADFStage } from '@atlaskit/editor-common/validator';
|
|
|
10
10
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
11
11
|
import type { EmojiResourceConfig } from '@atlaskit/emoji/resource';
|
|
12
12
|
import type { RendererContext } from '../';
|
|
13
|
-
import type { TextHighlighter } from '../react/types';
|
|
13
|
+
import type { TextHighlighter, ExtensionViewportSize } from '../react/types';
|
|
14
14
|
import type { RenderOutputStat } from '../render-document';
|
|
15
15
|
import type { MediaOptions } from '../types/mediaOptions';
|
|
16
16
|
import type { SmartLinksOptions } from '../types/smartLinksOptions';
|
|
@@ -47,6 +47,7 @@ export interface RendererProps {
|
|
|
47
47
|
media?: MediaOptions;
|
|
48
48
|
emojiResourceConfig?: EmojiResourceConfig;
|
|
49
49
|
smartLinks?: SmartLinksOptions;
|
|
50
|
+
extensionViewportSizes?: ExtensionViewportSize[];
|
|
50
51
|
allowAnnotations?: boolean;
|
|
51
52
|
annotationProvider?: AnnotationProviders | null;
|
|
52
53
|
innerRef?: React.RefObject<HTMLDivElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "113.1
|
|
3
|
+
"version": "113.2.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
32
32
|
"@atlaskit/button": "^21.1.0",
|
|
33
33
|
"@atlaskit/code": "^16.0.0",
|
|
34
|
-
"@atlaskit/editor-common": "^101.
|
|
34
|
+
"@atlaskit/editor-common": "^101.1.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
36
|
-
"@atlaskit/editor-palette": "2.0.0",
|
|
36
|
+
"@atlaskit/editor-palette": "^2.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
39
39
|
"@atlaskit/emoji": "^68.0.0",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"@atlaskit/media-ui": "^28.0.0",
|
|
49
49
|
"@atlaskit/media-viewer": "^52.0.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
|
-
"@atlaskit/smart-card": "^35.
|
|
51
|
+
"@atlaskit/smart-card": "^35.2.0",
|
|
52
52
|
"@atlaskit/status": "^3.0.0",
|
|
53
53
|
"@atlaskit/task-decision": "^19.0.0",
|
|
54
|
-
"@atlaskit/theme": "^
|
|
54
|
+
"@atlaskit/theme": "^18.0.0",
|
|
55
55
|
"@atlaskit/tmp-editor-statsig": "^3.4.0",
|
|
56
56
|
"@atlaskit/tokens": "^4.3.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"react-dom": "^18.2.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@af/integration-testing": "
|
|
76
|
-
"@af/visual-regression": "
|
|
75
|
+
"@af/integration-testing": "^0.5.0",
|
|
76
|
+
"@af/visual-regression": "^1.3.0",
|
|
77
77
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
78
78
|
"@atlaskit/css-reset": "^7.0.0",
|
|
79
79
|
"@atlaskit/link-provider": "^2.0.0",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@atlaskit/mention": "^24.1.0",
|
|
86
86
|
"@atlaskit/navigation-next": "patch:@atlaskit/navigation-next@npm%3A9.0.17#~/.yarn/patches/@atlaskit-navigation-next-npm-9.0.17-d1445f2f74.patch",
|
|
87
87
|
"@atlaskit/util-data-test": "^18.0.0",
|
|
88
|
-
"@atlaskit/visual-regression": "
|
|
89
|
-
"@atlassian/feature-flags-test-utils": "
|
|
88
|
+
"@atlaskit/visual-regression": "^0.10.0",
|
|
89
|
+
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
90
90
|
"@testing-library/react": "^13.4.0",
|
|
91
91
|
"@testing-library/react-hooks": "^8.0.1",
|
|
92
92
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -118,6 +118,15 @@
|
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
120
|
"platform-feature-flags": {
|
|
121
|
+
"platform_editor_heading_margin_fix": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"platform_editor_typography_ugc": {
|
|
125
|
+
"type": "boolean"
|
|
126
|
+
},
|
|
127
|
+
"platform_editor_emotion_refactor_renderer": {
|
|
128
|
+
"type": "boolean"
|
|
129
|
+
},
|
|
121
130
|
"platform_editor_update_panel_icon_aria_label": {
|
|
122
131
|
"type": "boolean"
|
|
123
132
|
},
|
|
@@ -133,9 +142,6 @@
|
|
|
133
142
|
"annotations_align_editor_and_renderer_styles": {
|
|
134
143
|
"type": "boolean"
|
|
135
144
|
},
|
|
136
|
-
"platform_editor_react18_phase2_v2": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
145
|
"platform-fix-table-ssr-resizing": {
|
|
140
146
|
"type": "boolean"
|
|
141
147
|
},
|