@atlaskit/editor-core 197.1.0 → 197.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/composable-editor/BaseThemeWrapper.js +29 -0
- package/dist/cjs/composable-editor/editor-internal.js +12 -7
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +63 -67
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +6 -12
- package/dist/cjs/ui/CollapsedEditor/index.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.js +24 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/BaseThemeWrapper.js +19 -0
- package/dist/es2019/composable-editor/editor-internal.js +11 -6
- package/dist/es2019/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +65 -67
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +6 -12
- package/dist/es2019/ui/CollapsedEditor/index.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +13 -0
- package/dist/es2019/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.js +14 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/BaseThemeWrapper.js +20 -0
- package/dist/esm/composable-editor/editor-internal.js +11 -6
- package/dist/esm/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +64 -68
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +6 -12
- package/dist/esm/ui/CollapsedEditor/index.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.js +15 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/composable-editor/BaseThemeWrapper.d.ts +7 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -2
- package/dist/types/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.d.ts +6 -0
- package/dist/types-ts4.5/composable-editor/BaseThemeWrapper.d.ts +7 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -2
- package/dist/types-ts4.5/ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper.d.ts +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#135207](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135207)
|
|
8
|
+
[`84391e4360fbd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/84391e4360fbd) -
|
|
9
|
+
Refactor editor internals to minimise bundle size and javascript run by removing width observer
|
|
10
|
+
from main editor.
|
|
11
|
+
|
|
3
12
|
## 197.1.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BaseThemeWrapper = BaseThemeWrapper;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
|
+
|
|
15
|
+
// Default value from: `import { fontSize } from '@atlaskit/theme/constants';`
|
|
16
|
+
var defaultFontSize = 14;
|
|
17
|
+
function BaseThemeWrapper(_ref) {
|
|
18
|
+
var baseFontSize = _ref.baseFontSize,
|
|
19
|
+
children = _ref.children;
|
|
20
|
+
var memoizedTheme = (0, _react.useMemo)(function () {
|
|
21
|
+
return {
|
|
22
|
+
baseFontSize: baseFontSize || defaultFontSize,
|
|
23
|
+
layoutMaxWidth: _editorSharedStyles.akEditorDefaultLayoutWidth
|
|
24
|
+
};
|
|
25
|
+
}, [baseFontSize]);
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_react2.ThemeProvider, {
|
|
27
|
+
theme: memoizedTheme
|
|
28
|
+
}, children);
|
|
29
|
+
}
|
|
@@ -12,7 +12,6 @@ var _react = require("react");
|
|
|
12
12
|
var _react2 = require("@emotion/react");
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _portal = require("@atlaskit/editor-common/portal");
|
|
15
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
16
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBoundary"));
|
|
18
17
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
@@ -20,7 +19,9 @@ var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEdi
|
|
|
20
19
|
var _contextAdapter = require("../nodeviews/context-adapter");
|
|
21
20
|
var _context = require("../presets/context");
|
|
22
21
|
var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
|
|
22
|
+
var _IntlProviderIfMissingWrapper = require("../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper");
|
|
23
23
|
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
24
|
+
var _BaseThemeWrapper = require("./BaseThemeWrapper");
|
|
24
25
|
var _useProviders = require("./hooks/useProviders");
|
|
25
26
|
var _getBaseFontSize = require("./utils/getBaseFontSize");
|
|
26
27
|
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; }
|
|
@@ -28,6 +29,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
28
29
|
* @jsxRuntime classic
|
|
29
30
|
* @jsx jsx
|
|
30
31
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
32
|
+
var editorContainerStyles = (0, _react2.css)({
|
|
33
|
+
position: 'relative',
|
|
34
|
+
width: '100%',
|
|
35
|
+
height: '100%'
|
|
36
|
+
});
|
|
37
|
+
|
|
31
38
|
/**
|
|
32
39
|
* EditorInternalComponent is used to capture the common component
|
|
33
40
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
@@ -82,13 +89,11 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
82
89
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
83
90
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
84
91
|
featureFlags: featureFlags
|
|
85
|
-
}, (0, _react2.jsx)(
|
|
86
|
-
css:
|
|
87
|
-
height: '100%'
|
|
88
|
-
})
|
|
92
|
+
}, (0, _react2.jsx)("div", {
|
|
93
|
+
css: editorContainerStyles
|
|
89
94
|
}, (0, _react2.jsx)(_EditorContext.default, {
|
|
90
95
|
editorActions: editorActions
|
|
91
|
-
}, (0, _react2.jsx)(_contextAdapter.ContextAdapter, null, (0, _react2.jsx)(
|
|
96
|
+
}, (0, _react2.jsx)(_contextAdapter.ContextAdapter, null, (0, _react2.jsx)(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ReactEditorViewContextWrapper, {
|
|
92
97
|
editorProps: overriddenEditorProps,
|
|
93
98
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
94
99
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -107,7 +112,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
107
112
|
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
108
113
|
editorRef = _ref2.editorRef,
|
|
109
114
|
editorAPI = _ref2.editorAPI;
|
|
110
|
-
return (0, _react2.jsx)(
|
|
115
|
+
return (0, _react2.jsx)(_BaseThemeWrapper.BaseThemeWrapper, {
|
|
111
116
|
baseFontSize: (0, _getBaseFontSize.getBaseFontSize)(props.appearance)
|
|
112
117
|
}, (0, _react2.jsx)(AppearanceComponent, {
|
|
113
118
|
innerRef: editorRef,
|
|
@@ -164,7 +164,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
164
164
|
}
|
|
165
165
|
return (0, _react2.jsx)(_WithFlash.default, {
|
|
166
166
|
animate: maxContentSizeReached
|
|
167
|
-
}, (0, _react2.jsx)("div", {
|
|
167
|
+
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
168
168
|
css: [commentEditorStyles,
|
|
169
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
170
170
|
(0, _react2.css)({
|
|
@@ -253,6 +253,6 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
253
253
|
style: {
|
|
254
254
|
flexGrow: 1
|
|
255
255
|
}
|
|
256
|
-
}), customSecondaryToolbarComponents));
|
|
256
|
+
}), customSecondaryToolbarComponents)));
|
|
257
257
|
};
|
|
258
258
|
CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
|
|
@@ -44,74 +44,70 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}, []);
|
|
47
|
-
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
return (
|
|
48
|
+
// Cleaned up with: platform_editor_context-panel_simplify_behaviour
|
|
49
|
+
(0, _react2.jsx)(_ui.ContextPanelConsumer, null, function (_ref) {
|
|
50
|
+
var _contentAreaRef$curre;
|
|
51
|
+
var positionedOverEditor = _ref.positionedOverEditor;
|
|
52
|
+
return (0, _react2.jsx)("div", {
|
|
53
|
+
css: [
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
55
|
+
_StyledComponents.contentArea,
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
57
|
+
props.isEditorToolbarHidden && _StyledComponents.contentAreaHeightNoToolbar,
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
59
|
+
positionedOverEditor && _StyledComponents.positionedOverEditorStyle],
|
|
60
|
+
"data-testid": CONTENT_AREA_TEST_ID,
|
|
61
|
+
ref: containerRef
|
|
62
|
+
}, (0, _react2.jsx)(_StyledComponents.ScrollContainer
|
|
63
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
64
|
+
, {
|
|
65
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
66
|
+
featureFlags: props.featureFlags,
|
|
67
|
+
ref: scrollContainerRef
|
|
68
|
+
}, (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
69
|
+
editorView: props.editorView,
|
|
70
|
+
editorDisabled: props.disabled
|
|
71
|
+
}, (0, _react2.jsx)("div", {
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
73
|
+
css: (0, _StyledComponents.editorContentAreaStyle)({
|
|
74
|
+
fullWidthMode: fullWidthMode,
|
|
75
|
+
layoutMaxWidth: theme.layoutMaxWidth
|
|
76
|
+
}),
|
|
77
|
+
role: "region",
|
|
78
|
+
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.editableContentLabel),
|
|
79
|
+
ref: contentAreaRef
|
|
80
|
+
}, (0, _react2.jsx)("div", {
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
82
|
+
css: (0, _StyledComponents.editorContentGutterStyle)()
|
|
65
83
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
66
|
-
,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
eventDispatcher: props.eventDispatcher,
|
|
94
|
-
providerFactory: props.providerFactory,
|
|
95
|
-
appearance: props.appearance,
|
|
96
|
-
items: props.contentComponents,
|
|
97
|
-
pluginHooks: props.pluginHooks,
|
|
98
|
-
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
99
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
100
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
101
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
102
|
-
disabled: !!props.disabled,
|
|
103
|
-
containerElement: scrollContainerRef.current,
|
|
104
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
105
|
-
wrapperElement: props.wrapperElement
|
|
106
|
-
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null)))), (0, _react2.jsx)("div", {
|
|
107
|
-
css: _StyledComponents.sidebarArea
|
|
108
|
-
}, props.contextPanel || (0, _react2.jsx)(_ContextPanel.default, {
|
|
109
|
-
editorAPI: props.editorAPI,
|
|
110
|
-
visible: false
|
|
111
|
-
})));
|
|
112
|
-
})
|
|
113
|
-
);
|
|
114
|
-
});
|
|
84
|
+
,
|
|
85
|
+
className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
86
|
+
ref: contentAreaRef
|
|
87
|
+
}, !!props.customContentComponents && 'before' in props.customContentComponents ? props.customContentComponents.before : props.customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
88
|
+
editorView: props.editorView,
|
|
89
|
+
editorActions: props.editorActions,
|
|
90
|
+
eventDispatcher: props.eventDispatcher,
|
|
91
|
+
providerFactory: props.providerFactory,
|
|
92
|
+
appearance: props.appearance,
|
|
93
|
+
items: props.contentComponents,
|
|
94
|
+
pluginHooks: props.pluginHooks,
|
|
95
|
+
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
96
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
97
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
98
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
99
|
+
disabled: !!props.disabled,
|
|
100
|
+
containerElement: scrollContainerRef.current,
|
|
101
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
102
|
+
wrapperElement: props.wrapperElement
|
|
103
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null)))), (0, _react2.jsx)("div", {
|
|
104
|
+
css: _StyledComponents.sidebarArea
|
|
105
|
+
}, props.contextPanel || (0, _react2.jsx)(_ContextPanel.default, {
|
|
106
|
+
editorAPI: props.editorAPI,
|
|
107
|
+
visible: false
|
|
108
|
+
})));
|
|
109
|
+
})
|
|
110
|
+
);
|
|
115
111
|
});
|
|
116
112
|
var FullPageContentArea = exports.FullPageContentArea = (0, _reactIntlNext.injectIntl)(Content, {
|
|
117
113
|
forwardRef: true
|
|
@@ -108,14 +108,14 @@ var editorContentAreaHideContainer = exports.editorContentAreaHideContainer = (0
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
/* Prevent horizontal scroll on page in full width mode */
|
|
111
|
-
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(
|
|
111
|
+
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle() {
|
|
112
112
|
return (0, _react.css)({
|
|
113
113
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
114
114
|
'.fabric-editor--full-width-mode': {
|
|
115
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
|
-
'.code-block, .extension-container': {
|
|
116
|
+
'.code-block, .extension-container, .multiBodiedExtension--container': {
|
|
117
117
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
118
|
-
maxWidth: "
|
|
118
|
+
maxWidth: "calc(100% - ".concat(_consts.tableMarginFullWidthMode * 2, "px)")
|
|
119
119
|
},
|
|
120
120
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
121
121
|
'.extension-container.inline': {
|
|
@@ -126,23 +126,17 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(c
|
|
|
126
126
|
maxWidth: 'inherit'
|
|
127
127
|
},
|
|
128
128
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
129
|
-
'.multiBodiedExtension--container': {
|
|
130
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
131
|
-
maxWidth: "".concat(containerWidth - getTotalPadding() - _consts.tableMarginFullWidthMode * 2, "px")
|
|
132
|
-
},
|
|
133
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
134
129
|
'[data-layout-section]': {
|
|
135
130
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
136
|
-
maxWidth: "".concat(
|
|
131
|
+
maxWidth: "calc(100% + ".concat(_editorSharedStyles.akLayoutGutterOffset * 2, "px)")
|
|
137
132
|
}
|
|
138
133
|
}
|
|
139
134
|
});
|
|
140
135
|
};
|
|
141
136
|
var editorContentAreaStyle = exports.editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
142
137
|
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
143
|
-
fullWidthMode = _ref.fullWidthMode
|
|
144
|
-
|
|
145
|
-
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), containerWidth ? editorContentAreaContainerStyle(containerWidth) : editorContentAreaHideContainer];
|
|
138
|
+
fullWidthMode = _ref.fullWidthMode;
|
|
139
|
+
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle()];
|
|
146
140
|
};
|
|
147
141
|
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
148
142
|
return (0, _react.css)({
|
|
@@ -13,8 +13,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
16
|
var _ChromeCollapsed = _interopRequireDefault(require("../ChromeCollapsed"));
|
|
17
|
+
var _IntlProviderIfMissingWrapper = require("../IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper");
|
|
18
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
20
|
var CollapsedEditor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
@@ -51,7 +51,7 @@ var CollapsedEditor = exports.default = /*#__PURE__*/function (_React$Component)
|
|
|
51
51
|
var child = _react.default.Children.only(this.props.children);
|
|
52
52
|
this.functionalEditor = typeof child.type === 'function';
|
|
53
53
|
if (!this.props.isExpanded) {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, /*#__PURE__*/_react.default.createElement(_ChromeCollapsed.default, {
|
|
55
55
|
onFocus: this.props.onFocus,
|
|
56
56
|
text: this.props.placeholder
|
|
57
57
|
}));
|
|
@@ -75,7 +75,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)({
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
var contentStyles = function contentStyles(props) {
|
|
78
|
-
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
78
|
+
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
79
79
|
theme: props.theme
|
|
80
80
|
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), _media.mediaStyles, (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(), (0, _styles.smartCardStyles)(), _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
81
81
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.IntlProviderIfMissingWrapper = IntlProviderIfMissingWrapper;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
var useCheckIntlContext = function useCheckIntlContext() {
|
|
13
|
+
return (0, _react.useContext)(_reactIntlNext.IntlContext) === null;
|
|
14
|
+
};
|
|
15
|
+
function IntlProviderIfMissingWrapper(_ref) {
|
|
16
|
+
var children = _ref.children;
|
|
17
|
+
var missingIntlContext = useCheckIntlContext();
|
|
18
|
+
if (missingIntlContext) {
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
|
|
20
|
+
locale: "en"
|
|
21
|
+
}, children);
|
|
22
|
+
}
|
|
23
|
+
return children;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
|
+
import { ThemeProvider } from '@emotion/react';
|
|
5
|
+
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
// Default value from: `import { fontSize } from '@atlaskit/theme/constants';`
|
|
7
|
+
const defaultFontSize = 14;
|
|
8
|
+
export function BaseThemeWrapper({
|
|
9
|
+
baseFontSize,
|
|
10
|
+
children
|
|
11
|
+
}) {
|
|
12
|
+
const memoizedTheme = useMemo(() => ({
|
|
13
|
+
baseFontSize: baseFontSize || defaultFontSize,
|
|
14
|
+
layoutMaxWidth: akEditorDefaultLayoutWidth
|
|
15
|
+
}), [baseFontSize]);
|
|
16
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
17
|
+
theme: memoizedTheme
|
|
18
|
+
}, children);
|
|
19
|
+
}
|
|
@@ -9,7 +9,6 @@ import { Fragment, memo, useCallback } from 'react';
|
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
11
11
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
12
|
-
import { BaseTheme, IntlProviderIfMissingWrapper, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
13
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
15
14
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
@@ -17,9 +16,17 @@ import ReactEditorView from '../create-editor/ReactEditorView';
|
|
|
17
16
|
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
18
17
|
import { useSetPresetContext } from '../presets/context';
|
|
19
18
|
import EditorContext from '../ui/EditorContext';
|
|
19
|
+
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
20
20
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
21
|
+
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
21
22
|
import { useProviders } from './hooks/useProviders';
|
|
22
23
|
import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
24
|
+
const editorContainerStyles = css({
|
|
25
|
+
position: 'relative',
|
|
26
|
+
width: '100%',
|
|
27
|
+
height: '100%'
|
|
28
|
+
});
|
|
29
|
+
|
|
23
30
|
/**
|
|
24
31
|
* EditorInternalComponent is used to capture the common component
|
|
25
32
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
@@ -73,10 +80,8 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
73
80
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
74
81
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
75
82
|
featureFlags: featureFlags
|
|
76
|
-
}, jsx(
|
|
77
|
-
css:
|
|
78
|
-
height: '100%'
|
|
79
|
-
})
|
|
83
|
+
}, jsx("div", {
|
|
84
|
+
css: editorContainerStyles
|
|
80
85
|
}, jsx(EditorContext, {
|
|
81
86
|
editorActions: editorActions
|
|
82
87
|
}, jsx(ContextAdapter, null, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, jsx(ReactEditorViewContextWrapper, {
|
|
@@ -99,7 +104,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
99
104
|
editorAPI
|
|
100
105
|
}) => {
|
|
101
106
|
var _props$featureFlags, _props$featureFlags2;
|
|
102
|
-
return jsx(
|
|
107
|
+
return jsx(BaseThemeWrapper, {
|
|
103
108
|
baseFontSize: getBaseFontSize(props.appearance)
|
|
104
109
|
}, jsx(AppearanceComponent, {
|
|
105
110
|
innerRef: editorRef,
|
|
@@ -12,7 +12,7 @@ import ButtonGroup from '@atlaskit/button/button-group';
|
|
|
12
12
|
import Button from '@atlaskit/button/new';
|
|
13
13
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
14
14
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
15
|
-
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
15
|
+
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
16
16
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
17
17
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
18
18
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -149,7 +149,7 @@ export const CommentEditorWithIntl = props => {
|
|
|
149
149
|
}
|
|
150
150
|
return jsx(WithFlash, {
|
|
151
151
|
animate: maxContentSizeReached
|
|
152
|
-
}, jsx("div", {
|
|
152
|
+
}, jsx(WidthProvider, null, jsx("div", {
|
|
153
153
|
css: [commentEditorStyles,
|
|
154
154
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
155
155
|
css({
|
|
@@ -239,6 +239,6 @@ export const CommentEditorWithIntl = props => {
|
|
|
239
239
|
style: {
|
|
240
240
|
flexGrow: 1
|
|
241
241
|
}
|
|
242
|
-
}), customSecondaryToolbarComponents));
|
|
242
|
+
}), customSecondaryToolbarComponents)));
|
|
243
243
|
};
|
|
244
244
|
CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
|
|
@@ -9,7 +9,7 @@ import React, { useImperativeHandle, useRef } from 'react';
|
|
|
9
9
|
import { jsx, useTheme } from '@emotion/react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
-
import { ContextPanelConsumer
|
|
12
|
+
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { ClickAreaBlock } from '../../Addon';
|
|
14
14
|
import ContextPanel from '../../ContextPanel';
|
|
15
15
|
import PluginSlot from '../../PluginSlot';
|
|
@@ -32,73 +32,71 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
32
32
|
return containerRef.current;
|
|
33
33
|
}
|
|
34
34
|
}), []);
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
ref: containerRef
|
|
53
|
-
}, jsx(ScrollContainer
|
|
54
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
55
|
-
, {
|
|
56
|
-
className: "fabric-editor-popup-scroll-parent",
|
|
57
|
-
featureFlags: props.featureFlags,
|
|
58
|
-
ref: scrollContainerRef
|
|
59
|
-
}, jsx(ClickAreaBlock, {
|
|
60
|
-
editorView: props.editorView,
|
|
61
|
-
editorDisabled: props.disabled
|
|
62
|
-
}, jsx("div", {
|
|
63
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
64
|
-
css: editorContentAreaStyle({
|
|
65
|
-
fullWidthMode,
|
|
66
|
-
layoutMaxWidth: theme.layoutMaxWidth,
|
|
67
|
-
containerWidth: width
|
|
68
|
-
}),
|
|
69
|
-
role: "region",
|
|
70
|
-
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
71
|
-
ref: contentAreaRef
|
|
72
|
-
}, jsx("div", {
|
|
73
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
74
|
-
css: editorContentGutterStyle()
|
|
35
|
+
return (
|
|
36
|
+
// Cleaned up with: platform_editor_context-panel_simplify_behaviour
|
|
37
|
+
jsx(ContextPanelConsumer, null, ({
|
|
38
|
+
positionedOverEditor
|
|
39
|
+
}) => {
|
|
40
|
+
var _contentAreaRef$curre;
|
|
41
|
+
return jsx("div", {
|
|
42
|
+
css: [
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
44
|
+
contentArea,
|
|
45
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
46
|
+
props.isEditorToolbarHidden && contentAreaHeightNoToolbar,
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
48
|
+
positionedOverEditor && positionedOverEditorStyle],
|
|
49
|
+
"data-testid": CONTENT_AREA_TEST_ID,
|
|
50
|
+
ref: containerRef
|
|
51
|
+
}, jsx(ScrollContainer
|
|
75
52
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
76
|
-
,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
53
|
+
, {
|
|
54
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
55
|
+
featureFlags: props.featureFlags,
|
|
56
|
+
ref: scrollContainerRef
|
|
57
|
+
}, jsx(ClickAreaBlock, {
|
|
58
|
+
editorView: props.editorView,
|
|
59
|
+
editorDisabled: props.disabled
|
|
60
|
+
}, jsx("div", {
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
62
|
+
css: editorContentAreaStyle({
|
|
63
|
+
fullWidthMode,
|
|
64
|
+
layoutMaxWidth: theme.layoutMaxWidth
|
|
65
|
+
}),
|
|
66
|
+
role: "region",
|
|
67
|
+
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
68
|
+
ref: contentAreaRef
|
|
69
|
+
}, jsx("div", {
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
71
|
+
css: editorContentGutterStyle()
|
|
72
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
73
|
+
,
|
|
74
|
+
className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
75
|
+
ref: contentAreaRef
|
|
76
|
+
}, !!props.customContentComponents && 'before' in props.customContentComponents ? props.customContentComponents.before : props.customContentComponents, jsx(PluginSlot, {
|
|
77
|
+
editorView: props.editorView,
|
|
78
|
+
editorActions: props.editorActions,
|
|
79
|
+
eventDispatcher: props.eventDispatcher,
|
|
80
|
+
providerFactory: props.providerFactory,
|
|
81
|
+
appearance: props.appearance,
|
|
82
|
+
items: props.contentComponents,
|
|
83
|
+
pluginHooks: props.pluginHooks,
|
|
84
|
+
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
85
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
86
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
87
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
88
|
+
disabled: !!props.disabled,
|
|
89
|
+
containerElement: scrollContainerRef.current,
|
|
90
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
91
|
+
wrapperElement: props.wrapperElement
|
|
92
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null)))), jsx("div", {
|
|
93
|
+
css: sidebarArea
|
|
94
|
+
}, props.contextPanel || jsx(ContextPanel, {
|
|
95
|
+
editorAPI: props.editorAPI,
|
|
96
|
+
visible: false
|
|
97
|
+
})));
|
|
98
|
+
})
|
|
99
|
+
);
|
|
102
100
|
});
|
|
103
101
|
export const FullPageContentArea = injectIntl(Content, {
|
|
104
102
|
forwardRef: true
|
|
@@ -99,13 +99,13 @@ export const editorContentAreaHideContainer = css({
|
|
|
99
99
|
});
|
|
100
100
|
|
|
101
101
|
/* Prevent horizontal scroll on page in full width mode */
|
|
102
|
-
const editorContentAreaContainerStyle =
|
|
102
|
+
const editorContentAreaContainerStyle = () => css({
|
|
103
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
104
104
|
'.fabric-editor--full-width-mode': {
|
|
105
105
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
106
|
-
'.code-block, .extension-container': {
|
|
106
|
+
'.code-block, .extension-container, .multiBodiedExtension--container': {
|
|
107
107
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
108
|
-
maxWidth:
|
|
108
|
+
maxWidth: `calc(100% - ${tableMarginFullWidthMode * 2}px)`
|
|
109
109
|
},
|
|
110
110
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
111
111
|
'.extension-container.inline': {
|
|
@@ -116,22 +116,16 @@ const editorContentAreaContainerStyle = containerWidth => css({
|
|
|
116
116
|
maxWidth: 'inherit'
|
|
117
117
|
},
|
|
118
118
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
119
|
-
'.multiBodiedExtension--container': {
|
|
120
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
121
|
-
maxWidth: `${containerWidth - getTotalPadding() - tableMarginFullWidthMode * 2}px`
|
|
122
|
-
},
|
|
123
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
124
119
|
'[data-layout-section]': {
|
|
125
120
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
126
|
-
maxWidth:
|
|
121
|
+
maxWidth: `calc(100% + ${akLayoutGutterOffset * 2}px)`
|
|
127
122
|
}
|
|
128
123
|
}
|
|
129
124
|
});
|
|
130
125
|
export const editorContentAreaStyle = ({
|
|
131
126
|
layoutMaxWidth,
|
|
132
|
-
fullWidthMode
|
|
133
|
-
|
|
134
|
-
}) => [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), containerWidth ? editorContentAreaContainerStyle(containerWidth) : editorContentAreaHideContainer];
|
|
127
|
+
fullWidthMode
|
|
128
|
+
}) => [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle()];
|
|
135
129
|
const editorContentAreaWithLayoutWith = layoutMaxWidth => css({
|
|
136
130
|
// this restricts max width
|
|
137
131
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { IntlProviderIfMissingWrapper } from '@atlaskit/editor-common/ui';
|
|
4
3
|
import ChromeCollapsed from '../ChromeCollapsed';
|
|
4
|
+
import { IntlProviderIfMissingWrapper } from '../IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
5
5
|
export default class CollapsedEditor extends React.Component {
|
|
6
6
|
constructor(...args) {
|
|
7
7
|
super(...args);
|
|
@@ -249,6 +249,19 @@ const contentStyles = props => css`
|
|
|
249
249
|
text-align: center;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
+
// For FullPage only when inside a table
|
|
253
|
+
// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts
|
|
254
|
+
// In the "editorContentAreaContainerStyle" function
|
|
255
|
+
.fabric-editor--full-width-mode {
|
|
256
|
+
.pm-table-container {
|
|
257
|
+
.code-block,
|
|
258
|
+
.extension-container,
|
|
259
|
+
.multiBodiedExtension--container {
|
|
260
|
+
max-width: 100%;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
.pm-table-header-content-wrap :not(.fabric-editor-alignment),
|
|
253
266
|
.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,
|
|
254
267
|
.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { IntlContext, IntlProvider } from 'react-intl-next';
|
|
3
|
+
const useCheckIntlContext = () => useContext(IntlContext) === null;
|
|
4
|
+
export function IntlProviderIfMissingWrapper({
|
|
5
|
+
children
|
|
6
|
+
}) {
|
|
7
|
+
const missingIntlContext = useCheckIntlContext();
|
|
8
|
+
if (missingIntlContext) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
10
|
+
locale: "en"
|
|
11
|
+
}, children);
|
|
12
|
+
}
|
|
13
|
+
return children;
|
|
14
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.1.
|
|
2
|
+
export const version = "197.1.1";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
|
+
import { ThemeProvider } from '@emotion/react';
|
|
5
|
+
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
// Default value from: `import { fontSize } from '@atlaskit/theme/constants';`
|
|
7
|
+
var defaultFontSize = 14;
|
|
8
|
+
export function BaseThemeWrapper(_ref) {
|
|
9
|
+
var baseFontSize = _ref.baseFontSize,
|
|
10
|
+
children = _ref.children;
|
|
11
|
+
var memoizedTheme = useMemo(function () {
|
|
12
|
+
return {
|
|
13
|
+
baseFontSize: baseFontSize || defaultFontSize,
|
|
14
|
+
layoutMaxWidth: akEditorDefaultLayoutWidth
|
|
15
|
+
};
|
|
16
|
+
}, [baseFontSize]);
|
|
17
|
+
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
18
|
+
theme: memoizedTheme
|
|
19
|
+
}, children);
|
|
20
|
+
}
|
|
@@ -13,7 +13,6 @@ import { Fragment, memo, useCallback } from 'react';
|
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
15
15
|
import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
16
|
-
import { BaseTheme, IntlProviderIfMissingWrapper, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
17
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
17
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
19
18
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
@@ -21,9 +20,17 @@ import ReactEditorView from '../create-editor/ReactEditorView';
|
|
|
21
20
|
import { ContextAdapter } from '../nodeviews/context-adapter';
|
|
22
21
|
import { useSetPresetContext } from '../presets/context';
|
|
23
22
|
import EditorContext from '../ui/EditorContext';
|
|
23
|
+
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
24
24
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
25
|
+
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
25
26
|
import { useProviders } from './hooks/useProviders';
|
|
26
27
|
import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
28
|
+
var editorContainerStyles = css({
|
|
29
|
+
position: 'relative',
|
|
30
|
+
width: '100%',
|
|
31
|
+
height: '100%'
|
|
32
|
+
});
|
|
33
|
+
|
|
27
34
|
/**
|
|
28
35
|
* EditorInternalComponent is used to capture the common component
|
|
29
36
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
@@ -78,10 +85,8 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
78
85
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
79
86
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
80
87
|
featureFlags: featureFlags
|
|
81
|
-
}, jsx(
|
|
82
|
-
css:
|
|
83
|
-
height: '100%'
|
|
84
|
-
})
|
|
88
|
+
}, jsx("div", {
|
|
89
|
+
css: editorContainerStyles
|
|
85
90
|
}, jsx(EditorContext, {
|
|
86
91
|
editorActions: editorActions
|
|
87
92
|
}, jsx(ContextAdapter, null, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, jsx(ReactEditorViewContextWrapper, {
|
|
@@ -103,7 +108,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
103
108
|
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
104
109
|
editorRef = _ref2.editorRef,
|
|
105
110
|
editorAPI = _ref2.editorAPI;
|
|
106
|
-
return jsx(
|
|
111
|
+
return jsx(BaseThemeWrapper, {
|
|
107
112
|
baseFontSize: getBaseFontSize(props.appearance)
|
|
108
113
|
}, jsx(AppearanceComponent, {
|
|
109
114
|
innerRef: editorRef,
|
|
@@ -13,7 +13,7 @@ import ButtonGroup from '@atlaskit/button/button-group';
|
|
|
13
13
|
import Button from '@atlaskit/button/new';
|
|
14
14
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
15
15
|
import { GRID_GUTTER } from '@atlaskit/editor-common/styles';
|
|
16
|
-
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
16
|
+
import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
18
18
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
19
19
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -153,7 +153,7 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
153
153
|
}
|
|
154
154
|
return jsx(WithFlash, {
|
|
155
155
|
animate: maxContentSizeReached
|
|
156
|
-
}, jsx("div", {
|
|
156
|
+
}, jsx(WidthProvider, null, jsx("div", {
|
|
157
157
|
css: [commentEditorStyles,
|
|
158
158
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
159
159
|
css({
|
|
@@ -242,6 +242,6 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
242
242
|
style: {
|
|
243
243
|
flexGrow: 1
|
|
244
244
|
}
|
|
245
|
-
}), customSecondaryToolbarComponents));
|
|
245
|
+
}), customSecondaryToolbarComponents)));
|
|
246
246
|
};
|
|
247
247
|
CommentEditorWithIntl.displayName = 'CommentEditorAppearance';
|
|
@@ -9,7 +9,7 @@ import React, { useImperativeHandle, useRef } from 'react';
|
|
|
9
9
|
import { jsx, useTheme } from '@emotion/react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
-
import { ContextPanelConsumer
|
|
12
|
+
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { ClickAreaBlock } from '../../Addon';
|
|
14
14
|
import ContextPanel from '../../ContextPanel';
|
|
15
15
|
import PluginSlot from '../../PluginSlot';
|
|
@@ -34,74 +34,70 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
}, []);
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
return (
|
|
38
|
+
// Cleaned up with: platform_editor_context-panel_simplify_behaviour
|
|
39
|
+
jsx(ContextPanelConsumer, null, function (_ref) {
|
|
40
|
+
var _contentAreaRef$curre;
|
|
41
|
+
var positionedOverEditor = _ref.positionedOverEditor;
|
|
42
|
+
return jsx("div", {
|
|
43
|
+
css: [
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
45
|
+
contentArea,
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
47
|
+
props.isEditorToolbarHidden && contentAreaHeightNoToolbar,
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
49
|
+
positionedOverEditor && positionedOverEditorStyle],
|
|
50
|
+
"data-testid": CONTENT_AREA_TEST_ID,
|
|
51
|
+
ref: containerRef
|
|
52
|
+
}, jsx(ScrollContainer
|
|
53
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
54
|
+
, {
|
|
55
|
+
className: "fabric-editor-popup-scroll-parent",
|
|
56
|
+
featureFlags: props.featureFlags,
|
|
57
|
+
ref: scrollContainerRef
|
|
58
|
+
}, jsx(ClickAreaBlock, {
|
|
59
|
+
editorView: props.editorView,
|
|
60
|
+
editorDisabled: props.disabled
|
|
61
|
+
}, jsx("div", {
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
63
|
+
css: editorContentAreaStyle({
|
|
64
|
+
fullWidthMode: fullWidthMode,
|
|
65
|
+
layoutMaxWidth: theme.layoutMaxWidth
|
|
66
|
+
}),
|
|
67
|
+
role: "region",
|
|
68
|
+
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
69
|
+
ref: contentAreaRef
|
|
70
|
+
}, jsx("div", {
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
72
|
+
css: editorContentGutterStyle()
|
|
55
73
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
56
|
-
,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
eventDispatcher: props.eventDispatcher,
|
|
84
|
-
providerFactory: props.providerFactory,
|
|
85
|
-
appearance: props.appearance,
|
|
86
|
-
items: props.contentComponents,
|
|
87
|
-
pluginHooks: props.pluginHooks,
|
|
88
|
-
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
89
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
90
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
91
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
92
|
-
disabled: !!props.disabled,
|
|
93
|
-
containerElement: scrollContainerRef.current,
|
|
94
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
95
|
-
wrapperElement: props.wrapperElement
|
|
96
|
-
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null)))), jsx("div", {
|
|
97
|
-
css: sidebarArea
|
|
98
|
-
}, props.contextPanel || jsx(ContextPanel, {
|
|
99
|
-
editorAPI: props.editorAPI,
|
|
100
|
-
visible: false
|
|
101
|
-
})));
|
|
102
|
-
})
|
|
103
|
-
);
|
|
104
|
-
});
|
|
74
|
+
,
|
|
75
|
+
className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
76
|
+
ref: contentAreaRef
|
|
77
|
+
}, !!props.customContentComponents && 'before' in props.customContentComponents ? props.customContentComponents.before : props.customContentComponents, jsx(PluginSlot, {
|
|
78
|
+
editorView: props.editorView,
|
|
79
|
+
editorActions: props.editorActions,
|
|
80
|
+
eventDispatcher: props.eventDispatcher,
|
|
81
|
+
providerFactory: props.providerFactory,
|
|
82
|
+
appearance: props.appearance,
|
|
83
|
+
items: props.contentComponents,
|
|
84
|
+
pluginHooks: props.pluginHooks,
|
|
85
|
+
contentArea: (_contentAreaRef$curre = contentAreaRef.current) !== null && _contentAreaRef$curre !== void 0 ? _contentAreaRef$curre : undefined,
|
|
86
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
87
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
88
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
89
|
+
disabled: !!props.disabled,
|
|
90
|
+
containerElement: scrollContainerRef.current,
|
|
91
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
92
|
+
wrapperElement: props.wrapperElement
|
|
93
|
+
}), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? props.customContentComponents.after : null)))), jsx("div", {
|
|
94
|
+
css: sidebarArea
|
|
95
|
+
}, props.contextPanel || jsx(ContextPanel, {
|
|
96
|
+
editorAPI: props.editorAPI,
|
|
97
|
+
visible: false
|
|
98
|
+
})));
|
|
99
|
+
})
|
|
100
|
+
);
|
|
105
101
|
});
|
|
106
102
|
export var FullPageContentArea = injectIntl(Content, {
|
|
107
103
|
forwardRef: true
|
|
@@ -103,14 +103,14 @@ export var editorContentAreaHideContainer = css({
|
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
/* Prevent horizontal scroll on page in full width mode */
|
|
106
|
-
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(
|
|
106
|
+
var editorContentAreaContainerStyle = function editorContentAreaContainerStyle() {
|
|
107
107
|
return css({
|
|
108
108
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
109
109
|
'.fabric-editor--full-width-mode': {
|
|
110
110
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
111
|
-
'.code-block, .extension-container': {
|
|
111
|
+
'.code-block, .extension-container, .multiBodiedExtension--container': {
|
|
112
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
113
|
-
maxWidth: "
|
|
113
|
+
maxWidth: "calc(100% - ".concat(tableMarginFullWidthMode * 2, "px)")
|
|
114
114
|
},
|
|
115
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
116
116
|
'.extension-container.inline': {
|
|
@@ -121,23 +121,17 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(c
|
|
|
121
121
|
maxWidth: 'inherit'
|
|
122
122
|
},
|
|
123
123
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
124
|
-
'.multiBodiedExtension--container': {
|
|
125
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
126
|
-
maxWidth: "".concat(containerWidth - getTotalPadding() - tableMarginFullWidthMode * 2, "px")
|
|
127
|
-
},
|
|
128
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
129
124
|
'[data-layout-section]': {
|
|
130
125
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
131
|
-
maxWidth: "".concat(
|
|
126
|
+
maxWidth: "calc(100% + ".concat(akLayoutGutterOffset * 2, "px)")
|
|
132
127
|
}
|
|
133
128
|
}
|
|
134
129
|
});
|
|
135
130
|
};
|
|
136
131
|
export var editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
137
132
|
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
138
|
-
fullWidthMode = _ref.fullWidthMode
|
|
139
|
-
|
|
140
|
-
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), containerWidth ? editorContentAreaContainerStyle(containerWidth) : editorContentAreaHideContainer];
|
|
133
|
+
fullWidthMode = _ref.fullWidthMode;
|
|
134
|
+
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle()];
|
|
141
135
|
};
|
|
142
136
|
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
143
137
|
return css({
|
|
@@ -8,8 +8,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import { IntlProviderIfMissingWrapper } from '@atlaskit/editor-common/ui';
|
|
12
11
|
import ChromeCollapsed from '../ChromeCollapsed';
|
|
12
|
+
import { IntlProviderIfMissingWrapper } from '../IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
13
13
|
var CollapsedEditor = /*#__PURE__*/function (_React$Component) {
|
|
14
14
|
_inherits(CollapsedEditor, _React$Component);
|
|
15
15
|
var _super = _createSuper(CollapsedEditor);
|
|
@@ -68,7 +68,7 @@ export var placeholderStyles = css({
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
var contentStyles = function contentStyles(props) {
|
|
71
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), editorFontSize({
|
|
71
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), editorFontSize({
|
|
72
72
|
theme: props.theme
|
|
73
73
|
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles, layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(), mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, statusStyles, annotationSharedStyles(), smartCardStyles(), smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, aiPanelStyles(props.colorMode), MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
74
74
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { IntlContext, IntlProvider } from 'react-intl-next';
|
|
3
|
+
var useCheckIntlContext = function useCheckIntlContext() {
|
|
4
|
+
return useContext(IntlContext) === null;
|
|
5
|
+
};
|
|
6
|
+
export function IntlProviderIfMissingWrapper(_ref) {
|
|
7
|
+
var children = _ref.children;
|
|
8
|
+
var missingIntlContext = useCheckIntlContext();
|
|
9
|
+
if (missingIntlContext) {
|
|
10
|
+
return /*#__PURE__*/React.createElement(IntlProvider, {
|
|
11
|
+
locale: "en"
|
|
12
|
+
}, children);
|
|
13
|
+
}
|
|
14
|
+
return children;
|
|
15
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "197.1.
|
|
2
|
+
export var version = "197.1.1";
|
|
@@ -16,9 +16,8 @@ export declare const contentArea: () => import("@emotion/react").SerializedStyle
|
|
|
16
16
|
export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
|
|
17
17
|
export declare const sidebarArea: import("@emotion/react").SerializedStyles;
|
|
18
18
|
export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
|
|
19
|
-
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode,
|
|
19
|
+
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, }: {
|
|
20
20
|
layoutMaxWidth: number;
|
|
21
21
|
fullWidthMode: boolean;
|
|
22
|
-
containerWidth?: number | undefined;
|
|
23
22
|
}) => (false | import("@emotion/react").SerializedStyles)[];
|
|
24
23
|
export declare const editorContentGutterStyle: () => import("@emotion/react").SerializedStyles;
|
|
@@ -16,9 +16,8 @@ export declare const contentArea: () => import("@emotion/react").SerializedStyle
|
|
|
16
16
|
export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
|
|
17
17
|
export declare const sidebarArea: import("@emotion/react").SerializedStyles;
|
|
18
18
|
export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
|
|
19
|
-
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode,
|
|
19
|
+
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, }: {
|
|
20
20
|
layoutMaxWidth: number;
|
|
21
21
|
fullWidthMode: boolean;
|
|
22
|
-
containerWidth?: number | undefined;
|
|
23
22
|
}) => (false | import("@emotion/react").SerializedStyles)[];
|
|
24
23
|
export declare const editorContentGutterStyle: () => import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "197.1.
|
|
3
|
+
"version": "197.1.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"@atlaskit/visual-regression": "*",
|
|
109
109
|
"@atlassian/adf-schema-json": "^1.22.0",
|
|
110
110
|
"@atlassian/feature-flags-test-utils": "*",
|
|
111
|
-
"@atlassian/search-provider": "2.4.
|
|
111
|
+
"@atlassian/search-provider": "2.4.117",
|
|
112
112
|
"@emotion/jest": "^11.8.0",
|
|
113
113
|
"@storybook/addon-knobs": "^5.3.18",
|
|
114
114
|
"@testing-library/react": "^12.1.5",
|