@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
|
@@ -55,7 +55,7 @@ var MEDIA_RESOLVED_STATES = ['ready', 'error', 'cancelled'];
|
|
|
55
55
|
export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
56
56
|
// @ts-ignore: private is OK
|
|
57
57
|
|
|
58
|
-
function MediaPluginStateImplementation(_state, options, mediaOptions, _dispatch) {
|
|
58
|
+
function MediaPluginStateImplementation(_state, options, mediaOptions, newInsertionBehaviour, _dispatch) {
|
|
59
59
|
var _this = this;
|
|
60
60
|
_classCallCheck(this, MediaPluginStateImplementation);
|
|
61
61
|
_defineProperty(this, "allowsUploads", false);
|
|
@@ -223,7 +223,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
226
|
-
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert);
|
|
226
|
+
insertMediaSingleNode(_this.view, mediaStateWithContext, _this.getInputMethod(pickerType), collection, _this.mediaOptions && _this.mediaOptions.alignLeftOnInsert, _this.newInsertionBehaviour);
|
|
227
227
|
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = _this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
228
228
|
insertMediaInlineNode(_this.view, mediaStateWithContext, collection, _this.getInputMethod(pickerType));
|
|
229
229
|
} else {
|
|
@@ -422,6 +422,7 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
422
422
|
});
|
|
423
423
|
this.options = options;
|
|
424
424
|
this.mediaOptions = mediaOptions;
|
|
425
|
+
this.newInsertionBehaviour = newInsertionBehaviour;
|
|
425
426
|
this.dispatch = _dispatch;
|
|
426
427
|
this.waitForMediaUpload = options.waitForMediaUpload === undefined ? true : options.waitForMediaUpload;
|
|
427
428
|
var nodes = _state.schema.nodes;
|
|
@@ -592,13 +593,13 @@ export var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
592
593
|
export var getMediaPluginState = function getMediaPluginState(state) {
|
|
593
594
|
return stateKey.getState(state);
|
|
594
595
|
};
|
|
595
|
-
export var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, dispatch, mediaOptions) {
|
|
596
|
+
export var createPlugin = function createPlugin(_schema, options, reactContext, getIntl, dispatch, mediaOptions, newInsertionBehaviour) {
|
|
596
597
|
var intl = getIntl();
|
|
597
598
|
var dropPlaceholder = createDropPlaceholder(intl, mediaOptions && mediaOptions.allowDropzoneDropLine);
|
|
598
599
|
return new SafePlugin({
|
|
599
600
|
state: {
|
|
600
601
|
init: function init(_config, state) {
|
|
601
|
-
return new MediaPluginStateImplementation(state, options, mediaOptions, dispatch);
|
|
602
|
+
return new MediaPluginStateImplementation(state, options, mediaOptions, newInsertionBehaviour, dispatch);
|
|
602
603
|
},
|
|
603
604
|
apply: function apply(tr, pluginState) {
|
|
604
605
|
// remap editing media single position if we're in collab
|
|
@@ -10,7 +10,6 @@ import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
|
|
|
10
10
|
import { mapSlice } from '../../../utils/slice';
|
|
11
11
|
import { addAnalytics, ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
|
|
12
12
|
import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '../../../utils/insert';
|
|
13
|
-
import { getFeatureFlags } from '../../feature-flags-context';
|
|
14
13
|
import { isImage } from './is-image';
|
|
15
14
|
import { atTheBeginningOfBlock } from '../../../utils/prosemirror/position';
|
|
16
15
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
@@ -78,7 +77,7 @@ export var insertMediaAsMediaSingle = function insertMediaAsMediaSingle(view, no
|
|
|
78
77
|
};
|
|
79
78
|
return insertNodesWithOptionalParagraph(nodes, analyticsAttributes)(state, dispatch);
|
|
80
79
|
};
|
|
81
|
-
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert) {
|
|
80
|
+
export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaState, inputMethod, collection, alignLeftOnInsert, newInsertionBehaviour) {
|
|
82
81
|
var _state$selection$$fro;
|
|
83
82
|
if (collection === undefined) {
|
|
84
83
|
return false;
|
|
@@ -105,8 +104,6 @@ export var insertMediaSingleNode = function insertMediaSingleNode(view, mediaSta
|
|
|
105
104
|
inputMethod: inputMethod
|
|
106
105
|
})(state, dispatch);
|
|
107
106
|
} else {
|
|
108
|
-
var _getFeatureFlags = getFeatureFlags(view.state),
|
|
109
|
-
newInsertionBehaviour = _getFeatureFlags.newInsertionBehaviour;
|
|
110
107
|
var tr = null;
|
|
111
108
|
if (newInsertionBehaviour) {
|
|
112
109
|
tr = safeInsert(node, state.selection.from)(state.tr);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { setTextSelection, findParentNodeOfType } from 'prosemirror-utils';
|
|
2
|
+
import { setTextSelection, findParentNodeOfType, hasParentNodeOfType } from 'prosemirror-utils';
|
|
3
3
|
import { isEmptyNode } from '../../../utils';
|
|
4
4
|
function findParentNode(selection, nodeType) {
|
|
5
5
|
var parentPosition = findParentNodeOfType(nodeType)(selection);
|
|
@@ -43,7 +43,8 @@ export function keymapPlugin() {
|
|
|
43
43
|
var isParentNodeAPanel = parentNodeType === panel;
|
|
44
44
|
|
|
45
45
|
// Stops merging panels when deleting empty paragraph in between
|
|
46
|
-
|
|
46
|
+
// Stops merging blockquotes with panels when deleting from start of blockquote
|
|
47
|
+
if (isPreviousNodeAPanel && !isParentNodeAPanel || isInsideAnEmptyNode(selection, panel, state.schema) || hasParentNodeOfType(blockquote)(selection)) {
|
|
47
48
|
var content = $from.node($from.depth).content;
|
|
48
49
|
var insertPos = previousPos.pos;
|
|
49
50
|
deleteCurrentItem($from, tr).insert(insertPos, content);
|
|
@@ -15,7 +15,7 @@ import uuid from 'uuid/v4';
|
|
|
15
15
|
import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
|
|
16
16
|
import { compose, insideTable, isParagraph, isText, isLinkMark, insideTableCell, isInListItem } from '../../utils';
|
|
17
17
|
import { mapSlice } from '../../utils/slice';
|
|
18
|
-
import { INPUT_METHOD } from '../analytics';
|
|
18
|
+
import { ACTION, INPUT_METHOD } from '../analytics';
|
|
19
19
|
import { queueCardsFromChangedTr } from '../card/pm-plugins/doc';
|
|
20
20
|
import { GapCursorSelection, Side } from '../selection/gap-cursor-selection';
|
|
21
21
|
import { linkifyContent } from '../hyperlink/utils';
|
|
@@ -104,7 +104,7 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
104
104
|
// This maintains both the selection (destination) and the slice (paste content).
|
|
105
105
|
safeInsert(transformedSlice.content)(tr).scrollIntoView();
|
|
106
106
|
}
|
|
107
|
-
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD);
|
|
107
|
+
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD, ACTION.PASTED);
|
|
108
108
|
if (dispatch) {
|
|
109
109
|
dispatch(tr);
|
|
110
110
|
}
|
|
@@ -362,7 +362,7 @@ export function handlePastePreservingMarks(slice) {
|
|
|
362
362
|
// special case for plainTextSlice & linkMark: merge into existing link
|
|
363
363
|
if (isPlainTextSlice && linkMark.isInSet(selectionMarks) && selectionMarks.length === 1) {
|
|
364
364
|
var tr = closeHistory(state.tr).replaceSelectionWith(slice.content.firstChild.firstChild, true).setStoredMarks(selectionMarks).scrollIntoView();
|
|
365
|
-
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD);
|
|
365
|
+
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD, ACTION.PASTED);
|
|
366
366
|
if (dispatch) {
|
|
367
367
|
dispatch(tr);
|
|
368
368
|
}
|
|
@@ -374,7 +374,7 @@ export function handlePastePreservingMarks(slice) {
|
|
|
374
374
|
if (hasOnlyNodesOfType(bulletList, hardBreak, heading, listItem, paragraph, text, emoji, mention, orderedList)(slice)) {
|
|
375
375
|
var transformedSlice = applyTextMarksToSlice(schema, selectionMarks)(slice);
|
|
376
376
|
var _tr2 = closeHistory(state.tr).replaceSelection(transformedSlice).setStoredMarks(selectionMarks).scrollIntoView();
|
|
377
|
-
queueCardsFromChangedTr(state, _tr2, INPUT_METHOD.CLIPBOARD);
|
|
377
|
+
queueCardsFromChangedTr(state, _tr2, INPUT_METHOD.CLIPBOARD, ACTION.PASTED);
|
|
378
378
|
if (dispatch) {
|
|
379
379
|
dispatch(_tr2);
|
|
380
380
|
}
|
|
@@ -592,7 +592,7 @@ export function handleMarkdown(markdownSlice, from, to) {
|
|
|
592
592
|
tr.replaceSelection(markdownSlice);
|
|
593
593
|
}
|
|
594
594
|
tr.setSelection(TextSelection.near(tr.doc.resolve(pastesFrom + markdownSlice.size), -1));
|
|
595
|
-
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD);
|
|
595
|
+
queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD, ACTION.PASTED);
|
|
596
596
|
if (dispatch) {
|
|
597
597
|
dispatch(tr.scrollIntoView());
|
|
598
598
|
}
|
|
@@ -816,7 +816,7 @@ export function handleRichText(slice) {
|
|
|
816
816
|
|
|
817
817
|
// queue link cards, ignoring any errors
|
|
818
818
|
if (dispatch) {
|
|
819
|
-
dispatch(queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD));
|
|
819
|
+
dispatch(queueCardsFromChangedTr(state, tr, INPUT_METHOD.CLIPBOARD, ACTION.PASTED));
|
|
820
820
|
}
|
|
821
821
|
return true;
|
|
822
822
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { createPlugin } from './pm-plugins/main';
|
|
2
|
-
var pastePlugin = function pastePlugin(_ref) {
|
|
2
|
+
var pastePlugin = function pastePlugin(_ref, api) {
|
|
3
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
3
4
|
var cardOptions = _ref.cardOptions,
|
|
4
5
|
sanitizePrivateContent = _ref.sanitizePrivateContent;
|
|
6
|
+
var 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()) || {};
|
|
5
7
|
return {
|
|
6
8
|
name: 'paste',
|
|
7
9
|
pmPlugins: function pmPlugins() {
|
|
@@ -12,7 +14,7 @@ var pastePlugin = function pastePlugin(_ref) {
|
|
|
12
14
|
providerFactory = _ref2.providerFactory,
|
|
13
15
|
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
14
16
|
dispatch = _ref2.dispatch;
|
|
15
|
-
return createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptions, sanitizePrivateContent, providerFactory);
|
|
17
|
+
return createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, cardOptions, sanitizePrivateContent, providerFactory);
|
|
16
18
|
}
|
|
17
19
|
}];
|
|
18
20
|
}
|
|
@@ -5,9 +5,9 @@ import { Slice, Fragment } from 'prosemirror-model';
|
|
|
5
5
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
6
|
import uuid from 'uuid';
|
|
7
7
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
8
|
+
import { addLinkMetadata } from '@atlaskit/editor-common/card';
|
|
8
9
|
import { mapChildren } from '../../../utils/slice';
|
|
9
10
|
import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
|
|
10
|
-
sendPasteAnalyticsEvent;
|
|
11
11
|
import * as clipboard from '../../../utils/clipboard';
|
|
12
12
|
import { transformSliceForMedia } from '../../media/utils/media-single';
|
|
13
13
|
import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks } from '../util';
|
|
@@ -16,7 +16,7 @@ import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
|
16
16
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
17
17
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
18
18
|
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
|
|
19
|
-
import { analyticsPluginKey, PasteTypes } from '../../analytics';
|
|
19
|
+
import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../analytics';
|
|
20
20
|
import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
|
|
21
21
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
22
22
|
import { transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../../media/utils/media-common';
|
|
@@ -33,8 +33,7 @@ import { extractSliceFromStep } from '../../../utils/step';
|
|
|
33
33
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
34
34
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
35
35
|
export { md } from '../md';
|
|
36
|
-
|
|
37
|
-
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
36
|
+
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
38
37
|
var atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
39
38
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
40
39
|
var textInput = text;
|
|
@@ -201,6 +200,10 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptio
|
|
|
201
200
|
if (!isPastingTextInsidePlaceholderText && !isPastingTable) {
|
|
202
201
|
tr.setMeta(betterTypePluginKey, true);
|
|
203
202
|
}
|
|
203
|
+
addLinkMetadata(view.state.selection, tr, {
|
|
204
|
+
action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
|
|
205
|
+
inputMethod: INPUT_METHOD.CLIPBOARD
|
|
206
|
+
});
|
|
204
207
|
view.dispatch(tr);
|
|
205
208
|
};
|
|
206
209
|
slice = handleParagraphBlockMarks(state, slice);
|
|
@@ -356,7 +359,6 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptio
|
|
|
356
359
|
if (handlePasteIntoCaptionWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
|
|
357
360
|
return true;
|
|
358
361
|
}
|
|
359
|
-
var featureFlags = getFeatureFlags(state);
|
|
360
362
|
if (handlePastePanelOrDecisionIntoListWithAnalytics(view, event, slice)(state, dispatch)) {
|
|
361
363
|
return true;
|
|
362
364
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHorizontalRule } from './pm-plugins/input-rule';
|
|
2
|
-
export var insertHorizontalRule = function insertHorizontalRule(inputMethod) {
|
|
2
|
+
export var insertHorizontalRule = function insertHorizontalRule(inputMethod, featureFlags) {
|
|
3
3
|
return function (state, dispatch) {
|
|
4
|
-
var tr = createHorizontalRule(state, state.selection.from, state.selection.to, inputMethod);
|
|
4
|
+
var tr = createHorizontalRule(state, featureFlags, state.selection.from, state.selection.to, inputMethod);
|
|
5
5
|
if (tr) {
|
|
6
6
|
if (dispatch) {
|
|
7
7
|
dispatch(tr);
|
|
@@ -5,7 +5,9 @@ import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
|
5
5
|
import { IconDivider } from '../quick-insert/assets';
|
|
6
6
|
import inputRulePlugin from './pm-plugins/input-rule';
|
|
7
7
|
import keymapPlugin from './pm-plugins/keymap';
|
|
8
|
-
var rulePlugin = function rulePlugin() {
|
|
8
|
+
var rulePlugin = function rulePlugin(_, api) {
|
|
9
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
10
|
+
var 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()) || {};
|
|
9
11
|
return {
|
|
10
12
|
name: 'rule',
|
|
11
13
|
nodes: function nodes() {
|
|
@@ -18,14 +20,13 @@ var rulePlugin = function rulePlugin() {
|
|
|
18
20
|
return [{
|
|
19
21
|
name: 'ruleInputRule',
|
|
20
22
|
plugin: function plugin(_ref) {
|
|
21
|
-
var schema = _ref.schema
|
|
22
|
-
featureFlags = _ref.featureFlags;
|
|
23
|
+
var schema = _ref.schema;
|
|
23
24
|
return inputRulePlugin(schema, featureFlags);
|
|
24
25
|
}
|
|
25
26
|
}, {
|
|
26
27
|
name: 'ruleKeymap',
|
|
27
28
|
plugin: function plugin() {
|
|
28
|
-
return keymapPlugin();
|
|
29
|
+
return keymapPlugin(featureFlags);
|
|
29
30
|
}
|
|
30
31
|
}];
|
|
31
32
|
},
|
|
@@ -4,15 +4,13 @@ import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules'
|
|
|
4
4
|
import { safeInsert } from '../../../utils/insert';
|
|
5
5
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
|
|
7
|
-
|
|
8
|
-
export var createHorizontalRule = function createHorizontalRule(state, start, end, inputMethod) {
|
|
7
|
+
export var createHorizontalRule = function createHorizontalRule(state, featureFlags, start, end, inputMethod) {
|
|
9
8
|
if (!state.selection.empty) {
|
|
10
9
|
return null;
|
|
11
10
|
}
|
|
12
11
|
var tr = null;
|
|
13
12
|
var rule = state.schema.nodes.rule;
|
|
14
|
-
var
|
|
15
|
-
newInsertionBehaviour = _getFeatureFlags.newInsertionBehaviour;
|
|
13
|
+
var newInsertionBehaviour = featureFlags.newInsertionBehaviour;
|
|
16
14
|
if (newInsertionBehaviour) {
|
|
17
15
|
/**
|
|
18
16
|
* This is a workaround to get rid of the typeahead text when using quick insert
|
|
@@ -35,19 +33,19 @@ export var createHorizontalRule = function createHorizontalRule(state, start, en
|
|
|
35
33
|
eventType: EVENT_TYPE.TRACK
|
|
36
34
|
});
|
|
37
35
|
};
|
|
38
|
-
var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(state, start, end) {
|
|
36
|
+
var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(state, featureFlags, start, end) {
|
|
39
37
|
var listItem = state.schema.nodes.listItem;
|
|
40
38
|
if (hasParentNodeOfType(listItem)(state.selection)) {
|
|
41
39
|
return null;
|
|
42
40
|
}
|
|
43
|
-
return createHorizontalRule(state, start, end, INPUT_METHOD.FORMATTING);
|
|
41
|
+
return createHorizontalRule(state, featureFlags, start, end, INPUT_METHOD.FORMATTING);
|
|
44
42
|
};
|
|
45
43
|
export function inputRulePlugin(schema, featureFlags) {
|
|
46
44
|
var rules = [];
|
|
47
45
|
if (schema.nodes.rule) {
|
|
48
46
|
// '---' and '***' for hr
|
|
49
47
|
rules.push(createRule(/^(\-\-\-|\*\*\*)$/, function (state, _match, start, end) {
|
|
50
|
-
return createHorizontalRuleAutoformat(state, start, end);
|
|
48
|
+
return createHorizontalRuleAutoformat(state, featureFlags, start, end);
|
|
51
49
|
}));
|
|
52
50
|
|
|
53
51
|
// '---' and '***' after shift+enter for hr
|
|
@@ -56,7 +54,7 @@ export function inputRulePlugin(schema, featureFlags) {
|
|
|
56
54
|
if (state.doc.resolve(start).nodeAfter.type !== hardBreak) {
|
|
57
55
|
return null;
|
|
58
56
|
}
|
|
59
|
-
return createHorizontalRuleAutoformat(state, start, end);
|
|
57
|
+
return createHorizontalRuleAutoformat(state, featureFlags, start, end);
|
|
60
58
|
}));
|
|
61
59
|
}
|
|
62
60
|
if (rules.length !== 0) {
|
|
@@ -2,9 +2,9 @@ import { keymap } from 'prosemirror-keymap';
|
|
|
2
2
|
import * as keymaps from '../../../keymaps';
|
|
3
3
|
import { INPUT_METHOD } from '../../analytics';
|
|
4
4
|
import { insertHorizontalRule } from '../commands';
|
|
5
|
-
export function keymapPlugin() {
|
|
5
|
+
export function keymapPlugin(featureFlags) {
|
|
6
6
|
var list = {};
|
|
7
|
-
keymaps.bindKeymapWithCommand(keymaps.insertRule.common, insertHorizontalRule(INPUT_METHOD.SHORTCUT), list);
|
|
7
|
+
keymaps.bindKeymapWithCommand(keymaps.insertRule.common, insertHorizontalRule(INPUT_METHOD.SHORTCUT, featureFlags), list);
|
|
8
8
|
keymaps.bindKeymapWithCommand(keymaps.escape.common, function () {
|
|
9
9
|
return true;
|
|
10
10
|
}, list);
|
|
@@ -9,7 +9,9 @@ var pluginConfig = function pluginConfig(textColorConfig) {
|
|
|
9
9
|
}
|
|
10
10
|
return textColorConfig;
|
|
11
11
|
};
|
|
12
|
-
var textColorPlugin = function textColorPlugin(textColorConfig) {
|
|
12
|
+
var textColorPlugin = function textColorPlugin(textColorConfig, api) {
|
|
13
|
+
var _api$dependencies, _api$dependencies$fea;
|
|
14
|
+
var 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()) || {};
|
|
13
15
|
return {
|
|
14
16
|
name: 'textColor',
|
|
15
17
|
marks: function marks() {
|
|
@@ -49,7 +51,8 @@ var textColorPlugin = function textColorPlugin(textColorConfig) {
|
|
|
49
51
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
50
52
|
popupsScrollableElement: popupsScrollableElement,
|
|
51
53
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
52
|
-
disabled: disabled
|
|
54
|
+
disabled: disabled,
|
|
55
|
+
featureFlags: featureFlags
|
|
53
56
|
});
|
|
54
57
|
}
|
|
55
58
|
});
|
|
@@ -26,7 +26,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../
|
|
|
26
26
|
import * as commands from '../../commands/change-color';
|
|
27
27
|
import { EditorTextColorIcon } from './icon';
|
|
28
28
|
import { backgroundDisabled, textColorIconBar, textColorIconWrapper } from './styles';
|
|
29
|
-
import { getFeatureFlags } from '../../../feature-flags-context/get-feature-flags';
|
|
30
29
|
var EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
31
30
|
var EXPERIMENT_GROUP_CONTROL = 'control';
|
|
32
31
|
export var messages = defineMessages({
|
|
@@ -158,11 +157,11 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
158
157
|
isReducedSpacing = _this$props.isReducedSpacing,
|
|
159
158
|
pluginState = _this$props.pluginState,
|
|
160
159
|
formatMessage = _this$props.intl.formatMessage,
|
|
161
|
-
disabled = _this$props.disabled
|
|
160
|
+
disabled = _this$props.disabled,
|
|
161
|
+
featureFlags = _this$props.featureFlags;
|
|
162
162
|
var labelTextColor = formatMessage(messages.textColor);
|
|
163
163
|
var palette = pluginState.palette;
|
|
164
|
-
var
|
|
165
|
-
useSomewhatSemanticTextColorNames = _getFeatureFlags.useSomewhatSemanticTextColorNames;
|
|
164
|
+
var useSomewhatSemanticTextColorNames = featureFlags.useSomewhatSemanticTextColorNames;
|
|
166
165
|
var fitWidth;
|
|
167
166
|
if (document.body.clientWidth <= 740) {
|
|
168
167
|
// This was originally hard-coded, but moved here to a const
|
|
@@ -74,5 +74,15 @@ export var toolbarMessages = defineMessages({
|
|
|
74
74
|
id: 'fabric.editor.text.formatting.off',
|
|
75
75
|
defaultMessage: 'Text formatting Off',
|
|
76
76
|
description: 'Reports that text formatting has been turned off'
|
|
77
|
+
},
|
|
78
|
+
navigateToEditorToolbar: {
|
|
79
|
+
id: 'fabric.editor.navigate.toolbar.editor',
|
|
80
|
+
defaultMessage: 'Navigate to editor toolbar',
|
|
81
|
+
description: 'Navigate to the main editor toolbar.'
|
|
82
|
+
},
|
|
83
|
+
navigateToFloatingToolbar: {
|
|
84
|
+
id: 'fabric.editor.navigate.toolbar.floating',
|
|
85
|
+
defaultMessage: 'Navigate to floating toolbar',
|
|
86
|
+
description: 'Navigate to a floating toolbar for relevant nodes (e.g. tables or panels).'
|
|
77
87
|
}
|
|
78
88
|
});
|
|
@@ -98,6 +98,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
98
98
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
99
99
|
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
100
100
|
}
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
event.stopPropagation();
|
|
101
103
|
};
|
|
102
104
|
return jsx(WithFlash, {
|
|
103
105
|
animate: maxContentSizeReached
|
|
@@ -16,7 +16,6 @@ import { fullPageEditorWrapper } from './StyledComponents';
|
|
|
16
16
|
import { ContextPanelWidthProvider } from '../../ContextPanel/context';
|
|
17
17
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
18
18
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
19
|
-
import { getFeatureFlags } from '../../../plugins/feature-flags-context';
|
|
20
19
|
export var FullPageEditor = /*#__PURE__*/function (_React$Component) {
|
|
21
20
|
_inherits(FullPageEditor, _React$Component);
|
|
22
21
|
var _super = _createSuper(FullPageEditor);
|
|
@@ -63,6 +62,7 @@ export var FullPageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
63
62
|
_defineProperty(_assertThisInitialized(_this), "handleResize", function () {
|
|
64
63
|
_this.updateToolbarKeyline();
|
|
65
64
|
});
|
|
65
|
+
_this.featureFlags = props.featureFlags;
|
|
66
66
|
if (props.innerRef) {
|
|
67
67
|
_this.wrapperElementRef = props.innerRef;
|
|
68
68
|
}
|
|
@@ -82,10 +82,8 @@ export var FullPageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
82
82
|
}, {
|
|
83
83
|
key: "render",
|
|
84
84
|
value: function render() {
|
|
85
|
-
var _props$editorView;
|
|
86
85
|
var props = this.props;
|
|
87
86
|
var showKeyline = this.state.showKeyline;
|
|
88
|
-
var featureFlags = (_props$editorView = props.editorView) !== null && _props$editorView !== void 0 && _props$editorView.state ? getFeatureFlags(props.editorView.state) : undefined;
|
|
89
87
|
return jsx(ContextPanelWidthProvider, null, jsx("div", {
|
|
90
88
|
css: fullPageEditorWrapper,
|
|
91
89
|
className: "akEditor",
|
|
@@ -109,7 +107,7 @@ export var FullPageEditor = /*#__PURE__*/function (_React$Component) {
|
|
|
109
107
|
primaryToolbarComponents: props.primaryToolbarComponents,
|
|
110
108
|
providerFactory: props.providerFactory,
|
|
111
109
|
showKeyline: showKeyline,
|
|
112
|
-
featureFlags: featureFlags
|
|
110
|
+
featureFlags: this.featureFlags
|
|
113
111
|
}), jsx(FullPageContentArea, {
|
|
114
112
|
appearance: props.appearance,
|
|
115
113
|
contentArea: this.contentArea,
|
|
@@ -80,6 +80,8 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
80
80
|
var _props$editorView2;
|
|
81
81
|
(_props$editorView2 = props.editorView) === null || _props$editorView2 === void 0 ? void 0 : _props$editorView2.focus();
|
|
82
82
|
}
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
83
85
|
};
|
|
84
86
|
return jsx(ContextPanelConsumer, null, function (_ref) {
|
|
85
87
|
var _props$featureFlags8, _props$featureFlags9, _props$featureFlags10;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
2
|
-
export { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages };
|
|
1
|
+
import { ColorPalette, backgroundPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
2
|
+
export { ColorPalette, backgroundPaletteTooltipMessages, chartsColorPaletteTooltipMessages, textPaletteTooltipMessages };
|
|
3
3
|
export default ColorPalette;
|
|
@@ -45,7 +45,8 @@ function ConfigForm(_ref) {
|
|
|
45
45
|
onFieldChange = _ref.onFieldChange,
|
|
46
46
|
parameters = _ref.parameters,
|
|
47
47
|
submitting = _ref.submitting,
|
|
48
|
-
contextIdentifierProvider = _ref.contextIdentifierProvider
|
|
48
|
+
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
49
|
+
featureFlags = _ref.featureFlags;
|
|
49
50
|
useEffect(function () {
|
|
50
51
|
if (fields) {
|
|
51
52
|
var firstDuplicateField = findDuplicateFields(fields);
|
|
@@ -68,7 +69,8 @@ function ConfigForm(_ref) {
|
|
|
68
69
|
extensionManifest: extensionManifest,
|
|
69
70
|
onFieldChange: onFieldChange,
|
|
70
71
|
firstVisibleFieldName: firstVisibleFieldName,
|
|
71
|
-
contextIdentifierProvider: contextIdentifierProvider
|
|
72
|
+
contextIdentifierProvider: contextIdentifierProvider,
|
|
73
|
+
featureFlags: featureFlags
|
|
72
74
|
}), /*#__PURE__*/React.createElement("div", {
|
|
73
75
|
style: canSave ? {} : {
|
|
74
76
|
display: 'none'
|
|
@@ -383,16 +385,18 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
383
385
|
key: "render",
|
|
384
386
|
value: function render() {
|
|
385
387
|
var _this2 = this;
|
|
386
|
-
var
|
|
388
|
+
var _this$props6 = this.props,
|
|
389
|
+
extensionManifest = _this$props6.extensionManifest,
|
|
390
|
+
featureFlags = _this$props6.featureFlags;
|
|
387
391
|
if (!extensionManifest) {
|
|
388
392
|
return /*#__PURE__*/React.createElement(LoadingState, null);
|
|
389
393
|
}
|
|
390
|
-
var _this$
|
|
391
|
-
autoSave = _this$
|
|
392
|
-
errorMessage = _this$
|
|
393
|
-
fields = _this$
|
|
394
|
-
isLoading = _this$
|
|
395
|
-
onCancel = _this$
|
|
394
|
+
var _this$props7 = this.props,
|
|
395
|
+
autoSave = _this$props7.autoSave,
|
|
396
|
+
errorMessage = _this$props7.errorMessage,
|
|
397
|
+
fields = _this$props7.fields,
|
|
398
|
+
isLoading = _this$props7.isLoading,
|
|
399
|
+
onCancel = _this$props7.onCancel;
|
|
396
400
|
var _this$state = this.state,
|
|
397
401
|
currentParameters = _this$state.currentParameters,
|
|
398
402
|
hasParsedParameters = _this$state.hasParsedParameters,
|
|
@@ -437,7 +441,8 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
|
437
441
|
onFieldChange: onFieldChange,
|
|
438
442
|
parameters: currentParameters,
|
|
439
443
|
submitting: submitting,
|
|
440
|
-
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider
|
|
444
|
+
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider,
|
|
445
|
+
featureFlags: featureFlags
|
|
441
446
|
}));
|
|
442
447
|
}
|
|
443
448
|
}));
|
|
@@ -75,6 +75,7 @@ export default function FieldsLoader(_ref) {
|
|
|
75
75
|
autoSaveReject = _ref.autoSaveReject,
|
|
76
76
|
closeOnEsc = _ref.closeOnEsc,
|
|
77
77
|
showHeader = _ref.showHeader,
|
|
78
|
+
featureFlags = _ref.featureFlags,
|
|
78
79
|
onChange = _ref.onChange,
|
|
79
80
|
onCancel = _ref.onCancel;
|
|
80
81
|
var _useStateFromPromise = useStateFromPromise(function () {
|
|
@@ -104,7 +105,8 @@ export default function FieldsLoader(_ref) {
|
|
|
104
105
|
showHeader: showHeader,
|
|
105
106
|
onChange: onChange,
|
|
106
107
|
onCancel: onCancel,
|
|
107
|
-
errorMessage: errorMessage
|
|
108
|
+
errorMessage: errorMessage,
|
|
109
|
+
featureFlags: featureFlags
|
|
108
110
|
});
|
|
109
111
|
});
|
|
110
112
|
}
|