@atlaskit/editor-common 114.1.0 → 114.2.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 +32 -0
- package/dist/cjs/card/ui/assets/card.js +13 -7
- package/dist/cjs/card/ui/assets/embed.js +13 -7
- package/dist/cjs/card/ui/assets/inline.js +13 -7
- package/dist/cjs/card/ui/assets/url.js +13 -7
- package/dist/cjs/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/cjs/extensibility/extensionNodeView.js +1 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/cjs/resizer/BreakoutResizer.js +7 -4
- package/dist/cjs/resizer/Resizer.js +33 -12
- package/dist/cjs/table/content-mode.js +62 -0
- package/dist/cjs/table/index.js +19 -0
- package/dist/cjs/toolbar/context.js +14 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/es2019/card/ui/assets/card.js +14 -7
- package/dist/es2019/card/ui/assets/embed.js +14 -7
- package/dist/es2019/card/ui/assets/inline.js +14 -7
- package/dist/es2019/card/ui/assets/url.js +14 -7
- package/dist/es2019/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/es2019/extensibility/extensionNodeView.js +1 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/es2019/resizer/BreakoutResizer.js +7 -4
- package/dist/es2019/resizer/Resizer.js +33 -13
- package/dist/es2019/table/content-mode.js +56 -0
- package/dist/es2019/table/index.js +2 -1
- package/dist/es2019/toolbar/context.js +17 -9
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +1 -1
- package/dist/esm/card/ui/assets/card.js +14 -7
- package/dist/esm/card/ui/assets/embed.js +14 -7
- package/dist/esm/card/ui/assets/inline.js +14 -7
- package/dist/esm/card/ui/assets/url.js +14 -7
- package/dist/esm/extensibility/ExtensionNodeWrapper.js +1 -1
- package/dist/esm/extensibility/extensionNodeView.js +1 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/react-node-view/getInlineNodeViewProducer.js +44 -13
- package/dist/esm/resizer/BreakoutResizer.js +7 -4
- package/dist/esm/resizer/Resizer.js +33 -12
- package/dist/esm/table/content-mode.js +57 -0
- package/dist/esm/table/index.js +2 -1
- package/dist/esm/toolbar/context.js +15 -5
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +1 -1
- package/dist/types/table/content-mode.d.ts +35 -0
- package/dist/types/table/index.d.ts +1 -0
- package/dist/types-ts4.5/table/content-mode.d.ts +35 -0
- package/dist/types-ts4.5/table/index.d.ts +1 -0
- package/package.json +5 -8
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
const IconEmbedGlyph = ({
|
|
4
6
|
'aria-label': ariaLabel,
|
|
@@ -21,18 +23,23 @@ const IconEmbedGlyph = ({
|
|
|
21
23
|
fill: "currentColor"
|
|
22
24
|
}));
|
|
23
25
|
};
|
|
26
|
+
const iconEmbedStyle = {
|
|
27
|
+
width: '24px',
|
|
28
|
+
height: '24px'
|
|
29
|
+
};
|
|
24
30
|
export const IconEmbed = ({
|
|
25
31
|
label
|
|
26
32
|
}) => {
|
|
33
|
+
const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconEmbedStyle :
|
|
34
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
35
|
+
{
|
|
36
|
+
width: '24px',
|
|
37
|
+
height: '24px'
|
|
38
|
+
};
|
|
27
39
|
return /*#__PURE__*/React.createElement(IconEmbedGlyph, {
|
|
28
40
|
"aria-label": label
|
|
29
|
-
// eslint-disable-next-line @
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
30
42
|
,
|
|
31
|
-
style:
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
width: '24px',
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
35
|
-
height: '24px'
|
|
36
|
-
}
|
|
43
|
+
style: style
|
|
37
44
|
});
|
|
38
45
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
const IconInlineGlyph = ({
|
|
4
6
|
'aria-label': ariaLabel,
|
|
@@ -21,18 +23,23 @@ const IconInlineGlyph = ({
|
|
|
21
23
|
fill: "currentColor"
|
|
22
24
|
}));
|
|
23
25
|
};
|
|
26
|
+
const iconInlineStyle = {
|
|
27
|
+
width: '24px',
|
|
28
|
+
height: '24px'
|
|
29
|
+
};
|
|
24
30
|
export const IconInline = ({
|
|
25
31
|
label
|
|
26
32
|
}) => {
|
|
33
|
+
const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconInlineStyle :
|
|
34
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
35
|
+
{
|
|
36
|
+
width: '24px',
|
|
37
|
+
height: '24px'
|
|
38
|
+
};
|
|
27
39
|
return /*#__PURE__*/React.createElement(IconInlineGlyph, {
|
|
28
40
|
"aria-label": label
|
|
29
|
-
// eslint-disable-next-line @
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
30
42
|
,
|
|
31
|
-
style:
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
width: '24px',
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
35
|
-
height: '24px'
|
|
36
|
-
}
|
|
43
|
+
style: style
|
|
37
44
|
});
|
|
38
45
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
const IconUrlGlyph = ({
|
|
4
6
|
'aria-label': ariaLabel,
|
|
@@ -23,18 +25,23 @@ const IconUrlGlyph = ({
|
|
|
23
25
|
fill: "currentColor"
|
|
24
26
|
}));
|
|
25
27
|
};
|
|
28
|
+
const iconUrlStyle = {
|
|
29
|
+
width: '24px',
|
|
30
|
+
height: '24px'
|
|
31
|
+
};
|
|
26
32
|
export const IconUrl = ({
|
|
27
33
|
label
|
|
28
34
|
}) => {
|
|
35
|
+
const style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconUrlStyle :
|
|
36
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
37
|
+
{
|
|
38
|
+
width: '24px',
|
|
39
|
+
height: '24px'
|
|
40
|
+
};
|
|
29
41
|
return /*#__PURE__*/React.createElement(IconUrlGlyph, {
|
|
30
42
|
"aria-label": label
|
|
31
|
-
// eslint-disable-next-line @
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
32
44
|
,
|
|
33
|
-
style:
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
35
|
-
width: '24px',
|
|
36
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
37
|
-
height: '24px'
|
|
38
|
-
}
|
|
45
|
+
style: style
|
|
39
46
|
});
|
|
40
47
|
};
|
|
@@ -72,7 +72,7 @@ export const ExtensionNodeWrapper = ({
|
|
|
72
72
|
relative: showMacroInteractionDesignUpdates
|
|
73
73
|
});
|
|
74
74
|
return jsx("span", {
|
|
75
|
-
"data-
|
|
75
|
+
"data-testid": "extension-node-wrapper"
|
|
76
76
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
77
77
|
,
|
|
78
78
|
className: wrapperClassNames,
|
|
@@ -118,7 +118,7 @@ export class ExtensionNode extends ReactNodeView {
|
|
|
118
118
|
if (this.didReuseSsrDom && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
|
|
119
119
|
const ssrElement = this.findSSRElement();
|
|
120
120
|
if (ssrElement) {
|
|
121
|
-
const extensionNodeWrapper = ssrElement.querySelector('[data-
|
|
121
|
+
const extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
|
|
122
122
|
if (extensionNodeWrapper) {
|
|
123
123
|
extensionNodeWrapper.remove();
|
|
124
124
|
}
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "114.
|
|
7
|
+
const packageVersion = "114.1.1";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -7,16 +7,19 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
10
|
+
import { flushSync } from 'react-dom';
|
|
11
|
+
import { createRoot } from 'react-dom/client';
|
|
10
12
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
15
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../analytics';
|
|
16
|
+
import { isSSR } from '../core-utils/is-ssr';
|
|
13
17
|
import { ErrorBoundary } from '../ui/ErrorBoundary';
|
|
14
18
|
import { analyticsEventKey, getPerformanceOptions, startMeasureReactNodeViewRendered, stopMeasureReactNodeViewRendered } from '../utils';
|
|
15
19
|
import { getBrowserInfo } from '../utils/browser';
|
|
16
20
|
import { ZERO_WIDTH_SPACE } from '../whitespace';
|
|
17
21
|
import { generateUniqueNodeKey } from './generateUniqueNodeKey';
|
|
18
22
|
import { getOrCreateOnVisibleObserver } from './onVisibleObserverFactory';
|
|
19
|
-
const isSSR = Boolean(process.env.REACT_SSR);
|
|
20
23
|
export const inlineNodeViewClassname = 'inlineNodeView';
|
|
21
24
|
const canRenderFallback = node => {
|
|
22
25
|
return node.type.isInline && node.type.isAtom && node.type.isLeaf;
|
|
@@ -70,13 +73,39 @@ function createNodeView({
|
|
|
70
73
|
// to the passed dom element (domRef) which means it is automatically
|
|
71
74
|
// "cleaned up" when you do a "re render".
|
|
72
75
|
function renderComponent() {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
if (isSSR() && expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
77
|
+
let html = '';
|
|
78
|
+
|
|
79
|
+
// We don't use direct rendering to the domRef, as this can lead to unexpected behavior,
|
|
80
|
+
// when the domRef element might have handlers from ProseMirror that will start executing
|
|
81
|
+
// in JSDom. Therefore, we simply attempt to render the element synchronously, get its HTML, and set it to the domRef,
|
|
82
|
+
// to keep the domRef as clear as possible.
|
|
83
|
+
try {
|
|
84
|
+
const PortalComponent = getPortalChildren({
|
|
85
|
+
dispatchAnalyticsEvent,
|
|
86
|
+
currentNode,
|
|
87
|
+
nodeViewParams,
|
|
88
|
+
Component,
|
|
89
|
+
extraComponentProps
|
|
90
|
+
});
|
|
91
|
+
const rootElement = document.createElement('span');
|
|
92
|
+
const ssrRoot = createRoot(rootElement);
|
|
93
|
+
flushSync(() => {
|
|
94
|
+
ssrRoot.render(jsx(PortalComponent, null));
|
|
95
|
+
});
|
|
96
|
+
html = rootElement.innerHTML;
|
|
97
|
+
ssrRoot.unmount();
|
|
98
|
+
} catch {}
|
|
99
|
+
domRef.innerHTML = html;
|
|
100
|
+
} else {
|
|
101
|
+
pmPluginFactoryParams.portalProviderAPI.render(getPortalChildren({
|
|
102
|
+
dispatchAnalyticsEvent,
|
|
103
|
+
currentNode,
|
|
104
|
+
nodeViewParams,
|
|
105
|
+
Component,
|
|
106
|
+
extraComponentProps
|
|
107
|
+
}), domRef, key);
|
|
108
|
+
}
|
|
80
109
|
}
|
|
81
110
|
const {
|
|
82
111
|
samplingRate,
|
|
@@ -133,10 +162,12 @@ function createNodeView({
|
|
|
133
162
|
return true;
|
|
134
163
|
},
|
|
135
164
|
destroy() {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
165
|
+
if (!isSSR() || !expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true)) {
|
|
166
|
+
// When prosemirror destroys the node view, we need to clean up
|
|
167
|
+
// what we have previously rendered using the editor portal
|
|
168
|
+
// provider api.
|
|
169
|
+
pmPluginFactoryParams.portalProviderAPI.remove(key);
|
|
170
|
+
}
|
|
140
171
|
// @ts-expect-error Expect an error as domRef is expected to be
|
|
141
172
|
// of HTMLSpanElement type however once the node view has
|
|
142
173
|
// been destroyed no other consumers should still be using it.
|
|
@@ -414,7 +445,7 @@ export function getInlineNodeViewProducer({
|
|
|
414
445
|
extraNodeViewProps
|
|
415
446
|
};
|
|
416
447
|
const isNodeTypeAllowedToBeVirtualized = virtualizedNodeAllowlist.includes((node === null || node === void 0 ? void 0 : (_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.name) || '');
|
|
417
|
-
if (!isNodeTypeAllowedToBeVirtualized || isSSR) {
|
|
448
|
+
if (!isNodeTypeAllowedToBeVirtualized || isSSR()) {
|
|
418
449
|
return createNodeView(parameters);
|
|
419
450
|
}
|
|
420
451
|
if (fg('platform_editor_inline_node_virt_threshold_override')) {
|
|
@@ -2,6 +2,7 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
2
2
|
import { bind, bindAll } from 'bind-event-listener';
|
|
3
3
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
7
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
|
|
7
8
|
import { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '../styles';
|
|
@@ -68,6 +69,10 @@ const defaultStyles = {
|
|
|
68
69
|
display: 'grid'
|
|
69
70
|
};
|
|
70
71
|
const RESIZE_STEP_VALUE = 10;
|
|
72
|
+
const RESIZER_ENABLE_HANDLES = {
|
|
73
|
+
left: true,
|
|
74
|
+
right: true
|
|
75
|
+
};
|
|
71
76
|
/**
|
|
72
77
|
* BreakoutResizer is a common component used to resize nodes that support the 'Breakout' mark, so it requires
|
|
73
78
|
* correct ADF support.
|
|
@@ -324,10 +329,8 @@ const BreakoutResizer = ({
|
|
|
324
329
|
});
|
|
325
330
|
}
|
|
326
331
|
return /*#__PURE__*/React.createElement(Resizer, {
|
|
327
|
-
ref: resizerRef
|
|
328
|
-
|
|
329
|
-
,
|
|
330
|
-
enable: {
|
|
332
|
+
ref: resizerRef,
|
|
333
|
+
enable: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? RESIZER_ENABLE_HANDLES : {
|
|
331
334
|
left: true,
|
|
332
335
|
right: true
|
|
333
336
|
},
|
|
@@ -6,6 +6,7 @@ import { useIntl } from 'react-intl';
|
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
8
8
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
11
12
|
import { messages } from '../messages/breakout';
|
|
@@ -106,16 +107,31 @@ const ResizerNext = (props, ref) => {
|
|
|
106
107
|
left: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'left', handleSize, handleAlignmentMethod),
|
|
107
108
|
right: classnames(handleClassName !== null && handleClassName !== void 0 ? handleClassName : resizerHandleClassName, 'right', handleSize, handleAlignmentMethod)
|
|
108
109
|
};
|
|
110
|
+
const handleWidth = handlePositioning === 'adjacent' ? "var(--ds-space-100, 8px)" : "var(--ds-space-300, 24px)";
|
|
109
111
|
const baseHandleStyles = {
|
|
110
|
-
width:
|
|
112
|
+
width: handleWidth,
|
|
111
113
|
zIndex: resizerHandleZIndex,
|
|
112
114
|
pointerEvents: 'auto',
|
|
113
115
|
alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
|
|
114
116
|
};
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
const memoizedBaseHandleStyles = useMemo(() => ({
|
|
118
|
+
width: handleWidth,
|
|
119
|
+
zIndex: resizerHandleZIndex,
|
|
120
|
+
pointerEvents: 'auto',
|
|
121
|
+
alignItems: handlePositioning === 'adjacent' ? 'center' : undefined
|
|
122
|
+
}), [handleWidth, handlePositioning]);
|
|
123
|
+
const offset = handlePositioning === 'adjacent' ? `calc(${handleWidth} * -1)` : `calc(${handleWidth} * -0.5)`;
|
|
124
|
+
const memoizedNextHandleStyles = useMemo(() => SUPPORTED_HANDLES.reduce((result, position) => ({
|
|
125
|
+
...result,
|
|
126
|
+
[position]: {
|
|
127
|
+
...memoizedBaseHandleStyles,
|
|
128
|
+
[position]: offset,
|
|
129
|
+
...(handleStyles === null || handleStyles === void 0 ? void 0 : handleStyles[position])
|
|
130
|
+
}
|
|
131
|
+
}), {}), [memoizedBaseHandleStyles, offset, handleStyles]);
|
|
132
|
+
const nextHandleStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedNextHandleStyles :
|
|
133
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- intentional fallback for experiment off path
|
|
134
|
+
SUPPORTED_HANDLES.reduce((result, position) => ({
|
|
119
135
|
...result,
|
|
120
136
|
[position]: {
|
|
121
137
|
...baseHandleStyles,
|
|
@@ -199,15 +215,19 @@ const ResizerNext = (props, ref) => {
|
|
|
199
215
|
}
|
|
200
216
|
return snapGap;
|
|
201
217
|
}, [snap, snapGap]);
|
|
218
|
+
const resizerAutoSize = useMemo(() => ({
|
|
219
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
220
|
+
height: 'auto'
|
|
221
|
+
}), [width]);
|
|
222
|
+
const resizerSize = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? resizerAutoSize :
|
|
223
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- intentional fallback for experiment off path
|
|
224
|
+
{
|
|
225
|
+
width: width !== null && width !== void 0 ? width : 'auto',
|
|
226
|
+
height: 'auto'
|
|
227
|
+
};
|
|
202
228
|
return /*#__PURE__*/React.createElement(Resizable, _extends({
|
|
203
|
-
ref: resizable
|
|
204
|
-
|
|
205
|
-
,
|
|
206
|
-
size: {
|
|
207
|
-
width: width !== null && width !== void 0 ? width : 'auto',
|
|
208
|
-
// just content itself (no paddings)
|
|
209
|
-
height: 'auto'
|
|
210
|
-
}
|
|
229
|
+
ref: resizable,
|
|
230
|
+
size: resizerSize
|
|
211
231
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
212
232
|
,
|
|
213
233
|
className: resizerClassName,
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns true if any cell in the first row of the table has a colwidth attribute set.
|
|
5
|
+
*
|
|
6
|
+
* Used by both the editor (as `hasTableColumnBeenResized`) and the renderer (as `hasColWidths`)
|
|
7
|
+
* to determine whether a table has had its columns manually resized.
|
|
8
|
+
*/
|
|
9
|
+
export const hasTableColumnBeenResized = tableNode => {
|
|
10
|
+
const firstRow = tableNode.content.firstChild;
|
|
11
|
+
if (!firstRow) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
for (let i = 0; i < firstRow.childCount; i++) {
|
|
15
|
+
if (firstRow.child(i).attrs.colwidth) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Returns true if the table has been explicitly resized — either the table itself has a width
|
|
24
|
+
* attribute set, or any column has been individually resized (colwidth present on cells).
|
|
25
|
+
*/
|
|
26
|
+
export const hasTableBeenResized = tableNode => tableNode.attrs.width !== null || hasTableColumnBeenResized(tableNode);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Determines whether a table should render in content mode.
|
|
30
|
+
*
|
|
31
|
+
* Content mode tables have no fixed column widths — the browser sizes columns to fit their
|
|
32
|
+
* content (`table-layout: auto`). This is the shared core predicate used by both the editor
|
|
33
|
+
* and the renderer. Each consumer is responsible for computing `isSupported` from its own
|
|
34
|
+
* feature flags / props before calling this function.
|
|
35
|
+
*
|
|
36
|
+
* A table is in content mode when ALL of the following are true:
|
|
37
|
+
* 1. The `platform_editor_table_fit_to_content_auto_convert` experiment is enabled
|
|
38
|
+
* 2. `isSupported` is true (caller has verified resizing is allowed and appearance is full-page)
|
|
39
|
+
* 3. The table is not nested inside another table or block node
|
|
40
|
+
* 4. The table node exists
|
|
41
|
+
* 5. The table has not been explicitly resized (`width === null` and no `colwidth` on cells)
|
|
42
|
+
* 6. The table's layout is `'align-start'`
|
|
43
|
+
*/
|
|
44
|
+
export const isTableInContentMode = ({
|
|
45
|
+
tableNode,
|
|
46
|
+
isSupported,
|
|
47
|
+
isTableNested
|
|
48
|
+
}) => {
|
|
49
|
+
if (!expValEqualsNoExposure('platform_editor_table_fit_to_content_auto_convert', 'isEnabled', true)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (!tableNode || isTableNested) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return isSupported && !hasTableBeenResized(tableNode) && tableNode.attrs.layout === 'align-start';
|
|
56
|
+
};
|
|
@@ -2,4 +2,5 @@
|
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
4
|
export { SORTABLE_COLUMN_ICON_CLASSNAME } from './consts';
|
|
5
|
-
export { default as SortingIcon, StatusClassNames } from './SortingIcon';
|
|
5
|
+
export { default as SortingIcon, StatusClassNames } from './SortingIcon';
|
|
6
|
+
export { hasTableBeenResized, hasTableColumnBeenResized, isTableInContentMode } from './content-mode';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { createContext, useContext } from 'react';
|
|
1
|
+
import React, { createContext, useContext, useMemo } from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
2
3
|
const EditorToolbarContext = /*#__PURE__*/createContext({
|
|
3
4
|
editorView: null,
|
|
4
5
|
editorAppearance: undefined,
|
|
@@ -24,14 +25,21 @@ export const EditorToolbarProvider = ({
|
|
|
24
25
|
editorToolbarDockingPreference,
|
|
25
26
|
isOffline
|
|
26
27
|
}) => {
|
|
28
|
+
const memoizedValue = useMemo(() => ({
|
|
29
|
+
editorView,
|
|
30
|
+
editorAppearance,
|
|
31
|
+
editorViewMode,
|
|
32
|
+
editorToolbarDockingPreference,
|
|
33
|
+
isOffline
|
|
34
|
+
}), [editorView, editorAppearance, editorViewMode, editorToolbarDockingPreference, isOffline]);
|
|
35
|
+
const contextValue = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedValue : {
|
|
36
|
+
editorView,
|
|
37
|
+
editorAppearance,
|
|
38
|
+
editorViewMode,
|
|
39
|
+
editorToolbarDockingPreference,
|
|
40
|
+
isOffline
|
|
41
|
+
};
|
|
27
42
|
return /*#__PURE__*/React.createElement(EditorToolbarContext.Provider, {
|
|
28
|
-
|
|
29
|
-
value: {
|
|
30
|
-
editorView,
|
|
31
|
-
editorAppearance,
|
|
32
|
-
editorViewMode,
|
|
33
|
-
editorToolbarDockingPreference,
|
|
34
|
-
isOffline
|
|
35
|
-
}
|
|
43
|
+
value: contextValue
|
|
36
44
|
}, children);
|
|
37
45
|
};
|
|
@@ -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 = "114.
|
|
17
|
+
const packageVersion = "114.1.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -322,7 +322,7 @@ export const mediaWrapperStyle = props => css`
|
|
|
322
322
|
/* Renderer */
|
|
323
323
|
[data-node-type='media'] {
|
|
324
324
|
position: static !important;
|
|
325
|
-
|
|
325
|
+
height: auto !important;
|
|
326
326
|
|
|
327
327
|
> div {
|
|
328
328
|
position: absolute;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
var IconCardGlyph = function IconCardGlyph(_ref) {
|
|
4
6
|
var ariaLabel = _ref['aria-label'],
|
|
@@ -20,17 +22,22 @@ var IconCardGlyph = function IconCardGlyph(_ref) {
|
|
|
20
22
|
fill: "currentColor"
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
25
|
+
var iconCardStyle = {
|
|
26
|
+
width: '24px',
|
|
27
|
+
height: '24px'
|
|
28
|
+
};
|
|
23
29
|
export var IconCard = function IconCard(_ref2) {
|
|
24
30
|
var label = _ref2.label;
|
|
31
|
+
var style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconCardStyle :
|
|
32
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
33
|
+
{
|
|
34
|
+
width: '24px',
|
|
35
|
+
height: '24px'
|
|
36
|
+
};
|
|
25
37
|
return /*#__PURE__*/React.createElement(IconCardGlyph, {
|
|
26
38
|
"aria-label": label
|
|
27
|
-
// eslint-disable-next-line @
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
28
40
|
,
|
|
29
|
-
style:
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
31
|
-
width: '24px',
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
height: '24px'
|
|
34
|
-
}
|
|
41
|
+
style: style
|
|
35
42
|
});
|
|
36
43
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
var IconEmbedGlyph = function IconEmbedGlyph(_ref) {
|
|
4
6
|
var ariaLabel = _ref['aria-label'],
|
|
@@ -20,17 +22,22 @@ var IconEmbedGlyph = function IconEmbedGlyph(_ref) {
|
|
|
20
22
|
fill: "currentColor"
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
25
|
+
var iconEmbedStyle = {
|
|
26
|
+
width: '24px',
|
|
27
|
+
height: '24px'
|
|
28
|
+
};
|
|
23
29
|
export var IconEmbed = function IconEmbed(_ref2) {
|
|
24
30
|
var label = _ref2.label;
|
|
31
|
+
var style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconEmbedStyle :
|
|
32
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
33
|
+
{
|
|
34
|
+
width: '24px',
|
|
35
|
+
height: '24px'
|
|
36
|
+
};
|
|
25
37
|
return /*#__PURE__*/React.createElement(IconEmbedGlyph, {
|
|
26
38
|
"aria-label": label
|
|
27
|
-
// eslint-disable-next-line @
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
28
40
|
,
|
|
29
|
-
style:
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
31
|
-
width: '24px',
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
height: '24px'
|
|
34
|
-
}
|
|
41
|
+
style: style
|
|
35
42
|
});
|
|
36
43
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
var IconInlineGlyph = function IconInlineGlyph(_ref) {
|
|
4
6
|
var ariaLabel = _ref['aria-label'],
|
|
@@ -20,17 +22,22 @@ var IconInlineGlyph = function IconInlineGlyph(_ref) {
|
|
|
20
22
|
fill: "currentColor"
|
|
21
23
|
}));
|
|
22
24
|
};
|
|
25
|
+
var iconInlineStyle = {
|
|
26
|
+
width: '24px',
|
|
27
|
+
height: '24px'
|
|
28
|
+
};
|
|
23
29
|
export var IconInline = function IconInline(_ref2) {
|
|
24
30
|
var label = _ref2.label;
|
|
31
|
+
var style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconInlineStyle :
|
|
32
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
33
|
+
{
|
|
34
|
+
width: '24px',
|
|
35
|
+
height: '24px'
|
|
36
|
+
};
|
|
25
37
|
return /*#__PURE__*/React.createElement(IconInlineGlyph, {
|
|
26
38
|
"aria-label": label
|
|
27
|
-
// eslint-disable-next-line @
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
28
40
|
,
|
|
29
|
-
style:
|
|
30
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
31
|
-
width: '24px',
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
height: '24px'
|
|
34
|
-
}
|
|
41
|
+
style: style
|
|
35
42
|
});
|
|
36
43
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
|
|
2
4
|
// Custom icon ejection - these icons have been migrated away from the deprecated Custom / SVG components to native SVG. Please review whether this icon should be contributed to @atlaskit/icon-lab or whether it can be replaced by an existing icon from either @atlaskit/icon or @atlaskit/icon-lab
|
|
3
5
|
var IconUrlGlyph = function IconUrlGlyph(_ref) {
|
|
4
6
|
var ariaLabel = _ref['aria-label'],
|
|
@@ -22,17 +24,22 @@ var IconUrlGlyph = function IconUrlGlyph(_ref) {
|
|
|
22
24
|
fill: "currentColor"
|
|
23
25
|
}));
|
|
24
26
|
};
|
|
27
|
+
var iconUrlStyle = {
|
|
28
|
+
width: '24px',
|
|
29
|
+
height: '24px'
|
|
30
|
+
};
|
|
25
31
|
export var IconUrl = function IconUrl(_ref2) {
|
|
26
32
|
var label = _ref2.label;
|
|
33
|
+
var style = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? iconUrlStyle :
|
|
34
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props
|
|
35
|
+
{
|
|
36
|
+
width: '24px',
|
|
37
|
+
height: '24px'
|
|
38
|
+
};
|
|
27
39
|
return /*#__PURE__*/React.createElement(IconUrlGlyph, {
|
|
28
40
|
"aria-label": label
|
|
29
|
-
// eslint-disable-next-line @
|
|
41
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
30
42
|
,
|
|
31
|
-
style:
|
|
32
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
33
|
-
width: '24px',
|
|
34
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
35
|
-
height: '24px'
|
|
36
|
-
}
|
|
43
|
+
style: style
|
|
37
44
|
});
|
|
38
45
|
};
|
|
@@ -70,7 +70,7 @@ export var ExtensionNodeWrapper = function ExtensionNodeWrapper(_ref) {
|
|
|
70
70
|
relative: showMacroInteractionDesignUpdates
|
|
71
71
|
});
|
|
72
72
|
return jsx("span", {
|
|
73
|
-
"data-
|
|
73
|
+
"data-testid": "extension-node-wrapper"
|
|
74
74
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
75
75
|
,
|
|
76
76
|
className: wrapperClassNames,
|
|
@@ -147,7 +147,7 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
147
147
|
if (this.didReuseSsrDom && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
|
|
148
148
|
var ssrElement = this.findSSRElement();
|
|
149
149
|
if (ssrElement) {
|
|
150
|
-
var extensionNodeWrapper = ssrElement.querySelector('[data-
|
|
150
|
+
var extensionNodeWrapper = ssrElement.querySelector('[data-testid="extension-node-wrapper"]');
|
|
151
151
|
if (extensionNodeWrapper) {
|
|
152
152
|
extensionNodeWrapper.remove();
|
|
153
153
|
}
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "114.
|
|
13
|
+
var packageVersion = "114.1.1";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|