@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
|
@@ -12,19 +12,20 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _templateObject, _templateObject2, _templateObject3;
|
|
15
|
+
/** @jsx jsx */
|
|
15
16
|
var wrapperNode = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n font-size: ", ";\n margin: 0 ", ";\n min-height: 24px;\n padding: 0 ", ";\n user-select: none;\n vertical-align: middle;\n white-space: nowrap;\n\n .ProseMirror-selectednode & {\n background: ", ";\n outline: none;\n }\n"])), "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-border, ".concat(_colors.N50, ")"), (0, _constants.borderRadius)(), (0, _editorSharedStyles.relativeFontSizeToBase16)(13), "var(--ds-space-025, 2px)", "var(--ds-space-050, 4px)", "var(--ds-background-selected, ".concat(_colors.N50, ")"));
|
|
16
17
|
var jiraChildNode = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n color: ", ";\n line-height: 24px;\n vertical-align: top;\n\n &::before {\n color: ", ";\n content: 'JIRA | ';\n }\n"])), "var(--ds-text-subtlest, #707070)", "var(--ds-text, black)");
|
|
17
18
|
var svgChildNode = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n display: inline-block;\n height: 24px;\n vertical-align: top;\n width: 24px;\n\n & > div {\n height: 24px;\n width: 24px;\n }\n"])));
|
|
18
19
|
function JIRAIssueNode(props) {
|
|
19
20
|
var issueKey = props.node.attrs.issueKey;
|
|
20
|
-
return
|
|
21
|
+
return (0, _react.jsx)("span", {
|
|
21
22
|
css: wrapperNode,
|
|
22
23
|
"data-testid": "jira-issue-node"
|
|
23
|
-
},
|
|
24
|
+
}, (0, _react.jsx)("span", {
|
|
24
25
|
css: svgChildNode
|
|
25
|
-
},
|
|
26
|
+
}, (0, _react.jsx)(_jiraIcon.JiraIcon, {
|
|
26
27
|
size: "small"
|
|
27
|
-
})),
|
|
28
|
+
})), (0, _react.jsx)("span", {
|
|
28
29
|
css: jiraChildNode
|
|
29
30
|
}, issueKey));
|
|
30
31
|
}
|
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.insertSliceForLists = insertSliceForLists;
|
|
7
|
+
exports.insertSliceForListsInsideBlockquote = insertSliceForListsInsideBlockquote;
|
|
8
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
7
9
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
10
|
var _lists = require("./lists");
|
|
9
11
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
12
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
10
13
|
var _util = require("../util");
|
|
11
14
|
function insertSliceForLists(_ref) {
|
|
12
15
|
var _slice$content$firstC;
|
|
@@ -59,4 +62,27 @@ function insertSliceForLists(_ref) {
|
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
tr.replaceSelection(slice);
|
|
65
|
+
}
|
|
66
|
+
function insertSliceForListsInsideBlockquote(_ref3) {
|
|
67
|
+
var tr = _ref3.tr,
|
|
68
|
+
slice = _ref3.slice;
|
|
69
|
+
(0, _utils.safeInsert)(slice.content, tr.selection.$to.pos)(tr).scrollIntoView();
|
|
70
|
+
// ProseMirror doesn't give a proper way to tell us where something was inserted.
|
|
71
|
+
// However, we can know "how" it inserted something.
|
|
72
|
+
//
|
|
73
|
+
// So, instead of weird depth calculations, we can use the step produced by the transform.
|
|
74
|
+
// For instance:
|
|
75
|
+
// The `replaceStep.to and replaceStep.from`, tell us the real position
|
|
76
|
+
// where the content will be insert.
|
|
77
|
+
// Then, we can use the `tr.mapping.map` to the updated position after the replace operation
|
|
78
|
+
var replaceStep = tr.steps[0];
|
|
79
|
+
if (!(replaceStep instanceof _transform.ReplaceStep)) {
|
|
80
|
+
return tr;
|
|
81
|
+
}
|
|
82
|
+
var nextPosition = tr.mapping.map(replaceStep.to);
|
|
83
|
+
// The findFrom will make search for both: TextSelection and NodeSelections.
|
|
84
|
+
var nextSelection = _state.Selection.findFrom(tr.doc.resolve(Math.min(nextPosition, tr.doc.content.size)), -1);
|
|
85
|
+
if (nextSelection) {
|
|
86
|
+
tr.setSelection(nextSelection);
|
|
87
|
+
}
|
|
62
88
|
}
|
|
@@ -861,15 +861,24 @@ function handleRichText(slice, queueCardsFromChangedTr) {
|
|
|
861
861
|
schema: schema
|
|
862
862
|
});
|
|
863
863
|
} else if (noNeedForSafeInsert) {
|
|
864
|
-
var
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
864
|
+
var _firstChildOfSlice$ty2, _firstChildOfSlice$co;
|
|
865
|
+
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')) {
|
|
866
|
+
// checks if parent node is a blockquote and child node is either a bulletlist or orderedlist
|
|
867
|
+
(0, _edgeCases.insertSliceForListsInsideBlockquote)({
|
|
868
|
+
tr: tr,
|
|
869
|
+
slice: slice
|
|
870
|
+
});
|
|
871
|
+
} else {
|
|
872
|
+
var _slice$content$lastCh;
|
|
873
|
+
tr.replaceSelection(slice);
|
|
874
|
+
// when cursor is inside a table cell, and slice.content.lastChild is a panel, expand, or decisionList
|
|
875
|
+
// need to make sure the cursor position is is right after the panel, expand, or decisionList
|
|
876
|
+
// still in the same table cell, see issue: https://product-fabric.atlassian.net/browse/ED-17862
|
|
877
|
+
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) || '');
|
|
878
|
+
if ((0, _utils3.insideTableCell)(state) && shouldUpdateCursorPosAfterPaste) {
|
|
879
|
+
var nextPos = tr.doc.resolve(tr.mapping.map(selection.$from.pos));
|
|
880
|
+
tr.setSelection(new _selection.GapCursorSelection(nextPos, _selection.Side.RIGHT));
|
|
881
|
+
}
|
|
873
882
|
}
|
|
874
883
|
} else {
|
|
875
884
|
// need to scan the slice if there's a block node or list items inside it
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.ToolbarUndoRedo = void 0;
|
|
9
|
+
var _react = require("@emotion/react");
|
|
9
10
|
var _reactIntlNext = require("react-intl-next");
|
|
10
11
|
var _undo = _interopRequireDefault(require("@atlaskit/icon/glyph/undo"));
|
|
11
12
|
var _redo = _interopRequireDefault(require("@atlaskit/icon/glyph/redo"));
|
|
@@ -18,6 +19,8 @@ var _commands = require("../../commands");
|
|
|
18
19
|
var _keymaps2 = require("@atlaskit/editor-common/keymaps");
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
|
|
21
24
|
var closeTypeAheadAndRunCommand = function closeTypeAheadAndRunCommand(editorView, api) {
|
|
22
25
|
return function (command) {
|
|
23
26
|
var _api$typeAhead;
|
|
@@ -62,39 +65,39 @@ var ToolbarUndoRedo = exports.ToolbarUndoRedo = function ToolbarUndoRedo(_ref) {
|
|
|
62
65
|
var _ref2 = historyState !== null && historyState !== void 0 ? historyState : {},
|
|
63
66
|
canUndo = _ref2.canUndo,
|
|
64
67
|
canRedo = _ref2.canRedo;
|
|
65
|
-
return
|
|
68
|
+
return (0, _react.jsx)("span", {
|
|
66
69
|
css: _styles.buttonGroupStyle
|
|
67
|
-
},
|
|
70
|
+
}, (0, _react.jsx)(_ToolbarButton.default, {
|
|
68
71
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.UNDO,
|
|
69
72
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
70
73
|
onClick: handleUndo,
|
|
71
74
|
disabled: !canUndo || disabled,
|
|
72
75
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.undo, labelUndo),
|
|
73
76
|
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.undo),
|
|
74
|
-
title:
|
|
77
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
75
78
|
description: labelUndo,
|
|
76
79
|
keymap: _keymaps.undo
|
|
77
80
|
}),
|
|
78
|
-
iconBefore:
|
|
81
|
+
iconBefore: (0, _react.jsx)(_undo.default, {
|
|
79
82
|
label: ""
|
|
80
83
|
}),
|
|
81
84
|
testId: "ak-editor-toolbar-button-undo"
|
|
82
|
-
}),
|
|
85
|
+
}), (0, _react.jsx)(_ToolbarButton.default, {
|
|
83
86
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
84
87
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.REDO,
|
|
85
88
|
onClick: handleRedo,
|
|
86
89
|
disabled: !canRedo || disabled,
|
|
87
|
-
title:
|
|
90
|
+
title: (0, _react.jsx)(_keymaps.ToolTipContent, {
|
|
88
91
|
description: labelRedo,
|
|
89
92
|
keymap: _keymaps.redo
|
|
90
93
|
}),
|
|
91
|
-
iconBefore:
|
|
94
|
+
iconBefore: (0, _react.jsx)(_redo.default, {
|
|
92
95
|
label: ""
|
|
93
96
|
}),
|
|
94
97
|
testId: "ak-editor-toolbar-button-redo",
|
|
95
98
|
"aria-label": (0, _keymaps.tooltip)(_keymaps.redo, labelRedo),
|
|
96
99
|
"aria-keyshortcuts": (0, _keymaps2.getAriaKeyshortcuts)(_keymaps.redo)
|
|
97
|
-
}),
|
|
100
|
+
}), (0, _react.jsx)("span", {
|
|
98
101
|
css: _styles.separatorStyles
|
|
99
102
|
}));
|
|
100
103
|
};
|
|
@@ -10,6 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _clickAreaHelper = require("../click-area-helper");
|
|
12
12
|
var _templateObject;
|
|
13
|
+
/** @jsx jsx */
|
|
13
14
|
var clickWrapper = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n height: 100%;\n"])));
|
|
14
15
|
var ClickAreaBlock = exports.ClickAreaBlock = function ClickAreaBlock(_ref) {
|
|
15
16
|
var editorView = _ref.editorView,
|
|
@@ -23,7 +24,7 @@ var ClickAreaBlock = exports.ClickAreaBlock = function ClickAreaBlock(_ref) {
|
|
|
23
24
|
(0, _clickAreaHelper.clickAreaClickHandler)(editorView, event);
|
|
24
25
|
}
|
|
25
26
|
}, [editorView, editorDisabled]);
|
|
26
|
-
return
|
|
27
|
+
return (0, _react2.jsx)("div", {
|
|
27
28
|
"data-testid": "click-wrapper",
|
|
28
29
|
css: clickWrapper,
|
|
29
30
|
onMouseDown: handleMouseDown
|
|
@@ -10,6 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _commands = require("../../../commands");
|
|
12
12
|
var _templateObject;
|
|
13
|
+
/** @jsx jsx */
|
|
13
14
|
var clickArea = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
|
|
14
15
|
var ClickAreaInline = exports.ClickAreaInline = function ClickAreaInline(_ref) {
|
|
15
16
|
var editorView = _ref.editorView,
|
|
@@ -23,7 +24,7 @@ var ClickAreaInline = exports.ClickAreaInline = function ClickAreaInline(_ref) {
|
|
|
23
24
|
event.stopPropagation();
|
|
24
25
|
}
|
|
25
26
|
}, [editorView]);
|
|
26
|
-
return
|
|
27
|
+
return (0, _react2.jsx)("div", {
|
|
27
28
|
"data-testid": "click-wrapper",
|
|
28
29
|
css: clickArea,
|
|
29
30
|
onMouseDown: handleMouseDown
|
|
@@ -17,6 +17,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
18
|
var _clickAreaHelper = require("../click-area-helper");
|
|
19
19
|
var _templateObject;
|
|
20
|
+
/** @jsx jsx */
|
|
20
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
22
|
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; } }
|
|
22
23
|
/**
|
|
@@ -80,7 +81,7 @@ var ClickAreaMobile = exports.default = /*#__PURE__*/function (_React$Component)
|
|
|
80
81
|
(0, _createClass2.default)(ClickAreaMobile, [{
|
|
81
82
|
key: "render",
|
|
82
83
|
value: function render() {
|
|
83
|
-
return
|
|
84
|
+
return (0, _react2.jsx)("div", {
|
|
84
85
|
css: clickWrapper({
|
|
85
86
|
isExpanded: this.props.isExpanded,
|
|
86
87
|
minHeight: this.props.minHeight
|
|
@@ -13,9 +13,10 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _react2 = require("@emotion/react");
|
|
16
17
|
var _styles = require("./styles");
|
|
17
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
|
-
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; } }
|
|
19
|
+
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; } } /** @jsx jsx */
|
|
19
20
|
var DropdownWrapper = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
20
21
|
(0, _inherits2.default)(DropdownWrapper, _React$Component);
|
|
21
22
|
var _super = _createSuper(DropdownWrapper);
|
|
@@ -49,7 +50,7 @@ var DropdownWrapper = exports.default = /*#__PURE__*/function (_React$Component)
|
|
|
49
50
|
onClick: _this2.handleClick
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
|
-
return
|
|
53
|
+
return (0, _react2.jsx)("div", {
|
|
53
54
|
css: _styles.dropdown
|
|
54
55
|
}, children);
|
|
55
56
|
}
|
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
7
8
|
var _styles = require("./styles");
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
|
|
8
11
|
var DropdownItemWrapper = function DropdownItemWrapper(props) {
|
|
9
|
-
return
|
|
12
|
+
return (0, _react.jsx)("div", {
|
|
10
13
|
css: _styles.dropdownItem,
|
|
11
14
|
onClick: function onClick() {
|
|
12
15
|
return props.onClick && props.onClick({
|
|
@@ -14,6 +17,6 @@ var DropdownItemWrapper = function DropdownItemWrapper(props) {
|
|
|
14
17
|
renderOnClick: props.renderOnClick
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
|
-
},
|
|
20
|
+
}, (0, _react.jsx)("span", null, props.icon), props.children);
|
|
18
21
|
};
|
|
19
22
|
var _default = exports.default = DropdownItemWrapper;
|
|
@@ -10,7 +10,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var _react = require("react");
|
|
13
|
+
var _react = require("@emotion/react");
|
|
14
|
+
var _react2 = require("react");
|
|
14
15
|
var _reactIntlNext = require("react-intl-next");
|
|
15
16
|
var _iconMap = require("../../plugins/alignment/ui/ToolbarAlignment/icon-map");
|
|
16
17
|
var _AlignmentButton = _interopRequireDefault(require("./AlignmentButton"));
|
|
@@ -18,7 +19,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
18
19
|
var _styles = require("./styles");
|
|
19
20
|
var _keymaps = require("../../keymaps");
|
|
20
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
21
|
-
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; } }
|
|
22
|
+
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; } } /** @jsx jsx */
|
|
22
23
|
var alignmentOptions = [{
|
|
23
24
|
title: _messages.alignmentMessages.alignLeft,
|
|
24
25
|
shortcut: _keymaps.alignLeft,
|
|
@@ -45,7 +46,7 @@ var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
|
45
46
|
selectedAlignment = _this$props.selectedAlignment,
|
|
46
47
|
className = _this$props.className,
|
|
47
48
|
intl = _this$props.intl;
|
|
48
|
-
return
|
|
49
|
+
return (0, _react.jsx)("div", {
|
|
49
50
|
css: _styles.alignmentWrapper,
|
|
50
51
|
className: className
|
|
51
52
|
}, alignmentOptions.map(function (alignment) {
|
|
@@ -53,8 +54,8 @@ var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
|
53
54
|
title = alignment.title,
|
|
54
55
|
shortcut = alignment.shortcut;
|
|
55
56
|
var message = intl.formatMessage(title);
|
|
56
|
-
return
|
|
57
|
-
content:
|
|
57
|
+
return (0, _react.jsx)(_AlignmentButton.default, {
|
|
58
|
+
content: (0, _react.jsx)(_iconMap.IconMap, {
|
|
58
59
|
alignment: value
|
|
59
60
|
}),
|
|
60
61
|
key: value,
|
|
@@ -68,5 +69,5 @@ var Alignment = /*#__PURE__*/function (_PureComponent) {
|
|
|
68
69
|
}
|
|
69
70
|
}]);
|
|
70
71
|
return Alignment;
|
|
71
|
-
}(
|
|
72
|
+
}(_react2.PureComponent);
|
|
72
73
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(Alignment);
|
|
@@ -23,6 +23,7 @@ var _WithFlash = _interopRequireDefault(require("../WithFlash"));
|
|
|
23
23
|
var _context = require("../../presets/context");
|
|
24
24
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
25
25
|
var _templateObject, _templateObject2, _templateObject3;
|
|
26
|
+
/** @jsx jsx */
|
|
26
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -63,18 +64,18 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
63
64
|
pluginHooks = _this$props.pluginHooks,
|
|
64
65
|
featureFlags = _this$props.featureFlags;
|
|
65
66
|
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
66
|
-
return
|
|
67
|
+
return (0, _react2.jsx)(_WithFlash.default, {
|
|
67
68
|
animate: maxContentSizeReached
|
|
68
|
-
},
|
|
69
|
+
}, (0, _react2.jsx)("div", {
|
|
69
70
|
css: [chromelessEditor, maxHeight && (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n max-height: ", "px;\n "])), maxHeight), (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", "px;\n "])), minHeight)],
|
|
70
71
|
"data-testid": "chromeless-editor",
|
|
71
72
|
ref: function ref(_ref2) {
|
|
72
73
|
return _this.containerElement = _ref2;
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
+
}, (0, _react2.jsx)(ContentArea, {
|
|
75
76
|
className: "ak-editor-content-area",
|
|
76
77
|
featureFlags: featureFlags
|
|
77
|
-
}, customContentComponents,
|
|
78
|
+
}, customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
78
79
|
editorView: editorView,
|
|
79
80
|
editorActions: editorActions,
|
|
80
81
|
eventDispatcher: eventDispatcher,
|
|
@@ -96,7 +97,7 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
96
97
|
(0, _createClass2.default)(Editor, [{
|
|
97
98
|
key: "render",
|
|
98
99
|
value: function render() {
|
|
99
|
-
return
|
|
100
|
+
return (0, _react2.jsx)(RenderWithPluginState, {
|
|
100
101
|
renderChrome: this.renderChrome
|
|
101
102
|
});
|
|
102
103
|
}
|
|
@@ -109,7 +110,7 @@ function RenderWithPluginState(_ref3) {
|
|
|
109
110
|
var api = (0, _context.usePresetContext)();
|
|
110
111
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['maxContentSize']),
|
|
111
112
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
112
|
-
return
|
|
113
|
+
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
113
114
|
maxContentSize: maxContentSizeState
|
|
114
115
|
}));
|
|
115
116
|
}
|
|
@@ -38,6 +38,7 @@ var _ContentStyles = require("../../ContentStyles");
|
|
|
38
38
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
39
39
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
40
40
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
41
|
+
/** @jsx jsx */
|
|
41
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
42
43
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
44
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -109,15 +110,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
109
110
|
event.preventDefault();
|
|
110
111
|
event.stopPropagation();
|
|
111
112
|
};
|
|
112
|
-
return
|
|
113
|
+
return (0, _react2.jsx)(_WithFlash.default, {
|
|
113
114
|
animate: maxContentSizeReached
|
|
114
|
-
},
|
|
115
|
+
}, (0, _react2.jsx)("div", {
|
|
115
116
|
css: [commentEditorStyle, (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n min-height: ", "px;\n "])), minHeight)],
|
|
116
117
|
className: "akEditor",
|
|
117
118
|
ref: _this.wrapperElementRef
|
|
118
|
-
},
|
|
119
|
+
}, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
|
|
119
120
|
useStickyToolbar: useStickyToolbar
|
|
120
|
-
},
|
|
121
|
+
}, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
121
122
|
editorView: editorView,
|
|
122
123
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
123
124
|
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
@@ -125,7 +126,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
125
126
|
editorAppearance: _this.appearance,
|
|
126
127
|
useStickyToolbar: useStickyToolbar,
|
|
127
128
|
intl: intl
|
|
128
|
-
},
|
|
129
|
+
}, (0, _react2.jsx)(_Toolbar.default, {
|
|
129
130
|
editorView: editorView,
|
|
130
131
|
editorActions: editorActions,
|
|
131
132
|
eventDispatcher: eventDispatcher,
|
|
@@ -138,14 +139,14 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
138
139
|
disabled: !!disabled,
|
|
139
140
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
140
141
|
containerElement: _this.containerElement
|
|
141
|
-
}),
|
|
142
|
+
}), (0, _react2.jsx)("div", {
|
|
142
143
|
css: _Toolbar2.mainToolbarCustomComponentsSlotStyle
|
|
143
|
-
}, customPrimaryToolbarComponents))),
|
|
144
|
+
}, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
144
145
|
editorView: editorView,
|
|
145
146
|
editorDisabled: disabled
|
|
146
|
-
},
|
|
147
|
+
}, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref2) {
|
|
147
148
|
var width = _ref2.width;
|
|
148
|
-
return
|
|
149
|
+
return (0, _react2.jsx)(ContentArea, {
|
|
149
150
|
ref: function ref(_ref3) {
|
|
150
151
|
return _this.containerElement = _ref3;
|
|
151
152
|
},
|
|
@@ -154,7 +155,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
154
155
|
'less-margin': width < _editorSharedStyles.akEditorMobileBreakoutPoint
|
|
155
156
|
}),
|
|
156
157
|
featureFlags: featureFlags
|
|
157
|
-
}, customContentComponents,
|
|
158
|
+
}, customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
158
159
|
editorView: editorView,
|
|
159
160
|
editorActions: editorActions,
|
|
160
161
|
eventDispatcher: eventDispatcher,
|
|
@@ -170,19 +171,19 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
170
171
|
wrapperElement: _this.wrapperElementRef.current,
|
|
171
172
|
pluginHooks: pluginHooks
|
|
172
173
|
}), editorDOMElement);
|
|
173
|
-
}))), showSecondaryToolbar &&
|
|
174
|
+
}))), showSecondaryToolbar && (0, _react2.jsx)("div", {
|
|
174
175
|
css: secondaryToolbarStyle,
|
|
175
176
|
"data-testid": "ak-editor-secondary-toolbar"
|
|
176
|
-
},
|
|
177
|
+
}, (0, _react2.jsx)(_buttonGroup.default, null, !!onSave && (0, _react2.jsx)(_customThemeButton.default, {
|
|
177
178
|
appearance: "primary",
|
|
178
179
|
onClick: _this.handleSave,
|
|
179
180
|
testId: "comment-save-button",
|
|
180
181
|
isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
|
|
181
|
-
}, intl.formatMessage(_messages.default.saveButton)), !!onCancel &&
|
|
182
|
+
}, intl.formatMessage(_messages.default.saveButton)), !!onCancel && (0, _react2.jsx)(_customThemeButton.default, {
|
|
182
183
|
appearance: "subtle",
|
|
183
184
|
onClick: _this.handleCancel,
|
|
184
185
|
isDisabled: disabled
|
|
185
|
-
}, intl.formatMessage(_messages.default.cancelButton))),
|
|
186
|
+
}, intl.formatMessage(_messages.default.cancelButton))), (0, _react2.jsx)("span", {
|
|
186
187
|
style: {
|
|
187
188
|
flexGrow: 1
|
|
188
189
|
}
|
|
@@ -196,7 +197,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
196
197
|
(0, _createClass2.default)(Editor, [{
|
|
197
198
|
key: "render",
|
|
198
199
|
value: function render() {
|
|
199
|
-
return
|
|
200
|
+
return (0, _react2.jsx)(RenderWithPluginState, {
|
|
200
201
|
renderChrome: this.renderChrome
|
|
201
202
|
});
|
|
202
203
|
}
|
|
@@ -210,7 +211,7 @@ function RenderWithPluginState(_ref4) {
|
|
|
210
211
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize']),
|
|
211
212
|
mediaState = _useSharedPluginState.mediaState,
|
|
212
213
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
213
|
-
return
|
|
214
|
+
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
214
215
|
maxContentSize: maxContentSizeState,
|
|
215
216
|
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined
|
|
216
217
|
}));
|
|
@@ -14,6 +14,7 @@ var _react2 = require("@emotion/react");
|
|
|
14
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
15
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
|
+
/** @jsx jsx */
|
|
17
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
20
|
var TableControlsPadding = exports.TableControlsPadding = 20;
|
|
@@ -36,14 +37,14 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
36
37
|
setTop(props.offsetTop || 0);
|
|
37
38
|
}
|
|
38
39
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
39
|
-
return
|
|
40
|
+
return (0, _react2.jsx)("div", {
|
|
40
41
|
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
|
|
41
42
|
"data-testid": "ak-editor-main-toolbar",
|
|
42
43
|
className: 'show-keyline'
|
|
43
44
|
}, props.children);
|
|
44
45
|
};
|
|
45
46
|
var FixedToolbar = function FixedToolbar(props) {
|
|
46
|
-
return
|
|
47
|
+
return (0, _react2.jsx)("div", {
|
|
47
48
|
css: mainToolbarWrapperStyle,
|
|
48
49
|
"data-testid": "ak-editor-main-toolbar"
|
|
49
50
|
}, props.children);
|
|
@@ -80,8 +81,8 @@ var MainToolbar = exports.MainToolbar = function MainToolbar(_ref) {
|
|
|
80
81
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
81
82
|
children = _ref.children;
|
|
82
83
|
if (useStickyToolbar) {
|
|
83
|
-
return
|
|
84
|
+
return (0, _react2.jsx)(StickyToolbar, getStickyParameters(useStickyToolbar), children);
|
|
84
85
|
}
|
|
85
|
-
return
|
|
86
|
+
return (0, _react2.jsx)(FixedToolbar, null, children);
|
|
86
87
|
};
|
|
87
88
|
var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\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)");
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.FullPageEditor = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
11
12
|
var _StyledComponents = require("./StyledComponents");
|
|
12
13
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
14
|
var _FullPageContentArea = require("./FullPageContentArea");
|
|
@@ -15,6 +16,8 @@ var _FullPageToolbar = require("./FullPageToolbar");
|
|
|
15
16
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
/** @jsx jsx */
|
|
20
|
+
|
|
18
21
|
var useShowKeyline = function useShowKeyline(contentAreaRef) {
|
|
19
22
|
var _useState = (0, _react.useState)(false),
|
|
20
23
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -51,11 +54,11 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
51
54
|
}, [props.innerRef]);
|
|
52
55
|
var scrollContentContainerRef = (0, _react.useRef)(null);
|
|
53
56
|
var showKeyline = useShowKeyline(scrollContentContainerRef);
|
|
54
|
-
return
|
|
57
|
+
return (0, _react2.jsx)(_ui.ContextPanelWidthProvider, null, (0, _react2.jsx)("div", {
|
|
55
58
|
css: _StyledComponents.fullPageEditorWrapper,
|
|
56
59
|
className: "akEditor",
|
|
57
60
|
ref: wrapperElementRef
|
|
58
|
-
},
|
|
61
|
+
}, (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
|
|
59
62
|
appearance: props.appearance,
|
|
60
63
|
beforeIcon: props.primaryToolbarIconBefore,
|
|
61
64
|
collabEdit: props.collabEdit,
|
|
@@ -76,7 +79,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
76
79
|
showKeyline: showKeyline,
|
|
77
80
|
featureFlags: props.featureFlags,
|
|
78
81
|
hideAvatarGroup: props.hideAvatarGroup
|
|
79
|
-
}),
|
|
82
|
+
}), (0, _react2.jsx)(_FullPageContentArea.FullPageContentArea, {
|
|
80
83
|
ref: scrollContentContainerRef,
|
|
81
84
|
appearance: props.appearance,
|
|
82
85
|
contentComponents: props.contentComponents,
|
|
@@ -17,6 +17,8 @@ var _StyledComponents = require("./StyledComponents");
|
|
|
17
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
/** @jsx jsx */
|
|
21
|
+
|
|
20
22
|
var CONTENT_AREA_TEST_ID = exports.CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
21
23
|
var Content = /*#__PURE__*/_react2.default.forwardRef(function (props, ref) {
|
|
22
24
|
var theme = (0, _react.useTheme)();
|
|
@@ -33,22 +35,22 @@ var Content = /*#__PURE__*/_react2.default.forwardRef(function (props, ref) {
|
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
37
|
}, []);
|
|
36
|
-
return
|
|
38
|
+
return (0, _react.jsx)(_ui.WidthConsumer, null, function (_ref) {
|
|
37
39
|
var width = _ref.width;
|
|
38
|
-
return
|
|
40
|
+
return (0, _react.jsx)(_ui.ContextPanelConsumer, null, function (_ref2) {
|
|
39
41
|
var _contentAreaRef$curre;
|
|
40
42
|
var positionedOverEditor = _ref2.positionedOverEditor;
|
|
41
|
-
return
|
|
43
|
+
return (0, _react.jsx)("div", {
|
|
42
44
|
css: [_StyledComponents.contentArea, positionedOverEditor && _StyledComponents.positionedOverEditorStyle],
|
|
43
45
|
"data-testid": CONTENT_AREA_TEST_ID
|
|
44
|
-
},
|
|
46
|
+
}, (0, _react.jsx)(_StyledComponents.ScrollContainer, {
|
|
45
47
|
className: "fabric-editor-popup-scroll-parent",
|
|
46
48
|
featureFlags: props.featureFlags,
|
|
47
49
|
ref: scrollContainerRef
|
|
48
|
-
},
|
|
50
|
+
}, (0, _react.jsx)(_Addon.ClickAreaBlock, {
|
|
49
51
|
editorView: props.editorView,
|
|
50
52
|
editorDisabled: props.disabled
|
|
51
|
-
},
|
|
53
|
+
}, (0, _react.jsx)("div", {
|
|
52
54
|
css: (0, _StyledComponents.editorContentAreaStyle)({
|
|
53
55
|
fullWidthMode: fullWidthMode,
|
|
54
56
|
layoutMaxWidth: theme.layoutMaxWidth,
|
|
@@ -57,11 +59,11 @@ var Content = /*#__PURE__*/_react2.default.forwardRef(function (props, ref) {
|
|
|
57
59
|
role: "region",
|
|
58
60
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.editableContentLabel),
|
|
59
61
|
ref: contentAreaRef
|
|
60
|
-
},
|
|
62
|
+
}, (0, _react.jsx)("div", {
|
|
61
63
|
css: _StyledComponents.editorContentGutterStyle,
|
|
62
64
|
className: ['ak-editor-content-area', fullWidthMode ? 'fabric-editor--full-width-mode' : ''].join(' '),
|
|
63
65
|
ref: contentAreaRef
|
|
64
|
-
}, props.customContentComponents,
|
|
66
|
+
}, props.customContentComponents, (0, _react.jsx)(_PluginSlot.default, {
|
|
65
67
|
editorView: props.editorView,
|
|
66
68
|
editorActions: props.editorActions,
|
|
67
69
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -77,9 +79,9 @@ var Content = /*#__PURE__*/_react2.default.forwardRef(function (props, ref) {
|
|
|
77
79
|
containerElement: scrollContainerRef.current,
|
|
78
80
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
79
81
|
wrapperElement: props.wrapperElement
|
|
80
|
-
}), props.editorDOMElement)))),
|
|
82
|
+
}), props.editorDOMElement)))), (0, _react.jsx)("div", {
|
|
81
83
|
css: _StyledComponents.sidebarArea
|
|
82
|
-
}, props.contextPanel ||
|
|
84
|
+
}, props.contextPanel || (0, _react.jsx)(_ContextPanel.default, {
|
|
83
85
|
visible: false
|
|
84
86
|
})));
|
|
85
87
|
});
|