@atlaskit/editor-core 197.3.0 → 197.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +0 -3
- package/dist/cjs/actions/index.js +13 -40
- package/dist/cjs/composable-editor/editor-internal.js +7 -6
- package/dist/cjs/create-editor/ReactEditorView.js +2 -1
- package/dist/cjs/presets/universal.js +7 -9
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/cjs/ui/ToolbarFeedback/index.js +5 -210
- package/dist/cjs/utils/action.js +9 -38
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +1 -12
- package/dist/es2019/composable-editor/editor-internal.js +7 -6
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/index.js +8 -1
- package/dist/es2019/presets/universal.js +7 -9
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/es2019/ui/ToolbarFeedback/index.js +5 -188
- package/dist/es2019/utils/action.js +0 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +14 -41
- package/dist/esm/composable-editor/editor-internal.js +7 -6
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/index.js +8 -1
- package/dist/esm/presets/universal.js +7 -9
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/esm/ui/ToolbarFeedback/index.js +5 -212
- package/dist/esm/utils/action.js +9 -37
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +0 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +3 -0
- package/dist/types/index.d.ts +8 -1
- package/dist/types/presets/default.d.ts +2 -0
- package/dist/types/presets/universal.d.ts +4 -0
- package/dist/types/presets/useUniversalPreset.d.ts +3 -0
- package/dist/types/types/editor-appearance-component.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +0 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ToolbarFeedback/index.d.ts +1 -26
- package/dist/types/utils/action.d.ts +0 -4
- package/dist/types-ts4.5/actions/index.d.ts +0 -1
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +3 -0
- package/dist/types-ts4.5/index.d.ts +8 -1
- package/dist/types-ts4.5/presets/default.d.ts +2 -0
- package/dist/types-ts4.5/presets/universal.d.ts +4 -0
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +3 -0
- package/dist/types-ts4.5/types/editor-appearance-component.d.ts +0 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +0 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/ToolbarFeedback/index.d.ts +1 -26
- package/dist/types-ts4.5/utils/action.d.ts +0 -7
- package/package.json +11 -13
package/dist/es2019/index.js
CHANGED
|
@@ -6,7 +6,14 @@ export { default as WithEditorActions } from './ui/WithEditorActions';
|
|
|
6
6
|
export { default as WithHelpTrigger } from './ui/WithHelpTrigger';
|
|
7
7
|
export { default as CollapsedEditor } from './ui/CollapsedEditor';
|
|
8
8
|
export { default as ToolbarHelp } from './ui/ToolbarHelp';
|
|
9
|
-
export {
|
|
9
|
+
export {
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated
|
|
12
|
+
* DO NOT USE THIS WILL BE REMOVED SOON.
|
|
13
|
+
*
|
|
14
|
+
* This was intended for rollout of bitbucket only.
|
|
15
|
+
*/
|
|
16
|
+
default as ToolbarFeedback } from './ui/ToolbarFeedback';
|
|
10
17
|
export {
|
|
11
18
|
/**
|
|
12
19
|
* @deprecated
|
|
@@ -223,7 +223,11 @@ export default function createUniversalPresetInternal({
|
|
|
223
223
|
tableSelectorSupported: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableSelector) && isFullPage,
|
|
224
224
|
nativeStatusSupported: !statusMenuDisabled,
|
|
225
225
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
226
|
-
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
226
|
+
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false,
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
// For platform_editor_element_level_templates experiment only
|
|
229
|
+
// clean up ticket ED-24873
|
|
230
|
+
UNSAFE_editorAppearance: appearance
|
|
227
231
|
}]).maybeAdd([beforePrimaryToolbarPlugin, {
|
|
228
232
|
beforePrimaryToolbarComponents: // @ts-expect-error 2339: Property 'before' does not exist on type 'PrimaryToolbarComponents'.
|
|
229
233
|
(_props$primaryToolbar = props.primaryToolbarComponents) === null || _props$primaryToolbar === void 0 ? void 0 : _props$primaryToolbar.before
|
|
@@ -234,15 +238,9 @@ export default function createUniversalPresetInternal({
|
|
|
234
238
|
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
235
239
|
collabEdit: props.collabEdit,
|
|
236
240
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
237
|
-
showAvatarGroup:
|
|
238
|
-
// Cleanup: `platform_editor_remove_hide_avatar_group_prop`
|
|
239
|
-
// Remove `!props.hideAvatarGroup`
|
|
240
|
-
!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
241
|
+
showAvatarGroup: featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
241
242
|
}]).maybeAdd([findReplacePlugin, {
|
|
242
|
-
takeFullWidth:
|
|
243
|
-
// Cleanup: `platform_editor_remove_hide_avatar_group_prop`
|
|
244
|
-
// Remove `!props.hideAvatarGroup`
|
|
245
|
-
!props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
243
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
246
244
|
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
247
245
|
}], Boolean(props.allowFindReplace)).maybeAdd(borderPlugin, Boolean(props.allowBorderMark || props.UNSAFE_allowBorderMark)).maybeAdd(fragmentPlugin, Boolean(props.allowFragmentMark)).add(pasteOptionsToolbarPlugin).add([codeBidiWarningPlugin, {
|
|
248
246
|
appearance
|
|
@@ -9,7 +9,6 @@ import { jsx } from '@emotion/react';
|
|
|
9
9
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
14
13
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
15
14
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
@@ -80,8 +79,7 @@ export const FullPageEditor = props => {
|
|
|
80
79
|
primaryToolbarComponents: primaryToolbarComponents,
|
|
81
80
|
providerFactory: props.providerFactory,
|
|
82
81
|
showKeyline: showKeyline,
|
|
83
|
-
featureFlags: props.featureFlags
|
|
84
|
-
hideAvatarGroup: fg('platform_editor_remove_hide_avatar_group_prop') ? undefined : props.hideAvatarGroup
|
|
82
|
+
featureFlags: props.featureFlags
|
|
85
83
|
}), jsx(FullPageContentArea, {
|
|
86
84
|
editorAPI: editorAPI,
|
|
87
85
|
ref: scrollContentContainerRef,
|
|
@@ -16,7 +16,7 @@ import Toolbar from '../../Toolbar';
|
|
|
16
16
|
import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
|
|
17
17
|
import { customToolbarWrapperStyle, mainToolbarFirstChildStyle, mainToolbarIconBeforeStyle, mainToolbarSecondChildStyle, mainToolbarStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, nonCustomToolbarWrapperStyle } from './MainToolbar';
|
|
18
18
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
19
|
-
var _props$featureFlags, _props$customPrimaryT
|
|
19
|
+
var _props$featureFlags, _props$customPrimaryT;
|
|
20
20
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
21
21
|
const {
|
|
22
22
|
editorAPI
|
|
@@ -52,14 +52,6 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
52
52
|
css: customToolbarWrapperStyle
|
|
53
53
|
}, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
54
54
|
beforePrimaryToolbarComponents: (_props$customPrimaryT = props.customPrimaryToolbarComponents) === null || _props$customPrimaryT === void 0 ? void 0 : _props$customPrimaryT.before
|
|
55
|
-
}) : null, !fg('platform_editor_remove_hide_avatar_group_prop') ? props.hideAvatarGroup || (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : // Avatars are moved to Confluence codebase for Edit in Context
|
|
56
|
-
// When Edit in Context is enabled customPrimaryToolbarComponents is undefined
|
|
57
|
-
// For more details please check
|
|
58
|
-
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
59
|
-
editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$avatarGrou = editorAPI.avatarGroup) === null || _editorAPI$avatarGrou === void 0 ? void 0 : _editorAPI$avatarGrou.actions.getToolbarItem({
|
|
60
|
-
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
61
|
-
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
62
|
-
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
|
|
63
55
|
}) : null, editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.getToolbarButton({
|
|
64
56
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
65
57
|
popupsMountPoint: props.popupsMountPoint,
|
|
@@ -1,190 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @jsx jsx
|
|
6
|
-
*/
|
|
7
|
-
import { PureComponent } from 'react';
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import { jsx } from '@emotion/react';
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
12
|
-
import ButtonGroup from '@atlaskit/button/button-group';
|
|
13
|
-
import Button from '@atlaskit/button/new';
|
|
14
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
15
|
-
import { Popup } from '@atlaskit/editor-common/ui';
|
|
16
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
17
|
-
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
18
|
-
import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
|
|
19
|
-
import Spinner from '@atlaskit/spinner';
|
|
20
|
-
import { createDispatch } from '../../event-dispatcher';
|
|
21
|
-
import { usePresetContext } from '../../presets/context';
|
|
22
|
-
import deprecationWarnings from '../../utils/deprecation-warnings';
|
|
23
|
-
import { buttonContent, confirmationHeader, confirmationImg, confirmationPopup, confirmationText, wrapper } from './styles';
|
|
24
|
-
const PopupWithOutsideListeners = withOuterListeners(Popup);
|
|
25
|
-
const POPUP_HEIGHT = 388;
|
|
26
|
-
const POPUP_WIDTH = 280;
|
|
27
|
-
const EDITOR_IMAGE_URL = 'https://confluence.atlassian.com/download/attachments/945114421/editorillustration@2x.png?api=v2';
|
|
28
|
-
const deprecations = [{
|
|
29
|
-
property: 'packageVersion',
|
|
30
|
-
description: 'To pass package version use feedbackInfo property – <Editor feedbackInfo={{ packageVersion }} />',
|
|
31
|
-
type: 'removed'
|
|
32
|
-
}, {
|
|
33
|
-
property: 'packageName',
|
|
34
|
-
description: 'To pass package name use feedbackInfo property – <Editor feedbackInfo={{ packageName }} />',
|
|
35
|
-
type: 'removed'
|
|
36
|
-
}, {
|
|
37
|
-
property: 'labels',
|
|
38
|
-
description: 'To pass feedback labels use feedbackInfo property – <Editor feedbackInfo={{ labels }} />',
|
|
39
|
-
type: 'removed'
|
|
40
|
-
}];
|
|
41
|
-
class ToolbarFeedbackInternal extends PureComponent {
|
|
42
|
-
constructor(props) {
|
|
43
|
-
super(props);
|
|
44
|
-
_defineProperty(this, "state", {
|
|
45
|
-
jiraIssueCollectorScriptLoading: false,
|
|
46
|
-
showOptOutOption: false
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(this, "handleRef", ref => {
|
|
49
|
-
if (ref) {
|
|
50
|
-
this.setState({
|
|
51
|
-
target: ref
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
// Create a FeedbackInfo instance from props.
|
|
56
|
-
_defineProperty(this, "getFeedbackInfo", () => {
|
|
57
|
-
const {
|
|
58
|
-
product,
|
|
59
|
-
packageVersion,
|
|
60
|
-
packageName,
|
|
61
|
-
labels
|
|
62
|
-
} = this.props;
|
|
63
|
-
return {
|
|
64
|
-
...(product !== undefined && {
|
|
65
|
-
product
|
|
66
|
-
}),
|
|
67
|
-
...(packageVersion !== undefined && {
|
|
68
|
-
packageVersion
|
|
69
|
-
}),
|
|
70
|
-
...(packageName !== undefined && {
|
|
71
|
-
packageName
|
|
72
|
-
}),
|
|
73
|
-
...(labels !== undefined && {
|
|
74
|
-
labels
|
|
75
|
-
})
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
_defineProperty(this, "collectFeedback", () => {
|
|
79
|
-
if (this.props.product === 'bitbucket') {
|
|
80
|
-
this.setState({
|
|
81
|
-
showOptOutOption: true
|
|
82
|
-
});
|
|
83
|
-
} else {
|
|
84
|
-
this.openFeedbackPopup();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
_defineProperty(this, "toggleShowOptOutOption", () => {
|
|
88
|
-
this.setState({
|
|
89
|
-
showOptOutOption: !this.state.showOptOutOption
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(this, "openJiraIssueCollector", async () => {
|
|
93
|
-
var _this$props$api, _this$props$api$conte, _this$props$api$conte2, _this$props$api$conte3, _window$localStorage$, _this$props$api2, _this$props$api2$feed;
|
|
94
|
-
this.setState({
|
|
95
|
-
jiraIssueCollectorScriptLoading: true,
|
|
96
|
-
showOptOutOption: false
|
|
97
|
-
});
|
|
98
|
-
const contentId = (_this$props$api = this.props.api) === null || _this$props$api === void 0 ? void 0 : (_this$props$api$conte = _this$props$api.contextIdentifier) === null || _this$props$api$conte === void 0 ? void 0 : (_this$props$api$conte2 = _this$props$api$conte.sharedState.currentState()) === null || _this$props$api$conte2 === void 0 ? void 0 : (_this$props$api$conte3 = _this$props$api$conte2.contextIdentifierProvider) === null || _this$props$api$conte3 === void 0 ? void 0 : _this$props$api$conte3.objectId;
|
|
99
|
-
const sessionId = (_window$localStorage$ = window.localStorage.getItem('awc.session.id')) === null || _window$localStorage$ === void 0 ? void 0 : _window$localStorage$.toString();
|
|
100
|
-
const tabId = window.sessionStorage['awc.tab.id'];
|
|
101
|
-
await ((_this$props$api2 = this.props.api) === null || _this$props$api2 === void 0 ? void 0 : (_this$props$api2$feed = _this$props$api2.feedbackDialog) === null || _this$props$api2$feed === void 0 ? void 0 : _this$props$api2$feed.actions.openFeedbackDialog({
|
|
102
|
-
...this.getFeedbackInfo(),
|
|
103
|
-
sessionId,
|
|
104
|
-
contentId,
|
|
105
|
-
tabId
|
|
106
|
-
}));
|
|
107
|
-
this.setState({
|
|
108
|
-
jiraIssueCollectorScriptLoading: false
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
_defineProperty(this, "openFeedbackPopup", () => {
|
|
112
|
-
const dispatch = createDispatch(this.context.editorActions.eventDispatcher);
|
|
113
|
-
dispatch(analyticsEventKey, {
|
|
114
|
-
payload: {
|
|
115
|
-
action: ACTION.CLICKED,
|
|
116
|
-
actionSubject: ACTION_SUBJECT.BUTTON,
|
|
117
|
-
actionSubjectId: ACTION_SUBJECT_ID.BUTTON_FEEDBACK,
|
|
118
|
-
eventType: EVENT_TYPE.UI
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
this.openJiraIssueCollector();
|
|
122
|
-
return true;
|
|
123
|
-
});
|
|
124
|
-
_defineProperty(this, "openLearnMorePage", () => {
|
|
125
|
-
window.open('https://confluence.atlassian.com/x/NU1VO', '_blank');
|
|
126
|
-
this.toggleShowOptOutOption();
|
|
127
|
-
});
|
|
128
|
-
_defineProperty(this, "hasJquery", () => {
|
|
129
|
-
return typeof window.jQuery !== 'undefined';
|
|
130
|
-
});
|
|
131
|
-
deprecationWarnings(ToolbarFeedback.name, props, deprecations);
|
|
1
|
+
export default function ToolbarFeedback() {
|
|
2
|
+
if (process.env.NODE_ENV === 'development') {
|
|
3
|
+
// eslint-disable-next-line no-console
|
|
4
|
+
console.warn('ToolbarFeedback component is no longer available. This will be deprecated soon.');
|
|
132
5
|
}
|
|
133
|
-
|
|
134
|
-
const {
|
|
135
|
-
popupsMountPoint,
|
|
136
|
-
popupsBoundariesElement,
|
|
137
|
-
popupsScrollableElement
|
|
138
|
-
} = this.props;
|
|
139
|
-
const iconBefore = this.state.jiraIssueCollectorScriptLoading ? jsx(Spinner, null) : undefined;
|
|
140
|
-
|
|
141
|
-
// JIRA issue collector script is using jQuery internally
|
|
142
|
-
return this.hasJquery() ?
|
|
143
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
144
|
-
jsx("div", {
|
|
145
|
-
css: wrapper
|
|
146
|
-
}, jsx(ToolbarButton, {
|
|
147
|
-
ref: this.handleRef,
|
|
148
|
-
iconBefore: iconBefore,
|
|
149
|
-
onClick: this.collectFeedback,
|
|
150
|
-
selected: false,
|
|
151
|
-
spacing: "compact"
|
|
152
|
-
}, jsx("span", {
|
|
153
|
-
css: buttonContent
|
|
154
|
-
}, "Feedback")), this.state.showOptOutOption && jsx(PopupWithOutsideListeners, {
|
|
155
|
-
target: this.state.target,
|
|
156
|
-
mountTo: popupsMountPoint,
|
|
157
|
-
boundariesElement: popupsBoundariesElement,
|
|
158
|
-
scrollableElement: popupsScrollableElement,
|
|
159
|
-
fitHeight: POPUP_HEIGHT,
|
|
160
|
-
fitWidth: POPUP_WIDTH,
|
|
161
|
-
handleClickOutside: this.toggleShowOptOutOption,
|
|
162
|
-
handleEscapeKeydown: this.toggleShowOptOutOption
|
|
163
|
-
}, jsx("div", {
|
|
164
|
-
css: confirmationPopup
|
|
165
|
-
}, jsx("div", {
|
|
166
|
-
css: confirmationHeader
|
|
167
|
-
}, jsx("img", {
|
|
168
|
-
css: confirmationImg,
|
|
169
|
-
src: EDITOR_IMAGE_URL
|
|
170
|
-
})), jsx("div", {
|
|
171
|
-
css: confirmationText
|
|
172
|
-
}, jsx("div", null, "We are rolling out a new editing experience across Atlassian products. Help us improve by providing feedback."), jsx("div", null, "You can opt-out for now by turning off the \"Atlassian Editor\" feature on the Labs page in Bitbucket settings."), jsx(ButtonGroup, null, jsx(Button, {
|
|
173
|
-
appearance: "primary",
|
|
174
|
-
onClick: this.openFeedbackPopup
|
|
175
|
-
}, "Give feedback"), jsx(Button, {
|
|
176
|
-
appearance: "default",
|
|
177
|
-
onClick: this.openLearnMorePage
|
|
178
|
-
}, "Learn more")))))) : null;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
|
-
_defineProperty(ToolbarFeedbackInternal, "contextTypes", {
|
|
183
|
-
editorActions: PropTypes.object.isRequired
|
|
184
|
-
});
|
|
185
|
-
export default function ToolbarFeedback(props) {
|
|
186
|
-
const api = usePresetContext();
|
|
187
|
-
return jsx(ToolbarFeedbackInternal, _extends({
|
|
188
|
-
api: api
|
|
189
|
-
}, props));
|
|
6
|
+
return null;
|
|
190
7
|
}
|
|
@@ -8,16 +8,6 @@ const mediaPluginKey = {
|
|
|
8
8
|
return state['mediaPlugin$'];
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
|
-
export async function __temporaryFixForConfigPanel(editorView, api) {
|
|
12
|
-
var _api$extension;
|
|
13
|
-
const extensionPluginState = api === null || api === void 0 ? void 0 : (_api$extension = api.extension) === null || _api$extension === void 0 ? void 0 : _api$extension.sharedState.currentState();
|
|
14
|
-
if (extensionPluginState && extensionPluginState.showContextPanel) {
|
|
15
|
-
await new Promise(resolve => {
|
|
16
|
-
var _api$extension2, _api$contextPanel;
|
|
17
|
-
api === null || api === void 0 ? void 0 : (_api$extension2 = api.extension) === null || _api$extension2 === void 0 ? void 0 : _api$extension2.actions.forceAutoSave(api === null || api === void 0 ? void 0 : (_api$contextPanel = api.contextPanel) === null || _api$contextPanel === void 0 ? void 0 : _api$contextPanel.actions.applyChange)(resolve)(editorView.state, editorView.dispatch);
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
11
|
export async function getEditorValueWithMedia(editorView) {
|
|
22
12
|
const mediaPluginState = editorView.state && mediaPluginKey.getState(editorView.state);
|
|
23
13
|
if (mediaPluginState && mediaPluginState.waitForMediaUpload) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.
|
|
2
|
+
export const version = "197.4.0";
|
|
@@ -10,7 +10,7 @@ import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
|
10
10
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { findParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
12
12
|
import { createDispatch } from '../event-dispatcher';
|
|
13
|
-
import {
|
|
13
|
+
import { getEditorValueWithMedia } from '../utils/action';
|
|
14
14
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
15
15
|
import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
|
|
16
16
|
import { processRawFragmentValue } from '../utils/processRawFragmentValue';
|
|
@@ -196,34 +196,7 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
196
196
|
editorView.dispatch(tr);
|
|
197
197
|
return true;
|
|
198
198
|
}
|
|
199
|
-
|
|
200
|
-
key: "__temporaryFixForConfigPanel",
|
|
201
|
-
value: function () {
|
|
202
|
-
var _temporaryFixForConfigPanel2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
203
|
-
var editorView, __EDITOR_INTERNALS_DO_NOT_USE__API;
|
|
204
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
205
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
206
|
-
case 0:
|
|
207
|
-
// @ts-ignore Internal API not for use, just to unblock extracting extension plugin
|
|
208
|
-
editorView = this.editorView, __EDITOR_INTERNALS_DO_NOT_USE__API = this.__EDITOR_INTERNALS_DO_NOT_USE__API;
|
|
209
|
-
if (!(!editorView || !__EDITOR_INTERNALS_DO_NOT_USE__API)) {
|
|
210
|
-
_context2.next = 3;
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
return _context2.abrupt("return");
|
|
214
|
-
case 3:
|
|
215
|
-
_temporaryFixForConfigPanel(editorView, __EDITOR_INTERNALS_DO_NOT_USE__API);
|
|
216
|
-
case 4:
|
|
217
|
-
case "end":
|
|
218
|
-
return _context2.stop();
|
|
219
|
-
}
|
|
220
|
-
}, _callee2, this);
|
|
221
|
-
}));
|
|
222
|
-
function __temporaryFixForConfigPanel() {
|
|
223
|
-
return _temporaryFixForConfigPanel2.apply(this, arguments);
|
|
224
|
-
}
|
|
225
|
-
return __temporaryFixForConfigPanel;
|
|
226
|
-
}()
|
|
199
|
+
|
|
227
200
|
/**
|
|
228
201
|
* @deprecated This is deprecated and is no longer maintained.
|
|
229
202
|
*
|
|
@@ -237,36 +210,36 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
237
210
|
}, {
|
|
238
211
|
key: "getValue",
|
|
239
212
|
value: (function () {
|
|
240
|
-
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
213
|
+
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
241
214
|
var editorView, doc, json, nodeSanitized;
|
|
242
|
-
return _regeneratorRuntime.wrap(function
|
|
243
|
-
while (1) switch (
|
|
215
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
216
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
244
217
|
case 0:
|
|
245
218
|
editorView = this.editorView;
|
|
246
219
|
if (editorView) {
|
|
247
|
-
|
|
220
|
+
_context2.next = 3;
|
|
248
221
|
break;
|
|
249
222
|
}
|
|
250
|
-
return
|
|
223
|
+
return _context2.abrupt("return");
|
|
251
224
|
case 3:
|
|
252
|
-
|
|
225
|
+
_context2.next = 5;
|
|
253
226
|
return getEditorValueWithMedia(editorView);
|
|
254
227
|
case 5:
|
|
255
|
-
doc =
|
|
228
|
+
doc = _context2.sent;
|
|
256
229
|
json = toJSON(doc);
|
|
257
230
|
if (this.contentEncode) {
|
|
258
|
-
|
|
231
|
+
_context2.next = 9;
|
|
259
232
|
break;
|
|
260
233
|
}
|
|
261
|
-
return
|
|
234
|
+
return _context2.abrupt("return", json);
|
|
262
235
|
case 9:
|
|
263
236
|
nodeSanitized = Node.fromJSON(this.editorView.state.schema, json);
|
|
264
|
-
return
|
|
237
|
+
return _context2.abrupt("return", this.contentEncode(nodeSanitized));
|
|
265
238
|
case 11:
|
|
266
239
|
case "end":
|
|
267
|
-
return
|
|
240
|
+
return _context2.stop();
|
|
268
241
|
}
|
|
269
|
-
},
|
|
242
|
+
}, _callee2, this);
|
|
270
243
|
}));
|
|
271
244
|
function getValue() {
|
|
272
245
|
return _getValue.apply(this, arguments);
|
|
@@ -50,10 +50,12 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
50
50
|
var setEditorApi = useCallback(
|
|
51
51
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
52
|
function (api) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (!fg('platform_editor_remove_editor_actions_workaround')) {
|
|
54
|
+
// This is an workaround to unblock Editor Lego Decoupling project, if you have questions ping us #cc-editor-lego
|
|
55
|
+
// We may clean up this code when EditorActions deprecation process starts
|
|
56
|
+
// @ts-expect-error 2339: Property '__EDITOR_INTERNALS_DO_NOT_USE__API' does not exist on type 'EditorActions<any>'.
|
|
57
|
+
editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
|
|
58
|
+
}
|
|
57
59
|
}, [editorActions]);
|
|
58
60
|
var overriddenEditorProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
59
61
|
onSave: props.onSave ? handleSave : undefined,
|
|
@@ -141,8 +143,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
|
|
|
141
143
|
enableToolbarMinWidth: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
142
144
|
useStickyToolbar: props.useStickyToolbar,
|
|
143
145
|
featureFlags: featureFlags,
|
|
144
|
-
pluginHooks: config.pluginHooks
|
|
145
|
-
hideAvatarGroup: fg('platform_editor_remove_hide_avatar_group_prop') ? undefined : props.hideAvatarGroup
|
|
146
|
+
pluginHooks: config.pluginHooks
|
|
146
147
|
}));
|
|
147
148
|
}
|
|
148
149
|
}), jsx(PortalRenderer, null))))))));
|
|
@@ -27,6 +27,7 @@ import { EditorExperience, ExperienceStore, RELIABILITY_INTERVAL } from '@atlask
|
|
|
27
27
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
28
28
|
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
29
29
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
30
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
31
|
import { createDispatch, EventDispatcher } from '../event-dispatcher';
|
|
31
32
|
import { EditorAPIContext } from '../presets/context';
|
|
32
33
|
import { findChangedNodesFromTransaction } from '../utils/findChangedNodesFromTransaction';
|
|
@@ -550,7 +551,7 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
550
551
|
});
|
|
551
552
|
var _api = _this.pluginInjectionAPI.api();
|
|
552
553
|
(_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 || _props$setEditorApi.call(props, _api);
|
|
553
|
-
if (props.editorProps.editorActions) {
|
|
554
|
+
if (props.editorProps.editorActions && !fg('platform_editor_remove_editor_actions_workaround')) {
|
|
554
555
|
// @ts-expect-error
|
|
555
556
|
props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
|
|
556
557
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -6,7 +6,14 @@ export { default as WithEditorActions } from './ui/WithEditorActions';
|
|
|
6
6
|
export { default as WithHelpTrigger } from './ui/WithHelpTrigger';
|
|
7
7
|
export { default as CollapsedEditor } from './ui/CollapsedEditor';
|
|
8
8
|
export { default as ToolbarHelp } from './ui/ToolbarHelp';
|
|
9
|
-
export {
|
|
9
|
+
export {
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated
|
|
12
|
+
* DO NOT USE THIS WILL BE REMOVED SOON.
|
|
13
|
+
*
|
|
14
|
+
* This was intended for rollout of bitbucket only.
|
|
15
|
+
*/
|
|
16
|
+
default as ToolbarFeedback } from './ui/ToolbarFeedback';
|
|
10
17
|
export {
|
|
11
18
|
/**
|
|
12
19
|
* @deprecated
|
|
@@ -217,7 +217,11 @@ export default function createUniversalPresetInternal(_ref) {
|
|
|
217
217
|
tableSelectorSupported: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableSelector) && isFullPage,
|
|
218
218
|
nativeStatusSupported: !statusMenuDisabled,
|
|
219
219
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
220
|
-
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
220
|
+
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false,
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
// For platform_editor_element_level_templates experiment only
|
|
223
|
+
// clean up ticket ED-24873
|
|
224
|
+
UNSAFE_editorAppearance: appearance
|
|
221
225
|
}]).maybeAdd([beforePrimaryToolbarPlugin, {
|
|
222
226
|
beforePrimaryToolbarComponents: // @ts-expect-error 2339: Property 'before' does not exist on type 'PrimaryToolbarComponents'.
|
|
223
227
|
(_props$primaryToolbar = props.primaryToolbarComponents) === null || _props$primaryToolbar === void 0 ? void 0 : _props$primaryToolbar.before
|
|
@@ -228,15 +232,9 @@ export default function createUniversalPresetInternal(_ref) {
|
|
|
228
232
|
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
229
233
|
collabEdit: props.collabEdit,
|
|
230
234
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
231
|
-
showAvatarGroup:
|
|
232
|
-
// Cleanup: `platform_editor_remove_hide_avatar_group_prop`
|
|
233
|
-
// Remove `!props.hideAvatarGroup`
|
|
234
|
-
!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
235
|
+
showAvatarGroup: featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
235
236
|
}]).maybeAdd([findReplacePlugin, {
|
|
236
|
-
takeFullWidth:
|
|
237
|
-
// Cleanup: `platform_editor_remove_hide_avatar_group_prop`
|
|
238
|
-
// Remove `!props.hideAvatarGroup`
|
|
239
|
-
!props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
237
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
240
238
|
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
241
239
|
}], Boolean(props.allowFindReplace)).maybeAdd(borderPlugin, Boolean(props.allowBorderMark || props.UNSAFE_allowBorderMark)).maybeAdd(fragmentPlugin, Boolean(props.allowFragmentMark)).add(pasteOptionsToolbarPlugin).add([codeBidiWarningPlugin, {
|
|
242
240
|
appearance: appearance
|
|
@@ -10,7 +10,6 @@ import { jsx } from '@emotion/react';
|
|
|
10
10
|
import { browser } from '@atlaskit/editor-common/browser';
|
|
11
11
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
12
12
|
import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
15
14
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
16
15
|
import { fullPageEditorWrapper } from './StyledComponents';
|
|
@@ -87,8 +86,7 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
87
86
|
primaryToolbarComponents: primaryToolbarComponents,
|
|
88
87
|
providerFactory: props.providerFactory,
|
|
89
88
|
showKeyline: showKeyline,
|
|
90
|
-
featureFlags: props.featureFlags
|
|
91
|
-
hideAvatarGroup: fg('platform_editor_remove_hide_avatar_group_prop') ? undefined : props.hideAvatarGroup
|
|
89
|
+
featureFlags: props.featureFlags
|
|
92
90
|
}), jsx(FullPageContentArea, {
|
|
93
91
|
editorAPI: editorAPI,
|
|
94
92
|
ref: scrollContentContainerRef,
|
|
@@ -17,7 +17,7 @@ import Toolbar from '../../Toolbar';
|
|
|
17
17
|
import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
|
|
18
18
|
import { customToolbarWrapperStyle, mainToolbarFirstChildStyle, mainToolbarIconBeforeStyle, mainToolbarSecondChildStyle, mainToolbarStyle, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, nonCustomToolbarWrapperStyle } from './MainToolbar';
|
|
19
19
|
export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
20
|
-
var _props$featureFlags, _props$customPrimaryT
|
|
20
|
+
var _props$featureFlags, _props$customPrimaryT;
|
|
21
21
|
var _useState = useState(false),
|
|
22
22
|
_useState2 = _slicedToArray(_useState, 2),
|
|
23
23
|
shouldSplitToolbar = _useState2[0],
|
|
@@ -54,14 +54,6 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
54
54
|
css: customToolbarWrapperStyle
|
|
55
55
|
}, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
56
56
|
beforePrimaryToolbarComponents: (_props$customPrimaryT = props.customPrimaryToolbarComponents) === null || _props$customPrimaryT === void 0 ? void 0 : _props$customPrimaryT.before
|
|
57
|
-
}) : null, !fg('platform_editor_remove_hide_avatar_group_prop') ? props.hideAvatarGroup || (props === null || props === void 0 || (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : // Avatars are moved to Confluence codebase for Edit in Context
|
|
58
|
-
// When Edit in Context is enabled customPrimaryToolbarComponents is undefined
|
|
59
|
-
// For more details please check
|
|
60
|
-
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
61
|
-
editorAPI === null || editorAPI === void 0 || (_editorAPI$avatarGrou = editorAPI.avatarGroup) === null || _editorAPI$avatarGrou === void 0 ? void 0 : _editorAPI$avatarGrou.actions.getToolbarItem({
|
|
62
|
-
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
63
|
-
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
64
|
-
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
|
|
65
57
|
}) : null, editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.findReplace.actions.getToolbarButton({
|
|
66
58
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
67
59
|
popupsMountPoint: props.popupsMountPoint,
|