@atlaskit/editor-core 203.11.6 → 203.11.8
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 +16 -0
- package/dist/cjs/composable-editor/editor-internal.js +2 -94
- package/dist/cjs/create-editor/ReactEditorViewNext.js +1 -0
- package/dist/cjs/ui/ContentStyles/code-block.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +3 -93
- package/dist/es2019/create-editor/ReactEditorViewNext.js +1 -1
- package/dist/es2019/ui/ContentStyles/code-block.js +2 -1
- package/dist/es2019/ui/ContentStyles/index.js +19 -8
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +3 -95
- package/dist/esm/create-editor/ReactEditorViewNext.js +1 -1
- package/dist/esm/ui/ContentStyles/code-block.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +1 -0
- package/dist/types/create-editor/create-universal-preset.d.ts +2 -6
- package/dist/types/presets/default.d.ts +4 -12
- package/dist/types/presets/universal.d.ts +2 -6
- package/dist/types/presets/useUniversalPreset.d.ts +2 -6
- package/dist/types-ts4.5/create-editor/ReactEditorViewNext.d.ts +1 -0
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +2 -6
- package/dist/types-ts4.5/presets/default.d.ts +4 -12
- package/dist/types-ts4.5/presets/universal.d.ts +2 -6
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +2 -6
- package/package.json +5 -8
- package/dist/cjs/create-editor/ReactEditorView.js +0 -712
- package/dist/es2019/create-editor/ReactEditorView.js +0 -658
- package/dist/esm/create-editor/ReactEditorView.js +0 -705
- package/dist/types/create-editor/ReactEditorView.d.ts +0 -117
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +0 -117
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 203.11.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#104540](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104540)
|
|
8
|
+
[`ce84e9acae216`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ce84e9acae216) -
|
|
9
|
+
Cleanup platform_editor_mark_boundary_cursor
|
|
10
|
+
|
|
11
|
+
## 203.11.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#104526](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/104526)
|
|
16
|
+
[`4467b31befcb9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4467b31befcb9) -
|
|
17
|
+
[ux] ED-23633 add prosemirror css style for hideselection
|
|
18
|
+
|
|
3
19
|
## 203.11.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.EditorInternal = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _react = require("react");
|
|
@@ -15,21 +14,17 @@ var _portal = require("@atlaskit/editor-common/portal");
|
|
|
15
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _ErrorBoundary = _interopRequireDefault(require("../create-editor/ErrorBoundary"));
|
|
17
16
|
var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
|
|
18
|
-
var _ReactEditorView = _interopRequireDefault(require("../create-editor/ReactEditorView"));
|
|
19
17
|
var _ReactEditorViewNext = _interopRequireDefault(require("../create-editor/ReactEditorViewNext"));
|
|
20
18
|
var _EditorContext = _interopRequireDefault(require("../ui/EditorContext"));
|
|
21
19
|
var _IntlProviderIfMissingWrapper = require("../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper");
|
|
22
20
|
var _RenderTracking = require("../utils/performance/components/RenderTracking");
|
|
23
21
|
var _BaseThemeWrapper = require("./BaseThemeWrapper");
|
|
24
|
-
var _useProviders = require("./hooks/useProviders");
|
|
25
22
|
var _getBaseFontSize = require("./utils/getBaseFontSize");
|
|
26
23
|
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; }
|
|
27
24
|
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
25
|
* @jsxRuntime classic
|
|
29
26
|
* @jsx jsx
|
|
30
27
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
31
|
-
// Ignored via go/ees005
|
|
32
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
33
28
|
var editorContainerStyles = (0, _react2.css)({
|
|
34
29
|
position: 'relative',
|
|
35
30
|
width: '100%',
|
|
@@ -85,7 +80,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
85
80
|
css: editorContainerStyles
|
|
86
81
|
}, (0, _react2.jsx)(_EditorContext.default, {
|
|
87
82
|
editorActions: editorActions
|
|
88
|
-
}, (0, _react2.jsx)(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, (0, _react2.jsx)(_react.Fragment, null, (0,
|
|
83
|
+
}, (0, _react2.jsx)(_IntlProviderIfMissingWrapper.IntlProviderIfMissingWrapper, null, (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ReactEditorViewNext.default, {
|
|
89
84
|
editorProps: overriddenEditorProps,
|
|
90
85
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
91
86
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -143,92 +138,5 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
|
|
|
143
138
|
pluginHooks: config.pluginHooks
|
|
144
139
|
}));
|
|
145
140
|
}
|
|
146
|
-
}) : (0, _react2.jsx)(ReactEditorViewContextWrapper, {
|
|
147
|
-
editorProps: overriddenEditorProps,
|
|
148
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
149
|
-
portalProviderAPI: portalProviderAPI,
|
|
150
|
-
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
151
|
-
providerFactory: providerFactory,
|
|
152
|
-
onEditorCreated: onEditorCreated,
|
|
153
|
-
onEditorDestroyed: onEditorDestroyed,
|
|
154
|
-
disabled: props.disabled,
|
|
155
|
-
preset: preset,
|
|
156
|
-
render: function render(_ref3) {
|
|
157
|
-
var _props$featureFlags3, _props$featureFlags4;
|
|
158
|
-
var editor = _ref3.editor,
|
|
159
|
-
view = _ref3.view,
|
|
160
|
-
eventDispatcher = _ref3.eventDispatcher,
|
|
161
|
-
config = _ref3.config,
|
|
162
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
163
|
-
editorRef = _ref3.editorRef,
|
|
164
|
-
editorAPI = _ref3.editorAPI;
|
|
165
|
-
return (0, _react2.jsx)(_BaseThemeWrapper.BaseThemeWrapper, {
|
|
166
|
-
baseFontSize: (0, _getBaseFontSize.getBaseFontSize)(props.appearance)
|
|
167
|
-
}, (0, _react2.jsx)(AppearanceComponent, {
|
|
168
|
-
innerRef: editorRef,
|
|
169
|
-
editorAPI: editorAPI
|
|
170
|
-
// Ignored via go/ees005
|
|
171
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
172
|
-
,
|
|
173
|
-
appearance: props.appearance,
|
|
174
|
-
disabled: props.disabled,
|
|
175
|
-
editorActions: editorActions,
|
|
176
|
-
editorDOMElement: editor,
|
|
177
|
-
editorView: view,
|
|
178
|
-
providerFactory: providerFactory,
|
|
179
|
-
eventDispatcher: eventDispatcher,
|
|
180
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
181
|
-
maxHeight: props.maxHeight,
|
|
182
|
-
minHeight: props.minHeight,
|
|
183
|
-
onSave: props.onSave ? handleSave : undefined,
|
|
184
|
-
onCancel: props.onCancel,
|
|
185
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
186
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
187
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
188
|
-
contentComponents: config.contentComponents,
|
|
189
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
190
|
-
primaryToolbarIconBefore: props.primaryToolbarIconBefore,
|
|
191
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
192
|
-
customContentComponents: props.contentComponents,
|
|
193
|
-
customPrimaryToolbarComponents: props.primaryToolbarComponents,
|
|
194
|
-
customSecondaryToolbarComponents: props.secondaryToolbarComponents,
|
|
195
|
-
contextPanel: props.contextPanel,
|
|
196
|
-
collabEdit: props.collabEdit,
|
|
197
|
-
persistScrollGutter: props.persistScrollGutter,
|
|
198
|
-
enableToolbarMinWidth: ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
199
|
-
useStickyToolbar: props.useStickyToolbar,
|
|
200
|
-
featureFlags: featureFlags,
|
|
201
|
-
pluginHooks: config.pluginHooks
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
141
|
}), (0, _react2.jsx)(PortalRenderer, null), (0, _react2.jsx)(NodeViewPortalRenderer, null)))))));
|
|
205
|
-
});
|
|
206
|
-
function ReactEditorViewContextWrapper(props) {
|
|
207
|
-
var _media, _linking;
|
|
208
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
209
|
-
var _useState = (0, _react.useState)(undefined),
|
|
210
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
211
|
-
editorAPI = _useState2[0],
|
|
212
|
-
setEditorAPI = _useState2[1];
|
|
213
|
-
|
|
214
|
-
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
215
|
-
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
216
|
-
var smartLinks = props.editorProps.smartLinks;
|
|
217
|
-
(0, _useProviders.useProviders)({
|
|
218
|
-
editorApi: editorAPI,
|
|
219
|
-
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
220
|
-
mediaProvider: (_media = props.editorProps.media) === null || _media === void 0 ? void 0 : _media.provider,
|
|
221
|
-
mentionProvider: props.editorProps.mentionProvider,
|
|
222
|
-
cardProvider: ((_linking = props.editorProps.linking) === null || _linking === void 0 || (_linking = _linking.smartLinks) === null || _linking === void 0 ? void 0 : _linking.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
223
|
-
emojiProvider: props.editorProps.emojiProvider,
|
|
224
|
-
autoformattingProvider: props.editorProps.autoformattingProvider,
|
|
225
|
-
taskDecisionProvider: props.editorProps.taskDecisionProvider
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// Ignored via go/ees005
|
|
229
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
230
|
-
return (0, _react2.jsx)(_ReactEditorView.default, (0, _extends2.default)({}, props, {
|
|
231
|
-
editorAPI: editorAPI,
|
|
232
|
-
setEditorAPI: setEditorAPI
|
|
233
|
-
}));
|
|
234
|
-
}
|
|
142
|
+
});
|
|
@@ -5,6 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.ReactEditorView = ReactEditorView;
|
|
8
9
|
exports.default = void 0;
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -20,5 +20,5 @@ var GutterDangerOverlay = function GutterDangerOverlay() {
|
|
|
20
20
|
/* When code-block is inside the panel */
|
|
21
21
|
var firstCodeBlockWithNoMargin = (0, _experiments.editorExperiment)('nested-dnd', true) ? (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t.ak-editor-panel__content {\n\t\t\t\t> .code-block:first-child,\n\t\t\t\t> .ProseMirror-widget:first-child + .code-block,\n\t\t\t\t> .ProseMirror-widget:first-child + .ProseMirror-widget + .code-block {\n\t\t\t\t\tmargin: 0 0 0 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t"]))) : (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t.ak-editor-panel__content {\n\t\t\t\t> .code-block:first-child {\n\t\t\t\t\tmargin: 0 0 0 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t"])));
|
|
22
22
|
var codeBlockStyles = exports.codeBlockStyles = function codeBlockStyles() {
|
|
23
|
-
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror li {\n\t\t/* if same list item has multiple code blocks we need top margin for all but first */\n\t\t> .code-block {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\t\t> .code-block:first-child,\n\t\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t> div:last-of-type.code-block {\n\t\t\tmargin-bottom: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror .code-block.", ":not(.danger) {\n\t\t", "\n\t}\n\n\t/* Danger when top level node */\n\t.ProseMirror .danger.code-block {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t/* Danger when nested node */\n\t.ProseMirror .danger .code-block {\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t", "\n"])), (0, _styles.codeBlockSharedStyles)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, #FFECEB)", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))", firstCodeBlockWithNoMargin);
|
|
23
|
+
return (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror li {\n\t\t/* if same list item has multiple code blocks we need top margin for all but first */\n\t\t> .code-block {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\t\t> .code-block:first-child,\n\t\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t> div:last-of-type.code-block,\n\t\t> pre:last-of-type.code-block {\n\t\t\tmargin-bottom: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror .code-block.", ":not(.danger) {\n\t\t", "\n\t}\n\n\t/* Danger when top level node */\n\t.ProseMirror .danger.code-block {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t/* Danger when nested node */\n\t.ProseMirror .danger .code-block {\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t", "\n"])), (0, _styles.codeBlockSharedStyles)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, #FFECEB)", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))", firstCodeBlockWithNoMargin);
|
|
24
24
|
};
|
|
@@ -92,9 +92,9 @@ var fixBlockControlStylesSSR = exports.fixBlockControlStylesSSR = function fixBl
|
|
|
92
92
|
// The breakpoint for small devices is 1266px, copied from getBreakpoint in platform/packages/editor/editor-common/src/ui/WidthProvider/index.tsx
|
|
93
93
|
var akEditorBreakpointForSmallDevice = "1266px";
|
|
94
94
|
var contentStyles = function contentStyles(props) {
|
|
95
|
-
return (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: 52px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\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", "\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/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\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
|
|
95
|
+
return (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: 52px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\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", "\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/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\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.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\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/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, (0, _editorSharedStyles.editorFontSize)({
|
|
96
96
|
theme: props.theme
|
|
97
|
-
}), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0,
|
|
97
|
+
}), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(props.typographyTheme), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), (0, _media.mediaStyles)(), (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _panel2.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, (0, _styles.embedCardStyles)(), _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), fixBlockControlStylesSSR(), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT, !(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.hyperlink-open-link {\n\t\t\t\t\tmin-width: 24px;\n\t\t\t\t\tsvg {\n\t\t\t\t\t\tmax-width: 18px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t"]))) : null);
|
|
98
98
|
};
|
|
99
99
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
100
100
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
5
4
|
*/
|
|
6
|
-
import { Fragment, memo
|
|
5
|
+
import { Fragment, memo } from 'react';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -12,15 +11,11 @@ import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
|
12
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
14
13
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
15
|
-
// Ignored via go/ees005
|
|
16
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
17
|
-
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
18
14
|
import ReactEditorViewNext from '../create-editor/ReactEditorViewNext';
|
|
19
15
|
import EditorContext from '../ui/EditorContext';
|
|
20
16
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
21
17
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
22
18
|
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
23
|
-
import { useProviders } from './hooks/useProviders';
|
|
24
19
|
import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
25
20
|
const editorContainerStyles = css({
|
|
26
21
|
position: 'relative',
|
|
@@ -73,7 +68,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
73
68
|
css: editorContainerStyles
|
|
74
69
|
}, jsx(EditorContext, {
|
|
75
70
|
editorActions: editorActions
|
|
76
|
-
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null,
|
|
71
|
+
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, jsx(ReactEditorViewNext, {
|
|
77
72
|
editorProps: overriddenEditorProps,
|
|
78
73
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
79
74
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -132,90 +127,5 @@ export const EditorInternal = /*#__PURE__*/memo(({
|
|
|
132
127
|
pluginHooks: config.pluginHooks
|
|
133
128
|
}));
|
|
134
129
|
}
|
|
135
|
-
}) : jsx(ReactEditorViewContextWrapper, {
|
|
136
|
-
editorProps: overriddenEditorProps,
|
|
137
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
138
|
-
portalProviderAPI: portalProviderAPI,
|
|
139
|
-
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
140
|
-
providerFactory: providerFactory,
|
|
141
|
-
onEditorCreated: onEditorCreated,
|
|
142
|
-
onEditorDestroyed: onEditorDestroyed,
|
|
143
|
-
disabled: props.disabled,
|
|
144
|
-
preset: preset,
|
|
145
|
-
render: ({
|
|
146
|
-
editor,
|
|
147
|
-
view,
|
|
148
|
-
eventDispatcher,
|
|
149
|
-
config,
|
|
150
|
-
dispatchAnalyticsEvent,
|
|
151
|
-
editorRef,
|
|
152
|
-
editorAPI
|
|
153
|
-
}) => {
|
|
154
|
-
var _props$featureFlags3, _props$featureFlags4;
|
|
155
|
-
return jsx(BaseThemeWrapper, {
|
|
156
|
-
baseFontSize: getBaseFontSize(props.appearance)
|
|
157
|
-
}, jsx(AppearanceComponent, {
|
|
158
|
-
innerRef: editorRef,
|
|
159
|
-
editorAPI: editorAPI
|
|
160
|
-
// Ignored via go/ees005
|
|
161
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
162
|
-
,
|
|
163
|
-
appearance: props.appearance,
|
|
164
|
-
disabled: props.disabled,
|
|
165
|
-
editorActions: editorActions,
|
|
166
|
-
editorDOMElement: editor,
|
|
167
|
-
editorView: view,
|
|
168
|
-
providerFactory: providerFactory,
|
|
169
|
-
eventDispatcher: eventDispatcher,
|
|
170
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
171
|
-
maxHeight: props.maxHeight,
|
|
172
|
-
minHeight: props.minHeight,
|
|
173
|
-
onSave: props.onSave ? handleSave : undefined,
|
|
174
|
-
onCancel: props.onCancel,
|
|
175
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
176
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
177
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
178
|
-
contentComponents: config.contentComponents,
|
|
179
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
180
|
-
primaryToolbarIconBefore: props.primaryToolbarIconBefore,
|
|
181
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
182
|
-
customContentComponents: props.contentComponents,
|
|
183
|
-
customPrimaryToolbarComponents: props.primaryToolbarComponents,
|
|
184
|
-
customSecondaryToolbarComponents: props.secondaryToolbarComponents,
|
|
185
|
-
contextPanel: props.contextPanel,
|
|
186
|
-
collabEdit: props.collabEdit,
|
|
187
|
-
persistScrollGutter: props.persistScrollGutter,
|
|
188
|
-
enableToolbarMinWidth: ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
189
|
-
useStickyToolbar: props.useStickyToolbar,
|
|
190
|
-
featureFlags: featureFlags,
|
|
191
|
-
pluginHooks: config.pluginHooks
|
|
192
|
-
}));
|
|
193
|
-
}
|
|
194
130
|
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
195
|
-
});
|
|
196
|
-
function ReactEditorViewContextWrapper(props) {
|
|
197
|
-
var _media, _linking, _linking$smartLinks;
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
199
|
-
const [editorAPI, setEditorAPI] = useState(undefined);
|
|
200
|
-
|
|
201
|
-
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
202
|
-
const UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
203
|
-
const smartLinks = props.editorProps.smartLinks;
|
|
204
|
-
useProviders({
|
|
205
|
-
editorApi: editorAPI,
|
|
206
|
-
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
207
|
-
mediaProvider: (_media = props.editorProps.media) === null || _media === void 0 ? void 0 : _media.provider,
|
|
208
|
-
mentionProvider: props.editorProps.mentionProvider,
|
|
209
|
-
cardProvider: ((_linking = props.editorProps.linking) === null || _linking === void 0 ? void 0 : (_linking$smartLinks = _linking.smartLinks) === null || _linking$smartLinks === void 0 ? void 0 : _linking$smartLinks.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
210
|
-
emojiProvider: props.editorProps.emojiProvider,
|
|
211
|
-
autoformattingProvider: props.editorProps.autoformattingProvider,
|
|
212
|
-
taskDecisionProvider: props.editorProps.taskDecisionProvider
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// Ignored via go/ees005
|
|
216
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
217
|
-
return jsx(ReactEditorView, _extends({}, props, {
|
|
218
|
-
editorAPI: editorAPI,
|
|
219
|
-
setEditorAPI: setEditorAPI
|
|
220
|
-
}));
|
|
221
|
-
}
|
|
131
|
+
});
|
|
@@ -30,7 +30,7 @@ import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
|
|
|
30
30
|
import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
|
|
31
31
|
import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
|
|
32
32
|
const EDIT_AREA_ID = 'ak-editor-textarea';
|
|
33
|
-
function ReactEditorView(props) {
|
|
33
|
+
export function ReactEditorView(props) {
|
|
34
34
|
var _media, _linking, _linking$smartLinks, _props$render, _props$render2;
|
|
35
35
|
const {
|
|
36
36
|
preset,
|
|
@@ -268,6 +268,19 @@ const contentStyles = props => css`
|
|
|
268
268
|
background: transparent;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
/**
|
|
272
|
+
* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24
|
|
273
|
+
*
|
|
274
|
+
* 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection
|
|
275
|
+
* 2. Cleanup duplicated style from platform_editor_advanced_code_blocks
|
|
276
|
+
* https://product-fabric.atlassian.net/browse/ED-26331
|
|
277
|
+
*/
|
|
278
|
+
${fg('platform_editor_hide_cursor_when_pm_hideselection') ? css`
|
|
279
|
+
.ProseMirror-hideselection {
|
|
280
|
+
caret-color: transparent;
|
|
281
|
+
}
|
|
282
|
+
` : null}
|
|
283
|
+
|
|
271
284
|
/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */
|
|
272
285
|
${editorExperiment('platform_editor_advanced_code_blocks', true) ? css`
|
|
273
286
|
.ProseMirror-hideselection {
|
|
@@ -283,14 +296,12 @@ const contentStyles = props => css`
|
|
|
283
296
|
outline: 2px solid ${"var(--ds-border-focused, #8cf)"};
|
|
284
297
|
}
|
|
285
298
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
` : null}
|
|
299
|
+
.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {
|
|
300
|
+
caret-color: transparent;
|
|
301
|
+
}
|
|
302
|
+
.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
294
305
|
|
|
295
306
|
${placeholderTextStyles}
|
|
296
307
|
${placeholderStyles}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "203.11.
|
|
2
|
+
export const version = "203.11.8";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
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; }
|
|
@@ -7,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
6
|
* @jsxRuntime classic
|
|
8
7
|
* @jsx jsx
|
|
9
8
|
*/
|
|
10
|
-
import { Fragment, memo
|
|
9
|
+
import { Fragment, memo } from 'react';
|
|
11
10
|
|
|
12
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
12
|
import { css, jsx } from '@emotion/react';
|
|
@@ -16,15 +15,11 @@ import { usePortalProvider } from '@atlaskit/editor-common/portal';
|
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import ErrorBoundary from '../create-editor/ErrorBoundary';
|
|
18
17
|
import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
|
|
19
|
-
// Ignored via go/ees005
|
|
20
|
-
// eslint-disable-next-line import/no-named-as-default
|
|
21
|
-
import ReactEditorView from '../create-editor/ReactEditorView';
|
|
22
18
|
import ReactEditorViewNext from '../create-editor/ReactEditorViewNext';
|
|
23
19
|
import EditorContext from '../ui/EditorContext';
|
|
24
20
|
import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper/IntlProviderIfMissingWrapper';
|
|
25
21
|
import { RenderTracking } from '../utils/performance/components/RenderTracking';
|
|
26
22
|
import { BaseThemeWrapper } from './BaseThemeWrapper';
|
|
27
|
-
import { useProviders } from './hooks/useProviders';
|
|
28
23
|
import { getBaseFontSize } from './utils/getBaseFontSize';
|
|
29
24
|
var editorContainerStyles = css({
|
|
30
25
|
position: 'relative',
|
|
@@ -81,7 +76,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
81
76
|
css: editorContainerStyles
|
|
82
77
|
}, jsx(EditorContext, {
|
|
83
78
|
editorActions: editorActions
|
|
84
|
-
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null,
|
|
79
|
+
}, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, jsx(ReactEditorViewNext, {
|
|
85
80
|
editorProps: overriddenEditorProps,
|
|
86
81
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
87
82
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -139,92 +134,5 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
139
134
|
pluginHooks: config.pluginHooks
|
|
140
135
|
}));
|
|
141
136
|
}
|
|
142
|
-
}) : jsx(ReactEditorViewContextWrapper, {
|
|
143
|
-
editorProps: overriddenEditorProps,
|
|
144
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
145
|
-
portalProviderAPI: portalProviderAPI,
|
|
146
|
-
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI,
|
|
147
|
-
providerFactory: providerFactory,
|
|
148
|
-
onEditorCreated: onEditorCreated,
|
|
149
|
-
onEditorDestroyed: onEditorDestroyed,
|
|
150
|
-
disabled: props.disabled,
|
|
151
|
-
preset: preset,
|
|
152
|
-
render: function render(_ref3) {
|
|
153
|
-
var _props$featureFlags3, _props$featureFlags4;
|
|
154
|
-
var editor = _ref3.editor,
|
|
155
|
-
view = _ref3.view,
|
|
156
|
-
eventDispatcher = _ref3.eventDispatcher,
|
|
157
|
-
config = _ref3.config,
|
|
158
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
159
|
-
editorRef = _ref3.editorRef,
|
|
160
|
-
editorAPI = _ref3.editorAPI;
|
|
161
|
-
return jsx(BaseThemeWrapper, {
|
|
162
|
-
baseFontSize: getBaseFontSize(props.appearance)
|
|
163
|
-
}, jsx(AppearanceComponent, {
|
|
164
|
-
innerRef: editorRef,
|
|
165
|
-
editorAPI: editorAPI
|
|
166
|
-
// Ignored via go/ees005
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
168
|
-
,
|
|
169
|
-
appearance: props.appearance,
|
|
170
|
-
disabled: props.disabled,
|
|
171
|
-
editorActions: editorActions,
|
|
172
|
-
editorDOMElement: editor,
|
|
173
|
-
editorView: view,
|
|
174
|
-
providerFactory: providerFactory,
|
|
175
|
-
eventDispatcher: eventDispatcher,
|
|
176
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
177
|
-
maxHeight: props.maxHeight,
|
|
178
|
-
minHeight: props.minHeight,
|
|
179
|
-
onSave: props.onSave ? handleSave : undefined,
|
|
180
|
-
onCancel: props.onCancel,
|
|
181
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
182
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
183
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
184
|
-
contentComponents: config.contentComponents,
|
|
185
|
-
primaryToolbarComponents: config.primaryToolbarComponents,
|
|
186
|
-
primaryToolbarIconBefore: props.primaryToolbarIconBefore,
|
|
187
|
-
secondaryToolbarComponents: config.secondaryToolbarComponents,
|
|
188
|
-
customContentComponents: props.contentComponents,
|
|
189
|
-
customPrimaryToolbarComponents: props.primaryToolbarComponents,
|
|
190
|
-
customSecondaryToolbarComponents: props.secondaryToolbarComponents,
|
|
191
|
-
contextPanel: props.contextPanel,
|
|
192
|
-
collabEdit: props.collabEdit,
|
|
193
|
-
persistScrollGutter: props.persistScrollGutter,
|
|
194
|
-
enableToolbarMinWidth: ((_props$featureFlags3 = props.featureFlags) === null || _props$featureFlags3 === void 0 ? void 0 : _props$featureFlags3.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
195
|
-
useStickyToolbar: props.useStickyToolbar,
|
|
196
|
-
featureFlags: featureFlags,
|
|
197
|
-
pluginHooks: config.pluginHooks
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
137
|
}), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
|
|
201
|
-
});
|
|
202
|
-
function ReactEditorViewContextWrapper(props) {
|
|
203
|
-
var _media, _linking;
|
|
204
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
205
|
-
var _useState = useState(undefined),
|
|
206
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
207
|
-
editorAPI = _useState2[0],
|
|
208
|
-
setEditorAPI = _useState2[1];
|
|
209
|
-
|
|
210
|
-
// TODO: Remove these when we deprecate these props from editor-props - smartLinks is unfortunately still used in some places, we can sidestep this problem if we move everyone across to ComposableEditor and deprecate Editor
|
|
211
|
-
var UNSAFE_cards = props.editorProps.UNSAFE_cards;
|
|
212
|
-
var smartLinks = props.editorProps.smartLinks;
|
|
213
|
-
useProviders({
|
|
214
|
-
editorApi: editorAPI,
|
|
215
|
-
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
216
|
-
mediaProvider: (_media = props.editorProps.media) === null || _media === void 0 ? void 0 : _media.provider,
|
|
217
|
-
mentionProvider: props.editorProps.mentionProvider,
|
|
218
|
-
cardProvider: ((_linking = props.editorProps.linking) === null || _linking === void 0 || (_linking = _linking.smartLinks) === null || _linking === void 0 ? void 0 : _linking.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
219
|
-
emojiProvider: props.editorProps.emojiProvider,
|
|
220
|
-
autoformattingProvider: props.editorProps.autoformattingProvider,
|
|
221
|
-
taskDecisionProvider: props.editorProps.taskDecisionProvider
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// Ignored via go/ees005
|
|
225
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
226
|
-
return jsx(ReactEditorView, _extends({}, props, {
|
|
227
|
-
editorAPI: editorAPI,
|
|
228
|
-
setEditorAPI: setEditorAPI
|
|
229
|
-
}));
|
|
230
|
-
}
|
|
138
|
+
});
|
|
@@ -34,7 +34,7 @@ import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
|
|
|
34
34
|
import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
|
|
35
35
|
import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
|
|
36
36
|
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
37
|
-
function ReactEditorView(props) {
|
|
37
|
+
export function ReactEditorView(props) {
|
|
38
38
|
var _media, _linking, _props$render, _props$render2;
|
|
39
39
|
var preset = props.preset,
|
|
40
40
|
_props$editorProps = props.editorProps,
|
|
@@ -13,5 +13,5 @@ var GutterDangerOverlay = function GutterDangerOverlay() {
|
|
|
13
13
|
/* When code-block is inside the panel */
|
|
14
14
|
var firstCodeBlockWithNoMargin = editorExperiment('nested-dnd', true) ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t\t.ak-editor-panel__content {\n\t\t\t\t> .code-block:first-child,\n\t\t\t\t> .ProseMirror-widget:first-child + .code-block,\n\t\t\t\t> .ProseMirror-widget:first-child + .ProseMirror-widget + .code-block {\n\t\t\t\t\tmargin: 0 0 0 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t"]))) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\t\t\t.ak-editor-panel__content {\n\t\t\t\t> .code-block:first-child {\n\t\t\t\t\tmargin: 0 0 0 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t"])));
|
|
15
15
|
export var codeBlockStyles = function codeBlockStyles() {
|
|
16
|
-
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror li {\n\t\t/* if same list item has multiple code blocks we need top margin for all but first */\n\t\t> .code-block {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\t\t> .code-block:first-child,\n\t\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t> div:last-of-type.code-block {\n\t\t\tmargin-bottom: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror .code-block.", ":not(.danger) {\n\t\t", "\n\t}\n\n\t/* Danger when top level node */\n\t.ProseMirror .danger.code-block {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t/* Danger when nested node */\n\t.ProseMirror .danger .code-block {\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t", "\n"])), codeBlockSharedStyles(), blockNodesVerticalMargin, blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, #FFECEB)", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(akEditorDeleteBackground, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))", firstCodeBlockWithNoMargin);
|
|
16
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t}\n\n\t.ProseMirror li {\n\t\t/* if same list item has multiple code blocks we need top margin for all but first */\n\t\t> .code-block {\n\t\t\tmargin: ", " 0 0 0;\n\t\t}\n\t\t> .code-block:first-child,\n\t\t> .ProseMirror-gapcursor:first-child + .code-block {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t> div:last-of-type.code-block,\n\t\t> pre:last-of-type.code-block {\n\t\t\tmargin-bottom: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror .code-block.", ":not(.danger) {\n\t\t", "\n\t}\n\n\t/* Danger when top level node */\n\t.ProseMirror .danger.code-block {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t/* Danger when nested node */\n\t.ProseMirror .danger .code-block {\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tcolor: ", ";\n\t\t\t", ";\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t}\n\t}\n\n\t", "\n"])), codeBlockSharedStyles(), blockNodesVerticalMargin, blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, #FFECEB)", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(akEditorDeleteBackground, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))", firstCodeBlockWithNoMargin);
|
|
17
17
|
};
|