@atlaskit/editor-common 114.16.0 → 114.18.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 +37 -0
- package/dist/cjs/extensibility/extensionNodeView.js +91 -22
- package/dist/cjs/messages/markdown-mode.js +5 -5
- package/dist/cjs/messages/media-insert.js +1 -1
- package/dist/cjs/messages/mentions.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Expand/index.js +5 -0
- package/dist/cjs/ui/MediaSingle/grid.js +2 -10
- package/dist/cjs/ui/MediaSingle/styled.js +1 -13
- package/dist/es2019/extensibility/extensionNodeView.js +88 -22
- package/dist/es2019/messages/markdown-mode.js +5 -5
- package/dist/es2019/messages/media-insert.js +1 -1
- package/dist/es2019/messages/mentions.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Expand/index.js +5 -0
- package/dist/es2019/ui/MediaSingle/grid.js +2 -10
- package/dist/es2019/ui/MediaSingle/styled.js +1 -13
- package/dist/esm/extensibility/extensionNodeView.js +91 -22
- package/dist/esm/messages/markdown-mode.js +5 -5
- package/dist/esm/messages/media-insert.js +1 -1
- package/dist/esm/messages/mentions.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Expand/index.js +5 -0
- package/dist/esm/ui/MediaSingle/grid.js +2 -10
- package/dist/esm/ui/MediaSingle/styled.js +1 -13
- package/dist/types/extensibility/extensionNodeView.d.ts +6 -13
- package/dist/types/messages/mentions.d.ts +16 -11
- package/dist/types/ui/Expand/index.d.ts +13 -8
- package/dist/types-ts4.5/extensibility/extensionNodeView.d.ts +6 -13
- package/dist/types-ts4.5/messages/mentions.d.ts +16 -11
- package/dist/types-ts4.5/ui/Expand/index.d.ts +13 -8
- package/package.json +3 -3
|
@@ -10,7 +10,6 @@ import React from 'react';
|
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
13
|
import { nonWrappedLayouts } from '../../utils';
|
|
15
14
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
16
15
|
function float(layout) {
|
|
@@ -117,16 +116,6 @@ export function calcResizedWidth(layout, width, containerWidth = 0
|
|
|
117
116
|
return `${width}px`;
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
|
-
function calcMaxWidth(layout, containerWidth) {
|
|
121
|
-
switch (layout) {
|
|
122
|
-
case 'wide':
|
|
123
|
-
return calcWideWidth(containerWidth);
|
|
124
|
-
case 'full-width':
|
|
125
|
-
return calcBreakoutWidth(layout, containerWidth);
|
|
126
|
-
default:
|
|
127
|
-
return '100%';
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
119
|
function calcMargin(layout) {
|
|
131
120
|
switch (layout) {
|
|
132
121
|
case 'wrap-right':
|
|
@@ -209,7 +198,6 @@ export const MediaSingleDimensionHelper = ({
|
|
|
209
198
|
isInRenderer = false
|
|
210
199
|
}) => {
|
|
211
200
|
const calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${mediaSingleWidth || width}px` : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
212
|
-
const calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? `${containerWidth}px` : calcMaxWidth(layout, containerWidth));
|
|
213
201
|
const cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
|
|
214
202
|
|
|
215
203
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
@@ -242,7 +230,7 @@ export const MediaSingleDimensionHelper = ({
|
|
|
242
230
|
'@container ak-renderer-wrapper (min-width: 1px)': {
|
|
243
231
|
maxWidth: '100cqw'
|
|
244
232
|
}
|
|
245
|
-
}) :
|
|
233
|
+
}) : `max-width: ${cssMaxWidth};`}
|
|
246
234
|
|
|
247
235
|
${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
|
|
248
236
|
.new-file-experience-wrapper {
|
|
@@ -15,6 +15,66 @@ import { isSSR } from '../core-utils';
|
|
|
15
15
|
import ReactNodeView from '../react-node-view';
|
|
16
16
|
import { Extension } from './Extension';
|
|
17
17
|
import { ExtensionNodeWrapper } from './ExtensionNodeWrapper';
|
|
18
|
+
/**
|
|
19
|
+
* Allowlists of extension keys + layout
|
|
20
|
+
* Currently, only toc with default layout allows to skip React render.
|
|
21
|
+
* Extensions NOT in this list always follow the normal React render path.
|
|
22
|
+
*/
|
|
23
|
+
var ssrHydrationExtensionAllowlist = ['toc'];
|
|
24
|
+
var ssrHydrationLayoutAllowlist = ['default'];
|
|
25
|
+
var isSSRHydrationEligible = function isSSRHydrationEligible(node) {
|
|
26
|
+
var _node$attrs;
|
|
27
|
+
if (node.type.name !== 'extension') {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
var _ref = (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 ? _node$attrs : {},
|
|
31
|
+
extensionKey = _ref.extensionKey,
|
|
32
|
+
layout = _ref.layout;
|
|
33
|
+
if (!ssrHydrationExtensionAllowlist.includes(extensionKey)) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
// Treat a missing layout attr as `default` (the schema default).
|
|
37
|
+
var effectiveLayout = layout !== null && layout !== void 0 ? layout : 'default';
|
|
38
|
+
return ssrHydrationLayoutAllowlist.includes(effectiveLayout);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Per-(EditorView, extensionKey + localId) record of which extension identities
|
|
43
|
+
* have already had their initial-hydration init pass. SSR DOM reuse is only valid
|
|
44
|
+
* the very first time an ExtensionNode init runs for a given identity in a given
|
|
45
|
+
* editor — that is the only moment a real SSR-rendered element for that identity
|
|
46
|
+
* can exist in the editor DOM.
|
|
47
|
+
*
|
|
48
|
+
* After the first init, any element matching the SSR selector is the previous
|
|
49
|
+
* node view's React-rendered domRef that ProseMirror has not yet detached (e.g.
|
|
50
|
+
* during DnD / layout resize, where ProseMirror constructs the new node view
|
|
51
|
+
* BEFORE destroying the old one). Reusing it as if it were SSR DOM causes the
|
|
52
|
+
* new node view to skip React rendering and leaves the extension invisible
|
|
53
|
+
* (EDITOR-6613).
|
|
54
|
+
*/
|
|
55
|
+
var consumedHydrationIdentitiesByEditor = new WeakMap();
|
|
56
|
+
var _getHydrationIdentityKey = function getHydrationIdentityKey(extensionKey, localId) {
|
|
57
|
+
if (typeof extensionKey !== 'string' || typeof localId !== 'string') {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
if (extensionKey === '' || localId === '') {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return "".concat(extensionKey, "::").concat(localId);
|
|
64
|
+
};
|
|
65
|
+
var hasHydrationIdentityBeenConsumed = function hasHydrationIdentityBeenConsumed(view, identityKey) {
|
|
66
|
+
var consumed = consumedHydrationIdentitiesByEditor.get(view);
|
|
67
|
+
return consumed ? consumed.has(identityKey) : false;
|
|
68
|
+
};
|
|
69
|
+
var markHydrationIdentityAsConsumed = function markHydrationIdentityAsConsumed(view, identityKey) {
|
|
70
|
+
var consumed = consumedHydrationIdentitiesByEditor.get(view);
|
|
71
|
+
if (!consumed) {
|
|
72
|
+
consumed = new Set();
|
|
73
|
+
consumedHydrationIdentitiesByEditor.set(view, consumed);
|
|
74
|
+
}
|
|
75
|
+
consumed.add(identityKey);
|
|
76
|
+
};
|
|
77
|
+
|
|
18
78
|
// getInlineNodeViewProducer is a new api to use instead of ReactNodeView
|
|
19
79
|
// when creating inline node views, however, it is difficult to test the impact
|
|
20
80
|
// on selections when migrating inlineExtension to use the new api.
|
|
@@ -28,16 +88,8 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
28
88
|
args[_key] = arguments[_key];
|
|
29
89
|
}
|
|
30
90
|
_this = _callSuper(this, ExtensionNode, [].concat(args));
|
|
31
|
-
/**
|
|
32
|
-
* Track whether we found and are reusing SSR'd DOM.
|
|
33
|
-
* When true, we skip React Portal rendering on first init to preserve SSR content.
|
|
34
|
-
*/
|
|
91
|
+
/** True between SSR DOM adoption in `createDomRef` and the SSR→React handoff in `update`. */
|
|
35
92
|
_defineProperty(_this, "didReuseSsrDom", false);
|
|
36
|
-
/**
|
|
37
|
-
* Track whether this is the first init call.
|
|
38
|
-
* SSR content preservation only happens on the very first init.
|
|
39
|
-
*/
|
|
40
|
-
_defineProperty(_this, "isFirstInit", true);
|
|
41
93
|
return _this;
|
|
42
94
|
}
|
|
43
95
|
_inherits(ExtensionNode, _ReactNodeView);
|
|
@@ -51,14 +103,32 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
51
103
|
return this.node.type.isAtom || mutation.type !== 'selection' && mutation.attributeName !== 'data-layout';
|
|
52
104
|
}
|
|
53
105
|
|
|
106
|
+
/** See {@link consumedHydrationIdentitiesByEditor}. Null when attrs are missing → SSR reuse skipped. */
|
|
107
|
+
}, {
|
|
108
|
+
key: "getHydrationIdentityKey",
|
|
109
|
+
value: function getHydrationIdentityKey() {
|
|
110
|
+
var _this$node$attrs, _this$node$attrs2;
|
|
111
|
+
return _getHydrationIdentityKey((_this$node$attrs = this.node.attrs) === null || _this$node$attrs === void 0 ? void 0 : _this$node$attrs.extensionKey, (_this$node$attrs2 = this.node.attrs) === null || _this$node$attrs2 === void 0 ? void 0 : _this$node$attrs2.localId);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** True only for the first ExtensionNode of this identity in this editor. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
115
|
+
}, {
|
|
116
|
+
key: "isInInitialHydrationWindow",
|
|
117
|
+
value: function isInInitialHydrationWindow() {
|
|
118
|
+
var identityKey = this.getHydrationIdentityKey();
|
|
119
|
+
if (identityKey === null) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return !hasHydrationIdentityBeenConsumed(this.view, identityKey);
|
|
123
|
+
}
|
|
124
|
+
|
|
54
125
|
// Reserve height by setting a minimum height for the extension node view element
|
|
55
126
|
}, {
|
|
56
127
|
key: "createDomRef",
|
|
57
128
|
value: function createDomRef() {
|
|
58
129
|
if (!fg('confluence_connect_macro_preset_height')) {
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
if (!isSSR() && this.isFirstInit && this.node.type.name === 'extension' && this.node.attrs.extensionKey === 'toc' && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
|
|
130
|
+
// SSR DOM reuse — see {@link consumedHydrationIdentitiesByEditor}.
|
|
131
|
+
if (!isSSR() && isSSRHydrationEligible(this.node) && this.isInInitialHydrationWindow() && expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
|
|
62
132
|
var ssrElement = this.findSSRElement();
|
|
63
133
|
if (ssrElement) {
|
|
64
134
|
this.didReuseSsrDom = true;
|
|
@@ -113,22 +183,22 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
113
183
|
return null;
|
|
114
184
|
}
|
|
115
185
|
|
|
116
|
-
/**
|
|
117
|
-
* Override init() to skip React Portal rendering on first init if we're reusing SSR'd DOM.
|
|
118
|
-
* This preserves the SSR content without React unnecessarily re-rendering it.
|
|
119
|
-
*/
|
|
186
|
+
/** Skip React Portal render on first init when reusing SSR DOM. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
120
187
|
}, {
|
|
121
188
|
key: "init",
|
|
122
189
|
value: function init() {
|
|
123
190
|
if (!expValEquals('platform_editor_hydration_skip_react_portal', 'isEnabled', true)) {
|
|
124
191
|
_superPropGet(ExtensionNode, "init", this, 3)([]);
|
|
125
192
|
} else {
|
|
126
|
-
|
|
193
|
+
var isEligibleForSsrReuse = !isSSR() && isSSRHydrationEligible(this.node);
|
|
194
|
+
if (isEligibleForSsrReuse && this.isInInitialHydrationWindow()) {
|
|
127
195
|
var ssrElement = this.findSSRElement();
|
|
128
196
|
var shouldSkipInitRender = ssrElement !== null;
|
|
129
197
|
_superPropGet(ExtensionNode, "init", this, 3)([shouldSkipInitRender]);
|
|
130
|
-
|
|
131
|
-
|
|
198
|
+
var identityKey = this.getHydrationIdentityKey();
|
|
199
|
+
if (identityKey !== null) {
|
|
200
|
+
// Close the hydration window — see {@link consumedHydrationIdentitiesByEditor}.
|
|
201
|
+
markHydrationIdentityAsConsumed(this.view, identityKey);
|
|
132
202
|
}
|
|
133
203
|
} else {
|
|
134
204
|
_superPropGet(ExtensionNode, "init", this, 3)([]);
|
|
@@ -210,9 +280,8 @@ export var ExtensionNode = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
210
280
|
key: "render",
|
|
211
281
|
value: function render(props, forwardRef) {
|
|
212
282
|
var _props$extensionNodeV;
|
|
213
|
-
//
|
|
214
|
-
|
|
215
|
-
if (this.didReuseSsrDom && this.isFirstInit) {
|
|
283
|
+
// While sitting on SSR DOM, skip the React portal — see {@link didReuseSsrDom}.
|
|
284
|
+
if (this.didReuseSsrDom) {
|
|
216
285
|
return null;
|
|
217
286
|
}
|
|
218
287
|
return /*#__PURE__*/React.createElement(ExtensionNodeWrapper, {
|
|
@@ -17,18 +17,18 @@ export var markdownModeMessages = defineMessages({
|
|
|
17
17
|
},
|
|
18
18
|
source: {
|
|
19
19
|
id: 'fabric.editor.markdownMode.viewToggle.source',
|
|
20
|
-
defaultMessage: '
|
|
21
|
-
description: 'Tooltip and accessible label for the toggle button that switches the editor into raw markdown source view.'
|
|
20
|
+
defaultMessage: 'Syntax editor',
|
|
21
|
+
description: 'Tooltip and accessible label for the toggle button that switches the editor into raw markdown source (syntax) view.'
|
|
22
22
|
},
|
|
23
23
|
wysiwyg: {
|
|
24
24
|
id: 'fabric.editor.markdownMode.viewToggle.wysiwyg',
|
|
25
|
-
defaultMessage: 'WYSIWYG',
|
|
25
|
+
defaultMessage: 'WYSIWYG editor',
|
|
26
26
|
description: 'Tooltip and accessible label for the toggle button that switches the editor into the WYSIWYG markdown editing view (the default).'
|
|
27
27
|
},
|
|
28
28
|
preview: {
|
|
29
29
|
id: 'fabric.editor.markdownMode.viewToggle.preview',
|
|
30
|
-
defaultMessage: '
|
|
31
|
-
description: 'Tooltip and accessible label for the toggle button that
|
|
30
|
+
defaultMessage: 'Split view (coming soon)',
|
|
31
|
+
description: 'Tooltip and accessible label for the toggle button that will switch the editor into a split view. This feature is not yet available.'
|
|
32
32
|
},
|
|
33
33
|
sourceAriaLabel: {
|
|
34
34
|
id: 'fabric.editor.markdownMode.sourceView.ariaLabel',
|
|
@@ -62,7 +62,7 @@ export var mediaInsertMessages = defineMessages({
|
|
|
62
62
|
},
|
|
63
63
|
generateTabTitle: {
|
|
64
64
|
id: 'fabric.editor.media.insert.generateTabTitle',
|
|
65
|
-
defaultMessage: '
|
|
65
|
+
defaultMessage: 'Create',
|
|
66
66
|
description: 'Title of the navigation tab that allows users to generate an image through AI'
|
|
67
67
|
},
|
|
68
68
|
mediaPickerPopupAriaLabel: {
|
|
@@ -34,5 +34,10 @@ export var mentionMessages = defineMessages({
|
|
|
34
34
|
id: 'fabric.editor.inviteItem.sendInvite',
|
|
35
35
|
defaultMessage: 'Send request to invite teammate',
|
|
36
36
|
description: 'By line text for send request to invite teammate option shown in mentions.'
|
|
37
|
+
},
|
|
38
|
+
inviteButton: {
|
|
39
|
+
id: 'fabric.editor.inviteItem.inviteButton',
|
|
40
|
+
defaultMessage: 'Invite',
|
|
41
|
+
description: 'Label for the invite button shown in the mention typeahead invite item.'
|
|
37
42
|
}
|
|
38
43
|
});
|
|
@@ -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.17.0";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "114.
|
|
24
|
+
var packageVersion = "114.17.0";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -43,6 +43,11 @@ export var messages = defineMessages({
|
|
|
43
43
|
id: 'fabric.editor.expandAriaLabel',
|
|
44
44
|
defaultMessage: 'Give this expand a title',
|
|
45
45
|
description: 'aria label for an expand node title input field'
|
|
46
|
+
},
|
|
47
|
+
expandBodyAriaLabel: {
|
|
48
|
+
id: 'fabric.editor.expandBodyAriaLabel',
|
|
49
|
+
defaultMessage: 'Expand body content',
|
|
50
|
+
description: 'Aria label for the body content of an expand node'
|
|
46
51
|
}
|
|
47
52
|
});
|
|
48
53
|
export var ExpandIconWrapper = function ExpandIconWrapper(_ref) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { akEditorBreakoutPadding, breakoutWideScaleRatio } from '@atlaskit/editor-shared-styles';
|
|
2
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
2
|
import { MEDIA_SINGLE_GUTTER_SIZE } from '../../media-single/constants';
|
|
4
3
|
var validWidthModes = ['center', 'wrap-left', 'wrap-right', 'align-start', 'align-end'];
|
|
5
4
|
export var layoutSupportsWidth = function layoutSupportsWidth(layout) {
|
|
@@ -55,10 +54,7 @@ export var calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
|
55
54
|
}
|
|
56
55
|
return calculatedPctWidth;
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
return calculatedPctWidth;
|
|
60
|
-
}
|
|
61
|
-
return Math.min(calculatedPctWidth, origWidth);
|
|
57
|
+
return calculatedPctWidth;
|
|
62
58
|
}
|
|
63
59
|
if (calculatedResizedPctWidth) {
|
|
64
60
|
return calculatedResizedPctWidth;
|
|
@@ -72,11 +68,7 @@ export var calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
|
72
68
|
} else if (layout && wrappedLayouts.indexOf(layout) !== -1) {
|
|
73
69
|
// when layout is wrap-left, wrap-right, align-start, align-end
|
|
74
70
|
// but no pctWidth is defined
|
|
75
|
-
|
|
76
|
-
return Math.min(calcPxFromPct(0.5, lineLength || width), origWidth);
|
|
77
|
-
}
|
|
78
|
-
var halfLineLength = Math.ceil((lineLength || width) / 2);
|
|
79
|
-
return origWidth <= halfLineLength ? origWidth : halfLineLength;
|
|
71
|
+
return Math.min(calcPxFromPct(0.5, lineLength || width), origWidth);
|
|
80
72
|
}
|
|
81
73
|
return origWidth;
|
|
82
74
|
};
|
|
@@ -14,7 +14,6 @@ import React from 'react';
|
|
|
14
14
|
import { css, jsx } from '@emotion/react';
|
|
15
15
|
import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
17
|
import { nonWrappedLayouts } from '../../utils';
|
|
19
18
|
import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
|
|
20
19
|
function float(layout) {
|
|
@@ -127,16 +126,6 @@ export function calcResizedWidth(layout, width) {
|
|
|
127
126
|
return "".concat(width, "px");
|
|
128
127
|
}
|
|
129
128
|
}
|
|
130
|
-
function calcMaxWidth(layout, containerWidth) {
|
|
131
|
-
switch (layout) {
|
|
132
|
-
case 'wide':
|
|
133
|
-
return calcWideWidth(containerWidth);
|
|
134
|
-
case 'full-width':
|
|
135
|
-
return calcBreakoutWidth(layout, containerWidth);
|
|
136
|
-
default:
|
|
137
|
-
return '100%';
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
129
|
function calcMargin(layout) {
|
|
141
130
|
switch (layout) {
|
|
142
131
|
case 'wrap-right':
|
|
@@ -221,7 +210,6 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
221
210
|
_ref$isInRenderer = _ref.isInRenderer,
|
|
222
211
|
isInRenderer = _ref$isInRenderer === void 0 ? false : _ref$isInRenderer;
|
|
223
212
|
var calculatedWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(mediaSingleWidth || width, "px") : mediaSingleWidth ? calcResizedWidth(layout, width || 0, containerWidth) : calcLegacyWidth(layout, width || 0, containerWidth, fullWidthMode, isResized, isInsideOfInlineExtension));
|
|
224
|
-
var calculatedMaxWidth = roundToClosestEvenPxValue(isExtendedResizeExperienceOn ? "".concat(containerWidth, "px") : calcMaxWidth(layout, containerWidth));
|
|
225
213
|
var cssMaxWidth = isExtendedResizeExperienceOn ? 'var(--ak-editor-max-container-width)' : calcMaxCssForPercentageTypeMedia(layout);
|
|
226
214
|
|
|
227
215
|
// jest warning: JSDOM version (22) doesn't support the new @container CSS rule
|
|
@@ -237,7 +225,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
|
|
|
237
225
|
'@container ak-renderer-wrapper (min-width: 1px)': {
|
|
238
226
|
maxWidth: '100cqw'
|
|
239
227
|
}
|
|
240
|
-
}) :
|
|
228
|
+
}) : "max-width: ".concat(cssMaxWidth, ";"), isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
|
|
241
229
|
};
|
|
242
230
|
var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
243
231
|
var hasFallbackContainer = _ref2.hasFallbackContainer,
|
|
@@ -25,20 +25,16 @@ interface ReactExtensionNodeProps {
|
|
|
25
25
|
showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNodeView<ReactExtensionNodeProps & AdditionalParams> {
|
|
28
|
-
/**
|
|
29
|
-
* Track whether we found and are reusing SSR'd DOM.
|
|
30
|
-
* When true, we skip React Portal rendering on first init to preserve SSR content.
|
|
31
|
-
*/
|
|
28
|
+
/** True between SSR DOM adoption in `createDomRef` and the SSR→React handoff in `update`. */
|
|
32
29
|
private didReuseSsrDom;
|
|
33
|
-
/**
|
|
34
|
-
* Track whether this is the first init call.
|
|
35
|
-
* SSR content preservation only happens on the very first init.
|
|
36
|
-
*/
|
|
37
|
-
private isFirstInit;
|
|
38
30
|
ignoreMutation(mutation: MutationRecord | {
|
|
39
31
|
target: Node;
|
|
40
32
|
type: 'selection';
|
|
41
33
|
}): boolean;
|
|
34
|
+
/** See {@link consumedHydrationIdentitiesByEditor}. Null when attrs are missing → SSR reuse skipped. */
|
|
35
|
+
private getHydrationIdentityKey;
|
|
36
|
+
/** True only for the first ExtensionNode of this identity in this editor. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
37
|
+
private isInInitialHydrationWindow;
|
|
42
38
|
createDomRef(): HTMLElement;
|
|
43
39
|
/**
|
|
44
40
|
* Cache for SSR element lookup to avoid repeated DOM queries.
|
|
@@ -53,10 +49,7 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
53
49
|
* @returns The SSR'd element if found, otherwise null
|
|
54
50
|
*/
|
|
55
51
|
private findSSRElement;
|
|
56
|
-
/**
|
|
57
|
-
* Override init() to skip React Portal rendering on first init if we're reusing SSR'd DOM.
|
|
58
|
-
* This preserves the SSR content without React unnecessarily re-rendering it.
|
|
59
|
-
*/
|
|
52
|
+
/** Skip React Portal render on first init when reusing SSR DOM. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
60
53
|
init(): this;
|
|
61
54
|
update(node: PmNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource, validUpdate?: (currentNode: PmNode, newNode: PmNode) => boolean): boolean;
|
|
62
55
|
/**
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
export declare const mentionMessages: {
|
|
2
|
+
inviteButton: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
2
7
|
inviteItemTitle: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
3
10
|
id: string;
|
|
11
|
+
};
|
|
12
|
+
inviteTeammateInvalidEmail: {
|
|
4
13
|
defaultMessage: string;
|
|
5
14
|
description: string;
|
|
15
|
+
id: string;
|
|
6
16
|
};
|
|
7
17
|
mentionsAddLabel: {
|
|
8
|
-
id: string;
|
|
9
18
|
defaultMessage: string;
|
|
10
19
|
description: string;
|
|
20
|
+
id: string;
|
|
11
21
|
};
|
|
12
22
|
mentionsIconLabel: {
|
|
13
|
-
id: string;
|
|
14
23
|
defaultMessage: string;
|
|
15
24
|
description: string;
|
|
25
|
+
id: string;
|
|
16
26
|
};
|
|
17
27
|
mentionsNodeLabel: {
|
|
18
|
-
id: string;
|
|
19
28
|
defaultMessage: string;
|
|
20
29
|
description: string;
|
|
21
|
-
};
|
|
22
|
-
unknownLabel: {
|
|
23
30
|
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
id: string;
|
|
32
|
+
sendInvite: {
|
|
29
33
|
defaultMessage: string;
|
|
30
34
|
description: string;
|
|
31
|
-
};
|
|
32
|
-
sendInvite: {
|
|
33
35
|
id: string;
|
|
36
|
+
};
|
|
37
|
+
unknownLabel: {
|
|
34
38
|
defaultMessage: string;
|
|
35
39
|
description: string;
|
|
40
|
+
id: string;
|
|
36
41
|
};
|
|
37
42
|
};
|
|
@@ -2,35 +2,40 @@ import React from 'react';
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { SerializedStyles } from '@emotion/react';
|
|
4
4
|
export declare const messages: {
|
|
5
|
-
|
|
6
|
-
id: string;
|
|
5
|
+
collapseNode: {
|
|
7
6
|
defaultMessage: string;
|
|
8
7
|
description: string;
|
|
8
|
+
id: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
expandArialabel: {
|
|
11
|
+
defaultMessage: string;
|
|
12
|
+
description: string;
|
|
11
13
|
id: string;
|
|
14
|
+
};
|
|
15
|
+
expandBodyAriaLabel: {
|
|
12
16
|
defaultMessage: string;
|
|
13
17
|
description: string;
|
|
18
|
+
id: string;
|
|
14
19
|
};
|
|
15
20
|
expandDefaultTitle: {
|
|
16
|
-
id: string;
|
|
17
21
|
defaultMessage: string;
|
|
18
22
|
description: string;
|
|
23
|
+
id: string;
|
|
19
24
|
};
|
|
20
25
|
expandNode: {
|
|
21
|
-
id: string;
|
|
22
26
|
defaultMessage: string;
|
|
23
27
|
description: string;
|
|
28
|
+
id: string;
|
|
24
29
|
};
|
|
25
30
|
expandPlaceholderText: {
|
|
26
|
-
id: string;
|
|
27
31
|
defaultMessage: string;
|
|
28
32
|
description: string;
|
|
29
|
-
};
|
|
30
|
-
expandArialabel: {
|
|
31
33
|
id: string;
|
|
34
|
+
};
|
|
35
|
+
loading: {
|
|
32
36
|
defaultMessage: string;
|
|
33
37
|
description: string;
|
|
38
|
+
id: string;
|
|
34
39
|
};
|
|
35
40
|
};
|
|
36
41
|
export declare const ExpandIconWrapper: ({ children, expanded, }: React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -25,20 +25,16 @@ interface ReactExtensionNodeProps {
|
|
|
25
25
|
showUpdatedLivePages1PBodiedExtensionUI?: (node: ADFEntity) => boolean;
|
|
26
26
|
}
|
|
27
27
|
export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNodeView<ReactExtensionNodeProps & AdditionalParams> {
|
|
28
|
-
/**
|
|
29
|
-
* Track whether we found and are reusing SSR'd DOM.
|
|
30
|
-
* When true, we skip React Portal rendering on first init to preserve SSR content.
|
|
31
|
-
*/
|
|
28
|
+
/** True between SSR DOM adoption in `createDomRef` and the SSR→React handoff in `update`. */
|
|
32
29
|
private didReuseSsrDom;
|
|
33
|
-
/**
|
|
34
|
-
* Track whether this is the first init call.
|
|
35
|
-
* SSR content preservation only happens on the very first init.
|
|
36
|
-
*/
|
|
37
|
-
private isFirstInit;
|
|
38
30
|
ignoreMutation(mutation: MutationRecord | {
|
|
39
31
|
target: Node;
|
|
40
32
|
type: 'selection';
|
|
41
33
|
}): boolean;
|
|
34
|
+
/** See {@link consumedHydrationIdentitiesByEditor}. Null when attrs are missing → SSR reuse skipped. */
|
|
35
|
+
private getHydrationIdentityKey;
|
|
36
|
+
/** True only for the first ExtensionNode of this identity in this editor. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
37
|
+
private isInInitialHydrationWindow;
|
|
42
38
|
createDomRef(): HTMLElement;
|
|
43
39
|
/**
|
|
44
40
|
* Cache for SSR element lookup to avoid repeated DOM queries.
|
|
@@ -53,10 +49,7 @@ export declare class ExtensionNode<AdditionalParams = unknown> extends ReactNode
|
|
|
53
49
|
* @returns The SSR'd element if found, otherwise null
|
|
54
50
|
*/
|
|
55
51
|
private findSSRElement;
|
|
56
|
-
/**
|
|
57
|
-
* Override init() to skip React Portal rendering on first init if we're reusing SSR'd DOM.
|
|
58
|
-
* This preserves the SSR content without React unnecessarily re-rendering it.
|
|
59
|
-
*/
|
|
52
|
+
/** Skip React Portal render on first init when reusing SSR DOM. See {@link consumedHydrationIdentitiesByEditor}. */
|
|
60
53
|
init(): this;
|
|
61
54
|
update(node: PmNode, decorations: ReadonlyArray<Decoration>, _innerDecorations?: DecorationSource, validUpdate?: (currentNode: PmNode, newNode: PmNode) => boolean): boolean;
|
|
62
55
|
/**
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
export declare const mentionMessages: {
|
|
2
|
+
inviteButton: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
2
7
|
inviteItemTitle: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
3
10
|
id: string;
|
|
11
|
+
};
|
|
12
|
+
inviteTeammateInvalidEmail: {
|
|
4
13
|
defaultMessage: string;
|
|
5
14
|
description: string;
|
|
15
|
+
id: string;
|
|
6
16
|
};
|
|
7
17
|
mentionsAddLabel: {
|
|
8
|
-
id: string;
|
|
9
18
|
defaultMessage: string;
|
|
10
19
|
description: string;
|
|
20
|
+
id: string;
|
|
11
21
|
};
|
|
12
22
|
mentionsIconLabel: {
|
|
13
|
-
id: string;
|
|
14
23
|
defaultMessage: string;
|
|
15
24
|
description: string;
|
|
25
|
+
id: string;
|
|
16
26
|
};
|
|
17
27
|
mentionsNodeLabel: {
|
|
18
|
-
id: string;
|
|
19
28
|
defaultMessage: string;
|
|
20
29
|
description: string;
|
|
21
|
-
};
|
|
22
|
-
unknownLabel: {
|
|
23
30
|
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
31
|
};
|
|
27
|
-
|
|
28
|
-
id: string;
|
|
32
|
+
sendInvite: {
|
|
29
33
|
defaultMessage: string;
|
|
30
34
|
description: string;
|
|
31
|
-
};
|
|
32
|
-
sendInvite: {
|
|
33
35
|
id: string;
|
|
36
|
+
};
|
|
37
|
+
unknownLabel: {
|
|
34
38
|
defaultMessage: string;
|
|
35
39
|
description: string;
|
|
40
|
+
id: string;
|
|
36
41
|
};
|
|
37
42
|
};
|
|
@@ -2,35 +2,40 @@ import React from 'react';
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { SerializedStyles } from '@emotion/react';
|
|
4
4
|
export declare const messages: {
|
|
5
|
-
|
|
6
|
-
id: string;
|
|
5
|
+
collapseNode: {
|
|
7
6
|
defaultMessage: string;
|
|
8
7
|
description: string;
|
|
8
|
+
id: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
expandArialabel: {
|
|
11
|
+
defaultMessage: string;
|
|
12
|
+
description: string;
|
|
11
13
|
id: string;
|
|
14
|
+
};
|
|
15
|
+
expandBodyAriaLabel: {
|
|
12
16
|
defaultMessage: string;
|
|
13
17
|
description: string;
|
|
18
|
+
id: string;
|
|
14
19
|
};
|
|
15
20
|
expandDefaultTitle: {
|
|
16
|
-
id: string;
|
|
17
21
|
defaultMessage: string;
|
|
18
22
|
description: string;
|
|
23
|
+
id: string;
|
|
19
24
|
};
|
|
20
25
|
expandNode: {
|
|
21
|
-
id: string;
|
|
22
26
|
defaultMessage: string;
|
|
23
27
|
description: string;
|
|
28
|
+
id: string;
|
|
24
29
|
};
|
|
25
30
|
expandPlaceholderText: {
|
|
26
|
-
id: string;
|
|
27
31
|
defaultMessage: string;
|
|
28
32
|
description: string;
|
|
29
|
-
};
|
|
30
|
-
expandArialabel: {
|
|
31
33
|
id: string;
|
|
34
|
+
};
|
|
35
|
+
loading: {
|
|
32
36
|
defaultMessage: string;
|
|
33
37
|
description: string;
|
|
38
|
+
id: string;
|
|
34
39
|
};
|
|
35
40
|
};
|
|
36
41
|
export declare const ExpandIconWrapper: ({ children, expanded, }: React.HTMLAttributes<HTMLDivElement> & {
|