@atlaskit/editor-core 197.2.7 → 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 +51 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +0 -3
- package/dist/cjs/actions/index.js +16 -42
- package/dist/cjs/composable-editor/editor-internal.js +9 -7
- package/dist/cjs/composable-editor/hooks/useProviders.js +11 -1
- package/dist/cjs/composable-editor/utils/handleProviders.js +3 -1
- package/dist/cjs/create-editor/ReactEditorView.js +13 -9
- package/dist/cjs/presets/universal.js +15 -11
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/cjs/ui/ContentStyles/expand.js +9 -4
- package/dist/cjs/ui/ContentStyles/layout.js +8 -2
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +3 -1
- package/dist/cjs/ui/ToolbarFeedback/index.js +5 -210
- package/dist/cjs/utils/action.js +9 -38
- package/dist/cjs/utils/getNodesCount.js +13 -0
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/utils/performance/getTimeSince.js +16 -0
- package/dist/cjs/utils/performance/track-transactions.js +5 -4
- package/dist/cjs/utils/{document.js → processRawFragmentValue.js} +2 -10
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +4 -14
- package/dist/es2019/composable-editor/editor-internal.js +9 -7
- package/dist/es2019/composable-editor/hooks/useProviders.js +11 -1
- package/dist/es2019/composable-editor/utils/handleProviders.js +3 -1
- package/dist/es2019/create-editor/ReactEditorView.js +8 -4
- package/dist/es2019/index.js +8 -1
- package/dist/es2019/presets/universal.js +15 -11
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/es2019/ui/ContentStyles/expand.js +16 -2
- package/dist/es2019/ui/ContentStyles/layout.js +25 -15
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +3 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +5 -188
- package/dist/es2019/utils/action.js +0 -10
- package/dist/es2019/utils/getNodesCount.js +7 -0
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/performance/getTimeSince.js +8 -0
- package/dist/es2019/utils/performance/track-transactions.js +2 -1
- package/dist/es2019/utils/{document.js → processRawFragmentValue.js} +1 -8
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +17 -43
- package/dist/esm/composable-editor/editor-internal.js +9 -7
- package/dist/esm/composable-editor/hooks/useProviders.js +11 -1
- package/dist/esm/composable-editor/utils/handleProviders.js +3 -1
- package/dist/esm/create-editor/ReactEditorView.js +8 -4
- package/dist/esm/index.js +8 -1
- package/dist/esm/presets/universal.js +15 -11
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -9
- package/dist/esm/ui/ContentStyles/expand.js +9 -4
- package/dist/esm/ui/ContentStyles/layout.js +7 -2
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +3 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +5 -212
- package/dist/esm/utils/action.js +9 -37
- package/dist/esm/utils/getNodesCount.js +7 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/performance/getTimeSince.js +10 -0
- package/dist/esm/utils/performance/track-transactions.js +2 -1
- package/dist/esm/utils/{document.js → processRawFragmentValue.js} +1 -8
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +0 -1
- package/dist/types/composable-editor/hooks/useProviders.d.ts +3 -1
- package/dist/types/create-editor/ReactEditorView.d.ts +2 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +1456 -77
- package/dist/types/index.d.ts +8 -1
- package/dist/types/presets/default.d.ts +1297 -45
- package/dist/types/presets/universal.d.ts +1457 -77
- package/dist/types/presets/useUniversalPreset.d.ts +2205 -826
- 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/utils/getNodesCount.d.ts +2 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/performance/getTimeSince.d.ts +8 -0
- package/dist/{types-ts4.5/utils/document.d.ts → types/utils/processRawFragmentValue.d.ts} +1 -2
- package/dist/types-ts4.5/actions/index.d.ts +0 -1
- package/dist/types-ts4.5/composable-editor/hooks/useProviders.d.ts +3 -1
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +2 -1
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +1648 -60
- package/dist/types-ts4.5/index.d.ts +8 -1
- package/dist/types-ts4.5/presets/default.d.ts +1466 -24
- package/dist/types-ts4.5/presets/universal.d.ts +1649 -60
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +2424 -836
- 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/dist/types-ts4.5/utils/getNodesCount.d.ts +2 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/performance/getTimeSince.d.ts +8 -0
- package/dist/{types/utils/document.d.ts → types-ts4.5/utils/processRawFragmentValue.d.ts} +1 -2
- package/package.json +20 -22
|
@@ -46,6 +46,7 @@ import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugins/tasks-and-deci
|
|
|
46
46
|
import { textColorPlugin } from '@atlaskit/editor-plugins/text-color';
|
|
47
47
|
import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugins/toolbar-lists-indentation';
|
|
48
48
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
49
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
49
50
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
50
51
|
import { version as coreVersion } from '../version-wrapper';
|
|
51
52
|
import { createDefaultPreset } from './default';
|
|
@@ -135,11 +136,16 @@ export default function createUniversalPresetInternal({
|
|
|
135
136
|
profilecardProvider: (_props$mention3 = props.mention) === null || _props$mention3 === void 0 ? void 0 : _props$mention3.profilecardProvider,
|
|
136
137
|
...(initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : initialPluginConfiguration.mentionsPlugin)
|
|
137
138
|
}], Boolean(props.mentionProvider)).maybeAdd([emojiPlugin, {
|
|
139
|
+
emojiProvider: props.emojiProvider,
|
|
138
140
|
emojiNodeDataProvider: initialPluginConfiguration === null || initialPluginConfiguration === void 0 ? void 0 : (_initialPluginConfigu = initialPluginConfiguration.emoji) === null || _initialPluginConfigu === void 0 ? void 0 : _initialPluginConfigu.emojiNodeDataProvider
|
|
139
141
|
}], Boolean(props.emojiProvider)).maybeAdd([tablesPlugin, {
|
|
140
142
|
tableOptions: !props.allowTables || typeof props.allowTables === 'boolean' ? {} : props.allowTables,
|
|
141
|
-
dragAndDropEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableDragAndDrop) && (isFullPage || (isComment || isChromeless) &&
|
|
142
|
-
|
|
143
|
+
dragAndDropEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableDragAndDrop) && (isFullPage || (isComment || isChromeless) && editorExperiment('support_table_in_comment', true, {
|
|
144
|
+
exposure: true
|
|
145
|
+
})),
|
|
146
|
+
isTableScalingEnabled: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tablePreserveWidth) && (isFullPage || isComment && editorExperiment('support_table_in_comment', true, {
|
|
147
|
+
exposure: true
|
|
148
|
+
})),
|
|
143
149
|
allowContextualMenu: !isMobile,
|
|
144
150
|
fullWidthEnabled: appearance === 'full-width',
|
|
145
151
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
@@ -217,7 +223,11 @@ export default function createUniversalPresetInternal({
|
|
|
217
223
|
tableSelectorSupported: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.tableSelector) && isFullPage,
|
|
218
224
|
nativeStatusSupported: !statusMenuDisabled,
|
|
219
225
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
220
|
-
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
|
|
221
231
|
}]).maybeAdd([beforePrimaryToolbarPlugin, {
|
|
222
232
|
beforePrimaryToolbarComponents: // @ts-expect-error 2339: Property 'before' does not exist on type 'PrimaryToolbarComponents'.
|
|
223
233
|
(_props$primaryToolbar = props.primaryToolbarComponents) === null || _props$primaryToolbar === void 0 ? void 0 : _props$primaryToolbar.before
|
|
@@ -228,15 +238,9 @@ export default function createUniversalPresetInternal({
|
|
|
228
238
|
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
229
239
|
collabEdit: props.collabEdit,
|
|
230
240
|
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
|
|
241
|
+
showAvatarGroup: featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar
|
|
235
242
|
}]).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),
|
|
243
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
240
244
|
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
241
245
|
}], Boolean(props.allowFindReplace)).maybeAdd(borderPlugin, Boolean(props.allowBorderMark || props.UNSAFE_allowBorderMark)).maybeAdd(fragmentPlugin, Boolean(props.allowFragmentMark)).add(pasteOptionsToolbarPlugin).add([codeBidiWarningPlugin, {
|
|
242
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,
|
|
@@ -4,12 +4,24 @@ import { BreakoutCssClassName, expandClassNames, sharedExpandStyles } from '@atl
|
|
|
4
4
|
import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { N100A, N40A, N50A, R300, R50 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
const EXPAND_SELECTED_BACKGROUND = "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))";
|
|
8
9
|
const EXPAND_ICON_COLOR = () => css({
|
|
9
10
|
color: `var(--ds-icon-subtle, ${N100A})`
|
|
10
11
|
});
|
|
11
12
|
const DANGER_STATE_BACKGROUND_COLOR = `var(--ds-background-danger, ${R50})`;
|
|
12
13
|
const DANGER_STATE_BORDER_COLOR = `var(--ds-border-danger, ${R300})`;
|
|
14
|
+
const firstNodeWithNotMarginTop = () => editorExperiment('nested-dnd', true) ?
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
16
|
+
css`
|
|
17
|
+
> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {
|
|
18
|
+
margin-top: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
> div.ak-editor-expand[data-node-type='nestedExpand'] {
|
|
22
|
+
margin-top: ${"var(--ds-space-050, 0.25rem)"};
|
|
23
|
+
}
|
|
24
|
+
` : '';
|
|
13
25
|
|
|
14
26
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
15
27
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
@@ -50,8 +62,8 @@ export const expandStyles = () => css`
|
|
|
50
62
|
> .${expandClassNames.type('expand')},
|
|
51
63
|
.${BreakoutCssClassName.BREAKOUT_MARK_DOM}
|
|
52
64
|
> .${expandClassNames.type('expand')} {
|
|
53
|
-
margin-left: -${akLayoutGutterOffset}px;
|
|
54
|
-
margin-right: -${akLayoutGutterOffset}px;
|
|
65
|
+
margin-left: -${akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0)}px;
|
|
66
|
+
margin-right: -${akLayoutGutterOffset + (editorExperiment('nested-dnd', true) ? 8 : 0)}px;
|
|
55
67
|
}
|
|
56
68
|
|
|
57
69
|
.${expandClassNames.content} {
|
|
@@ -80,6 +92,8 @@ export const expandStyles = () => css`
|
|
|
80
92
|
|
|
81
93
|
.${expandClassNames.content} {
|
|
82
94
|
padding-top: ${"var(--ds-space-100, 8px)"};
|
|
95
|
+
|
|
96
|
+
${firstNodeWithNotMarginTop()}
|
|
83
97
|
}
|
|
84
98
|
}
|
|
85
99
|
|
|
@@ -7,6 +7,29 @@ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderS
|
|
|
7
7
|
import { N40A, N50A } from '@atlaskit/theme/colors';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
9
|
export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
|
|
10
|
+
const firstNodeWithNotMarginTop = () => editorExperiment('nested-dnd', true) ?
|
|
11
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
12
|
+
css`
|
|
13
|
+
> :nth-child(1 of :not(style, .ProseMirror-gapcursor, .ProseMirror-widget, span)) {
|
|
14
|
+
margin-top: 0;
|
|
15
|
+
}
|
|
16
|
+
` :
|
|
17
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
18
|
+
css`
|
|
19
|
+
> :not(style):first-child,
|
|
20
|
+
> style:first-child + * {
|
|
21
|
+
margin-top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> .ProseMirror-gapcursor:first-child + *,
|
|
25
|
+
> style:first-child + .ProseMirror-gapcursor + * {
|
|
26
|
+
margin-top: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
> .ProseMirror-gapcursor:first-child + span + * {
|
|
30
|
+
margin-top: 0;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
10
33
|
|
|
11
34
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
12
35
|
export const layoutStyles = viewMode => css`
|
|
@@ -25,25 +48,12 @@ export const layoutStyles = viewMode => css`
|
|
|
25
48
|
border: ${viewMode === 'view' ? 0 : akEditorSelectedBorderSize}px solid
|
|
26
49
|
${`var(--ds-border, ${N40A})`};
|
|
27
50
|
border-radius: 4px;
|
|
28
|
-
padding: ${LAYOUT_COLUMN_PADDING}px
|
|
51
|
+
padding: ${LAYOUT_COLUMN_PADDING}px
|
|
29
52
|
${LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0)}px;
|
|
30
53
|
box-sizing: border-box;
|
|
31
54
|
|
|
32
55
|
> div {
|
|
33
|
-
|
|
34
|
-
> style:first-child + * {
|
|
35
|
-
margin-top: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
> .ProseMirror-gapcursor:first-child + *,
|
|
39
|
-
> style:first-child + .ProseMirror-gapcursor + * {
|
|
40
|
-
margin-top: 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
> .ProseMirror-gapcursor:first-child + span + *,
|
|
44
|
-
> style:first-child + .ProseMirror-gapcursor:first-child + span + * {
|
|
45
|
-
margin-top: 0;
|
|
46
|
-
}
|
|
56
|
+
${firstNodeWithNotMarginTop()}
|
|
47
57
|
|
|
48
58
|
> .embedCardView-content-wrap:first-of-type .rich-media-item {
|
|
49
59
|
margin-top: 0;
|
|
@@ -7,6 +7,7 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
|
+
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
10
11
|
import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
12
13
|
import { isFullPage } from '../../utils/is-full-page';
|
|
@@ -31,7 +32,8 @@ export const ToolbarWithSizeDetector = props => {
|
|
|
31
32
|
const elementWidth = useElementWidth(ref, {
|
|
32
33
|
skip: typeof width !== 'undefined'
|
|
33
34
|
});
|
|
34
|
-
const
|
|
35
|
+
const defaultToolbarSize = isSSR() && isFullPage(props.appearance) ? ToolbarSize.XXL : undefined;
|
|
36
|
+
const toolbarSize = typeof width === 'undefined' && typeof elementWidth === 'undefined' ? defaultToolbarSize : widthToToolbarSize(width || elementWidth, props.appearance);
|
|
35
37
|
const toolbarStyle = useMemo(() => {
|
|
36
38
|
const toolbarWidth = isFullPage(props.appearance) && props.twoLineEditorToolbar ? ToolbarSize.S : ToolbarSize.M;
|
|
37
39
|
const toolbarMinWidth = toolbarSizeToWidth(toolbarWidth, props.appearance);
|
|
@@ -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) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate the difference between performance.now() and the given startTime.
|
|
3
|
+
* This allows for the timing to be overridable during tests.
|
|
4
|
+
*
|
|
5
|
+
* @param startTime DOMHighResTimeStamp
|
|
6
|
+
* @returns DOMHighResTimeStamp
|
|
7
|
+
*/
|
|
8
|
+
export const getTimeSince = startTime => performance.now() - startTime;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { isPerformanceAPIAvailable } from '@atlaskit/editor-common/is-performance-api-available';
|
|
2
3
|
import { startMeasure, stopMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
3
|
-
import { getTimeSince
|
|
4
|
+
import { getTimeSince } from './getTimeSince';
|
|
4
5
|
export const EVENT_NAME_STATE_APPLY = `🦉 EditorView::state::apply`;
|
|
5
6
|
export const EVENT_NAME_UPDATE_STATE = `🦉 EditorView::updateState`;
|
|
6
7
|
export const EVENT_NAME_VIEW_STATE_UPDATED = `🦉 EditorView::onEditorViewStateUpdated`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { processRawValue } from '@atlaskit/editor-common/
|
|
1
|
+
import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
|
|
2
2
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
export function processRawFragmentValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
4
4
|
if (!value) {
|
|
@@ -9,11 +9,4 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
return Fragment.from(adfEntities);
|
|
12
|
-
}
|
|
13
|
-
export function getNodesCount(node) {
|
|
14
|
-
let count = {};
|
|
15
|
-
node.nodesBetween(0, node.nodeSize - 2, node => {
|
|
16
|
-
count[node.type.name] = (count[node.type.name] || 0) + 1;
|
|
17
|
-
});
|
|
18
|
-
return count;
|
|
19
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.
|
|
2
|
+
export const version = "197.4.0";
|
|
@@ -3,16 +3,17 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
import {
|
|
6
|
+
import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
|
|
7
|
+
import { findNodePosByLocalIds, isEmptyDocument, toJSON } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
|
|
8
9
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
11
|
import { findParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
11
12
|
import { createDispatch } from '../event-dispatcher';
|
|
12
|
-
import {
|
|
13
|
+
import { getEditorValueWithMedia } from '../utils/action';
|
|
13
14
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
14
|
-
import { processRawFragmentValue } from '../utils/document';
|
|
15
15
|
import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
|
|
16
|
+
import { processRawFragmentValue } from '../utils/processRawFragmentValue';
|
|
16
17
|
|
|
17
18
|
// TODO: ED-21786
|
|
18
19
|
// Please, do not copy or use this kind of code below
|
|
@@ -195,34 +196,7 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
195
196
|
editorView.dispatch(tr);
|
|
196
197
|
return true;
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
-
key: "__temporaryFixForConfigPanel",
|
|
200
|
-
value: function () {
|
|
201
|
-
var _temporaryFixForConfigPanel2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
202
|
-
var editorView, __EDITOR_INTERNALS_DO_NOT_USE__API;
|
|
203
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
204
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
205
|
-
case 0:
|
|
206
|
-
// @ts-ignore Internal API not for use, just to unblock extracting extension plugin
|
|
207
|
-
editorView = this.editorView, __EDITOR_INTERNALS_DO_NOT_USE__API = this.__EDITOR_INTERNALS_DO_NOT_USE__API;
|
|
208
|
-
if (!(!editorView || !__EDITOR_INTERNALS_DO_NOT_USE__API)) {
|
|
209
|
-
_context2.next = 3;
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
return _context2.abrupt("return");
|
|
213
|
-
case 3:
|
|
214
|
-
_temporaryFixForConfigPanel(editorView, __EDITOR_INTERNALS_DO_NOT_USE__API);
|
|
215
|
-
case 4:
|
|
216
|
-
case "end":
|
|
217
|
-
return _context2.stop();
|
|
218
|
-
}
|
|
219
|
-
}, _callee2, this);
|
|
220
|
-
}));
|
|
221
|
-
function __temporaryFixForConfigPanel() {
|
|
222
|
-
return _temporaryFixForConfigPanel2.apply(this, arguments);
|
|
223
|
-
}
|
|
224
|
-
return __temporaryFixForConfigPanel;
|
|
225
|
-
}()
|
|
199
|
+
|
|
226
200
|
/**
|
|
227
201
|
* @deprecated This is deprecated and is no longer maintained.
|
|
228
202
|
*
|
|
@@ -236,36 +210,36 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
236
210
|
}, {
|
|
237
211
|
key: "getValue",
|
|
238
212
|
value: (function () {
|
|
239
|
-
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
213
|
+
var _getValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
240
214
|
var editorView, doc, json, nodeSanitized;
|
|
241
|
-
return _regeneratorRuntime.wrap(function
|
|
242
|
-
while (1) switch (
|
|
215
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
216
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
243
217
|
case 0:
|
|
244
218
|
editorView = this.editorView;
|
|
245
219
|
if (editorView) {
|
|
246
|
-
|
|
220
|
+
_context2.next = 3;
|
|
247
221
|
break;
|
|
248
222
|
}
|
|
249
|
-
return
|
|
223
|
+
return _context2.abrupt("return");
|
|
250
224
|
case 3:
|
|
251
|
-
|
|
225
|
+
_context2.next = 5;
|
|
252
226
|
return getEditorValueWithMedia(editorView);
|
|
253
227
|
case 5:
|
|
254
|
-
doc =
|
|
228
|
+
doc = _context2.sent;
|
|
255
229
|
json = toJSON(doc);
|
|
256
230
|
if (this.contentEncode) {
|
|
257
|
-
|
|
231
|
+
_context2.next = 9;
|
|
258
232
|
break;
|
|
259
233
|
}
|
|
260
|
-
return
|
|
234
|
+
return _context2.abrupt("return", json);
|
|
261
235
|
case 9:
|
|
262
236
|
nodeSanitized = Node.fromJSON(this.editorView.state.schema, json);
|
|
263
|
-
return
|
|
237
|
+
return _context2.abrupt("return", this.contentEncode(nodeSanitized));
|
|
264
238
|
case 11:
|
|
265
239
|
case "end":
|
|
266
|
-
return
|
|
240
|
+
return _context2.stop();
|
|
267
241
|
}
|
|
268
|
-
},
|
|
242
|
+
}, _callee2, this);
|
|
269
243
|
}));
|
|
270
244
|
function getValue() {
|
|
271
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))))))));
|
|
@@ -173,7 +174,8 @@ function ReactEditorViewContextWrapper(props) {
|
|
|
173
174
|
useProviders({
|
|
174
175
|
contextIdentifierProvider: props.editorProps.contextIdentifierProvider,
|
|
175
176
|
mediaProvider: (_props$editorProps$me = props.editorProps.media) === null || _props$editorProps$me === void 0 ? void 0 : _props$editorProps$me.provider,
|
|
176
|
-
cardProvider: ((_props$editorProps$li = props.editorProps.linking) === null || _props$editorProps$li === void 0 || (_props$editorProps$li = _props$editorProps$li.smartLinks) === null || _props$editorProps$li === void 0 ? void 0 : _props$editorProps$li.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider
|
|
177
|
+
cardProvider: ((_props$editorProps$li = props.editorProps.linking) === null || _props$editorProps$li === void 0 || (_props$editorProps$li = _props$editorProps$li.smartLinks) === null || _props$editorProps$li === void 0 ? void 0 : _props$editorProps$li.provider) || smartLinks && smartLinks.provider || UNSAFE_cards && UNSAFE_cards.provider,
|
|
178
|
+
emojiProvider: props.editorProps.emojiProvider
|
|
177
179
|
});
|
|
178
180
|
return jsx(ReactEditorView, _extends({}, props, {
|
|
179
181
|
setEditorApi: setEditorAPI
|