@atlaskit/editor-core 189.5.0 → 189.5.3
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 +14 -0
- package/afm-cc/tsconfig.json +335 -0
- package/dist/cjs/composable-editor/editor-internal.js +11 -11
- package/dist/cjs/composable-editor/editor.js +8 -7
- package/dist/cjs/composable-editor/hooks/useEditorMeasuresConstructor.js +2 -0
- package/dist/cjs/composable-editor/hooks/useMeasureEditorMountTime.js +2 -0
- package/dist/cjs/editor.js +4 -3
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +11 -10
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +2 -1
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +6 -5
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +5 -2
- package/dist/cjs/plugins/collab-edit/ui/colored-avatar-item.js +4 -1
- package/dist/cjs/plugins/collab-edit/ui/invite-to-edit.js +7 -4
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +13 -11
- package/dist/cjs/plugins/extension/ui/Extension/InlineExtension/index.js +5 -4
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +9 -8
- package/dist/cjs/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +4 -4
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +7 -6
- package/dist/cjs/plugins/find-replace/ui/Find.js +14 -13
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +6 -5
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +8 -7
- package/dist/cjs/plugins/find-replace/ui/Replace.js +6 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +1 -0
- package/dist/cjs/plugins/jira-issue/nodeviews/jira-issue.js +5 -4
- package/dist/cjs/plugins/paste/edge-cases/index.js +26 -0
- package/dist/cjs/plugins/paste/handlers.js +18 -9
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +11 -8
- package/dist/cjs/ui/Addon/ClickAreaBlock/index.js +2 -1
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +2 -1
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +2 -1
- package/dist/cjs/ui/Addon/Dropdown/index.js +3 -2
- package/dist/cjs/ui/Addon/DropdownItem/index.js +5 -2
- package/dist/cjs/ui/Alignment/index.js +7 -6
- package/dist/cjs/ui/Appearance/Chromeless.js +7 -6
- package/dist/cjs/ui/Appearance/Comment/Comment.js +17 -16
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +5 -4
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +6 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +12 -10
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +15 -13
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +6 -5
- package/dist/cjs/ui/ChromeCollapsed/index.js +3 -2
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +16 -15
- package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +12 -11
- package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +7 -6
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +8 -8
- package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +18 -17
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +9 -8
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +10 -9
- package/dist/cjs/ui/ConfigPanel/Fields/SelectItem.js +6 -5
- package/dist/cjs/ui/ConfigPanel/Fields/TabGroup.js +7 -6
- package/dist/cjs/ui/ConfigPanel/Header.js +14 -13
- package/dist/cjs/ui/ConfigPanel/LoadingState.js +3 -2
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +5 -4
- package/dist/cjs/ui/ContentStyles/index.js +2 -1
- package/dist/cjs/ui/ContextPanel/index.js +11 -10
- package/dist/cjs/ui/PluginSlot/index.js +4 -3
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +2 -1
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +5 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +16 -15
- package/dist/cjs/ui/WithFlash/index.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +12 -11
- package/dist/es2019/composable-editor/editor.js +8 -6
- package/dist/es2019/composable-editor/hooks/useEditorMeasuresConstructor.js +2 -0
- package/dist/es2019/composable-editor/hooks/useMeasureEditorMountTime.js +1 -0
- package/dist/es2019/editor.js +4 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +11 -9
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -3
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +3 -2
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +7 -6
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +4 -2
- package/dist/es2019/plugins/collab-edit/ui/colored-avatar-item.js +3 -1
- package/dist/es2019/plugins/collab-edit/ui/invite-to-edit.js +6 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +14 -11
- package/dist/es2019/plugins/extension/ui/Extension/InlineExtension/index.js +5 -3
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +7 -5
- package/dist/es2019/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +6 -4
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +8 -7
- package/dist/es2019/plugins/find-replace/ui/Find.js +14 -12
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +6 -4
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +9 -8
- package/dist/es2019/plugins/find-replace/ui/Replace.js +6 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +1 -0
- package/dist/es2019/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
- package/dist/es2019/plugins/paste/edge-cases/index.js +27 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -10
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +10 -8
- package/dist/es2019/ui/Addon/ClickAreaBlock/index.js +3 -2
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +3 -2
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +3 -2
- package/dist/es2019/ui/Addon/Dropdown/index.js +3 -1
- package/dist/es2019/ui/Addon/DropdownItem/index.js +4 -2
- package/dist/es2019/ui/Alignment/index.js +5 -3
- package/dist/es2019/ui/Appearance/Chromeless.js +8 -7
- package/dist/es2019/ui/Appearance/Comment/Comment.js +18 -17
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +7 -5
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +5 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +12 -11
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +15 -13
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +7 -6
- package/dist/es2019/ui/ChromeCollapsed/index.js +3 -1
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +17 -17
- package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +13 -12
- package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +8 -7
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +9 -8
- package/dist/es2019/ui/ConfigPanel/Fields/DateRange.js +19 -18
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +10 -9
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +11 -10
- package/dist/es2019/ui/ConfigPanel/Fields/SelectItem.js +7 -6
- package/dist/es2019/ui/ConfigPanel/Fields/TabGroup.js +8 -7
- package/dist/es2019/ui/ConfigPanel/Header.js +15 -14
- package/dist/es2019/ui/ConfigPanel/LoadingState.js +4 -3
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +6 -5
- package/dist/es2019/ui/ContentStyles/index.js +3 -2
- package/dist/es2019/ui/ContextPanel/index.js +12 -11
- package/dist/es2019/ui/PluginSlot/index.js +5 -4
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +3 -2
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +6 -5
- package/dist/es2019/ui/ToolbarFeedback/index.js +14 -12
- package/dist/es2019/ui/WithFlash/index.js +3 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +12 -11
- package/dist/esm/composable-editor/editor.js +8 -6
- package/dist/esm/composable-editor/hooks/useEditorMeasuresConstructor.js +2 -0
- package/dist/esm/composable-editor/hooks/useMeasureEditorMountTime.js +1 -0
- package/dist/esm/editor.js +4 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +11 -9
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -3
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +3 -2
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +7 -6
- package/dist/esm/plugins/collab-edit/ui/avatars.js +4 -2
- package/dist/esm/plugins/collab-edit/ui/colored-avatar-item.js +3 -1
- package/dist/esm/plugins/collab-edit/ui/invite-to-edit.js +6 -4
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +14 -11
- package/dist/esm/plugins/extension/ui/Extension/InlineExtension/index.js +5 -3
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +7 -5
- package/dist/esm/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +6 -4
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +8 -7
- package/dist/esm/plugins/find-replace/ui/Find.js +14 -12
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +6 -4
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +9 -8
- package/dist/esm/plugins/find-replace/ui/Replace.js +6 -4
- package/dist/esm/plugins/find-replace/ui/styles.js +1 -0
- package/dist/esm/plugins/jira-issue/nodeviews/jira-issue.js +6 -5
- package/dist/esm/plugins/paste/edge-cases/index.js +26 -1
- package/dist/esm/plugins/paste/handlers.js +19 -10
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +10 -8
- package/dist/esm/ui/Addon/ClickAreaBlock/index.js +3 -2
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +3 -2
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +3 -2
- package/dist/esm/ui/Addon/Dropdown/index.js +3 -1
- package/dist/esm/ui/Addon/DropdownItem/index.js +4 -2
- package/dist/esm/ui/Alignment/index.js +5 -3
- package/dist/esm/ui/Appearance/Chromeless.js +8 -7
- package/dist/esm/ui/Appearance/Comment/Comment.js +18 -17
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +7 -5
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +5 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +12 -11
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +15 -13
- package/dist/esm/ui/AppearanceComponents/Mobile.js +7 -6
- package/dist/esm/ui/ChromeCollapsed/index.js +3 -1
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +17 -17
- package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +13 -12
- package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +8 -7
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +9 -8
- package/dist/esm/ui/ConfigPanel/Fields/DateRange.js +19 -18
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +10 -9
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +11 -10
- package/dist/esm/ui/ConfigPanel/Fields/SelectItem.js +7 -6
- package/dist/esm/ui/ConfigPanel/Fields/TabGroup.js +8 -7
- package/dist/esm/ui/ConfigPanel/Header.js +15 -14
- package/dist/esm/ui/ConfigPanel/LoadingState.js +4 -3
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +6 -5
- package/dist/esm/ui/ContentStyles/index.js +3 -2
- package/dist/esm/ui/ContextPanel/index.js +12 -11
- package/dist/esm/ui/PluginSlot/index.js +5 -4
- package/dist/esm/ui/Toolbar/ToolbarInner.js +3 -2
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +6 -5
- package/dist/esm/ui/ToolbarFeedback/index.js +14 -12
- package/dist/esm/ui/WithFlash/index.js +3 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/paste/edge-cases/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/paste/edge-cases/index.d.ts +4 -0
- package/package.json +8 -4
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { findParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
2
3
|
import { insertSliceIntoRangeSelectionInsideList, insertSliceInsideOfPanelNodeSelected, insertSliceAtNodeEdge, insertSliceIntoEmptyNode } from './lists';
|
|
3
4
|
import { isListNode } from '@atlaskit/editor-common/utils';
|
|
5
|
+
import { ReplaceStep } from '@atlaskit/editor-prosemirror/transform';
|
|
4
6
|
import { isSelectionInsidePanel, isEmptyNode, isCursorSelectionAtTextStartOrEnd } from '../util';
|
|
5
7
|
export function insertSliceForLists(_ref) {
|
|
6
8
|
var _slice$content$firstC;
|
|
@@ -53,4 +55,27 @@ export function insertSliceForLists(_ref) {
|
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
tr.replaceSelection(slice);
|
|
58
|
+
}
|
|
59
|
+
export function insertSliceForListsInsideBlockquote(_ref3) {
|
|
60
|
+
var tr = _ref3.tr,
|
|
61
|
+
slice = _ref3.slice;
|
|
62
|
+
safeInsert(slice.content, tr.selection.$to.pos)(tr).scrollIntoView();
|
|
63
|
+
// ProseMirror doesn't give a proper way to tell us where something was inserted.
|
|
64
|
+
// However, we can know "how" it inserted something.
|
|
65
|
+
//
|
|
66
|
+
// So, instead of weird depth calculations, we can use the step produced by the transform.
|
|
67
|
+
// For instance:
|
|
68
|
+
// The `replaceStep.to and replaceStep.from`, tell us the real position
|
|
69
|
+
// where the content will be insert.
|
|
70
|
+
// Then, we can use the `tr.mapping.map` to the updated position after the replace operation
|
|
71
|
+
var replaceStep = tr.steps[0];
|
|
72
|
+
if (!(replaceStep instanceof ReplaceStep)) {
|
|
73
|
+
return tr;
|
|
74
|
+
}
|
|
75
|
+
var nextPosition = tr.mapping.map(replaceStep.to);
|
|
76
|
+
// The findFrom will make search for both: TextSelection and NodeSelections.
|
|
77
|
+
var nextSelection = Selection.findFrom(tr.doc.resolve(Math.min(nextPosition, tr.doc.content.size)), -1);
|
|
78
|
+
if (nextSelection) {
|
|
79
|
+
tr.setSelection(nextSelection);
|
|
80
|
+
}
|
|
56
81
|
}
|
|
@@ -19,7 +19,7 @@ import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
|
19
19
|
// TODO: ED-20519 Needs Macro extraction
|
|
20
20
|
|
|
21
21
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
|
|
22
|
-
import { insertSliceForLists } from './edge-cases';
|
|
22
|
+
import { insertSliceForLists, insertSliceForListsInsideBlockquote } from './edge-cases';
|
|
23
23
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
24
24
|
import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
|
|
25
25
|
import { anyMarkActive } from '@atlaskit/editor-common/mark';
|
|
@@ -840,15 +840,24 @@ export function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
840
840
|
schema: schema
|
|
841
841
|
});
|
|
842
842
|
} else if (noNeedForSafeInsert) {
|
|
843
|
-
var
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
843
|
+
var _firstChildOfSlice$ty2, _firstChildOfSlice$co;
|
|
844
|
+
if ((firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$ty2 = firstChildOfSlice.type) === null || _firstChildOfSlice$ty2 === void 0 ? void 0 : _firstChildOfSlice$ty2.name) === 'blockquote' && (firstChildOfSlice === null || firstChildOfSlice === void 0 || (_firstChildOfSlice$co = firstChildOfSlice.content.firstChild) === null || _firstChildOfSlice$co === void 0 ? void 0 : _firstChildOfSlice$co.type.name) === ('bulletList' || 'orderedList')) {
|
|
845
|
+
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist
|
|
846
|
+
insertSliceForListsInsideBlockquote({
|
|
847
|
+
tr: tr,
|
|
848
|
+
slice: slice
|
|
849
|
+
});
|
|
850
|
+
} else {
|
|
851
|
+
var _slice$content$lastCh;
|
|
852
|
+
tr.replaceSelection(slice);
|
|
853
|
+
// when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
|
|
854
|
+
// need to make sure the cursor position is is right after the panel, expand, or decisionList
|
|
855
|
+
// still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
|
|
856
|
+
var shouldUpdateCursorPosAfterPaste = ['panel', 'nestedExpand', 'decisionList', 'codeBlock'].includes(((_slice$content$lastCh = slice.content.lastChild) === null || _slice$content$lastCh === void 0 || (_slice$content$lastCh = _slice$content$lastCh.type) === null || _slice$content$lastCh === void 0 ? void 0 : _slice$content$lastCh.name) || '');
|
|
857
|
+
if (insideTableCell(state) && shouldUpdateCursorPosAfterPaste) {
|
|
858
|
+
var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
|
|
859
|
+
tr.setSelection(new GapCursorSelection(nextPos, Side.RIGHT));
|
|
860
|
+
}
|
|
852
861
|
}
|
|
853
862
|
} else {
|
|
854
863
|
// need to scan the slice if there's a block node or list items inside it
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { injectIntl } from 'react-intl-next';
|
|
2
4
|
import UndoIcon from '@atlaskit/icon/glyph/undo';
|
|
3
5
|
import RedoIcon from '@atlaskit/icon/glyph/redo';
|
|
@@ -52,39 +54,39 @@ export var ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
|
|
|
52
54
|
var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
|
|
53
55
|
canUndo = _ref2.canUndo,
|
|
54
56
|
canRedo = _ref2.canRedo;
|
|
55
|
-
return
|
|
57
|
+
return jsx("span", {
|
|
56
58
|
css: buttonGroupStyle
|
|
57
|
-
},
|
|
59
|
+
}, jsx(ToolbarButton, {
|
|
58
60
|
buttonId: TOOLBAR_BUTTON.UNDO,
|
|
59
61
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
60
62
|
onClick: handleUndo,
|
|
61
63
|
disabled: !canUndo || disabled,
|
|
62
64
|
"aria-label": tooltip(undoKeymap, labelUndo),
|
|
63
65
|
"aria-keyshortcuts": getAriaKeyshortcuts(undoKeymap),
|
|
64
|
-
title:
|
|
66
|
+
title: jsx(ToolTipContent, {
|
|
65
67
|
description: labelUndo,
|
|
66
68
|
keymap: undoKeymap
|
|
67
69
|
}),
|
|
68
|
-
iconBefore:
|
|
70
|
+
iconBefore: jsx(UndoIcon, {
|
|
69
71
|
label: ""
|
|
70
72
|
}),
|
|
71
73
|
testId: "ak-editor-toolbar-button-undo"
|
|
72
|
-
}),
|
|
74
|
+
}), jsx(ToolbarButton, {
|
|
73
75
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
74
76
|
buttonId: TOOLBAR_BUTTON.REDO,
|
|
75
77
|
onClick: handleRedo,
|
|
76
78
|
disabled: !canRedo || disabled,
|
|
77
|
-
title:
|
|
79
|
+
title: jsx(ToolTipContent, {
|
|
78
80
|
description: labelRedo,
|
|
79
81
|
keymap: redoKeymap
|
|
80
82
|
}),
|
|
81
|
-
iconBefore:
|
|
83
|
+
iconBefore: jsx(RedoIcon, {
|
|
82
84
|
label: ""
|
|
83
85
|
}),
|
|
84
86
|
testId: "ak-editor-toolbar-button-redo",
|
|
85
87
|
"aria-label": tooltip(redoKeymap, labelRedo),
|
|
86
88
|
"aria-keyshortcuts": getAriaKeyshortcuts(redoKeymap)
|
|
87
|
-
}),
|
|
89
|
+
}), jsx("span", {
|
|
88
90
|
css: separatorStyles
|
|
89
91
|
}));
|
|
90
92
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { clickAreaClickHandler } from '../click-area-helper';
|
|
6
7
|
var clickWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-grow: 1;\n height: 100%;\n"])));
|
|
7
8
|
export var ClickAreaBlock = function ClickAreaBlock(_ref) {
|
|
@@ -16,7 +17,7 @@ export var ClickAreaBlock = function ClickAreaBlock(_ref) {
|
|
|
16
17
|
clickAreaClickHandler(editorView, event);
|
|
17
18
|
}
|
|
18
19
|
}, [editorView, editorDisabled]);
|
|
19
|
-
return
|
|
20
|
+
return jsx("div", {
|
|
20
21
|
"data-testid": "click-wrapper",
|
|
21
22
|
css: clickWrapper,
|
|
22
23
|
onMouseDown: handleMouseDown
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
|
+
/** @jsx jsx */
|
|
3
4
|
import React from 'react';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { createParagraphAtEnd } from '../../../commands';
|
|
6
7
|
var clickArea = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-grow: 1;\n"])));
|
|
7
8
|
export var ClickAreaInline = function ClickAreaInline(_ref) {
|
|
@@ -16,7 +17,7 @@ export var ClickAreaInline = function ClickAreaInline(_ref) {
|
|
|
16
17
|
event.stopPropagation();
|
|
17
18
|
}
|
|
18
19
|
}, [editorView]);
|
|
19
|
-
return
|
|
20
|
+
return jsx("div", {
|
|
20
21
|
"data-testid": "click-wrapper",
|
|
21
22
|
css: clickArea,
|
|
22
23
|
onMouseDown: handleMouseDown
|
|
@@ -9,8 +9,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
9
9
|
var _templateObject;
|
|
10
10
|
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); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
/** @jsx jsx */
|
|
12
13
|
import React from 'react';
|
|
13
|
-
import { css } from '@emotion/react';
|
|
14
|
+
import { css, jsx } from '@emotion/react';
|
|
14
15
|
import { clickAreaClickHandler } from '../click-area-helper';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -74,7 +75,7 @@ var ClickAreaMobile = /*#__PURE__*/function (_React$Component) {
|
|
|
74
75
|
_createClass(ClickAreaMobile, [{
|
|
75
76
|
key: "render",
|
|
76
77
|
value: function render() {
|
|
77
|
-
return
|
|
78
|
+
return jsx("div", {
|
|
78
79
|
css: clickWrapper({
|
|
79
80
|
isExpanded: this.props.isExpanded,
|
|
80
81
|
minHeight: this.props.minHeight
|
|
@@ -7,7 +7,9 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
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() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
+
/** @jsx jsx */
|
|
10
11
|
import React from 'react';
|
|
12
|
+
import { jsx } from '@emotion/react';
|
|
11
13
|
import { dropdown } from './styles';
|
|
12
14
|
var DropdownWrapper = /*#__PURE__*/function (_React$Component) {
|
|
13
15
|
_inherits(DropdownWrapper, _React$Component);
|
|
@@ -42,7 +44,7 @@ var DropdownWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
42
44
|
onClick: _this2.handleClick
|
|
43
45
|
});
|
|
44
46
|
});
|
|
45
|
-
return
|
|
47
|
+
return jsx("div", {
|
|
46
48
|
css: dropdown
|
|
47
49
|
}, children);
|
|
48
50
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { dropdownItem } from './styles';
|
|
2
4
|
var DropdownItemWrapper = function DropdownItemWrapper(props) {
|
|
3
|
-
return
|
|
5
|
+
return jsx("div", {
|
|
4
6
|
css: dropdownItem,
|
|
5
7
|
onClick: function onClick() {
|
|
6
8
|
return props.onClick && props.onClick({
|
|
@@ -8,6 +10,6 @@ var DropdownItemWrapper = function DropdownItemWrapper(props) {
|
|
|
8
10
|
renderOnClick: props.renderOnClick
|
|
9
11
|
});
|
|
10
12
|
}
|
|
11
|
-
},
|
|
13
|
+
}, jsx("span", null, props.icon), props.children);
|
|
12
14
|
};
|
|
13
15
|
export default DropdownItemWrapper;
|
|
@@ -5,6 +5,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
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); }; }
|
|
7
7
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { jsx } from '@emotion/react';
|
|
8
10
|
import { PureComponent } from 'react';
|
|
9
11
|
import { injectIntl } from 'react-intl-next';
|
|
10
12
|
import { IconMap } from '../../plugins/alignment/ui/ToolbarAlignment/icon-map';
|
|
@@ -38,7 +40,7 @@ var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
|
38
40
|
selectedAlignment = _this$props.selectedAlignment,
|
|
39
41
|
className = _this$props.className,
|
|
40
42
|
intl = _this$props.intl;
|
|
41
|
-
return
|
|
43
|
+
return jsx("div", {
|
|
42
44
|
css: alignmentWrapper,
|
|
43
45
|
className: className
|
|
44
46
|
}, alignmentOptions.map(function (alignment) {
|
|
@@ -46,8 +48,8 @@ var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
|
46
48
|
title = alignment.title,
|
|
47
49
|
shortcut = alignment.shortcut;
|
|
48
50
|
var message = intl.formatMessage(title);
|
|
49
|
-
return
|
|
50
|
-
content:
|
|
51
|
+
return jsx(AlignmentButton, {
|
|
52
|
+
content: jsx(IconMap, {
|
|
51
53
|
alignment: value
|
|
52
54
|
}),
|
|
53
55
|
key: value,
|
|
@@ -9,8 +9,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
9
9
|
var _templateObject, _templateObject2, _templateObject3;
|
|
10
10
|
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); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
/** @jsx jsx */
|
|
12
13
|
import React, { Fragment } from 'react';
|
|
13
|
-
import { css } from '@emotion/react';
|
|
14
|
+
import { css, jsx } from '@emotion/react';
|
|
14
15
|
import PluginSlot from '../PluginSlot';
|
|
15
16
|
import { createEditorContentStyle } from '../ContentStyles';
|
|
16
17
|
import { scrollbarStyles } from '../styles';
|
|
@@ -53,18 +54,18 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
53
54
|
pluginHooks = _this$props.pluginHooks,
|
|
54
55
|
featureFlags = _this$props.featureFlags;
|
|
55
56
|
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
56
|
-
return
|
|
57
|
+
return jsx(WithFlash, {
|
|
57
58
|
animate: maxContentSizeReached
|
|
58
|
-
},
|
|
59
|
+
}, jsx("div", {
|
|
59
60
|
css: [chromelessEditor, maxHeight && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), maxHeight), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), minHeight)],
|
|
60
61
|
"data-testid": "chromeless-editor",
|
|
61
62
|
ref: function ref(_ref2) {
|
|
62
63
|
return _this.containerElement = _ref2;
|
|
63
64
|
}
|
|
64
|
-
},
|
|
65
|
+
}, jsx(ContentArea, {
|
|
65
66
|
className: "ak-editor-content-area",
|
|
66
67
|
featureFlags: featureFlags
|
|
67
|
-
}, customContentComponents,
|
|
68
|
+
}, customContentComponents, jsx(PluginSlot, {
|
|
68
69
|
editorView: editorView,
|
|
69
70
|
editorActions: editorActions,
|
|
70
71
|
eventDispatcher: eventDispatcher,
|
|
@@ -86,7 +87,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
86
87
|
_createClass(Editor, [{
|
|
87
88
|
key: "render",
|
|
88
89
|
value: function render() {
|
|
89
|
-
return
|
|
90
|
+
return jsx(RenderWithPluginState, {
|
|
90
91
|
renderChrome: this.renderChrome
|
|
91
92
|
});
|
|
92
93
|
}
|
|
@@ -100,7 +101,7 @@ function RenderWithPluginState(_ref3) {
|
|
|
100
101
|
var api = usePresetContext();
|
|
101
102
|
var _useSharedPluginState = useSharedPluginState(api, ['maxContentSize']),
|
|
102
103
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
103
|
-
return
|
|
104
|
+
return jsx(Fragment, null, renderChrome({
|
|
104
105
|
maxContentSize: maxContentSizeState
|
|
105
106
|
}));
|
|
106
107
|
}
|
|
@@ -9,8 +9,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
9
9
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
10
10
|
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); }; }
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
+
/** @jsx jsx */
|
|
12
13
|
import React, { Fragment } from 'react';
|
|
13
|
-
import { css } from '@emotion/react';
|
|
14
|
+
import { css, jsx } from '@emotion/react';
|
|
14
15
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
15
16
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
16
17
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -99,15 +100,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
99
100
|
event.preventDefault();
|
|
100
101
|
event.stopPropagation();
|
|
101
102
|
};
|
|
102
|
-
return
|
|
103
|
+
return jsx(WithFlash, {
|
|
103
104
|
animate: maxContentSizeReached
|
|
104
|
-
},
|
|
105
|
+
}, jsx("div", {
|
|
105
106
|
css: [commentEditorStyle, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), minHeight)],
|
|
106
107
|
className: "akEditor",
|
|
107
108
|
ref: _this.wrapperElementRef
|
|
108
|
-
},
|
|
109
|
+
}, jsx(MainToolbar, {
|
|
109
110
|
useStickyToolbar: useStickyToolbar
|
|
110
|
-
},
|
|
111
|
+
}, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
111
112
|
editorView: editorView,
|
|
112
113
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
113
114
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
@@ -115,7 +116,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
115
116
|
editorAppearance: _this.appearance,
|
|
116
117
|
useStickyToolbar: useStickyToolbar,
|
|
117
118
|
intl: intl
|
|
118
|
-
},
|
|
119
|
+
}, jsx(Toolbar, {
|
|
119
120
|
editorView: editorView,
|
|
120
121
|
editorActions: editorActions,
|
|
121
122
|
eventDispatcher: eventDispatcher,
|
|
@@ -128,14 +129,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
128
129
|
disabled: !!disabled,
|
|
129
130
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
130
131
|
containerElement: _this.containerElement
|
|
131
|
-
}),
|
|
132
|
+
}), jsx("div", {
|
|
132
133
|
css: mainToolbarCustomComponentsSlotStyle
|
|
133
|
-
}, customPrimaryToolbarComponents))),
|
|
134
|
+
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
134
135
|
editorView: editorView,
|
|
135
136
|
editorDisabled: disabled
|
|
136
|
-
},
|
|
137
|
+
}, jsx(WidthConsumer, null, function (_ref2) {
|
|
137
138
|
var width = _ref2.width;
|
|
138
|
-
return
|
|
139
|
+
return jsx(ContentArea, {
|
|
139
140
|
ref: function ref(_ref3) {
|
|
140
141
|
return _this.containerElement = _ref3;
|
|
141
142
|
},
|
|
@@ -144,7 +145,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
144
145
|
'less-margin': width < akEditorMobileBreakoutPoint
|
|
145
146
|
}),
|
|
146
147
|
featureFlags: featureFlags
|
|
147
|
-
}, customContentComponents,
|
|
148
|
+
}, customContentComponents, jsx(PluginSlot, {
|
|
148
149
|
editorView: editorView,
|
|
149
150
|
editorActions: editorActions,
|
|
150
151
|
eventDispatcher: eventDispatcher,
|
|
@@ -160,19 +161,19 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
160
161
|
wrapperElement: _this.wrapperElementRef.current,
|
|
161
162
|
pluginHooks: pluginHooks
|
|
162
163
|
}), editorDOMElement);
|
|
163
|
-
}))), showSecondaryToolbar &&
|
|
164
|
+
}))), showSecondaryToolbar && jsx("div", {
|
|
164
165
|
css: secondaryToolbarStyle,
|
|
165
166
|
"data-testid": "ak-editor-secondary-toolbar"
|
|
166
|
-
},
|
|
167
|
+
}, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
|
|
167
168
|
appearance: "primary",
|
|
168
169
|
onClick: _this.handleSave,
|
|
169
170
|
testId: "comment-save-button",
|
|
170
171
|
isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
|
|
171
|
-
}, intl.formatMessage(messages.saveButton)), !!onCancel &&
|
|
172
|
+
}, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
|
|
172
173
|
appearance: "subtle",
|
|
173
174
|
onClick: _this.handleCancel,
|
|
174
175
|
isDisabled: disabled
|
|
175
|
-
}, intl.formatMessage(messages.cancelButton))),
|
|
176
|
+
}, intl.formatMessage(messages.cancelButton))), jsx("span", {
|
|
176
177
|
style: {
|
|
177
178
|
flexGrow: 1
|
|
178
179
|
}
|
|
@@ -186,7 +187,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
186
187
|
_createClass(Editor, [{
|
|
187
188
|
key: "render",
|
|
188
189
|
value: function render() {
|
|
189
|
-
return
|
|
190
|
+
return jsx(RenderWithPluginState, {
|
|
190
191
|
renderChrome: this.renderChrome
|
|
191
192
|
});
|
|
192
193
|
}
|
|
@@ -200,7 +201,7 @@ function RenderWithPluginState(_ref4) {
|
|
|
200
201
|
var _useSharedPluginState = useSharedPluginState(api, ['media', 'maxContentSize']),
|
|
201
202
|
mediaState = _useSharedPluginState.mediaState,
|
|
202
203
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
203
|
-
return
|
|
204
|
+
return jsx(Fragment, null, renderChrome({
|
|
204
205
|
maxContentSize: maxContentSizeState,
|
|
205
206
|
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined
|
|
206
207
|
}));
|
|
@@ -2,8 +2,10 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
|
|
5
7
|
import React, { useEffect, useState } from 'react';
|
|
6
|
-
import { css } from '@emotion/react';
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import { N30 } from '@atlaskit/theme/colors';
|
|
8
10
|
import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
9
11
|
export var TableControlsPadding = 20;
|
|
@@ -26,14 +28,14 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
26
28
|
setTop(props.offsetTop || 0);
|
|
27
29
|
}
|
|
28
30
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
29
|
-
return
|
|
31
|
+
return jsx("div", {
|
|
30
32
|
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n "])), top)],
|
|
31
33
|
"data-testid": "ak-editor-main-toolbar",
|
|
32
34
|
className: 'show-keyline'
|
|
33
35
|
}, props.children);
|
|
34
36
|
};
|
|
35
37
|
var FixedToolbar = function FixedToolbar(props) {
|
|
36
|
-
return
|
|
38
|
+
return jsx("div", {
|
|
37
39
|
css: mainToolbarWrapperStyle,
|
|
38
40
|
"data-testid": "ak-editor-main-toolbar"
|
|
39
41
|
}, props.children);
|
|
@@ -70,8 +72,8 @@ export var MainToolbar = function MainToolbar(_ref) {
|
|
|
70
72
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
71
73
|
children = _ref.children;
|
|
72
74
|
if (useStickyToolbar) {
|
|
73
|
-
return
|
|
75
|
+
return jsx(StickyToolbar, getStickyParameters(useStickyToolbar), children);
|
|
74
76
|
}
|
|
75
|
-
return
|
|
77
|
+
return jsx(FixedToolbar, null, children);
|
|
76
78
|
};
|
|
77
79
|
export var mainToolbarCustomComponentsSlotStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n padding-right: ", ";\n > div {\n display: flex;\n flex-shrink: 0;\n }\n"])), "var(--ds-space-250, 20px)");
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
2
3
|
import React, { useEffect, useState, useRef, useMemo } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
3
5
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
4
6
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
5
7
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
@@ -41,11 +43,11 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
41
43
|
}, [props.innerRef]);
|
|
42
44
|
var scrollContentContainerRef = useRef(null);
|
|
43
45
|
var showKeyline = useShowKeyline(scrollContentContainerRef);
|
|
44
|
-
return
|
|
46
|
+
return jsx(ContextPanelWidthProvider, null, jsx("div", {
|
|
45
47
|
css: fullPageEditorWrapper,
|
|
46
48
|
className: "akEditor",
|
|
47
49
|
ref: wrapperElementRef
|
|
48
|
-
},
|
|
50
|
+
}, jsx(FullPageToolbar, {
|
|
49
51
|
appearance: props.appearance,
|
|
50
52
|
beforeIcon: props.primaryToolbarIconBefore,
|
|
51
53
|
collabEdit: props.collabEdit,
|
|
@@ -66,7 +68,7 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
66
68
|
showKeyline: showKeyline,
|
|
67
69
|
featureFlags: props.featureFlags,
|
|
68
70
|
hideAvatarGroup: props.hideAvatarGroup
|
|
69
|
-
}),
|
|
71
|
+
}), jsx(FullPageContentArea, {
|
|
70
72
|
ref: scrollContentContainerRef,
|
|
71
73
|
appearance: props.appearance,
|
|
72
74
|
contentComponents: props.contentComponents,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, useTheme } from '@emotion/react';
|
|
2
3
|
import { WidthConsumer, ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
3
4
|
import React, { useImperativeHandle, useRef } from 'react';
|
|
4
5
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -23,22 +24,22 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
}, []);
|
|
26
|
-
return
|
|
27
|
+
return jsx(WidthConsumer, null, function (_ref) {
|
|
27
28
|
var width = _ref.width;
|
|
28
|
-
return
|
|
29
|
+
return jsx(ContextPanelConsumer, null, function (_ref2) {
|
|
29
30
|
var _contentAreaRef$curre;
|
|
30
31
|
var positionedOverEditor = _ref2.positionedOverEditor;
|
|
31
|
-
return
|
|
32
|
+
return jsx("div", {
|
|
32
33
|
css: [contentArea, positionedOverEditor && positionedOverEditorStyle],
|
|
33
34
|
"data-testid": CONTENT_AREA_TEST_ID
|
|
34
|
-
},
|
|
35
|
+
}, jsx(ScrollContainer, {
|
|
35
36
|
className: "fabric-editor-popup-scroll-parent",
|
|
36
37
|
featureFlags: props.featureFlags,
|
|
37
38
|
ref: scrollContainerRef
|
|
38
|
-
},
|
|
39
|
+
}, jsx(ClickAreaBlock, {
|
|
39
40
|
editorView: props.editorView,
|
|
40
41
|
editorDisabled: props.disabled
|
|
41
|
-
},
|
|
42
|
+
}, jsx("div", {
|
|
42
43
|
css: editorContentAreaStyle({
|
|
43
44
|
fullWidthMode: fullWidthMode,
|
|
44
45
|
layoutMaxWidth: theme.layoutMaxWidth,
|
|
@@ -47,11 +48,11 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
47
48
|
role: "region",
|
|
48
49
|
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
49
50
|
ref: contentAreaRef
|
|
50
|
-
},
|
|
51
|
+
}, jsx("div", {
|
|
51
52
|
css: editorContentGutterStyle,
|
|
52
53
|
className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
53
54
|
ref: contentAreaRef
|
|
54
|
-
}, props.customContentComponents,
|
|
55
|
+
}, props.customContentComponents, jsx(PluginSlot, {
|
|
55
56
|
editorView: props.editorView,
|
|
56
57
|
editorActions: props.editorActions,
|
|
57
58
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -67,9 +68,9 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
67
68
|
containerElement: scrollContainerRef.current,
|
|
68
69
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
69
70
|
wrapperElement: props.wrapperElement
|
|
70
|
-
}), props.editorDOMElement)))),
|
|
71
|
+
}), props.editorDOMElement)))), jsx("div", {
|
|
71
72
|
css: sidebarArea
|
|
72
|
-
}, props.contextPanel ||
|
|
73
|
+
}, props.contextPanel || jsx(ContextPanel, {
|
|
73
74
|
visible: false
|
|
74
75
|
})));
|
|
75
76
|
});
|