@atlaskit/editor-core 182.0.3 → 182.1.1
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/.eslintrc.js +2 -0
- package/CHANGELOG.md +47 -0
- package/README.md +20 -0
- package/architecture/0001-record-architecture-decisions.md +25 -0
- package/architecture/0002-deep-equality-check-for-getsharedstate.md +67 -0
- package/architecture/0003-explicit-plugin-dependencies.md +291 -0
- package/dist/cjs/actions/index.js +17 -6
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/cjs/create-editor/ErrorBoundary.js +1 -16
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
- package/dist/cjs/editor-next/editor-internal.js +2 -1
- package/dist/cjs/editor-next/index.js +5 -1
- package/dist/cjs/editor.js +9 -5
- package/dist/cjs/keymaps/index.js +12 -0
- package/dist/cjs/labs/next/internal/hooks/use-editor/index.js +5 -7
- package/dist/cjs/labs/next/presets/default.js +1 -2
- package/dist/cjs/plugins/card/index.js +16 -5
- package/dist/cjs/plugins/card/pm-plugins/actions.js +10 -1
- package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +48 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +337 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +19 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +5 -0
- package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +139 -0
- package/dist/cjs/plugins/card/pm-plugins/doc.js +99 -22
- package/dist/cjs/plugins/card/pm-plugins/main.js +16 -10
- package/dist/cjs/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/cjs/plugins/card/toolbar.js +18 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +12 -8
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +202 -0
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/cjs/plugins/card/utils.js +4 -2
- package/dist/cjs/plugins/extension/context-panel.js +3 -2
- package/dist/cjs/plugins/extension/index.js +4 -1
- package/dist/cjs/plugins/help-dialog/ui/index.js +29 -8
- package/dist/cjs/plugins/hyperlink/Toolbar.js +12 -2
- package/dist/cjs/plugins/hyperlink/commands.js +9 -5
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/index.js +5 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/cjs/plugins/media/index.js +9 -5
- package/dist/cjs/plugins/media/pm-plugins/main.js +5 -4
- package/dist/cjs/plugins/media/utils/media-single.js +1 -4
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +2 -1
- package/dist/cjs/plugins/paste/handlers.js +5 -5
- package/dist/cjs/plugins/paste/index.js +4 -2
- package/dist/cjs/plugins/paste/pm-plugins/main.js +6 -4
- package/dist/cjs/plugins/rule/commands.js +2 -2
- package/dist/cjs/plugins/rule/index.js +5 -4
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/cjs/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/text-color/index.js +5 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -0
- package/dist/cjs/ui/ColorPalette/index.js +6 -0
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +248 -17
- package/dist/cjs/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -12
- package/dist/cjs/ui/ContentStyles/index.js +2 -5
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/cjs/utils/document.js +5 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +10 -4
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +1 -13
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/es2019/editor-next/editor-internal.js +2 -1
- package/dist/es2019/editor-next/index.js +5 -1
- package/dist/es2019/editor.js +5 -2
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/es2019/labs/next/presets/default.js +1 -2
- package/dist/es2019/plugins/card/index.js +15 -5
- package/dist/es2019/plugins/card/pm-plugins/actions.js +4 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +38 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +316 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/es2019/plugins/card/pm-plugins/doc.js +94 -20
- package/dist/es2019/plugins/card/pm-plugins/main.js +17 -8
- package/dist/es2019/plugins/card/pm-plugins/reducers.js +8 -0
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/es2019/plugins/card/toolbar.js +16 -8
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +180 -0
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +11 -2
- package/dist/es2019/plugins/card/utils.js +6 -2
- package/dist/es2019/plugins/extension/context-panel.js +3 -2
- package/dist/es2019/plugins/extension/index.js +45 -41
- package/dist/es2019/plugins/help-dialog/ui/index.js +17 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +13 -4
- package/dist/es2019/plugins/hyperlink/commands.js +9 -6
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/index.js +96 -91
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +3 -2
- package/dist/es2019/plugins/media/index.js +202 -198
- package/dist/es2019/plugins/media/pm-plugins/main.js +5 -4
- package/dist/es2019/plugins/media/utils/media-single.js +1 -5
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/es2019/plugins/paste/handlers.js +6 -6
- package/dist/es2019/plugins/paste/index.js +18 -14
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/es2019/plugins/rule/commands.js +2 -2
- package/dist/es2019/plugins/rule/index.js +49 -46
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +6 -7
- package/dist/es2019/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/text-color/index.js +49 -44
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -0
- package/dist/es2019/ui/ColorPalette/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +8 -4
- package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +238 -13
- package/dist/es2019/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -11
- package/dist/es2019/ui/ContentStyles/index.js +2 -5
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +12 -10
- package/dist/es2019/utils/document.js +5 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +17 -6
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +2 -1
- package/dist/esm/create-editor/ErrorBoundary.js +1 -16
- package/dist/esm/create-editor/ReactEditorViewInternal.js +2 -2
- package/dist/esm/editor-next/editor-internal.js +2 -1
- package/dist/esm/editor-next/index.js +5 -1
- package/dist/esm/editor.js +9 -5
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/labs/next/internal/hooks/use-editor/index.js +4 -6
- package/dist/esm/labs/next/presets/default.js +1 -2
- package/dist/esm/plugins/card/index.js +13 -5
- package/dist/esm/plugins/card/pm-plugins/actions.js +8 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +41 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +328 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/index.js +2 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/types.js +1 -0
- package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +124 -0
- package/dist/esm/plugins/card/pm-plugins/doc.js +98 -22
- package/dist/esm/plugins/card/pm-plugins/main.js +16 -10
- package/dist/esm/plugins/card/pm-plugins/reducers.js +7 -0
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +3 -7
- package/dist/esm/plugins/card/toolbar.js +18 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +13 -9
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +191 -0
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +12 -4
- package/dist/esm/plugins/card/utils.js +4 -2
- package/dist/esm/plugins/extension/context-panel.js +3 -2
- package/dist/esm/plugins/extension/index.js +4 -1
- package/dist/esm/plugins/help-dialog/ui/index.js +29 -8
- package/dist/esm/plugins/hyperlink/Toolbar.js +13 -3
- package/dist/esm/plugins/hyperlink/commands.js +9 -5
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +4 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +5 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +25 -23
- package/dist/esm/plugins/media/index.js +9 -5
- package/dist/esm/plugins/media/pm-plugins/main.js +5 -4
- package/dist/esm/plugins/media/utils/media-single.js +1 -4
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +3 -2
- package/dist/esm/plugins/paste/handlers.js +6 -6
- package/dist/esm/plugins/paste/index.js +4 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -5
- package/dist/esm/plugins/rule/commands.js +2 -2
- package/dist/esm/plugins/rule/index.js +5 -4
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +6 -8
- package/dist/esm/plugins/rule/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/text-color/index.js +5 -2
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +3 -4
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +10 -0
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -0
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -4
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -0
- package/dist/esm/ui/ColorPalette/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +15 -10
- package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +3 -1
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +244 -19
- package/dist/esm/ui/ConfigPanel/FormContent.js +12 -6
- package/dist/esm/ui/ConfigPanel/utils.js +0 -10
- package/dist/esm/ui/ContentStyles/index.js +2 -5
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +16 -8
- package/dist/esm/utils/document.js +5 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +3 -2
- package/dist/types/create-editor/ErrorBoundary.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +1 -0
- package/dist/types/editor.d.ts +1 -0
- package/dist/types/keymaps/index.d.ts +1 -1
- package/dist/types/labs/next/internal/hooks/use-editor/index.d.ts +2 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -5
- package/dist/types/labs/next/presets/default.d.ts +2 -10
- package/dist/types/labs/next/presets/mobile.d.ts +1 -5
- package/dist/types/plugins/card/pm-plugins/actions.d.ts +2 -1
- package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +17 -0
- package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +2 -0
- package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +10 -0
- package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +26 -0
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +8 -7
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +3 -0
- package/dist/types/plugins/card/types.d.ts +81 -7
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +18 -0
- package/dist/types/plugins/card/utils.d.ts +1 -1
- package/dist/types/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/commands.d.ts +3 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +2 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +2 -1
- package/dist/types/plugins/media/index.d.ts +2 -0
- package/dist/types/plugins/media/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -1
- package/dist/types/plugins/paste/index.d.ts +2 -0
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/rule/commands.d.ts +2 -1
- package/dist/types/plugins/rule/index.d.ts +5 -1
- package/dist/types/plugins/rule/pm-plugins/input-rule.d.ts +1 -1
- package/dist/types/plugins/rule/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/text-color/index.d.ts +2 -0
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +2 -0
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +10 -0
- package/dist/types/types/editor-appearance-component.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPage.d.ts +2 -0
- package/dist/types/ui/ColorPalette/index.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +3 -1
- package/dist/types/ui/ConfigPanel/Fields/ColorPicker.d.ts +12 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/types.d.ts +3 -0
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +1 -1
- package/package.json +15 -14
- package/report.api.md +10 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -12
- package/dist/cjs/plugins/feature-flags-context/get-feature-flags.js +0 -11
- package/dist/cjs/plugins/feature-flags-context/index.js +0 -50
- package/dist/cjs/plugins/feature-flags-context/plugin-key.js +0 -9
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/es2019/plugins/feature-flags-context/get-feature-flags.js +0 -2
- package/dist/es2019/plugins/feature-flags-context/index.js +0 -29
- package/dist/es2019/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +0 -1
- package/dist/esm/plugins/feature-flags-context/get-feature-flags.js +0 -4
- package/dist/esm/plugins/feature-flags-context/index.js +0 -40
- package/dist/esm/plugins/feature-flags-context/plugin-key.js +0 -2
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +0 -1
- package/dist/types/plugins/feature-flags-context/get-feature-flags.d.ts +0 -3
- package/dist/types/plugins/feature-flags-context/index.d.ts +0 -9
- package/dist/types/plugins/feature-flags-context/plugin-key.d.ts +0 -2
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { ACTION, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { Fragment } from 'prosemirror-model';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import nodeNames from '../../../messages';
|
|
6
7
|
import { isSupportedInParent } from '../../../utils/nodes';
|
|
7
8
|
import { messages } from '../messages';
|
|
9
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
8
10
|
import { changeSelectedCardToLink, setSelectedCardAppearance } from '../pm-plugins/doc';
|
|
9
11
|
import { getButtonGroupOption } from './link-toolbar-button-group-options';
|
|
10
12
|
import { LinkToolbarButtonGroup } from './LinkToolbarButtonGroup';
|
|
@@ -52,7 +54,9 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
52
54
|
};
|
|
53
55
|
const options = [{
|
|
54
56
|
title: intl.formatMessage(messages.url),
|
|
55
|
-
onClick: (
|
|
57
|
+
onClick: commandWithMetadata(changeSelectedCardToLink(url, url, true), {
|
|
58
|
+
action: ACTION.CHANGED_TYPE
|
|
59
|
+
}),
|
|
56
60
|
selected: !currentAppearance,
|
|
57
61
|
testId: 'url-appearance'
|
|
58
62
|
}, {
|
|
@@ -77,7 +81,12 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
77
81
|
}
|
|
78
82
|
return /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
79
83
|
key: "link-toolbar-button-group",
|
|
80
|
-
options: options.map(option => getButtonGroupOption(intl, dispatchCommand,
|
|
84
|
+
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, {
|
|
85
|
+
...option,
|
|
86
|
+
onClick: commandWithMetadata(option.onClick, {
|
|
87
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
88
|
+
})
|
|
89
|
+
}))
|
|
81
90
|
});
|
|
82
91
|
});
|
|
83
92
|
}
|
|
@@ -2,7 +2,7 @@ import { NodeSelection } from 'prosemirror-state';
|
|
|
2
2
|
import { Slice, Fragment } from 'prosemirror-model';
|
|
3
3
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
4
4
|
import { mapChildren } from '../../utils/slice';
|
|
5
|
-
import { isSupportedInParent } from '
|
|
5
|
+
import { isSupportedInParent } from '../../utils/nodes';
|
|
6
6
|
export const appearanceForNodeType = spec => {
|
|
7
7
|
if (spec.name === 'inlineCard') {
|
|
8
8
|
return 'inline';
|
|
@@ -13,7 +13,11 @@ export const appearanceForNodeType = spec => {
|
|
|
13
13
|
}
|
|
14
14
|
return;
|
|
15
15
|
};
|
|
16
|
-
export const selectedCardAppearance = state =>
|
|
16
|
+
export const selectedCardAppearance = state => {
|
|
17
|
+
if (state.selection instanceof NodeSelection) {
|
|
18
|
+
return appearanceForNodeType(state.selection.node.type);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
17
21
|
export const titleUrlPairFromNode = node => {
|
|
18
22
|
const {
|
|
19
23
|
attrs
|
|
@@ -16,7 +16,7 @@ const areParametersEqual = (firstParameters, secondParameters) => {
|
|
|
16
16
|
}
|
|
17
17
|
return firstParameters === secondParameters;
|
|
18
18
|
};
|
|
19
|
-
export const getContextPanel = allowAutoSave => state => {
|
|
19
|
+
export const getContextPanel = (allowAutoSave, featureFlags) => state => {
|
|
20
20
|
const nodeWithPos = getSelectedExtension(state, true);
|
|
21
21
|
|
|
22
22
|
// Adding checks to bail out early
|
|
@@ -88,7 +88,8 @@ export const getContextPanel = allowAutoSave => state => {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
clearEditingContext(editorView.state, editorView.dispatch);
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
featureFlags: featureFlags
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
});
|
|
@@ -4,45 +4,49 @@ import keymapPlugin from './pm-plugins/keymap';
|
|
|
4
4
|
import { createPlugin as createUniqueIdPlugin } from './pm-plugins/unique-id';
|
|
5
5
|
import { getToolbarConfig } from './toolbar';
|
|
6
6
|
import { getContextPanel } from './context-panel';
|
|
7
|
-
const extensionPlugin = (options = {}) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
7
|
+
const extensionPlugin = (options = {}, api) => {
|
|
8
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
9
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
10
|
+
return {
|
|
11
|
+
name: 'extension',
|
|
12
|
+
nodes() {
|
|
13
|
+
return [{
|
|
14
|
+
name: 'extension',
|
|
15
|
+
node: extension
|
|
16
|
+
}, {
|
|
17
|
+
name: 'bodiedExtension',
|
|
18
|
+
node: bodiedExtension
|
|
19
|
+
}, {
|
|
20
|
+
name: 'inlineExtension',
|
|
21
|
+
node: inlineExtension
|
|
22
|
+
}];
|
|
23
|
+
},
|
|
24
|
+
pmPlugins() {
|
|
25
|
+
return [{
|
|
26
|
+
name: 'extension',
|
|
27
|
+
plugin: ({
|
|
28
|
+
dispatch,
|
|
29
|
+
providerFactory,
|
|
30
|
+
portalProviderAPI,
|
|
31
|
+
eventDispatcher
|
|
32
|
+
}) => {
|
|
33
|
+
const extensionHandlers = options.extensionHandlers || {};
|
|
34
|
+
return createPlugin(dispatch, providerFactory, extensionHandlers, portalProviderAPI, eventDispatcher, options.useLongPressSelection, {
|
|
35
|
+
appearance: options.appearance
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
name: 'extensionKeymap',
|
|
40
|
+
plugin: keymapPlugin
|
|
41
|
+
}, {
|
|
42
|
+
name: 'extensionUniqueId',
|
|
43
|
+
plugin: () => createUniqueIdPlugin()
|
|
44
|
+
}];
|
|
45
|
+
},
|
|
46
|
+
pluginsOptions: {
|
|
47
|
+
floatingToolbar: getToolbarConfig(options.breakoutEnabled),
|
|
48
|
+
contextPanel: getContextPanel(options.allowAutoSave, featureFlags)
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
};
|
|
48
52
|
export default extensionPlugin;
|
|
@@ -61,6 +61,17 @@ const messages = defineMessages({
|
|
|
61
61
|
description: 'Name of a feature, which let you insert items quickly.'
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
+
const navigationKeymaps = ({
|
|
65
|
+
formatMessage
|
|
66
|
+
}) => [{
|
|
67
|
+
name: formatMessage(toolbarMessages.navigateToEditorToolbar),
|
|
68
|
+
type: 'navigation',
|
|
69
|
+
keymap: () => keymaps.navToEditorToolbar
|
|
70
|
+
}, {
|
|
71
|
+
name: formatMessage(toolbarMessages.navigateToFloatingToolbar),
|
|
72
|
+
type: 'navigation',
|
|
73
|
+
keymap: () => keymaps.navToFloatingToolbar
|
|
74
|
+
}];
|
|
64
75
|
export const formatting = ({
|
|
65
76
|
formatMessage
|
|
66
77
|
}) => [{
|
|
@@ -293,7 +304,7 @@ const getKeyParts = keymap => {
|
|
|
293
304
|
};
|
|
294
305
|
export const getSupportedFormatting = (schema, intl, imageEnabled, quickInsertEnabled) => {
|
|
295
306
|
const supportedBySchema = formatting(intl).filter(format => schema.nodes[format.type] || schema.marks[format.type]);
|
|
296
|
-
return [...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...otherFormatting(intl)];
|
|
307
|
+
return [...navigationKeymaps(intl), ...supportedBySchema, ...(imageEnabled ? [imageAutoFormat] : []), ...(quickInsertEnabled ? [quickInsertAutoFormat(intl)] : []), ...otherFormatting(intl)];
|
|
297
308
|
};
|
|
298
309
|
export const getComponentFromKeymap = keymap => {
|
|
299
310
|
const keyParts = getKeyParts(keymap);
|
|
@@ -312,6 +323,11 @@ export const getComponentFromKeymap = keymap => {
|
|
|
312
323
|
css: codeMd,
|
|
313
324
|
key: `${keyParts}-${index}`
|
|
314
325
|
}, part);
|
|
326
|
+
} else if (['f9', 'f10'].indexOf(part.toLowerCase()) >= 0) {
|
|
327
|
+
return jsx("span", {
|
|
328
|
+
css: codeLg,
|
|
329
|
+
key: `${keyParts}-${index}`
|
|
330
|
+
}, part);
|
|
315
331
|
}
|
|
316
332
|
return jsx("span", {
|
|
317
333
|
css: codeSm,
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { stateKey } from './pm-plugins/main';
|
|
3
3
|
import { removeLink, editInsertedLink, updateLink, insertLinkWithAnalytics } from './commands';
|
|
4
4
|
import HyperlinkAddToolbar from './ui/HyperlinkAddToolbar';
|
|
5
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
6
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
6
7
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
7
8
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
@@ -10,7 +11,7 @@ import { linkToolbarMessages as linkToolbarCommonMessages, linkMessages } from '
|
|
|
10
11
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
11
12
|
import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '../../ui/LinkSearch/ToolbarComponents';
|
|
12
13
|
import { HyperlinkToolbarAppearance } from './HyperlinkToolbarAppearance';
|
|
13
|
-
import { addAnalytics, ACTION_SUBJECT_ID } from '../analytics';
|
|
14
|
+
import { addAnalytics, ACTION_SUBJECT_ID, ACTION, INPUT_METHOD } from '../analytics';
|
|
14
15
|
import { buildVisitedLinkPayload, buildOpenedSettingsPayload } from '../../utils/linking-utils';
|
|
15
16
|
/* type guard for edit links */
|
|
16
17
|
function isEditLink(linkMark) {
|
|
@@ -151,7 +152,9 @@ export const getToolbarConfig = (options, featureFlags) => (state, intl, provide
|
|
|
151
152
|
}, {
|
|
152
153
|
id: 'editor.link.unlink',
|
|
153
154
|
type: 'button',
|
|
154
|
-
onClick: removeLink(pos),
|
|
155
|
+
onClick: commandWithMetadata(removeLink(pos), {
|
|
156
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
157
|
+
}),
|
|
155
158
|
selected: false,
|
|
156
159
|
title: labelUnlink,
|
|
157
160
|
icon: UnlinkIcon,
|
|
@@ -202,9 +205,15 @@ export const getToolbarConfig = (options, featureFlags) => (state, intl, provide
|
|
|
202
205
|
displayText: displayText || '',
|
|
203
206
|
providerFactory: providerFactory,
|
|
204
207
|
onCancel: () => view.focus(),
|
|
205
|
-
onSubmit: (href, title = '', displayText, inputMethod) => {
|
|
208
|
+
onSubmit: (href, title = '', displayText, inputMethod, analytic) => {
|
|
206
209
|
var _options$cardOptions;
|
|
207
|
-
|
|
210
|
+
const isEdit = isEditLink(activeLinkMark);
|
|
211
|
+
const action = isEdit ? ACTION.UPDATED : ACTION.INSERTED;
|
|
212
|
+
const command = isEdit ? commandWithMetadata(updateLink(href, displayText || title, activeLinkMark.pos), {
|
|
213
|
+
action,
|
|
214
|
+
sourceEvent: analytic
|
|
215
|
+
}) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider), analytic);
|
|
216
|
+
command(view.state, view.dispatch, view);
|
|
208
217
|
view.focus();
|
|
209
218
|
}
|
|
210
219
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
1
2
|
import { normalizeUrl } from './utils';
|
|
2
3
|
import { stateKey, LinkAction } from './pm-plugins/main';
|
|
3
4
|
import { Selection } from 'prosemirror-state';
|
|
@@ -84,7 +85,7 @@ export function updateLink(href, text, pos, to) {
|
|
|
84
85
|
return true;
|
|
85
86
|
};
|
|
86
87
|
}
|
|
87
|
-
export function insertLink(from, to, incomingHref, incomingTitle, displayText, source) {
|
|
88
|
+
export function insertLink(from, to, incomingHref, incomingTitle, displayText, source, sourceEvent) {
|
|
88
89
|
return (state, dispatch) => {
|
|
89
90
|
const link = state.schema.marks.link;
|
|
90
91
|
const {
|
|
@@ -110,7 +111,7 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
|
|
|
110
111
|
}));
|
|
111
112
|
tr.setSelection(Selection.near(tr.doc.resolve(markEnd)));
|
|
112
113
|
if (!displayText || displayText === incomingHref) {
|
|
113
|
-
queueCardsFromChangedTr(state, tr, source, false);
|
|
114
|
+
queueCardsFromChangedTr(state, tr, source, ACTION.INSERTED, false, sourceEvent);
|
|
114
115
|
}
|
|
115
116
|
tr.setMeta(stateKey, {
|
|
116
117
|
type: LinkAction.HIDE_TOOLBAR
|
|
@@ -129,18 +130,20 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
|
|
|
129
130
|
return false;
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
|
-
export const insertLinkWithAnalytics = (inputMethod, from, to, href, title, displayText, cardsAvailable = false) => {
|
|
133
|
+
export const insertLinkWithAnalytics = (inputMethod, from, to, href, title, displayText, cardsAvailable = false, sourceEvent = undefined) => {
|
|
133
134
|
// If smart cards are available, we send analytics for hyperlinks when a smart link is rejected.
|
|
134
135
|
if (cardsAvailable && !title && !displayText) {
|
|
135
|
-
return insertLink(from, to, href, title, displayText, inputMethod);
|
|
136
|
+
return insertLink(from, to, href, title, displayText, inputMethod, sourceEvent);
|
|
136
137
|
}
|
|
137
|
-
return withAnalytics(getLinkCreationAnalyticsEvent(inputMethod, href))(insertLink(from, to, href, title, displayText, inputMethod));
|
|
138
|
+
return withAnalytics(getLinkCreationAnalyticsEvent(inputMethod, href))(insertLink(from, to, href, title, displayText, inputMethod, sourceEvent));
|
|
138
139
|
};
|
|
139
140
|
export const insertLinkWithAnalyticsMobileNative = (inputMethod, from, to, href, title, displayText) => {
|
|
140
141
|
return withAnalytics(getLinkCreationAnalyticsEvent(inputMethod, href))(insertLink(from, to, href, title, displayText, inputMethod));
|
|
141
142
|
};
|
|
142
143
|
export function removeLink(pos) {
|
|
143
|
-
return setLinkHref('', pos)
|
|
144
|
+
return commandWithMetadata(setLinkHref('', pos), {
|
|
145
|
+
action: ACTION.UNLINK
|
|
146
|
+
});
|
|
144
147
|
}
|
|
145
148
|
export function editInsertedLink() {
|
|
146
149
|
return (state, dispatch) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
1
2
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
2
3
|
import { findFilepaths, isLinkInMatches, LinkMatcher, normalizeUrl } from '../utils';
|
|
3
4
|
import { INPUT_METHOD, addAnalytics } from '../../analytics';
|
|
@@ -39,6 +40,9 @@ export function createLinkInputRule(regexp, skipAnalytics = false) {
|
|
|
39
40
|
if (to === end) {
|
|
40
41
|
tr.insertText(' ');
|
|
41
42
|
}
|
|
43
|
+
addLinkMetadata(state.selection, tr, {
|
|
44
|
+
inputMethod: INPUT_METHOD.AUTO_DETECT
|
|
45
|
+
});
|
|
42
46
|
if (skipAnalytics) {
|
|
43
47
|
return tr;
|
|
44
48
|
}
|
|
@@ -15,8 +15,8 @@ const onSubmitInterface = onSubmit => ({
|
|
|
15
15
|
displayText,
|
|
16
16
|
rawUrl,
|
|
17
17
|
meta
|
|
18
|
-
}) => {
|
|
19
|
-
onSubmit(url, title !== null && title !== void 0 ? title : rawUrl, displayText || undefined, meta.inputMethod === 'manual' ? INPUT_METHOD.MANUAL : INPUT_METHOD.TYPEAHEAD);
|
|
18
|
+
}, analytic) => {
|
|
19
|
+
onSubmit(url, title !== null && title !== void 0 ? title : rawUrl, displayText || undefined, meta.inputMethod === 'manual' ? INPUT_METHOD.MANUAL : INPUT_METHOD.TYPEAHEAD, analytic);
|
|
20
20
|
};
|
|
21
21
|
export default class HyperlinkAddToolbar extends React.PureComponent {
|
|
22
22
|
render() {
|
|
@@ -50,7 +50,6 @@ export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
|
50
50
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
51
51
|
export { default as historyPlugin } from './history';
|
|
52
52
|
export { default as captionPlugin } from './caption';
|
|
53
|
-
export { default as featureFlagsContextPlugin } from './feature-flags-context';
|
|
54
53
|
export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
55
54
|
export { default as scrollIntoViewPlugin } from './scroll-into-view';
|
|
56
55
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
@@ -39,96 +39,101 @@ const toolbarSizeToButtons = toolbarSize => {
|
|
|
39
39
|
function handleInsertBlockType(name) {
|
|
40
40
|
return insertBlockTypesWithAnalytics(name, INPUT_METHOD.TOOLBAR);
|
|
41
41
|
}
|
|
42
|
-
const insertBlockPlugin = (options = {}) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
42
|
+
const insertBlockPlugin = (options = {}, api) => {
|
|
43
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
44
|
+
const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
45
|
+
return {
|
|
46
|
+
name: 'insertBlock',
|
|
47
|
+
primaryToolbarComponent({
|
|
48
|
+
editorView,
|
|
49
|
+
editorActions,
|
|
50
|
+
dispatchAnalyticsEvent,
|
|
51
|
+
providerFactory,
|
|
52
|
+
popupsMountPoint,
|
|
53
|
+
popupsBoundariesElement,
|
|
54
|
+
popupsScrollableElement,
|
|
55
|
+
toolbarSize,
|
|
56
|
+
disabled,
|
|
57
|
+
isToolbarReducedSpacing,
|
|
58
|
+
isLastItem
|
|
59
|
+
}) {
|
|
60
|
+
const buttons = toolbarSizeToButtons(toolbarSize);
|
|
61
|
+
const renderNode = providers => {
|
|
62
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
63
|
+
plugins: {
|
|
64
|
+
typeAheadState: typeAheadPluginKey,
|
|
65
|
+
blockTypeState: blockTypeStateKey,
|
|
66
|
+
mediaState: mediaStateKey,
|
|
67
|
+
mentionState: mentionPluginKey,
|
|
68
|
+
macroState: macroStateKey,
|
|
69
|
+
hyperlinkState: hyperlinkPluginKey,
|
|
70
|
+
emojiState: emojiPluginKey,
|
|
71
|
+
dateState: dateStateKey,
|
|
72
|
+
imageUpload: imageUploadStateKey,
|
|
73
|
+
placeholderTextState: placeholderTextStateKey,
|
|
74
|
+
layoutState: layoutStateKey
|
|
75
|
+
},
|
|
76
|
+
render: ({
|
|
77
|
+
mentionState,
|
|
78
|
+
blockTypeState,
|
|
79
|
+
mediaState,
|
|
80
|
+
macroState = {},
|
|
81
|
+
hyperlinkState,
|
|
82
|
+
emojiState,
|
|
83
|
+
dateState,
|
|
84
|
+
imageUpload,
|
|
85
|
+
placeholderTextState,
|
|
86
|
+
layoutState
|
|
87
|
+
}) => /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
88
|
+
insertNodeAPI: options.insertNodeAPI,
|
|
89
|
+
buttons: buttons,
|
|
90
|
+
isReducedSpacing: isToolbarReducedSpacing,
|
|
91
|
+
isDisabled: disabled,
|
|
92
|
+
isTypeAheadAllowed: isTypeAheadAllowed(editorView.state),
|
|
93
|
+
editorView: editorView,
|
|
94
|
+
tableSupported: !!editorView.state.schema.nodes.table,
|
|
95
|
+
actionSupported: !!editorView.state.schema.nodes.taskItem,
|
|
96
|
+
mentionsSupported: !!(mentionState && mentionState.mentionProvider),
|
|
97
|
+
decisionSupported: !!editorView.state.schema.nodes.decisionItem,
|
|
98
|
+
dateEnabled: !!dateState,
|
|
99
|
+
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
100
|
+
layoutSectionEnabled: !!layoutState,
|
|
101
|
+
expandEnabled: !!options.allowExpand,
|
|
102
|
+
mediaUploadsEnabled: mediaState && mediaState.allowsUploads,
|
|
103
|
+
onShowMediaPicker: mediaState && mediaState.showMediaPicker,
|
|
104
|
+
mediaSupported: !!mediaState,
|
|
105
|
+
imageUploadSupported: !!imageUpload,
|
|
106
|
+
imageUploadEnabled: imageUpload && imageUpload.enabled,
|
|
107
|
+
handleImageUpload: startImageUpload,
|
|
108
|
+
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
109
|
+
linkSupported: !!hyperlinkState,
|
|
110
|
+
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
111
|
+
emojiDisabled: !emojiState || !emojiState.emojiProvider,
|
|
112
|
+
emojiProvider: providers.emojiProvider,
|
|
113
|
+
nativeStatusSupported: options.nativeStatusSupported,
|
|
114
|
+
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
115
|
+
onInsertBlockType: handleInsertBlockType,
|
|
116
|
+
onInsertMacroFromMacroBrowser: insertMacroFromMacroBrowser,
|
|
117
|
+
macroProvider: macroState.macroProvider,
|
|
118
|
+
popupsMountPoint: popupsMountPoint,
|
|
119
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
120
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
121
|
+
insertMenuItems: options.insertMenuItems,
|
|
122
|
+
editorActions: editorActions,
|
|
123
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
124
|
+
replacePlusMenuWithElementBrowser: options.replacePlusMenuWithElementBrowser,
|
|
125
|
+
showElementBrowserLink: options.showElementBrowserLink,
|
|
126
|
+
showSeparator: !isLastItem && toolbarSize <= ToolbarSize.S,
|
|
127
|
+
featureFlags: featureFlags
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
132
|
+
providerFactory: providerFactory,
|
|
133
|
+
providers: ['emojiProvider'],
|
|
134
|
+
renderNode: renderNode
|
|
125
135
|
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
providers: ['emojiProvider'],
|
|
130
|
-
renderNode: renderNode
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
};
|
|
134
139
|
export default insertBlockPlugin;
|
|
@@ -256,9 +256,10 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
256
256
|
editorView: {
|
|
257
257
|
state,
|
|
258
258
|
dispatch
|
|
259
|
-
}
|
|
259
|
+
},
|
|
260
|
+
featureFlags
|
|
260
261
|
} = this.props;
|
|
261
|
-
return insertHorizontalRule(inputMethod)(state, dispatch);
|
|
262
|
+
return insertHorizontalRule(inputMethod, featureFlags)(state, dispatch);
|
|
262
263
|
});
|
|
263
264
|
_defineProperty(this, "insertExpand", () => {
|
|
264
265
|
const {
|