@atlaskit/editor-core 187.31.6 → 187.32.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 +42 -0
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +14 -12
- package/dist/cjs/plugins/annotation/index.js +15 -13
- package/dist/cjs/plugins/avatar-group/index.js +16 -14
- package/dist/cjs/plugins/base/plugin.js +12 -10
- package/dist/cjs/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/cjs/plugins/block-type/index.js +32 -30
- package/dist/cjs/plugins/breakout/index.js +10 -8
- package/dist/cjs/plugins/caption/index.js +7 -6
- package/dist/cjs/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/code-bidi-warning/index.js +2 -4
- package/dist/cjs/plugins/code-block/index.js +14 -11
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/cjs/plugins/collab-edit/index.js +16 -14
- package/dist/cjs/plugins/collab-edit/plugin.js +5 -5
- package/dist/cjs/plugins/date/index.js +18 -17
- package/dist/cjs/plugins/emoji/index.js +35 -33
- package/dist/cjs/plugins/expand/index.js +14 -13
- package/dist/cjs/plugins/extension/index.js +16 -15
- package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +11 -2
- package/dist/cjs/plugins/feedback-dialog/index.js +5 -4
- package/dist/cjs/plugins/find-replace/index.js +17 -15
- package/dist/cjs/plugins/floating-toolbar/index.js +31 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/cjs/plugins/help-dialog/index.js +18 -17
- package/dist/cjs/plugins/insert-block/index.js +52 -51
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/cjs/plugins/layout/index.js +15 -14
- package/dist/cjs/plugins/max-content-size/index.js +4 -3
- package/dist/cjs/plugins/media/index.js +49 -47
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +7 -7
- package/dist/cjs/plugins/media/toolbar/index.js +29 -24
- package/dist/cjs/plugins/media/toolbar/linking.js +4 -4
- package/dist/cjs/plugins/media/toolbar/utils.js +22 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/cjs/plugins/mentions/index.js +17 -15
- package/dist/cjs/plugins/panel/index.js +13 -12
- package/dist/cjs/plugins/paste/index.js +13 -10
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/cjs/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/cjs/plugins/placeholder/index.js +9 -7
- package/dist/cjs/plugins/placeholder-text/index.js +23 -16
- package/dist/cjs/plugins/quick-insert/index.js +13 -12
- package/dist/cjs/plugins/rule/index.js +8 -7
- package/dist/cjs/plugins/save-on-enter/index.js +4 -3
- package/dist/cjs/plugins/selection/index.js +5 -4
- package/dist/cjs/plugins/status/index.js +20 -14
- package/dist/cjs/plugins/submit-editor/index.js +4 -3
- package/dist/cjs/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/cjs/plugins/text-color/index.js +17 -15
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/cjs/plugins/type-ahead/index.js +21 -20
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/plugins/analytics/plugin.js +11 -8
- package/dist/es2019/plugins/annotation/index.js +4 -1
- package/dist/es2019/plugins/avatar-group/index.js +8 -5
- package/dist/es2019/plugins/base/plugin.js +6 -3
- package/dist/es2019/plugins/before-primaryToolbar/index.js +4 -2
- package/dist/es2019/plugins/block-type/index.js +14 -11
- package/dist/es2019/plugins/breakout/index.js +6 -3
- package/dist/es2019/plugins/caption/index.js +3 -1
- package/dist/es2019/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/code-bidi-warning/index.js +2 -4
- package/dist/es2019/plugins/code-block/index.js +15 -9
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/es2019/plugins/collab-edit/index.js +9 -6
- package/dist/es2019/plugins/collab-edit/plugin.js +5 -5
- package/dist/es2019/plugins/date/index.js +6 -3
- package/dist/es2019/plugins/emoji/index.js +16 -13
- package/dist/es2019/plugins/expand/index.js +7 -4
- package/dist/es2019/plugins/extension/index.js +11 -8
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +13 -2
- package/dist/es2019/plugins/feedback-dialog/index.js +4 -2
- package/dist/es2019/plugins/find-replace/index.js +8 -5
- package/dist/es2019/plugins/floating-toolbar/index.js +6 -4
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/es2019/plugins/help-dialog/index.js +9 -6
- package/dist/es2019/plugins/insert-block/index.js +12 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/es2019/plugins/layout/index.js +8 -5
- package/dist/es2019/plugins/max-content-size/index.js +3 -1
- package/dist/es2019/plugins/media/index.js +14 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -7
- package/dist/es2019/plugins/media/toolbar/index.js +29 -25
- package/dist/es2019/plugins/media/toolbar/linking.js +4 -4
- package/dist/es2019/plugins/media/toolbar/utils.js +18 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/es2019/plugins/mentions/index.js +9 -6
- package/dist/es2019/plugins/panel/index.js +5 -2
- package/dist/es2019/plugins/paste/index.js +9 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/es2019/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/es2019/plugins/placeholder/index.js +10 -7
- package/dist/es2019/plugins/placeholder-text/index.js +12 -4
- package/dist/es2019/plugins/quick-insert/index.js +3 -1
- package/dist/es2019/plugins/rule/index.js +5 -3
- package/dist/es2019/plugins/save-on-enter/index.js +3 -1
- package/dist/es2019/plugins/selection/index.js +3 -1
- package/dist/es2019/plugins/status/index.js +11 -3
- package/dist/es2019/plugins/submit-editor/index.js +3 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +6 -4
- package/dist/es2019/plugins/text-color/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +9 -5
- package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/es2019/plugins/type-ahead/index.js +3 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -1
- package/dist/es2019/use-preset.js +2 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/plugins/analytics/plugin.js +14 -12
- package/dist/esm/plugins/annotation/index.js +15 -13
- package/dist/esm/plugins/avatar-group/index.js +16 -14
- package/dist/esm/plugins/base/plugin.js +12 -10
- package/dist/esm/plugins/before-primaryToolbar/index.js +3 -2
- package/dist/esm/plugins/block-type/index.js +32 -30
- package/dist/esm/plugins/breakout/index.js +10 -8
- package/dist/esm/plugins/caption/index.js +7 -6
- package/dist/esm/plugins/caption/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/code-bidi-warning/index.js +2 -4
- package/dist/esm/plugins/code-block/index.js +14 -11
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -2
- package/dist/esm/plugins/collab-edit/index.js +16 -14
- package/dist/esm/plugins/collab-edit/plugin.js +5 -5
- package/dist/esm/plugins/date/index.js +18 -17
- package/dist/esm/plugins/emoji/index.js +35 -33
- package/dist/esm/plugins/expand/index.js +14 -13
- package/dist/esm/plugins/extension/index.js +16 -15
- package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +11 -2
- package/dist/esm/plugins/feedback-dialog/index.js +5 -4
- package/dist/esm/plugins/find-replace/index.js +17 -15
- package/dist/esm/plugins/floating-toolbar/index.js +31 -30
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +3 -3
- package/dist/esm/plugins/help-dialog/index.js +18 -17
- package/dist/esm/plugins/insert-block/index.js +52 -51
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +11 -11
- package/dist/esm/plugins/layout/index.js +15 -14
- package/dist/esm/plugins/max-content-size/index.js +4 -3
- package/dist/esm/plugins/media/index.js +49 -47
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -7
- package/dist/esm/plugins/media/toolbar/index.js +30 -25
- package/dist/esm/plugins/media/toolbar/linking.js +4 -4
- package/dist/esm/plugins/media/toolbar/utils.js +19 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -4
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -2
- package/dist/esm/plugins/mentions/index.js +17 -15
- package/dist/esm/plugins/panel/index.js +13 -12
- package/dist/esm/plugins/paste/index.js +13 -10
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +8 -8
- package/dist/esm/plugins/paste/pm-plugins/main.js +10 -10
- package/dist/esm/plugins/placeholder/index.js +9 -7
- package/dist/esm/plugins/placeholder-text/index.js +23 -16
- package/dist/esm/plugins/quick-insert/index.js +13 -12
- package/dist/esm/plugins/rule/index.js +8 -7
- package/dist/esm/plugins/save-on-enter/index.js +4 -3
- package/dist/esm/plugins/selection/index.js +5 -4
- package/dist/esm/plugins/status/index.js +20 -14
- package/dist/esm/plugins/submit-editor/index.js +4 -3
- package/dist/esm/plugins/tasks-and-decisions/index.js +6 -5
- package/dist/esm/plugins/text-color/index.js +17 -15
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +31 -26
- package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +1 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -4
- package/dist/esm/plugins/type-ahead/index.js +21 -20
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +11 -11
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +2 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +62 -618
- package/dist/types/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types/plugins/caption/index.d.ts +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types/plugins/media/types.d.ts +1 -0
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/use-preset.d.ts +2 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +96 -716
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/before-primaryToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/selection/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/text-color/index.d.ts +3 -2
- package/dist/types-ts4.5/use-preset.d.ts +2 -2
- package/package.json +4 -4
|
@@ -18,9 +18,10 @@ var _blockType = require("../block-type/commands/block-type");
|
|
|
18
18
|
// Theres an existing interelationship between these files, where the imported function is being called for panel
|
|
19
19
|
// Insertions via the drop down menu
|
|
20
20
|
// tslint-ignore-next-line
|
|
21
|
-
var panelPlugin = function panelPlugin() {
|
|
22
|
-
var
|
|
23
|
-
|
|
21
|
+
var panelPlugin = function panelPlugin(_ref) {
|
|
22
|
+
var _ref$config = _ref.config,
|
|
23
|
+
options = _ref$config === void 0 ? {} : _ref$config,
|
|
24
|
+
api = _ref.api;
|
|
24
25
|
return {
|
|
25
26
|
name: 'panel',
|
|
26
27
|
nodes: function nodes() {
|
|
@@ -33,9 +34,9 @@ var panelPlugin = function panelPlugin() {
|
|
|
33
34
|
pmPlugins: function pmPlugins() {
|
|
34
35
|
return [{
|
|
35
36
|
name: 'panel',
|
|
36
|
-
plugin: function plugin(
|
|
37
|
-
var providerFactory =
|
|
38
|
-
dispatch =
|
|
37
|
+
plugin: function plugin(_ref2) {
|
|
38
|
+
var providerFactory = _ref2.providerFactory,
|
|
39
|
+
dispatch = _ref2.dispatch;
|
|
39
40
|
return (0, _main.createPlugin)(dispatch, providerFactory, options);
|
|
40
41
|
}
|
|
41
42
|
}, {
|
|
@@ -46,8 +47,8 @@ var panelPlugin = function panelPlugin() {
|
|
|
46
47
|
}];
|
|
47
48
|
},
|
|
48
49
|
pluginsOptions: {
|
|
49
|
-
quickInsert: function quickInsert(
|
|
50
|
-
var formatMessage =
|
|
50
|
+
quickInsert: function quickInsert(_ref3) {
|
|
51
|
+
var formatMessage = _ref3.formatMessage;
|
|
51
52
|
var quickInsertOptions = [{
|
|
52
53
|
id: 'infopanel',
|
|
53
54
|
title: formatMessage(_messages.messages.infoPanel),
|
|
@@ -159,7 +160,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
159
160
|
return quickInsertOptions;
|
|
160
161
|
},
|
|
161
162
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
162
|
-
return (0, _toolbar.getToolbarConfig)(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.
|
|
163
|
+
return (0, _toolbar.getToolbarConfig)(state, intl, options, providerFactory, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
};
|
|
@@ -177,9 +178,9 @@ var panelPlugin = function panelPlugin() {
|
|
|
177
178
|
* applyTransaction(tr);
|
|
178
179
|
* }
|
|
179
180
|
*/
|
|
180
|
-
function createPanelAction(
|
|
181
|
-
var state =
|
|
182
|
-
attributes =
|
|
181
|
+
function createPanelAction(_ref4) {
|
|
182
|
+
var state = _ref4.state,
|
|
183
|
+
attributes = _ref4.attributes;
|
|
183
184
|
var tr = (0, _blockType.createWrapSelectionTransaction)({
|
|
184
185
|
state: state,
|
|
185
186
|
type: state.schema.nodes.panel,
|
|
@@ -5,21 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _main = require("./pm-plugins/main");
|
|
8
|
-
var pastePlugin = function pastePlugin(_ref
|
|
9
|
-
var _api$
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
var
|
|
8
|
+
var pastePlugin = function pastePlugin(_ref) {
|
|
9
|
+
var _api$featureFlags;
|
|
10
|
+
var config = _ref.config,
|
|
11
|
+
api = _ref.api;
|
|
12
|
+
var _ref2 = config !== null && config !== void 0 ? config : {},
|
|
13
|
+
cardOptions = _ref2.cardOptions,
|
|
14
|
+
sanitizePrivateContent = _ref2.sanitizePrivateContent;
|
|
15
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
13
16
|
return {
|
|
14
17
|
name: 'paste',
|
|
15
18
|
pmPlugins: function pmPlugins() {
|
|
16
19
|
return [{
|
|
17
20
|
name: 'paste',
|
|
18
|
-
plugin: function plugin(
|
|
19
|
-
var schema =
|
|
20
|
-
providerFactory =
|
|
21
|
-
dispatchAnalyticsEvent =
|
|
22
|
-
dispatch =
|
|
21
|
+
plugin: function plugin(_ref3) {
|
|
22
|
+
var schema = _ref3.schema,
|
|
23
|
+
providerFactory = _ref3.providerFactory,
|
|
24
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
25
|
+
dispatch = _ref3.dispatch;
|
|
23
26
|
return (0, _main.createPlugin)(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
|
|
24
27
|
}
|
|
25
28
|
}];
|
|
@@ -239,10 +239,10 @@ var handlePasteAsPlainTextWithAnalytics = function handlePasteAsPlainTextWithAna
|
|
|
239
239
|
};
|
|
240
240
|
exports.handlePasteAsPlainTextWithAnalytics = handlePasteAsPlainTextWithAnalytics;
|
|
241
241
|
var handlePasteIntoTaskAndDecisionWithAnalytics = function handlePasteIntoTaskAndDecisionWithAnalytics(view, event, slice, type, pluginInjectionApi) {
|
|
242
|
-
var _pluginInjectionApi$
|
|
242
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$c2;
|
|
243
243
|
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
244
244
|
type: type
|
|
245
|
-
}))((0, _handlers.handlePasteIntoTaskOrDecisionOrPanel)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
245
|
+
}))((0, _handlers.handlePasteIntoTaskOrDecisionOrPanel)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr));
|
|
246
246
|
};
|
|
247
247
|
exports.handlePasteIntoTaskAndDecisionWithAnalytics = handlePasteIntoTaskAndDecisionWithAnalytics;
|
|
248
248
|
var handlePasteIntoCaptionWithAnalytics = function handlePasteIntoCaptionWithAnalytics(view, event, slice, type) {
|
|
@@ -264,24 +264,24 @@ var handleMediaSingleWithAnalytics = function handleMediaSingleWithAnalytics(vie
|
|
|
264
264
|
};
|
|
265
265
|
exports.handleMediaSingleWithAnalytics = handleMediaSingleWithAnalytics;
|
|
266
266
|
var handlePastePreservingMarksWithAnalytics = function handlePastePreservingMarksWithAnalytics(view, event, slice, type, pluginInjectionApi) {
|
|
267
|
-
var _pluginInjectionApi$
|
|
267
|
+
var _pluginInjectionApi$c3, _pluginInjectionApi$c4;
|
|
268
268
|
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
269
269
|
type: type
|
|
270
|
-
}))((0, _handlers.handlePastePreservingMarks)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
270
|
+
}))((0, _handlers.handlePastePreservingMarks)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr));
|
|
271
271
|
};
|
|
272
272
|
exports.handlePastePreservingMarksWithAnalytics = handlePastePreservingMarksWithAnalytics;
|
|
273
273
|
var handleMarkdownWithAnalytics = function handleMarkdownWithAnalytics(view, event, slice, pluginInjectionApi) {
|
|
274
|
-
var _pluginInjectionApi$
|
|
274
|
+
var _pluginInjectionApi$c5, _pluginInjectionApi$c6;
|
|
275
275
|
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
276
276
|
type: _analytics.PasteTypes.markdown
|
|
277
|
-
}))((0, _handlers.handleMarkdown)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
277
|
+
}))((0, _handlers.handleMarkdown)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c5 = pluginInjectionApi.card) === null || _pluginInjectionApi$c5 === void 0 ? void 0 : (_pluginInjectionApi$c6 = _pluginInjectionApi$c5.actions) === null || _pluginInjectionApi$c6 === void 0 ? void 0 : _pluginInjectionApi$c6.queueCardsFromChangedTr));
|
|
278
278
|
};
|
|
279
279
|
exports.handleMarkdownWithAnalytics = handleMarkdownWithAnalytics;
|
|
280
280
|
var handleRichTextWithAnalytics = function handleRichTextWithAnalytics(view, event, slice, pluginInjectionApi) {
|
|
281
|
-
var _pluginInjectionApi$
|
|
281
|
+
var _pluginInjectionApi$c7, _pluginInjectionApi$c8;
|
|
282
282
|
return injectAnalyticsPayloadBeforeCommand(createPasteAnalyticsPayloadBySelection(event, slice, {
|
|
283
283
|
type: _analytics.PasteTypes.richText
|
|
284
|
-
}))((0, _handlers.handleRichText)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
284
|
+
}))((0, _handlers.handleRichText)(slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c7 = pluginInjectionApi.card) === null || _pluginInjectionApi$c7 === void 0 ? void 0 : (_pluginInjectionApi$c8 = _pluginInjectionApi$c7.actions) === null || _pluginInjectionApi$c8 === void 0 ? void 0 : _pluginInjectionApi$c8.queueCardsFromChangedTr));
|
|
285
285
|
};
|
|
286
286
|
exports.handleRichTextWithAnalytics = handleRichTextWithAnalytics;
|
|
287
287
|
function injectAnalyticsPayloadBeforeCommand(createPayloadByTransaction) {
|
|
@@ -112,7 +112,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
handlePaste: function handlePaste(view, rawEvent, slice) {
|
|
115
|
-
var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$
|
|
115
|
+
var _text, _analyticsPlugin$perf, _analyticsPlugin$perf2, _schema$nodes, _schema$nodes2, _schema$nodes3, _pluginInjectionApi$a;
|
|
116
116
|
var event = rawEvent;
|
|
117
117
|
if (!event.clipboardData) {
|
|
118
118
|
return false;
|
|
@@ -207,9 +207,9 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
207
207
|
});
|
|
208
208
|
return tableExists;
|
|
209
209
|
});
|
|
210
|
-
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.
|
|
211
|
-
var _pluginInjectionApi$
|
|
212
|
-
tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
210
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.betterTypeHistory) {
|
|
211
|
+
var _pluginInjectionApi$b;
|
|
212
|
+
tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$b = pluginInjectionApi.betterTypeHistory) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.flagPasteEvent(tr);
|
|
213
213
|
}
|
|
214
214
|
(0, _card.addLinkMetadata)(view.state.selection, tr, {
|
|
215
215
|
action: isPlainText ? _analytics2.ACTION.PASTED_AS_PLAIN : _analytics2.ACTION.PASTED,
|
|
@@ -237,14 +237,14 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
237
237
|
// force a "paste as plain text" action by clearing the markdownSlice.
|
|
238
238
|
markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
|
|
239
239
|
if (markdownSlice) {
|
|
240
|
-
var _pluginInjectionApi$
|
|
240
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$c2;
|
|
241
241
|
// linkify text prior to converting to macro
|
|
242
242
|
if ((0, _analytics.handlePasteLinkOnSelectedTextWithAnalytics)(view, event, markdownSlice, _analytics2.PasteTypes.markdown)(state, dispatch)) {
|
|
243
243
|
return true;
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
// run macro autoconvert prior to other conversions
|
|
247
|
-
if ((0, _handlers.handleMacroAutoConvert)(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
247
|
+
if ((0, _handlers.handleMacroAutoConvert)(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 ? void 0 : (_pluginInjectionApi$c2 = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
248
248
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
249
249
|
(0, _analytics.sendPasteAnalyticsEvent)(view, event, markdownSlice, {
|
|
250
250
|
type: _analytics2.PasteTypes.markdown
|
|
@@ -276,7 +276,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
276
276
|
if ((0, _analytics.handleCodeBlockWithAnalytics)(view, event, slice, text)(state, dispatch)) {
|
|
277
277
|
return true;
|
|
278
278
|
}
|
|
279
|
-
if ((0, _analytics.handleMediaSingleWithAnalytics)(view, event, slice, isPastedFile ? _analytics2.PasteTypes.binary : _analytics2.PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
279
|
+
if ((0, _analytics.handleMediaSingleWithAnalytics)(view, event, slice, isPastedFile ? _analytics2.PasteTypes.binary : _analytics2.PasteTypes.richText, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions)(state, dispatch, view)) {
|
|
280
280
|
return true;
|
|
281
281
|
}
|
|
282
282
|
if ((0, _analytics.handleSelectedTableWithAnalytics)(view, event, slice)(state, dispatch)) {
|
|
@@ -309,7 +309,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
309
309
|
|
|
310
310
|
// finally, handle rich-text copy-paste
|
|
311
311
|
if (isRichText) {
|
|
312
|
-
var _pluginInjectionApi$
|
|
312
|
+
var _pluginInjectionApi$c3, _pluginInjectionApi$c4, _pluginInjectionApi$l;
|
|
313
313
|
// linkify the text where possible
|
|
314
314
|
slice = (0, _utils.linkifyContent)(state.schema)(slice);
|
|
315
315
|
if ((0, _analytics.handlePasteLinkOnSelectedTextWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
|
|
@@ -317,7 +317,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
// run macro autoconvert prior to other conversions
|
|
320
|
-
if ((0, _handlers.handleMacroAutoConvert)(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
320
|
+
if ((0, _handlers.handleMacroAutoConvert)(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.actions) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
321
321
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
322
322
|
(0, _analytics.sendPasteAnalyticsEvent)(view, event, slice, {
|
|
323
323
|
type: _analytics2.PasteTypes.richText
|
|
@@ -374,7 +374,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
374
374
|
if ((0, _analytics.handlePasteIntoCaptionWithAnalytics)(view, event, slice, _analytics2.PasteTypes.richText)(state, dispatch)) {
|
|
375
375
|
return true;
|
|
376
376
|
}
|
|
377
|
-
if ((0, _analytics.handlePastePanelOrDecisionIntoListWithAnalytics)(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
377
|
+
if ((0, _analytics.handlePastePanelOrDecisionIntoListWithAnalytics)(view, event, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.list) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.findRootParentListNode)(state, dispatch)) {
|
|
378
378
|
return true;
|
|
379
379
|
}
|
|
380
380
|
if (featureFlags !== null && featureFlags !== void 0 && featureFlags.restartNumberedLists && (0, _analytics.handlePasteNonNestableBlockNodesIntoListWithAnalytics)(view, event, slice)(state, dispatch)) {
|
|
@@ -83,13 +83,13 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
83
83
|
key: pluginKey,
|
|
84
84
|
state: {
|
|
85
85
|
init: function init(_, state) {
|
|
86
|
-
var _api$
|
|
87
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
86
|
+
var _api$focus, _api$focus$sharedStat;
|
|
87
|
+
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$focus = api.focus) === null || _api$focus === void 0 ? void 0 : (_api$focus$sharedStat = _api$focus.sharedState.currentState()) === null || _api$focus$sharedStat === void 0 ? void 0 : _api$focus$sharedStat.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
|
|
88
88
|
},
|
|
89
89
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
90
|
-
var _api$
|
|
90
|
+
var _api$focus2, _api$focus2$sharedSta;
|
|
91
91
|
var meta = tr.getMeta(pluginKey);
|
|
92
|
-
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$
|
|
92
|
+
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$focus2 = api.focus) === null || _api$focus2 === void 0 ? void 0 : (_api$focus2$sharedSta = _api$focus2.sharedState.currentState()) === null || _api$focus2$sharedSta === void 0 ? void 0 : _api$focus2$sharedSta.hasFocus);
|
|
93
93
|
if (meta) {
|
|
94
94
|
if (meta.removePlaceholder) {
|
|
95
95
|
return emptyPlaceholder;
|
|
@@ -103,12 +103,12 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
103
103
|
},
|
|
104
104
|
props: {
|
|
105
105
|
decorations: function decorations(editorState) {
|
|
106
|
-
var _api$
|
|
106
|
+
var _api$composition;
|
|
107
107
|
var _getPlaceholderState = getPlaceholderState(editorState),
|
|
108
108
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
109
109
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
110
110
|
pos = _getPlaceholderState.pos;
|
|
111
|
-
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$
|
|
111
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$composition = api.composition) === null || _api$composition === void 0 ? void 0 : _api$composition.sharedState.currentState();
|
|
112
112
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
113
113
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
114
114
|
}
|
|
@@ -117,7 +117,9 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
var placeholderPlugin = function placeholderPlugin(
|
|
120
|
+
var placeholderPlugin = function placeholderPlugin(_ref) {
|
|
121
|
+
var options = _ref.config,
|
|
122
|
+
api = _ref.api;
|
|
121
123
|
return {
|
|
122
124
|
name: 'placeholder',
|
|
123
125
|
pmPlugins: function pmPlugins() {
|
|
@@ -131,7 +131,8 @@ function createPlugin(dispatch, options) {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(
|
|
134
|
+
var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(_ref) {
|
|
135
|
+
var options = _ref.config;
|
|
135
136
|
return {
|
|
136
137
|
name: 'placeholderText',
|
|
137
138
|
nodes: function nodes() {
|
|
@@ -143,16 +144,16 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
143
144
|
pmPlugins: function pmPlugins() {
|
|
144
145
|
return [{
|
|
145
146
|
name: 'placeholderText',
|
|
146
|
-
plugin: function plugin(
|
|
147
|
-
var dispatch =
|
|
147
|
+
plugin: function plugin(_ref2) {
|
|
148
|
+
var dispatch = _ref2.dispatch;
|
|
148
149
|
return createPlugin(dispatch, options);
|
|
149
150
|
}
|
|
150
151
|
}];
|
|
151
152
|
},
|
|
152
|
-
contentComponent: function contentComponent(
|
|
153
|
-
var editorView =
|
|
154
|
-
popupsMountPoint =
|
|
155
|
-
popupsBoundariesElement =
|
|
153
|
+
contentComponent: function contentComponent(_ref3) {
|
|
154
|
+
var editorView = _ref3.editorView,
|
|
155
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
156
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement;
|
|
156
157
|
var insertPlaceholderText = function insertPlaceholderText(value) {
|
|
157
158
|
return (0, _actions.insertPlaceholderTextAtSelection)(value)(editorView.state, editorView.dispatch);
|
|
158
159
|
};
|
|
@@ -172,9 +173,9 @@ var basePlaceholderTextPlugin = function basePlaceholderTextPlugin(options) {
|
|
|
172
173
|
plugins: {
|
|
173
174
|
placeholderTextState: _pluginKey.pluginKey
|
|
174
175
|
},
|
|
175
|
-
render: function render(
|
|
176
|
-
var
|
|
177
|
-
placeholderTextState =
|
|
176
|
+
render: function render(_ref4) {
|
|
177
|
+
var _ref4$placeholderText = _ref4.placeholderTextState,
|
|
178
|
+
placeholderTextState = _ref4$placeholderText === void 0 ? {} : _ref4$placeholderText;
|
|
178
179
|
if (placeholderTextState.showInsertPanelAt) {
|
|
179
180
|
return /*#__PURE__*/_react.default.createElement(_PlaceholderFloatingToolbar.default, {
|
|
180
181
|
editorViewDOM: editorView.dom,
|
|
@@ -199,8 +200,8 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
199
200
|
return plugin;
|
|
200
201
|
}
|
|
201
202
|
plugin.pluginsOptions = {
|
|
202
|
-
quickInsert: function quickInsert(
|
|
203
|
-
var formatMessage =
|
|
203
|
+
quickInsert: function quickInsert(_ref5) {
|
|
204
|
+
var formatMessage = _ref5.formatMessage;
|
|
204
205
|
return [{
|
|
205
206
|
id: 'placeholderText',
|
|
206
207
|
title: formatMessage(_messages.messages.placeholderText),
|
|
@@ -213,12 +214,12 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
213
214
|
});
|
|
214
215
|
},
|
|
215
216
|
action: function action(insert, state) {
|
|
216
|
-
var _api$
|
|
217
|
+
var _api$analytics;
|
|
217
218
|
var tr = state.tr;
|
|
218
219
|
tr.setMeta(_pluginKey.pluginKey, {
|
|
219
220
|
showInsertPanelAt: tr.selection.anchor
|
|
220
221
|
});
|
|
221
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
222
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
|
|
222
223
|
action: _analytics.ACTION.INSERTED,
|
|
223
224
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
224
225
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PLACEHOLDER_TEXT,
|
|
@@ -234,8 +235,14 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
234
235
|
};
|
|
235
236
|
return plugin;
|
|
236
237
|
};
|
|
237
|
-
var placeholderTextPlugin = function placeholderTextPlugin(
|
|
238
|
-
|
|
238
|
+
var placeholderTextPlugin = function placeholderTextPlugin(_ref6) {
|
|
239
|
+
var _ref6$config = _ref6.config,
|
|
240
|
+
options = _ref6$config === void 0 ? {} : _ref6$config,
|
|
241
|
+
api = _ref6.api;
|
|
242
|
+
return decorateWithPluginOptions(basePlaceholderTextPlugin({
|
|
243
|
+
config: options,
|
|
244
|
+
api: api
|
|
245
|
+
}), options, api);
|
|
239
246
|
};
|
|
240
247
|
var _default = placeholderTextPlugin;
|
|
241
248
|
exports.default = _default;
|
|
@@ -18,17 +18,18 @@ var _commands = require("./commands");
|
|
|
18
18
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
19
19
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
20
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
var quickInsertPlugin = function quickInsertPlugin(
|
|
21
|
+
var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
22
|
+
var options = _ref.config;
|
|
22
23
|
return {
|
|
23
24
|
name: 'quickInsert',
|
|
24
25
|
pmPlugins: function pmPlugins(defaultItems) {
|
|
25
26
|
return [{
|
|
26
27
|
name: 'quickInsert',
|
|
27
28
|
// It's important that this plugin is above TypeAheadPlugin
|
|
28
|
-
plugin: function plugin(
|
|
29
|
-
var providerFactory =
|
|
30
|
-
getIntl =
|
|
31
|
-
dispatch =
|
|
29
|
+
plugin: function plugin(_ref2) {
|
|
30
|
+
var providerFactory = _ref2.providerFactory,
|
|
31
|
+
getIntl = _ref2.getIntl,
|
|
32
|
+
dispatch = _ref2.dispatch;
|
|
32
33
|
return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
33
34
|
}
|
|
34
35
|
}];
|
|
@@ -38,9 +39,9 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
38
39
|
id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
|
|
39
40
|
trigger: '/',
|
|
40
41
|
headless: options === null || options === void 0 ? void 0 : options.headless,
|
|
41
|
-
getItems: function getItems(
|
|
42
|
-
var query =
|
|
43
|
-
editorState =
|
|
42
|
+
getItems: function getItems(_ref3) {
|
|
43
|
+
var query = _ref3.query,
|
|
44
|
+
editorState = _ref3.editorState;
|
|
44
45
|
var quickInsertState = _pluginKey.pluginKey.getState(editorState);
|
|
45
46
|
return Promise.resolve((0, _quickInsert.getQuickInsertSuggestions)({
|
|
46
47
|
searchOptions: {
|
|
@@ -56,8 +57,8 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
|
-
contentComponent: function contentComponent(
|
|
60
|
-
var editorView =
|
|
60
|
+
contentComponent: function contentComponent(_ref4) {
|
|
61
|
+
var editorView = _ref4.editorView;
|
|
61
62
|
if (options !== null && options !== void 0 && options.enableElementBrowser) {
|
|
62
63
|
return /*#__PURE__*/_react.default.createElement(_ModalElementBrowser.default, {
|
|
63
64
|
editorView: editorView,
|
|
@@ -142,7 +143,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
142
143
|
},
|
|
143
144
|
view: function view(editorView) {
|
|
144
145
|
var providerHandler = /*#__PURE__*/function () {
|
|
145
|
-
var
|
|
146
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
|
|
146
147
|
var provider, providedItems;
|
|
147
148
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
148
149
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -178,7 +179,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
178
179
|
}, _callee, null, [[1, 11]]);
|
|
179
180
|
}));
|
|
180
181
|
return function providerHandler(_x, _x2) {
|
|
181
|
-
return
|
|
182
|
+
return _ref5.apply(this, arguments);
|
|
182
183
|
};
|
|
183
184
|
}();
|
|
184
185
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
@@ -12,9 +12,10 @@ var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
|
12
12
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
13
13
|
var _inputRule = _interopRequireDefault(require("./pm-plugins/input-rule"));
|
|
14
14
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
15
|
-
var rulePlugin = function rulePlugin(
|
|
16
|
-
var _api$
|
|
17
|
-
var
|
|
15
|
+
var rulePlugin = function rulePlugin(_ref) {
|
|
16
|
+
var _api$featureFlags;
|
|
17
|
+
var api = _ref.api;
|
|
18
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
18
19
|
return {
|
|
19
20
|
name: 'rule',
|
|
20
21
|
nodes: function nodes() {
|
|
@@ -26,8 +27,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
26
27
|
pmPlugins: function pmPlugins() {
|
|
27
28
|
return [{
|
|
28
29
|
name: 'ruleInputRule',
|
|
29
|
-
plugin: function plugin(
|
|
30
|
-
var schema =
|
|
30
|
+
plugin: function plugin(_ref2) {
|
|
31
|
+
var schema = _ref2.schema;
|
|
31
32
|
return (0, _inputRule.default)(schema, featureFlags);
|
|
32
33
|
}
|
|
33
34
|
}, {
|
|
@@ -38,8 +39,8 @@ var rulePlugin = function rulePlugin(_, api) {
|
|
|
38
39
|
}];
|
|
39
40
|
},
|
|
40
41
|
pluginsOptions: {
|
|
41
|
-
quickInsert: function quickInsert(
|
|
42
|
-
var formatMessage =
|
|
42
|
+
quickInsert: function quickInsert(_ref3) {
|
|
43
|
+
var formatMessage = _ref3.formatMessage;
|
|
43
44
|
return [{
|
|
44
45
|
id: 'rule',
|
|
45
46
|
title: formatMessage(_messages.messages.horizontalRule),
|
|
@@ -52,14 +52,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
var saveOnEnterPlugin = function saveOnEnterPlugin(
|
|
55
|
+
var saveOnEnterPlugin = function saveOnEnterPlugin(_ref2) {
|
|
56
|
+
var onSave = _ref2.config;
|
|
56
57
|
return {
|
|
57
58
|
name: 'saveOnEnter',
|
|
58
59
|
pmPlugins: function pmPlugins() {
|
|
59
60
|
return [{
|
|
60
61
|
name: 'saveOnEnter',
|
|
61
|
-
plugin: function plugin(
|
|
62
|
-
var dispatch =
|
|
62
|
+
plugin: function plugin(_ref3) {
|
|
63
|
+
var dispatch = _ref3.dispatch;
|
|
63
64
|
return createPlugin(dispatch, onSave);
|
|
64
65
|
}
|
|
65
66
|
}];
|
|
@@ -9,15 +9,16 @@ var _selectionMain = require("./pm-plugins/selection-main");
|
|
|
9
9
|
var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
|
|
10
10
|
var _gapCursorMain = _interopRequireDefault(require("./pm-plugins/gap-cursor-main"));
|
|
11
11
|
var _gapCursorKeymap = _interopRequireDefault(require("./pm-plugins/gap-cursor-keymap"));
|
|
12
|
-
var selectionPlugin = function selectionPlugin(
|
|
12
|
+
var selectionPlugin = function selectionPlugin(_ref) {
|
|
13
|
+
var options = _ref.config;
|
|
13
14
|
return {
|
|
14
15
|
name: 'selection',
|
|
15
16
|
pmPlugins: function pmPlugins() {
|
|
16
17
|
return [{
|
|
17
18
|
name: 'selection',
|
|
18
|
-
plugin: function plugin(
|
|
19
|
-
var dispatch =
|
|
20
|
-
dispatchAnalyticsEvent =
|
|
19
|
+
plugin: function plugin(_ref2) {
|
|
20
|
+
var dispatch = _ref2.dispatch,
|
|
21
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
21
22
|
return (0, _selectionMain.createPlugin)(dispatch, dispatchAnalyticsEvent, options);
|
|
22
23
|
}
|
|
23
24
|
}, {
|
|
@@ -17,7 +17,8 @@ var _keymap = require("./keymap");
|
|
|
17
17
|
var _plugin = _interopRequireDefault(require("./plugin"));
|
|
18
18
|
var _pluginKey = require("./plugin-key");
|
|
19
19
|
var _statusPicker = _interopRequireDefault(require("./ui/statusPicker"));
|
|
20
|
-
var baseStatusPlugin = function baseStatusPlugin(
|
|
20
|
+
var baseStatusPlugin = function baseStatusPlugin(_ref) {
|
|
21
|
+
var options = _ref.config;
|
|
21
22
|
return {
|
|
22
23
|
name: 'status',
|
|
23
24
|
nodes: function nodes() {
|
|
@@ -37,19 +38,19 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
37
38
|
plugin: _keymap.keymapPlugin
|
|
38
39
|
}];
|
|
39
40
|
},
|
|
40
|
-
contentComponent: function contentComponent(
|
|
41
|
-
var editorView =
|
|
42
|
-
popupsMountPoint =
|
|
43
|
-
popupsBoundariesElement =
|
|
44
|
-
popupsScrollableElement =
|
|
41
|
+
contentComponent: function contentComponent(_ref2) {
|
|
42
|
+
var editorView = _ref2.editorView,
|
|
43
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
44
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
45
|
+
popupsScrollableElement = _ref2.popupsScrollableElement;
|
|
45
46
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
46
47
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
47
48
|
plugins: {
|
|
48
49
|
statusState: _pluginKey.pluginKey
|
|
49
50
|
},
|
|
50
|
-
render: function render(
|
|
51
|
-
var
|
|
52
|
-
statusState =
|
|
51
|
+
render: function render(_ref3) {
|
|
52
|
+
var _ref3$statusState = _ref3.statusState,
|
|
53
|
+
statusState = _ref3$statusState === void 0 ? {} : _ref3$statusState;
|
|
53
54
|
var showStatusPickerAt = statusState.showStatusPickerAt;
|
|
54
55
|
if (typeof showStatusPickerAt !== 'number') {
|
|
55
56
|
return null;
|
|
@@ -91,12 +92,12 @@ var baseStatusPlugin = function baseStatusPlugin(options) {
|
|
|
91
92
|
};
|
|
92
93
|
};
|
|
93
94
|
var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, options) {
|
|
94
|
-
if (options.menuDisabled === true) {
|
|
95
|
+
if ((options === null || options === void 0 ? void 0 : options.menuDisabled) === true) {
|
|
95
96
|
return plugin;
|
|
96
97
|
}
|
|
97
98
|
plugin.pluginsOptions = {
|
|
98
|
-
quickInsert: function quickInsert(
|
|
99
|
-
var formatMessage =
|
|
99
|
+
quickInsert: function quickInsert(_ref4) {
|
|
100
|
+
var formatMessage = _ref4.formatMessage;
|
|
100
101
|
return [{
|
|
101
102
|
id: 'status',
|
|
102
103
|
title: formatMessage(_messages.messages.status),
|
|
@@ -122,8 +123,13 @@ var decorateWithPluginOptions = function decorateWithPluginOptions(plugin, optio
|
|
|
122
123
|
};
|
|
123
124
|
return plugin;
|
|
124
125
|
};
|
|
125
|
-
var statusPlugin = function statusPlugin(
|
|
126
|
-
|
|
126
|
+
var statusPlugin = function statusPlugin(_ref5) {
|
|
127
|
+
var options = _ref5.config,
|
|
128
|
+
api = _ref5.api;
|
|
129
|
+
return decorateWithPluginOptions(baseStatusPlugin({
|
|
130
|
+
config: options,
|
|
131
|
+
api: api
|
|
132
|
+
}), options);
|
|
127
133
|
};
|
|
128
134
|
var _default = statusPlugin;
|
|
129
135
|
exports.default = _default;
|
|
@@ -45,14 +45,15 @@ var analyticsPayload = function analyticsPayload(state) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
var submitEditorPlugin = function submitEditorPlugin(
|
|
48
|
+
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
49
|
+
var onSave = _ref.config;
|
|
49
50
|
return {
|
|
50
51
|
name: 'submitEditor',
|
|
51
52
|
pmPlugins: function pmPlugins() {
|
|
52
53
|
return [{
|
|
53
54
|
name: 'submitEditor',
|
|
54
|
-
plugin: function plugin(
|
|
55
|
-
var dispatch =
|
|
55
|
+
plugin: function plugin(_ref2) {
|
|
56
|
+
var dispatch = _ref2.dispatch;
|
|
56
57
|
return createPlugin(dispatch, onSave);
|
|
57
58
|
}
|
|
58
59
|
}];
|
|
@@ -34,11 +34,12 @@ var addItem = function addItem(insert, listType, schema) {
|
|
|
34
34
|
})));
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin() {
|
|
38
|
-
var _ref2 =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
var tasksAndDecisionsPlugin = function tasksAndDecisionsPlugin(_ref2) {
|
|
38
|
+
var _ref2$config = _ref2.config,
|
|
39
|
+
_ref2$config2 = _ref2$config === void 0 ? {} : _ref2$config,
|
|
40
|
+
allowNestedTasks = _ref2$config2.allowNestedTasks,
|
|
41
|
+
consumeTabs = _ref2$config2.consumeTabs,
|
|
42
|
+
useLongPressSelection = _ref2$config2.useLongPressSelection;
|
|
42
43
|
return {
|
|
43
44
|
name: 'taskDecision',
|
|
44
45
|
nodes: function nodes() {
|