@atlaskit/editor-core 217.9.2 → 217.10.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 +19 -0
- package/dist/cjs/composable-editor/editor-internal.js +5 -5
- package/dist/cjs/create-editor/ReactEditorView.js +32 -8
- package/dist/cjs/ui/Appearance/Chromeless.js +9 -6
- package/dist/cjs/ui/Appearance/Comment/Comment.js +26 -14
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +10 -7
- package/dist/cjs/ui/ContextPanel/index.js +9 -6
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +1 -1
- package/dist/cjs/ui/Toolbar/Toolbar.js +26 -17
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +5 -5
- package/dist/es2019/create-editor/ReactEditorView.js +30 -8
- package/dist/es2019/ui/Appearance/Chromeless.js +7 -4
- package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -14
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -3
- package/dist/es2019/ui/ContextPanel/index.js +7 -4
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +1 -1
- package/dist/es2019/ui/Toolbar/Toolbar.js +21 -16
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +5 -5
- package/dist/esm/create-editor/ReactEditorView.js +32 -8
- package/dist/esm/ui/Appearance/Chromeless.js +9 -6
- package/dist/esm/ui/Appearance/Comment/Comment.js +26 -14
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +3 -6
- package/dist/esm/ui/ContextPanel/index.js +9 -6
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +1 -1
- package/dist/esm/ui/Toolbar/Toolbar.js +23 -16
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +1 -0
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 217.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`22cc6940b4250`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22cc6940b4250) -
|
|
8
|
+
Add gated editor-core perf lint cleanup experiment support
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`d3fdb52a809c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3fdb52a809c9) -
|
|
13
|
+
clean up feature flag platform_editor_max_width_mode_resize_fix
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 217.9.3
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 217.9.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -32,6 +32,7 @@ var editorContainerStyles = (0, _react2.css)({
|
|
|
32
32
|
width: '100%',
|
|
33
33
|
height: '100%'
|
|
34
34
|
});
|
|
35
|
+
var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
35
36
|
|
|
36
37
|
/**
|
|
37
38
|
* EditorInternalComponent is used to capture the common component
|
|
@@ -67,14 +68,13 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
67
68
|
_usePortalProvider4 = (0, _slicedToArray2.default)(_usePortalProvider3, 2),
|
|
68
69
|
nodeViewPortalProviderAPI = _usePortalProvider4[0],
|
|
69
70
|
NodeViewPortalRenderer = _usePortalProvider4[1];
|
|
71
|
+
var propsToIgnore = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
70
72
|
return (0, _react2.jsx)(_react.Fragment, null, renderTrackingEnabled && (0, _react2.jsx)(_RenderTracking.RenderTracking, {
|
|
71
73
|
componentProps: props,
|
|
72
74
|
action: _analytics.ACTION.RE_RENDERED,
|
|
73
75
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
74
|
-
handleAnalyticsEvent: handleAnalyticsEvent
|
|
75
|
-
|
|
76
|
-
,
|
|
77
|
-
propsToIgnore: ['defaultValue'],
|
|
76
|
+
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
77
|
+
propsToIgnore: propsToIgnore,
|
|
78
78
|
useShallow: useShallow
|
|
79
79
|
}), (0, _react2.jsx)(_ErrorBoundary.default, {
|
|
80
80
|
errorTracking: true,
|
|
@@ -102,7 +102,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
102
102
|
onEditorDestroyed: onEditorDestroyed,
|
|
103
103
|
disabled: props.disabled,
|
|
104
104
|
preset: preset
|
|
105
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (
|
|
105
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017: this callback closes over the full props object and derived featureFlags; memoization is ineffective because ReactEditorViewNext is not memo()'d and deps (props, featureFlags) change every render
|
|
106
106
|
,
|
|
107
107
|
render: function render(_ref2) {
|
|
108
108
|
var _props$featureFlags, _props$featureFlags2;
|
|
@@ -868,6 +868,35 @@ function ReactEditorView(props) {
|
|
|
868
868
|
var _props$editorProps3 = props.editorProps,
|
|
869
869
|
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
870
870
|
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
871
|
+
var handleSsrEditorStateChanged = (0, _react.useCallback)(function (state) {
|
|
872
|
+
ssrEditorStateRef.current = state;
|
|
873
|
+
// Notify listeners about the initial SSR state
|
|
874
|
+
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
875
|
+
newEditorState: state,
|
|
876
|
+
oldEditorState: undefined
|
|
877
|
+
});
|
|
878
|
+
}, [pluginInjectionAPI]);
|
|
879
|
+
var memoizedReactEditorViewContext = (0, _react.useMemo)(function () {
|
|
880
|
+
return {
|
|
881
|
+
editorRef: editorRef,
|
|
882
|
+
// Use a getter so that consumers always read the live viewRef.current at access
|
|
883
|
+
// time, not a stale snapshot captured when this memo was created.
|
|
884
|
+
get editorView() {
|
|
885
|
+
return viewRef.current;
|
|
886
|
+
},
|
|
887
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
888
|
+
}
|
|
889
|
+
// viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
|
|
890
|
+
// .current lazily so there's no stale-closure risk.
|
|
891
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
892
|
+
;
|
|
893
|
+
}, [editorRef, props.editorProps.popupsMountPoint]);
|
|
894
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
|
|
895
|
+
var reactEditorViewContext = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
|
|
896
|
+
editorRef: editorRef,
|
|
897
|
+
editorView: viewRef.current,
|
|
898
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
899
|
+
};
|
|
871
900
|
var ssrEditor = (0, _react.useMemo)(function () {
|
|
872
901
|
if (!ssrDeps) {
|
|
873
902
|
return null;
|
|
@@ -890,7 +919,7 @@ function ReactEditorView(props) {
|
|
|
890
919
|
onSSRMeasure: onSSRMeasure
|
|
891
920
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
892
921
|
,
|
|
893
|
-
onEditorStateChanged: function
|
|
922
|
+
onEditorStateChanged: (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : function (state) {
|
|
894
923
|
ssrEditorStateRef.current = state;
|
|
895
924
|
// Notify listeners about the initial SSR state
|
|
896
925
|
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
@@ -899,7 +928,7 @@ function ReactEditorView(props) {
|
|
|
899
928
|
});
|
|
900
929
|
}
|
|
901
930
|
});
|
|
902
|
-
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
|
|
931
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
|
|
903
932
|
var editor = (0, _react.useMemo)(function () {
|
|
904
933
|
// SSR editor will be available only in SSR environment,
|
|
905
934
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -921,12 +950,7 @@ function ReactEditorView(props) {
|
|
|
921
950
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
922
951
|
onSSRMeasure: onSSRMeasure
|
|
923
952
|
}, /*#__PURE__*/_react.default.createElement(_uiReact.ReactEditorViewContext.Provider, {
|
|
924
|
-
|
|
925
|
-
value: {
|
|
926
|
-
editorRef: editorRef,
|
|
927
|
-
editorView: viewRef.current,
|
|
928
|
-
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
929
|
-
}
|
|
953
|
+
value: reactEditorViewContext
|
|
930
954
|
}, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
|
|
931
955
|
componentProps: props,
|
|
932
956
|
action: _analytics.ACTION.RE_RENDERED,
|
|
@@ -16,6 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
19
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
19
20
|
var _EditorContentContainer = _interopRequireDefault(require("../EditorContentContainer/EditorContentContainer"));
|
|
20
21
|
var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
|
|
21
22
|
var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
@@ -89,6 +90,9 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
89
90
|
_this = _callSuper(this, Editor, [].concat(args));
|
|
90
91
|
(0, _defineProperty2.default)(_this, "appearance", 'chromeless');
|
|
91
92
|
(0, _defineProperty2.default)(_this, "containerElement", null);
|
|
93
|
+
(0, _defineProperty2.default)(_this, "setContainerElement", function (ref) {
|
|
94
|
+
_this.containerElement = ref;
|
|
95
|
+
});
|
|
92
96
|
(0, _defineProperty2.default)(_this, "renderChrome", function (_ref) {
|
|
93
97
|
var maxContentSize = _ref.maxContentSize;
|
|
94
98
|
var _this$props = _this.props,
|
|
@@ -114,16 +118,15 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
114
118
|
var _states$editorViewMod;
|
|
115
119
|
return states === null || states === void 0 || (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
|
|
116
120
|
});
|
|
121
|
+
var containerRef = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.setContainerElement : function (ref) {
|
|
122
|
+
return _this.containerElement = ref;
|
|
123
|
+
};
|
|
117
124
|
return (0, _react2.jsx)(_WithFlash.default, {
|
|
118
125
|
animate: maxContentSizeReached
|
|
119
126
|
}, (0, _react2.jsx)(ChromelessEditorContainer, {
|
|
120
127
|
maxHeight: maxHeight,
|
|
121
|
-
minHeight: minHeight
|
|
122
|
-
|
|
123
|
-
,
|
|
124
|
-
containerRef: function containerRef(ref) {
|
|
125
|
-
return _this.containerElement = ref;
|
|
126
|
-
}
|
|
128
|
+
minHeight: minHeight,
|
|
129
|
+
containerRef: containerRef
|
|
127
130
|
}, (0, _react2.jsx)(_EditorContentContainer.default
|
|
128
131
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
129
132
|
, {
|
|
@@ -197,6 +197,30 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
197
197
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
198
198
|
}
|
|
199
199
|
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
|
|
200
|
+
var memoizedContentAreaStyles = (0, _react.useMemo)(function () {
|
|
201
|
+
return [maxHeight ?
|
|
202
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
203
|
+
(0, _react2.css)({
|
|
204
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
205
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
206
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
207
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
208
|
+
// This will cause the content area to have content overflowing the container
|
|
209
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
210
|
+
overflowY: 'auto'
|
|
211
|
+
}) : null];
|
|
212
|
+
}, [maxHeight]);
|
|
213
|
+
var contentAreaStyles = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
|
|
214
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
215
|
+
(0, _react2.css)({
|
|
216
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
217
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
218
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
219
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
220
|
+
// This will cause the content area to have content overflowing the container
|
|
221
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
222
|
+
overflowY: 'auto'
|
|
223
|
+
}) : null];
|
|
200
224
|
var customToolbarSlot = (0, _react2.jsx)("div", {
|
|
201
225
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
202
226
|
}, customPrimaryToolbarComponents);
|
|
@@ -270,20 +294,8 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
270
294
|
}, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref) {
|
|
271
295
|
var width = _ref.width;
|
|
272
296
|
return (0, _react2.jsx)(_EditorContentContainer.default, {
|
|
273
|
-
ref: containerElement
|
|
274
|
-
|
|
275
|
-
,
|
|
276
|
-
css: [maxHeight ?
|
|
277
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
278
|
-
(0, _react2.css)({
|
|
279
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
280
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
281
|
-
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
282
|
-
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
283
|
-
// This will cause the content area to have content overflowing the container
|
|
284
|
-
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
285
|
-
overflowY: 'auto'
|
|
286
|
-
}) : null],
|
|
297
|
+
ref: containerElement,
|
|
298
|
+
css: contentAreaStyles,
|
|
287
299
|
isScrollable: maxHeight ? true : undefined
|
|
288
300
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
289
301
|
,
|
|
@@ -25,12 +25,16 @@ var _EditorContentContainer = _interopRequireDefault(require("../../EditorConten
|
|
|
25
25
|
var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
|
|
26
26
|
var _StyledComponents = require("./StyledComponents");
|
|
27
27
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
28
|
-
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
28
|
+
/**
|
|
30
29
|
* @jsxRuntime classic
|
|
31
30
|
* @jsx jsx
|
|
32
|
-
*/
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
|
|
34
|
+
|
|
35
|
+
// Ignored via go/ees005
|
|
33
36
|
// eslint-disable-next-line import/no-named-as-default
|
|
37
|
+
|
|
34
38
|
var akEditorFullWidthLayoutWidth = 1800;
|
|
35
39
|
var akEditorUltraWideLayoutWidth = 4000;
|
|
36
40
|
var akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
|
|
@@ -281,11 +285,10 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
281
285
|
}) && editorContentReducedGutterStyles]
|
|
282
286
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
283
287
|
,
|
|
284
|
-
className: (0, _classnames.default)('ak-editor-content-area', 'appearance-full-page',
|
|
285
|
-
'fabric-editor--full-width-mode': fullWidthMode
|
|
286
|
-
}, (0, _platformFeatureFlags.fg)('platform_editor_max_width_mode_resize_fix') && {
|
|
288
|
+
className: (0, _classnames.default)('ak-editor-content-area', 'appearance-full-page', {
|
|
289
|
+
'fabric-editor--full-width-mode': fullWidthMode,
|
|
287
290
|
'fabric-editor--max-width-mode': Boolean(maxWidthMode)
|
|
288
|
-
})
|
|
291
|
+
}),
|
|
289
292
|
ref: contentAreaRef
|
|
290
293
|
}, !!props.customContentComponents && 'before' in props.customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents.before) : (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents), (0, _react2.jsx)(_PluginSlot.default, {
|
|
291
294
|
editorView: props.editorView,
|
|
@@ -22,6 +22,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
22
22
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
23
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
24
24
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
25
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
25
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27
28
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -75,6 +76,9 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
75
76
|
mounted: false,
|
|
76
77
|
currentPluginContent: undefined
|
|
77
78
|
});
|
|
79
|
+
(0, _defineProperty2.default)(_this, "handleTransitionExited", function () {
|
|
80
|
+
_this.unsetPluginContent();
|
|
81
|
+
});
|
|
78
82
|
(0, _defineProperty2.default)(_this, "focusEditor", function () {
|
|
79
83
|
var _editorAPI$core;
|
|
80
84
|
var editorAPI = _this.props.editorAPI;
|
|
@@ -89,16 +93,15 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
89
93
|
return;
|
|
90
94
|
}
|
|
91
95
|
var animSpeedMs = (0, _platformFeatureFlags.fg)('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
|
|
96
|
+
var onExited = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.handleTransitionExited : function () {
|
|
97
|
+
return _this.unsetPluginContent();
|
|
98
|
+
};
|
|
92
99
|
return (0, _react2.jsx)(_Transition.default, {
|
|
93
100
|
timeout: _this.state.mounted ? animSpeedMs : 0,
|
|
94
101
|
in: !!pluginContent,
|
|
95
102
|
mountOnEnter: true,
|
|
96
|
-
unmountOnExit: true
|
|
97
|
-
|
|
98
|
-
,
|
|
99
|
-
onExited: function onExited() {
|
|
100
|
-
return _this.unsetPluginContent();
|
|
101
|
-
}
|
|
103
|
+
unmountOnExit: true,
|
|
104
|
+
onExited: onExited
|
|
102
105
|
}, currentPluginContent);
|
|
103
106
|
});
|
|
104
107
|
(0, _defineProperty2.default)(_this, "showProvidedContent", function (isVisible) {
|
|
@@ -150,7 +150,7 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
|
|
|
150
150
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
151
151
|
_baseStyles.baseStyles,
|
|
152
152
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
153
|
-
|
|
153
|
+
_baseStyles.maxModeReizeFixStyles, (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) &&
|
|
154
154
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
155
155
|
_baseStyles.baseStylesMaxContainerWidthFixes,
|
|
156
156
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ToolbarNext = exports.Toolbar = void 0;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
11
11
|
var _types = require("@atlaskit/editor-common/types");
|
|
12
12
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
14
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _ToolbarInner = require("./ToolbarInner");
|
|
17
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
|
+
var TOOLBAR_FALLBACKS = {
|
|
19
|
+
group: _editorToolbar.ToolbarButtonGroup,
|
|
20
|
+
section: _editorToolbar.ToolbarSection,
|
|
21
|
+
menuSection: _editorToolbar.ToolbarDropdownItemSection
|
|
22
|
+
};
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
|
|
18
26
|
*
|
|
@@ -69,6 +77,18 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
|
|
|
69
77
|
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
70
78
|
// remove offline check when patch6Enabled is cleaned up
|
|
71
79
|
var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(connectivityStateMode);
|
|
80
|
+
var memoizedFireAnalyticsEvent = (0, _react.useCallback)(function (payload) {
|
|
81
|
+
var _editorAPI$analytics;
|
|
82
|
+
editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
83
|
+
}, [editorAPI]);
|
|
84
|
+
var fireAnalyticsEvent = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : function (payload) {
|
|
85
|
+
return memoizedFireAnalyticsEvent(payload);
|
|
86
|
+
};
|
|
87
|
+
var fallbacks = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
|
|
88
|
+
group: _editorToolbar.ToolbarButtonGroup,
|
|
89
|
+
section: _editorToolbar.ToolbarSection,
|
|
90
|
+
menuSection: _editorToolbar.ToolbarDropdownItemSection
|
|
91
|
+
};
|
|
72
92
|
return /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarProvider, {
|
|
73
93
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
74
94
|
editorAppearance: editorAppearance,
|
|
@@ -80,22 +100,11 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
|
|
|
80
100
|
isDisabled: isDisabled,
|
|
81
101
|
popupsMountPoint: popupsMountPoint,
|
|
82
102
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
83
|
-
popupsScrollableElement: popupsScrollableElement
|
|
84
|
-
|
|
85
|
-
,
|
|
86
|
-
fireAnalyticsEvent: function fireAnalyticsEvent(payload) {
|
|
87
|
-
var _editorAPI$analytics;
|
|
88
|
-
editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
89
|
-
}
|
|
103
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
104
|
+
fireAnalyticsEvent: fireAnalyticsEvent
|
|
90
105
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbarModel.ToolbarModelRenderer, {
|
|
91
106
|
toolbar: toolbar,
|
|
92
|
-
components: components
|
|
93
|
-
|
|
94
|
-
,
|
|
95
|
-
fallbacks: {
|
|
96
|
-
group: _editorToolbar.ToolbarButtonGroup,
|
|
97
|
-
section: _editorToolbar.ToolbarSection,
|
|
98
|
-
menuSection: _editorToolbar.ToolbarDropdownItemSection
|
|
99
|
-
}
|
|
107
|
+
components: components,
|
|
108
|
+
fallbacks: fallbacks
|
|
100
109
|
})));
|
|
101
110
|
};
|
|
@@ -23,6 +23,7 @@ const editorContainerStyles = css({
|
|
|
23
23
|
width: '100%',
|
|
24
24
|
height: '100%'
|
|
25
25
|
});
|
|
26
|
+
const DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* EditorInternalComponent is used to capture the common component
|
|
@@ -54,14 +55,13 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
54
55
|
const useShallow = false;
|
|
55
56
|
const [portalProviderAPI, PortalRenderer] = usePortalProvider();
|
|
56
57
|
const [nodeViewPortalProviderAPI, NodeViewPortalRenderer] = usePortalProvider();
|
|
58
|
+
const propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
57
59
|
return jsx(Fragment, null, renderTrackingEnabled && jsx(RenderTracking, {
|
|
58
60
|
componentProps: props,
|
|
59
61
|
action: ACTION.RE_RENDERED,
|
|
60
62
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
61
|
-
handleAnalyticsEvent: handleAnalyticsEvent
|
|
62
|
-
|
|
63
|
-
,
|
|
64
|
-
propsToIgnore: ['defaultValue'],
|
|
63
|
+
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
64
|
+
propsToIgnore: propsToIgnore,
|
|
65
65
|
useShallow: useShallow
|
|
66
66
|
}), jsx(ErrorBoundary, {
|
|
67
67
|
errorTracking: true,
|
|
@@ -89,7 +89,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
89
89
|
onEditorDestroyed: onEditorDestroyed,
|
|
90
90
|
disabled: props.disabled,
|
|
91
91
|
preset: preset
|
|
92
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (
|
|
92
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017: this callback closes over the full props object and derived featureFlags; memoization is ineffective because ReactEditorViewNext is not memo()'d and deps (props, featureFlags) change every render
|
|
93
93
|
,
|
|
94
94
|
render: ({
|
|
95
95
|
editor,
|
|
@@ -814,6 +814,33 @@ export function ReactEditorView(props) {
|
|
|
814
814
|
assistiveLabel,
|
|
815
815
|
assistiveDescribedBy
|
|
816
816
|
} = props.editorProps;
|
|
817
|
+
const handleSsrEditorStateChanged = useCallback(state => {
|
|
818
|
+
ssrEditorStateRef.current = state;
|
|
819
|
+
// Notify listeners about the initial SSR state
|
|
820
|
+
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
821
|
+
newEditorState: state,
|
|
822
|
+
oldEditorState: undefined
|
|
823
|
+
});
|
|
824
|
+
}, [pluginInjectionAPI]);
|
|
825
|
+
const memoizedReactEditorViewContext = useMemo(() => ({
|
|
826
|
+
editorRef,
|
|
827
|
+
// Use a getter so that consumers always read the live viewRef.current at access
|
|
828
|
+
// time, not a stale snapshot captured when this memo was created.
|
|
829
|
+
get editorView() {
|
|
830
|
+
return viewRef.current;
|
|
831
|
+
},
|
|
832
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
833
|
+
}
|
|
834
|
+
// viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
|
|
835
|
+
// .current lazily so there's no stale-closure risk.
|
|
836
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
837
|
+
), [editorRef, props.editorProps.popupsMountPoint]);
|
|
838
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
|
|
839
|
+
const reactEditorViewContext = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
|
|
840
|
+
editorRef,
|
|
841
|
+
editorView: viewRef.current,
|
|
842
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
843
|
+
};
|
|
817
844
|
const ssrEditor = useMemo(() => {
|
|
818
845
|
if (!ssrDeps) {
|
|
819
846
|
return null;
|
|
@@ -836,7 +863,7 @@ export function ReactEditorView(props) {
|
|
|
836
863
|
onSSRMeasure: onSSRMeasure
|
|
837
864
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
838
865
|
,
|
|
839
|
-
onEditorStateChanged: state => {
|
|
866
|
+
onEditorStateChanged: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : state => {
|
|
840
867
|
ssrEditorStateRef.current = state;
|
|
841
868
|
// Notify listeners about the initial SSR state
|
|
842
869
|
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
@@ -845,7 +872,7 @@ export function ReactEditorView(props) {
|
|
|
845
872
|
});
|
|
846
873
|
}
|
|
847
874
|
});
|
|
848
|
-
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
|
|
875
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
|
|
849
876
|
const editor = useMemo(() => {
|
|
850
877
|
// SSR editor will be available only in SSR environment,
|
|
851
878
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -867,12 +894,7 @@ export function ReactEditorView(props) {
|
|
|
867
894
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
868
895
|
onSSRMeasure: onSSRMeasure
|
|
869
896
|
}, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
870
|
-
|
|
871
|
-
value: {
|
|
872
|
-
editorRef: editorRef,
|
|
873
|
-
editorView: viewRef.current,
|
|
874
|
-
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
875
|
-
}
|
|
897
|
+
value: reactEditorViewContext
|
|
876
898
|
}, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
877
899
|
componentProps: props,
|
|
878
900
|
action: ACTION.RE_RENDERED,
|
|
@@ -8,6 +8,7 @@ import React, { Fragment } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
12
|
import EditorContentContainer from '../EditorContentContainer/EditorContentContainer';
|
|
12
13
|
import PluginSlot from '../PluginSlot';
|
|
13
14
|
import WithFlash from '../WithFlash';
|
|
@@ -70,6 +71,9 @@ export default class Editor extends React.Component {
|
|
|
70
71
|
super(...args);
|
|
71
72
|
_defineProperty(this, "appearance", 'chromeless');
|
|
72
73
|
_defineProperty(this, "containerElement", null);
|
|
74
|
+
_defineProperty(this, "setContainerElement", ref => {
|
|
75
|
+
this.containerElement = ref;
|
|
76
|
+
});
|
|
73
77
|
_defineProperty(this, "renderChrome", ({
|
|
74
78
|
maxContentSize
|
|
75
79
|
}) => {
|
|
@@ -96,14 +100,13 @@ export default class Editor extends React.Component {
|
|
|
96
100
|
var _states$editorViewMod;
|
|
97
101
|
return states === null || states === void 0 ? void 0 : (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
|
|
98
102
|
});
|
|
103
|
+
const containerRef = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? this.setContainerElement : ref => this.containerElement = ref;
|
|
99
104
|
return jsx(WithFlash, {
|
|
100
105
|
animate: maxContentSizeReached
|
|
101
106
|
}, jsx(ChromelessEditorContainer, {
|
|
102
107
|
maxHeight: maxHeight,
|
|
103
|
-
minHeight: minHeight
|
|
104
|
-
|
|
105
|
-
,
|
|
106
|
-
containerRef: ref => this.containerElement = ref
|
|
108
|
+
minHeight: minHeight,
|
|
109
|
+
containerRef: containerRef
|
|
107
110
|
}, jsx(EditorContentContainer
|
|
108
111
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
109
112
|
, {
|
|
@@ -185,6 +185,28 @@ export const CommentEditorWithIntl = props => {
|
|
|
185
185
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
186
186
|
}
|
|
187
187
|
const isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
|
|
188
|
+
const memoizedContentAreaStyles = useMemo(() => [maxHeight ?
|
|
189
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
190
|
+
css({
|
|
191
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
192
|
+
maxHeight: `${maxHeight}px`,
|
|
193
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
194
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
195
|
+
// This will cause the content area to have content overflowing the container
|
|
196
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
197
|
+
overflowY: 'auto'
|
|
198
|
+
}) : null], [maxHeight]);
|
|
199
|
+
const contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
|
|
200
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
201
|
+
css({
|
|
202
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
203
|
+
maxHeight: `${maxHeight}px`,
|
|
204
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
205
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
206
|
+
// This will cause the content area to have content overflowing the container
|
|
207
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
208
|
+
overflowY: 'auto'
|
|
209
|
+
}) : null];
|
|
188
210
|
const customToolbarSlot = jsx("div", {
|
|
189
211
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
190
212
|
}, customPrimaryToolbarComponents);
|
|
@@ -259,20 +281,8 @@ export const CommentEditorWithIntl = props => {
|
|
|
259
281
|
width
|
|
260
282
|
}) => {
|
|
261
283
|
return jsx(EditorContentContainer, {
|
|
262
|
-
ref: containerElement
|
|
263
|
-
|
|
264
|
-
,
|
|
265
|
-
css: [maxHeight ?
|
|
266
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
267
|
-
css({
|
|
268
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
269
|
-
maxHeight: `${maxHeight}px`,
|
|
270
|
-
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
271
|
-
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
272
|
-
// This will cause the content area to have content overflowing the container
|
|
273
|
-
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
274
|
-
overflowY: 'auto'
|
|
275
|
-
}) : null],
|
|
284
|
+
ref: containerElement,
|
|
285
|
+
css: contentAreaStyles,
|
|
276
286
|
isScrollable: maxHeight ? true : undefined
|
|
277
287
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
278
288
|
,
|
|
@@ -279,9 +279,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
279
279
|
,
|
|
280
280
|
className: classnames('ak-editor-content-area', 'appearance-full-page', {
|
|
281
281
|
'fabric-editor--full-width-mode': fullWidthMode,
|
|
282
|
-
|
|
283
|
-
'fabric-editor--max-width-mode': Boolean(maxWidthMode)
|
|
284
|
-
})
|
|
282
|
+
'fabric-editor--max-width-mode': Boolean(maxWidthMode)
|
|
285
283
|
}),
|
|
286
284
|
ref: contentAreaRef
|
|
287
285
|
}, !!props.customContentComponents && 'before' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.before) : contentComponentClickWrapper(props.customContentComponents), jsx(PluginSlot, {
|
|
@@ -16,6 +16,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
16
16
|
import { contextPanelMessages } from '@atlaskit/editor-common/messages';
|
|
17
17
|
import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
19
20
|
const ANIM_SPEED_MS = 500;
|
|
20
21
|
const panelHidden = css({
|
|
21
22
|
width: 0
|
|
@@ -57,6 +58,9 @@ class SwappableContentAreaInner extends React.PureComponent {
|
|
|
57
58
|
mounted: false,
|
|
58
59
|
currentPluginContent: undefined
|
|
59
60
|
});
|
|
61
|
+
_defineProperty(this, "handleTransitionExited", () => {
|
|
62
|
+
this.unsetPluginContent();
|
|
63
|
+
});
|
|
60
64
|
_defineProperty(this, "focusEditor", () => {
|
|
61
65
|
var _editorAPI$core;
|
|
62
66
|
const {
|
|
@@ -77,14 +81,13 @@ class SwappableContentAreaInner extends React.PureComponent {
|
|
|
77
81
|
return;
|
|
78
82
|
}
|
|
79
83
|
const animSpeedMs = fg('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
|
|
84
|
+
const onExited = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? this.handleTransitionExited : () => this.unsetPluginContent();
|
|
80
85
|
return jsx(Transition, {
|
|
81
86
|
timeout: this.state.mounted ? animSpeedMs : 0,
|
|
82
87
|
in: !!pluginContent,
|
|
83
88
|
mountOnEnter: true,
|
|
84
|
-
unmountOnExit: true
|
|
85
|
-
|
|
86
|
-
,
|
|
87
|
-
onExited: () => this.unsetPluginContent()
|
|
89
|
+
unmountOnExit: true,
|
|
90
|
+
onExited: onExited
|
|
88
91
|
}, currentPluginContent);
|
|
89
92
|
});
|
|
90
93
|
_defineProperty(this, "showProvidedContent", isVisible => {
|
|
@@ -146,7 +146,7 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
146
146
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
147
147
|
baseStyles,
|
|
148
148
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
149
|
-
|
|
149
|
+
maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
|
|
150
150
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
151
151
|
baseStylesMaxContainerWidthFixes,
|
|
152
152
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { EditorToolbarProvider, EditorToolbarUIProvider } from '@atlaskit/editor-common/toolbar';
|
|
4
4
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
6
6
|
import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { ToolbarInner } from './ToolbarInner';
|
|
10
|
+
const TOOLBAR_FALLBACKS = {
|
|
11
|
+
group: ToolbarButtonGroup,
|
|
12
|
+
section: ToolbarSection,
|
|
13
|
+
menuSection: ToolbarDropdownItemSection
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
/**
|
|
11
17
|
* *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
|
|
@@ -65,6 +71,16 @@ export const ToolbarNext = ({
|
|
|
65
71
|
} = usePluginState(editorAPI);
|
|
66
72
|
// remove offline check when patch6Enabled is cleaned up
|
|
67
73
|
const isOffline = isOfflineMode(connectivityStateMode);
|
|
74
|
+
const memoizedFireAnalyticsEvent = useCallback(payload => {
|
|
75
|
+
var _editorAPI$analytics;
|
|
76
|
+
editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
77
|
+
}, [editorAPI]);
|
|
78
|
+
const fireAnalyticsEvent = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : payload => memoizedFireAnalyticsEvent(payload);
|
|
79
|
+
const fallbacks = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
|
|
80
|
+
group: ToolbarButtonGroup,
|
|
81
|
+
section: ToolbarSection,
|
|
82
|
+
menuSection: ToolbarDropdownItemSection
|
|
83
|
+
};
|
|
68
84
|
return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
69
85
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
70
86
|
editorAppearance: editorAppearance,
|
|
@@ -76,22 +92,11 @@ export const ToolbarNext = ({
|
|
|
76
92
|
isDisabled: isDisabled,
|
|
77
93
|
popupsMountPoint: popupsMountPoint,
|
|
78
94
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
79
|
-
popupsScrollableElement: popupsScrollableElement
|
|
80
|
-
|
|
81
|
-
,
|
|
82
|
-
fireAnalyticsEvent: payload => {
|
|
83
|
-
var _editorAPI$analytics;
|
|
84
|
-
editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
85
|
-
}
|
|
95
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
96
|
+
fireAnalyticsEvent: fireAnalyticsEvent
|
|
86
97
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
87
98
|
toolbar: toolbar,
|
|
88
|
-
components: components
|
|
89
|
-
|
|
90
|
-
,
|
|
91
|
-
fallbacks: {
|
|
92
|
-
group: ToolbarButtonGroup,
|
|
93
|
-
section: ToolbarSection,
|
|
94
|
-
menuSection: ToolbarDropdownItemSection
|
|
95
|
-
}
|
|
99
|
+
components: components,
|
|
100
|
+
fallbacks: fallbacks
|
|
96
101
|
})));
|
|
97
102
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "217.9.
|
|
2
|
+
export const version = "217.9.3";
|
|
@@ -27,6 +27,7 @@ var editorContainerStyles = css({
|
|
|
27
27
|
width: '100%',
|
|
28
28
|
height: '100%'
|
|
29
29
|
});
|
|
30
|
+
var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* EditorInternalComponent is used to capture the common component
|
|
@@ -62,14 +63,13 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
62
63
|
_usePortalProvider4 = _slicedToArray(_usePortalProvider3, 2),
|
|
63
64
|
nodeViewPortalProviderAPI = _usePortalProvider4[0],
|
|
64
65
|
NodeViewPortalRenderer = _usePortalProvider4[1];
|
|
66
|
+
var propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
|
|
65
67
|
return jsx(Fragment, null, renderTrackingEnabled && jsx(RenderTracking, {
|
|
66
68
|
componentProps: props,
|
|
67
69
|
action: ACTION.RE_RENDERED,
|
|
68
70
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
69
|
-
handleAnalyticsEvent: handleAnalyticsEvent
|
|
70
|
-
|
|
71
|
-
,
|
|
72
|
-
propsToIgnore: ['defaultValue'],
|
|
71
|
+
handleAnalyticsEvent: handleAnalyticsEvent,
|
|
72
|
+
propsToIgnore: propsToIgnore,
|
|
73
73
|
useShallow: useShallow
|
|
74
74
|
}), jsx(ErrorBoundary, {
|
|
75
75
|
errorTracking: true,
|
|
@@ -97,7 +97,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
97
97
|
onEditorDestroyed: onEditorDestroyed,
|
|
98
98
|
disabled: props.disabled,
|
|
99
99
|
preset: preset
|
|
100
|
-
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (
|
|
100
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017: this callback closes over the full props object and derived featureFlags; memoization is ineffective because ReactEditorViewNext is not memo()'d and deps (props, featureFlags) change every render
|
|
101
101
|
,
|
|
102
102
|
render: function render(_ref2) {
|
|
103
103
|
var _props$featureFlags, _props$featureFlags2;
|
|
@@ -859,6 +859,35 @@ export function ReactEditorView(props) {
|
|
|
859
859
|
var _props$editorProps3 = props.editorProps,
|
|
860
860
|
assistiveLabel = _props$editorProps3.assistiveLabel,
|
|
861
861
|
assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
|
|
862
|
+
var handleSsrEditorStateChanged = useCallback(function (state) {
|
|
863
|
+
ssrEditorStateRef.current = state;
|
|
864
|
+
// Notify listeners about the initial SSR state
|
|
865
|
+
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
866
|
+
newEditorState: state,
|
|
867
|
+
oldEditorState: undefined
|
|
868
|
+
});
|
|
869
|
+
}, [pluginInjectionAPI]);
|
|
870
|
+
var memoizedReactEditorViewContext = useMemo(function () {
|
|
871
|
+
return {
|
|
872
|
+
editorRef: editorRef,
|
|
873
|
+
// Use a getter so that consumers always read the live viewRef.current at access
|
|
874
|
+
// time, not a stale snapshot captured when this memo was created.
|
|
875
|
+
get editorView() {
|
|
876
|
+
return viewRef.current;
|
|
877
|
+
},
|
|
878
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
879
|
+
}
|
|
880
|
+
// viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
|
|
881
|
+
// .current lazily so there's no stale-closure risk.
|
|
882
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
883
|
+
;
|
|
884
|
+
}, [editorRef, props.editorProps.popupsMountPoint]);
|
|
885
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
|
|
886
|
+
var reactEditorViewContext = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
|
|
887
|
+
editorRef: editorRef,
|
|
888
|
+
editorView: viewRef.current,
|
|
889
|
+
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
890
|
+
};
|
|
862
891
|
var ssrEditor = useMemo(function () {
|
|
863
892
|
if (!ssrDeps) {
|
|
864
893
|
return null;
|
|
@@ -881,7 +910,7 @@ export function ReactEditorView(props) {
|
|
|
881
910
|
onSSRMeasure: onSSRMeasure
|
|
882
911
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
883
912
|
,
|
|
884
|
-
onEditorStateChanged: function
|
|
913
|
+
onEditorStateChanged: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : function (state) {
|
|
885
914
|
ssrEditorStateRef.current = state;
|
|
886
915
|
// Notify listeners about the initial SSR state
|
|
887
916
|
pluginInjectionAPI.current.onEditorViewUpdated({
|
|
@@ -890,7 +919,7 @@ export function ReactEditorView(props) {
|
|
|
890
919
|
});
|
|
891
920
|
}
|
|
892
921
|
});
|
|
893
|
-
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
|
|
922
|
+
}, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
|
|
894
923
|
var editor = useMemo(function () {
|
|
895
924
|
// SSR editor will be available only in SSR environment,
|
|
896
925
|
// in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
|
|
@@ -912,12 +941,7 @@ export function ReactEditorView(props) {
|
|
|
912
941
|
startTimestampRef: firstRenderStartTimestampRef,
|
|
913
942
|
onSSRMeasure: onSSRMeasure
|
|
914
943
|
}, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
|
|
915
|
-
|
|
916
|
-
value: {
|
|
917
|
-
editorRef: editorRef,
|
|
918
|
-
editorView: viewRef.current,
|
|
919
|
-
popupsMountPoint: props.editorProps.popupsMountPoint
|
|
920
|
-
}
|
|
944
|
+
value: reactEditorViewContext
|
|
921
945
|
}, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
|
|
922
946
|
componentProps: props,
|
|
923
947
|
action: ACTION.RE_RENDERED,
|
|
@@ -15,6 +15,7 @@ import React, { Fragment } from 'react';
|
|
|
15
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
16
16
|
import { css, jsx } from '@emotion/react';
|
|
17
17
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
18
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
19
|
import EditorContentContainer from '../EditorContentContainer/EditorContentContainer';
|
|
19
20
|
import PluginSlot from '../PluginSlot';
|
|
20
21
|
import WithFlash from '../WithFlash';
|
|
@@ -82,6 +83,9 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
82
83
|
_this = _callSuper(this, Editor, [].concat(args));
|
|
83
84
|
_defineProperty(_this, "appearance", 'chromeless');
|
|
84
85
|
_defineProperty(_this, "containerElement", null);
|
|
86
|
+
_defineProperty(_this, "setContainerElement", function (ref) {
|
|
87
|
+
_this.containerElement = ref;
|
|
88
|
+
});
|
|
85
89
|
_defineProperty(_this, "renderChrome", function (_ref) {
|
|
86
90
|
var maxContentSize = _ref.maxContentSize;
|
|
87
91
|
var _this$props = _this.props,
|
|
@@ -107,16 +111,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
107
111
|
var _states$editorViewMod;
|
|
108
112
|
return states === null || states === void 0 || (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
|
|
109
113
|
});
|
|
114
|
+
var containerRef = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.setContainerElement : function (ref) {
|
|
115
|
+
return _this.containerElement = ref;
|
|
116
|
+
};
|
|
110
117
|
return jsx(WithFlash, {
|
|
111
118
|
animate: maxContentSizeReached
|
|
112
119
|
}, jsx(ChromelessEditorContainer, {
|
|
113
120
|
maxHeight: maxHeight,
|
|
114
|
-
minHeight: minHeight
|
|
115
|
-
|
|
116
|
-
,
|
|
117
|
-
containerRef: function containerRef(ref) {
|
|
118
|
-
return _this.containerElement = ref;
|
|
119
|
-
}
|
|
121
|
+
minHeight: minHeight,
|
|
122
|
+
containerRef: containerRef
|
|
120
123
|
}, jsx(EditorContentContainer
|
|
121
124
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
122
125
|
, {
|
|
@@ -186,6 +186,30 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
186
186
|
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
187
187
|
}
|
|
188
188
|
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
|
|
189
|
+
var memoizedContentAreaStyles = useMemo(function () {
|
|
190
|
+
return [maxHeight ?
|
|
191
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
192
|
+
css({
|
|
193
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
194
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
195
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
196
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
197
|
+
// This will cause the content area to have content overflowing the container
|
|
198
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
199
|
+
overflowY: 'auto'
|
|
200
|
+
}) : null];
|
|
201
|
+
}, [maxHeight]);
|
|
202
|
+
var contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
|
|
203
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
204
|
+
css({
|
|
205
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
206
|
+
maxHeight: "".concat(maxHeight, "px"),
|
|
207
|
+
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
208
|
+
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
209
|
+
// This will cause the content area to have content overflowing the container
|
|
210
|
+
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
211
|
+
overflowY: 'auto'
|
|
212
|
+
}) : null];
|
|
189
213
|
var customToolbarSlot = jsx("div", {
|
|
190
214
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
191
215
|
}, customPrimaryToolbarComponents);
|
|
@@ -259,20 +283,8 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
259
283
|
}, jsx(WidthConsumer, null, function (_ref) {
|
|
260
284
|
var width = _ref.width;
|
|
261
285
|
return jsx(EditorContentContainer, {
|
|
262
|
-
ref: containerElement
|
|
263
|
-
|
|
264
|
-
,
|
|
265
|
-
css: [maxHeight ?
|
|
266
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
267
|
-
css({
|
|
268
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
269
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
270
|
-
// When maxHeight is set, content area should have overflow-y explicitly set as auto
|
|
271
|
-
// As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
|
|
272
|
-
// This will cause the content area to have content overflowing the container
|
|
273
|
-
// so need to set overflow-y as auto to make sure the content area is scrollable
|
|
274
|
-
overflowY: 'auto'
|
|
275
|
-
}) : null],
|
|
286
|
+
ref: containerElement,
|
|
287
|
+
css: contentAreaStyles,
|
|
276
288
|
isScrollable: maxHeight ? true : undefined
|
|
277
289
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
278
290
|
,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
2
|
/**
|
|
5
3
|
* @jsxRuntime classic
|
|
6
4
|
* @jsx jsx
|
|
@@ -277,11 +275,10 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
277
275
|
}) && editorContentReducedGutterStyles]
|
|
278
276
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
279
277
|
,
|
|
280
|
-
className: classnames('ak-editor-content-area', 'appearance-full-page',
|
|
281
|
-
'fabric-editor--full-width-mode': fullWidthMode
|
|
282
|
-
}, fg('platform_editor_max_width_mode_resize_fix') && {
|
|
278
|
+
className: classnames('ak-editor-content-area', 'appearance-full-page', {
|
|
279
|
+
'fabric-editor--full-width-mode': fullWidthMode,
|
|
283
280
|
'fabric-editor--max-width-mode': Boolean(maxWidthMode)
|
|
284
|
-
})
|
|
281
|
+
}),
|
|
285
282
|
ref: contentAreaRef
|
|
286
283
|
}, !!props.customContentComponents && 'before' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.before) : contentComponentClickWrapper(props.customContentComponents), jsx(PluginSlot, {
|
|
287
284
|
editorView: props.editorView,
|
|
@@ -25,6 +25,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
25
25
|
import { contextPanelMessages } from '@atlaskit/editor-common/messages';
|
|
26
26
|
import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
27
27
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
28
29
|
var ANIM_SPEED_MS = 500;
|
|
29
30
|
var panelHidden = css({
|
|
30
31
|
width: 0
|
|
@@ -71,6 +72,9 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
71
72
|
mounted: false,
|
|
72
73
|
currentPluginContent: undefined
|
|
73
74
|
});
|
|
75
|
+
_defineProperty(_this, "handleTransitionExited", function () {
|
|
76
|
+
_this.unsetPluginContent();
|
|
77
|
+
});
|
|
74
78
|
_defineProperty(_this, "focusEditor", function () {
|
|
75
79
|
var _editorAPI$core;
|
|
76
80
|
var editorAPI = _this.props.editorAPI;
|
|
@@ -85,16 +89,15 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
85
89
|
return;
|
|
86
90
|
}
|
|
87
91
|
var animSpeedMs = fg('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
|
|
92
|
+
var onExited = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.handleTransitionExited : function () {
|
|
93
|
+
return _this.unsetPluginContent();
|
|
94
|
+
};
|
|
88
95
|
return jsx(Transition, {
|
|
89
96
|
timeout: _this.state.mounted ? animSpeedMs : 0,
|
|
90
97
|
in: !!pluginContent,
|
|
91
98
|
mountOnEnter: true,
|
|
92
|
-
unmountOnExit: true
|
|
93
|
-
|
|
94
|
-
,
|
|
95
|
-
onExited: function onExited() {
|
|
96
|
-
return _this.unsetPluginContent();
|
|
97
|
-
}
|
|
99
|
+
unmountOnExit: true,
|
|
100
|
+
onExited: onExited
|
|
98
101
|
}, currentPluginContent);
|
|
99
102
|
});
|
|
100
103
|
_defineProperty(_this, "showProvidedContent", function (isVisible) {
|
|
@@ -142,7 +142,7 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
142
142
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
143
143
|
baseStyles,
|
|
144
144
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
145
|
-
|
|
145
|
+
maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
|
|
146
146
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
147
147
|
baseStylesMaxContainerWidthFixes,
|
|
148
148
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
2
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { EditorToolbarProvider, EditorToolbarUIProvider } from '@atlaskit/editor-common/toolbar';
|
|
4
4
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
6
6
|
import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { ToolbarInner } from './ToolbarInner';
|
|
10
|
+
var TOOLBAR_FALLBACKS = {
|
|
11
|
+
group: ToolbarButtonGroup,
|
|
12
|
+
section: ToolbarSection,
|
|
13
|
+
menuSection: ToolbarDropdownItemSection
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
/**
|
|
11
17
|
* *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
|
|
@@ -63,6 +69,18 @@ export var ToolbarNext = function ToolbarNext(_ref) {
|
|
|
63
69
|
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
64
70
|
// remove offline check when patch6Enabled is cleaned up
|
|
65
71
|
var isOffline = isOfflineMode(connectivityStateMode);
|
|
72
|
+
var memoizedFireAnalyticsEvent = useCallback(function (payload) {
|
|
73
|
+
var _editorAPI$analytics;
|
|
74
|
+
editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
75
|
+
}, [editorAPI]);
|
|
76
|
+
var fireAnalyticsEvent = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : function (payload) {
|
|
77
|
+
return memoizedFireAnalyticsEvent(payload);
|
|
78
|
+
};
|
|
79
|
+
var fallbacks = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
|
|
80
|
+
group: ToolbarButtonGroup,
|
|
81
|
+
section: ToolbarSection,
|
|
82
|
+
menuSection: ToolbarDropdownItemSection
|
|
83
|
+
};
|
|
66
84
|
return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
67
85
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
68
86
|
editorAppearance: editorAppearance,
|
|
@@ -74,22 +92,11 @@ export var ToolbarNext = function ToolbarNext(_ref) {
|
|
|
74
92
|
isDisabled: isDisabled,
|
|
75
93
|
popupsMountPoint: popupsMountPoint,
|
|
76
94
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
77
|
-
popupsScrollableElement: popupsScrollableElement
|
|
78
|
-
|
|
79
|
-
,
|
|
80
|
-
fireAnalyticsEvent: function fireAnalyticsEvent(payload) {
|
|
81
|
-
var _editorAPI$analytics;
|
|
82
|
-
editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
|
|
83
|
-
}
|
|
95
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
96
|
+
fireAnalyticsEvent: fireAnalyticsEvent
|
|
84
97
|
}, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
|
|
85
98
|
toolbar: toolbar,
|
|
86
|
-
components: components
|
|
87
|
-
|
|
88
|
-
,
|
|
89
|
-
fallbacks: {
|
|
90
|
-
group: ToolbarButtonGroup,
|
|
91
|
-
section: ToolbarSection,
|
|
92
|
-
menuSection: ToolbarDropdownItemSection
|
|
93
|
-
}
|
|
99
|
+
components: components,
|
|
100
|
+
fallbacks: fallbacks
|
|
94
101
|
})));
|
|
95
102
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "217.9.
|
|
2
|
+
export var version = "217.9.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "217.
|
|
3
|
+
"version": "217.10.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"@atlaskit/editor-toolbar-model": "^0.4.0",
|
|
60
60
|
"@atlaskit/emoji": "^69.10.0",
|
|
61
61
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
62
|
-
"@atlaskit/icon": "^
|
|
62
|
+
"@atlaskit/icon": "^34.0.0",
|
|
63
63
|
"@atlaskit/link": "^3.3.0",
|
|
64
64
|
"@atlaskit/media-card": "^79.16.0",
|
|
65
65
|
"@atlaskit/mention": "^24.6.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
67
67
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
68
|
-
"@atlaskit/react-ufo": "^5.
|
|
68
|
+
"@atlaskit/react-ufo": "^5.10.0",
|
|
69
69
|
"@atlaskit/task-decision": "^19.3.0",
|
|
70
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
70
|
+
"@atlaskit/tmp-editor-statsig": "^54.0.0",
|
|
71
71
|
"@atlaskit/tokens": "^11.4.0",
|
|
72
72
|
"@atlaskit/tooltip": "^21.1.0",
|
|
73
73
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"uuid": "^3.1.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@atlaskit/editor-common": "^112.
|
|
87
|
+
"@atlaskit/editor-common": "^112.16.0",
|
|
88
88
|
"@atlaskit/link-provider": "^4.3.0",
|
|
89
89
|
"@atlaskit/media-core": "^37.0.0",
|
|
90
90
|
"react": "^18.2.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
109
109
|
"@atlaskit/media-test-helpers": "^40.0.0",
|
|
110
110
|
"@atlaskit/modal-dialog": "^14.14.0",
|
|
111
|
-
"@atlaskit/renderer": "^128.
|
|
111
|
+
"@atlaskit/renderer": "^128.7.0",
|
|
112
112
|
"@atlaskit/section-message": "^8.12.0",
|
|
113
113
|
"@atlaskit/synchrony-test-helpers": "workspace:^",
|
|
114
114
|
"@atlaskit/toggle": "^15.2.0",
|
|
@@ -304,9 +304,6 @@
|
|
|
304
304
|
"platform_editor_a11y_9262": {
|
|
305
305
|
"type": "boolean"
|
|
306
306
|
},
|
|
307
|
-
"platform_editor_max_width_mode_resize_fix": {
|
|
308
|
-
"type": "boolean"
|
|
309
|
-
},
|
|
310
307
|
"platform_editor_breakout_in_universal_preset": {
|
|
311
308
|
"type": "boolean"
|
|
312
309
|
},
|