@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
|
@@ -7,7 +7,9 @@ import { getPluginState } from './utils';
|
|
|
7
7
|
import { buildToolbar } from './toolbar';
|
|
8
8
|
import { InlineCommentView } from './ui/InlineCommentView';
|
|
9
9
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
10
|
-
var annotationPlugin = function annotationPlugin(
|
|
10
|
+
var annotationPlugin = function annotationPlugin(_ref) {
|
|
11
|
+
var annotationProviders = _ref.config,
|
|
12
|
+
api = _ref.api;
|
|
11
13
|
return {
|
|
12
14
|
name: 'annotation',
|
|
13
15
|
marks: function marks() {
|
|
@@ -25,10 +27,10 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
|
|
|
25
27
|
pmPlugins: function pmPlugins() {
|
|
26
28
|
return [{
|
|
27
29
|
name: 'annotation',
|
|
28
|
-
plugin: function plugin(
|
|
29
|
-
var dispatch =
|
|
30
|
-
portalProviderAPI =
|
|
31
|
-
eventDispatcher =
|
|
30
|
+
plugin: function plugin(_ref2) {
|
|
31
|
+
var dispatch = _ref2.dispatch,
|
|
32
|
+
portalProviderAPI = _ref2.portalProviderAPI,
|
|
33
|
+
eventDispatcher = _ref2.eventDispatcher;
|
|
32
34
|
if (annotationProviders) {
|
|
33
35
|
return inlineCommentPlugin({
|
|
34
36
|
dispatch: dispatch,
|
|
@@ -61,9 +63,9 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
|
|
|
61
63
|
}
|
|
62
64
|
}
|
|
63
65
|
},
|
|
64
|
-
contentComponent: function contentComponent(
|
|
65
|
-
var editorView =
|
|
66
|
-
dispatchAnalyticsEvent =
|
|
66
|
+
contentComponent: function contentComponent(_ref3) {
|
|
67
|
+
var editorView = _ref3.editorView,
|
|
68
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
67
69
|
if (!annotationProviders) {
|
|
68
70
|
return null;
|
|
69
71
|
}
|
|
@@ -76,11 +78,11 @@ var annotationPlugin = function annotationPlugin(annotationProviders, api) {
|
|
|
76
78
|
}
|
|
77
79
|
};
|
|
78
80
|
};
|
|
79
|
-
function AnnotationContentComponent(
|
|
80
|
-
var api =
|
|
81
|
-
editorView =
|
|
82
|
-
annotationProviders =
|
|
83
|
-
dispatchAnalyticsEvent =
|
|
81
|
+
function AnnotationContentComponent(_ref4) {
|
|
82
|
+
var api = _ref4.api,
|
|
83
|
+
editorView = _ref4.editorView,
|
|
84
|
+
annotationProviders = _ref4.annotationProviders,
|
|
85
|
+
dispatchAnalyticsEvent = _ref4.dispatchAnalyticsEvent;
|
|
84
86
|
var _useSharedPluginState = useSharedPluginState(api, ['annotation']),
|
|
85
87
|
inlineCommentState = _useSharedPluginState.annotationState;
|
|
86
88
|
if (inlineCommentState && !inlineCommentState.isVisible) {
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import AvatarGroupPluginWrapper from './ui/AvatarGroupPluginWrapper';
|
|
3
|
-
var avatarGroup = function avatarGroup(
|
|
4
|
-
var _api$
|
|
5
|
-
var
|
|
3
|
+
var avatarGroup = function avatarGroup(_ref) {
|
|
4
|
+
var _api$featureFlags;
|
|
5
|
+
var props = _ref.config,
|
|
6
|
+
api = _ref.api;
|
|
7
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
6
8
|
return {
|
|
7
9
|
name: 'avatarGroup',
|
|
8
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
9
|
-
var editorView =
|
|
10
|
-
popupsMountPoint =
|
|
11
|
-
popupsBoundariesElement =
|
|
12
|
-
popupsScrollableElement =
|
|
13
|
-
disabled =
|
|
14
|
-
isToolbarReducedSpacing =
|
|
15
|
-
eventDispatcher =
|
|
16
|
-
dispatchAnalyticsEvent =
|
|
10
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
11
|
+
var editorView = _ref2.editorView,
|
|
12
|
+
popupsMountPoint = _ref2.popupsMountPoint,
|
|
13
|
+
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
14
|
+
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
15
|
+
disabled = _ref2.disabled,
|
|
16
|
+
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
17
|
+
eventDispatcher = _ref2.eventDispatcher,
|
|
18
|
+
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
17
19
|
return /*#__PURE__*/React.createElement(AvatarGroupPluginWrapper, {
|
|
18
20
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
19
21
|
editorView: editorView,
|
|
20
22
|
eventDispatcher: eventDispatcher,
|
|
21
|
-
collabEdit: props.collabEdit,
|
|
22
|
-
takeFullWidth: props.takeFullWidth,
|
|
23
|
+
collabEdit: props === null || props === void 0 ? void 0 : props.collabEdit,
|
|
24
|
+
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
23
25
|
featureFlags: featureFlags
|
|
24
26
|
});
|
|
25
27
|
}
|
|
@@ -17,9 +17,11 @@ import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
|
17
17
|
import frozenEditor from './pm-plugins/frozen-editor';
|
|
18
18
|
// Chrome >= 88
|
|
19
19
|
export var isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
20
|
-
var basePlugin = function basePlugin(
|
|
21
|
-
var _api$
|
|
22
|
-
var
|
|
20
|
+
var basePlugin = function basePlugin(_ref) {
|
|
21
|
+
var _api$featureFlags;
|
|
22
|
+
var options = _ref.config,
|
|
23
|
+
api = _ref.api;
|
|
24
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
23
25
|
return {
|
|
24
26
|
name: 'base',
|
|
25
27
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -30,8 +32,8 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
30
32
|
pmPlugins: function pmPlugins() {
|
|
31
33
|
var plugins = [{
|
|
32
34
|
name: 'filterStepsPlugin',
|
|
33
|
-
plugin: function plugin(
|
|
34
|
-
var dispatchAnalyticsEvent =
|
|
35
|
+
plugin: function plugin(_ref2) {
|
|
36
|
+
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent;
|
|
35
37
|
return filterStepsPlugin(dispatchAnalyticsEvent);
|
|
36
38
|
}
|
|
37
39
|
}];
|
|
@@ -55,9 +57,9 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
55
57
|
plugin: newlinePreserveMarksPlugin
|
|
56
58
|
}, {
|
|
57
59
|
name: 'frozenEditor',
|
|
58
|
-
plugin: function plugin(
|
|
60
|
+
plugin: function plugin(_ref3) {
|
|
59
61
|
var _options$inputTrackin;
|
|
60
|
-
var dispatchAnalyticsEvent =
|
|
62
|
+
var dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent;
|
|
61
63
|
return options !== null && options !== void 0 && (_options$inputTrackin = options.inputTracking) !== null && _options$inputTrackin !== void 0 && _options$inputTrackin.enabled || options !== null && options !== void 0 && options.ufo ? frozenEditor(dispatchAnalyticsEvent, options.inputTracking, options.browserFreezeTracking, options.ufo) : undefined;
|
|
62
64
|
}
|
|
63
65
|
}, {
|
|
@@ -81,9 +83,9 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
81
83
|
}
|
|
82
84
|
}, {
|
|
83
85
|
name: 'contextIdentifier',
|
|
84
|
-
plugin: function plugin(
|
|
85
|
-
var dispatch =
|
|
86
|
-
providerFactory =
|
|
86
|
+
plugin: function plugin(_ref4) {
|
|
87
|
+
var dispatch = _ref4.dispatch,
|
|
88
|
+
providerFactory = _ref4.providerFactory;
|
|
87
89
|
return contextIdentifierPlugin(dispatch, providerFactory);
|
|
88
90
|
}
|
|
89
91
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BeforePrimaryToolbarWrapper } from './ui/BeforePrimaryToolbarWrapper';
|
|
3
|
-
var beforePrimaryToolbar = function beforePrimaryToolbar(
|
|
3
|
+
var beforePrimaryToolbar = function beforePrimaryToolbar(_ref) {
|
|
4
|
+
var props = _ref.config;
|
|
4
5
|
return {
|
|
5
6
|
name: 'beforePrimaryToolbar',
|
|
6
7
|
primaryToolbarComponent: function primaryToolbarComponent() {
|
|
7
8
|
return /*#__PURE__*/React.createElement(BeforePrimaryToolbarWrapper, {
|
|
8
|
-
beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
|
|
9
|
+
beforePrimaryToolbarComponents: props === null || props === void 0 ? void 0 : props.beforePrimaryToolbarComponents
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
12
|
};
|
|
@@ -84,7 +84,9 @@ var blockquotePluginOptions = function blockquotePluginOptions(_ref2, isAllowed,
|
|
|
84
84
|
}
|
|
85
85
|
}];
|
|
86
86
|
};
|
|
87
|
-
var blockTypePlugin = function blockTypePlugin(
|
|
87
|
+
var blockTypePlugin = function blockTypePlugin(_ref3) {
|
|
88
|
+
var options = _ref3.config,
|
|
89
|
+
api = _ref3.api;
|
|
88
90
|
return {
|
|
89
91
|
name: 'blockType',
|
|
90
92
|
nodes: function nodes() {
|
|
@@ -109,45 +111,45 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
|
|
|
109
111
|
pmPlugins: function pmPlugins() {
|
|
110
112
|
return [{
|
|
111
113
|
name: 'blockType',
|
|
112
|
-
plugin: function plugin(
|
|
113
|
-
var _api$
|
|
114
|
-
var dispatch =
|
|
115
|
-
return createPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
114
|
+
plugin: function plugin(_ref4) {
|
|
115
|
+
var _api$analytics;
|
|
116
|
+
var dispatch = _ref4.dispatch;
|
|
117
|
+
return createPlugin(api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions, dispatch, options && options.lastNodeMustBeParagraph);
|
|
116
118
|
}
|
|
117
119
|
}, {
|
|
118
120
|
name: 'blockTypeInputRule',
|
|
119
|
-
plugin: function plugin(
|
|
120
|
-
var _api$
|
|
121
|
-
var schema =
|
|
122
|
-
featureFlags =
|
|
123
|
-
return inputRulePlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
121
|
+
plugin: function plugin(_ref5) {
|
|
122
|
+
var _api$analytics2;
|
|
123
|
+
var schema = _ref5.schema,
|
|
124
|
+
featureFlags = _ref5.featureFlags;
|
|
125
|
+
return inputRulePlugin(api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, schema, featureFlags);
|
|
124
126
|
}
|
|
125
127
|
},
|
|
126
128
|
// Needs to be lower priority than editor-tables.tableEditing
|
|
127
129
|
// plugin as it is currently swallowing right/down arrow events inside tables
|
|
128
130
|
{
|
|
129
131
|
name: 'blockTypeKeyMap',
|
|
130
|
-
plugin: function plugin(
|
|
131
|
-
var _api$
|
|
132
|
-
var schema =
|
|
133
|
-
featureFlags =
|
|
134
|
-
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$
|
|
132
|
+
plugin: function plugin(_ref6) {
|
|
133
|
+
var _api$analytics3;
|
|
134
|
+
var schema = _ref6.schema,
|
|
135
|
+
featureFlags = _ref6.featureFlags;
|
|
136
|
+
return keymapPlugin(api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions, schema, featureFlags);
|
|
135
137
|
}
|
|
136
138
|
}];
|
|
137
139
|
},
|
|
138
|
-
primaryToolbarComponent: function primaryToolbarComponent(
|
|
139
|
-
var editorView =
|
|
140
|
-
popupsMountPoint =
|
|
141
|
-
popupsBoundariesElement =
|
|
142
|
-
popupsScrollableElement =
|
|
143
|
-
toolbarSize =
|
|
144
|
-
disabled =
|
|
145
|
-
isToolbarReducedSpacing =
|
|
146
|
-
eventDispatcher =
|
|
140
|
+
primaryToolbarComponent: function primaryToolbarComponent(_ref7) {
|
|
141
|
+
var editorView = _ref7.editorView,
|
|
142
|
+
popupsMountPoint = _ref7.popupsMountPoint,
|
|
143
|
+
popupsBoundariesElement = _ref7.popupsBoundariesElement,
|
|
144
|
+
popupsScrollableElement = _ref7.popupsScrollableElement,
|
|
145
|
+
toolbarSize = _ref7.toolbarSize,
|
|
146
|
+
disabled = _ref7.disabled,
|
|
147
|
+
isToolbarReducedSpacing = _ref7.isToolbarReducedSpacing,
|
|
148
|
+
eventDispatcher = _ref7.eventDispatcher;
|
|
147
149
|
var isSmall = options && options.isUndoRedoButtonsEnabled ? toolbarSize < ToolbarSize.XXL : toolbarSize < ToolbarSize.XL;
|
|
148
150
|
var boundSetBlockType = function boundSetBlockType(name) {
|
|
149
|
-
var _api$
|
|
150
|
-
return setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$
|
|
151
|
+
var _api$analytics4;
|
|
152
|
+
return setBlockTypeWithAnalytics(name, INPUT_METHOD.TOOLBAR, api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : _api$analytics4.actions)(editorView.state, editorView.dispatch);
|
|
151
153
|
};
|
|
152
154
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
153
155
|
editorView: editorView,
|
|
@@ -155,8 +157,8 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
|
|
|
155
157
|
plugins: {
|
|
156
158
|
pluginState: pluginKey
|
|
157
159
|
},
|
|
158
|
-
render: function render(
|
|
159
|
-
var pluginState =
|
|
160
|
+
render: function render(_ref8) {
|
|
161
|
+
var pluginState = _ref8.pluginState;
|
|
160
162
|
return /*#__PURE__*/React.createElement(ToolbarBlockType, {
|
|
161
163
|
isSmall: isSmall,
|
|
162
164
|
isDisabled: disabled,
|
|
@@ -172,9 +174,9 @@ var blockTypePlugin = function blockTypePlugin(options, api) {
|
|
|
172
174
|
},
|
|
173
175
|
pluginsOptions: {
|
|
174
176
|
quickInsert: function quickInsert(intl) {
|
|
175
|
-
var _api$
|
|
177
|
+
var _api$analytics5, _api$analytics6;
|
|
176
178
|
var exclude = options && options.allowBlockType && options.allowBlockType.exclude ? options.allowBlockType.exclude : [];
|
|
177
|
-
return [].concat(_toConsumableArray(blockquotePluginOptions(intl, exclude.indexOf('blockquote') === -1, api === null || api === void 0 ? void 0 : (_api$
|
|
179
|
+
return [].concat(_toConsumableArray(blockquotePluginOptions(intl, exclude.indexOf('blockquote') === -1, api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions)), _toConsumableArray(headingPluginOptions(intl, exclude.indexOf('heading') === -1, api === null || api === void 0 ? void 0 : (_api$analytics6 = api.analytics) === null || _api$analytics6 === void 0 ? void 0 : _api$analytics6.actions)));
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
182
|
};
|
|
@@ -79,11 +79,11 @@ var BreakoutView = /*#__PURE__*/function () {
|
|
|
79
79
|
this.mark = mark;
|
|
80
80
|
this.view = view;
|
|
81
81
|
this.contentDOM = contentDOM;
|
|
82
|
-
this.unsubscribe = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
82
|
+
this.unsubscribe = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.onChange(function (_ref) {
|
|
83
83
|
var nextSharedState = _ref.nextSharedState;
|
|
84
84
|
return _this.updateWidth(nextSharedState);
|
|
85
85
|
});
|
|
86
|
-
this.updateWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.
|
|
86
|
+
this.updateWidth(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width.sharedState.currentState());
|
|
87
87
|
}
|
|
88
88
|
_createClass(BreakoutView, [{
|
|
89
89
|
key: "destroy",
|
|
@@ -156,7 +156,9 @@ var LayoutButtonWrapper = function LayoutButtonWrapper(_ref3) {
|
|
|
156
156
|
node: (_breakoutState$breako = breakoutState === null || breakoutState === void 0 ? void 0 : (_breakoutState$breako2 = breakoutState.breakoutNode) === null || _breakoutState$breako2 === void 0 ? void 0 : _breakoutState$breako2.node) !== null && _breakoutState$breako !== void 0 ? _breakoutState$breako : null
|
|
157
157
|
});
|
|
158
158
|
};
|
|
159
|
-
var breakoutPlugin = function breakoutPlugin(
|
|
159
|
+
var breakoutPlugin = function breakoutPlugin(_ref4) {
|
|
160
|
+
var options = _ref4.config,
|
|
161
|
+
api = _ref4.api;
|
|
160
162
|
return {
|
|
161
163
|
name: 'breakout',
|
|
162
164
|
pmPlugins: function pmPlugins() {
|
|
@@ -187,11 +189,11 @@ var breakoutPlugin = function breakoutPlugin(options, api) {
|
|
|
187
189
|
}
|
|
188
190
|
return pluginState;
|
|
189
191
|
},
|
|
190
|
-
contentComponent: function contentComponent(
|
|
191
|
-
var editorView =
|
|
192
|
-
popupsMountPoint =
|
|
193
|
-
popupsBoundariesElement =
|
|
194
|
-
popupsScrollableElement =
|
|
192
|
+
contentComponent: function contentComponent(_ref5) {
|
|
193
|
+
var editorView = _ref5.editorView,
|
|
194
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
195
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
196
|
+
popupsScrollableElement = _ref5.popupsScrollableElement;
|
|
195
197
|
// This is a bit crappy, but should be resolved once we move to a static schema.
|
|
196
198
|
if (options && !options.allowBreakoutButton) {
|
|
197
199
|
return null;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { caption } from '@atlaskit/adf-schema';
|
|
2
2
|
import { default as createCaptionPlugin } from './pm-plugins/main';
|
|
3
3
|
import { captionKeymap } from './pm-plugins/keymap';
|
|
4
|
-
var captionPlugin = function captionPlugin(
|
|
4
|
+
var captionPlugin = function captionPlugin(_ref) {
|
|
5
|
+
var api = _ref.api;
|
|
5
6
|
return {
|
|
6
7
|
name: 'caption',
|
|
7
8
|
nodes: function nodes() {
|
|
@@ -13,11 +14,11 @@ var captionPlugin = function captionPlugin(_, api) {
|
|
|
13
14
|
pmPlugins: function pmPlugins() {
|
|
14
15
|
return [{
|
|
15
16
|
name: 'caption',
|
|
16
|
-
plugin: function plugin(
|
|
17
|
-
var portalProviderAPI =
|
|
18
|
-
providerFactory =
|
|
19
|
-
eventDispatcher =
|
|
20
|
-
dispatch =
|
|
17
|
+
plugin: function plugin(_ref2) {
|
|
18
|
+
var portalProviderAPI = _ref2.portalProviderAPI,
|
|
19
|
+
providerFactory = _ref2.providerFactory,
|
|
20
|
+
eventDispatcher = _ref2.eventDispatcher,
|
|
21
|
+
dispatch = _ref2.dispatch;
|
|
21
22
|
return createCaptionPlugin(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api);
|
|
22
23
|
}
|
|
23
24
|
}, {
|
|
@@ -12,8 +12,8 @@ var fireAnalytics = function fireAnalytics(tr, action, analyticsApi) {
|
|
|
12
12
|
})(tr);
|
|
13
13
|
};
|
|
14
14
|
export default (function (portalProviderAPI, eventDispatcher, providerFactory, dispatch, pluginInjectionApi) {
|
|
15
|
-
var _pluginInjectionApi$
|
|
16
|
-
var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
15
|
+
var _pluginInjectionApi$a;
|
|
16
|
+
var analyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
17
17
|
return new SafePlugin({
|
|
18
18
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
19
19
|
// only run for transactions that change selection
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { createPlugin } from './pm-plugins/main';
|
|
2
2
|
var codeBidiWarning = function codeBidiWarning(_ref) {
|
|
3
|
-
var
|
|
3
|
+
var config = _ref.config;
|
|
4
4
|
return {
|
|
5
5
|
name: 'codeBidiWarning',
|
|
6
6
|
pmPlugins: function pmPlugins() {
|
|
7
7
|
return [{
|
|
8
8
|
name: 'codeBidiWarning',
|
|
9
9
|
plugin: function plugin(options) {
|
|
10
|
-
return createPlugin(options,
|
|
11
|
-
appearance: appearance
|
|
12
|
-
});
|
|
10
|
+
return createPlugin(options, config);
|
|
13
11
|
}
|
|
14
12
|
}];
|
|
15
13
|
}
|
|
@@ -16,7 +16,9 @@ import refreshBrowserSelectionOnChange from './refresh-browser-selection';
|
|
|
16
16
|
// Insertions via the drop down menu
|
|
17
17
|
// tslint-ignore-next-line
|
|
18
18
|
import { createInsertCodeBlockTransaction } from '../block-type/commands/block-type';
|
|
19
|
-
var codeBlockPlugin = function codeBlockPlugin(
|
|
19
|
+
var codeBlockPlugin = function codeBlockPlugin(_ref) {
|
|
20
|
+
var options = _ref.config,
|
|
21
|
+
api = _ref.api;
|
|
20
22
|
return {
|
|
21
23
|
name: 'codeBlock',
|
|
22
24
|
nodes: function nodes() {
|
|
@@ -28,11 +30,12 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
|
|
|
28
30
|
pmPlugins: function pmPlugins() {
|
|
29
31
|
return [{
|
|
30
32
|
name: 'codeBlock',
|
|
31
|
-
plugin: function plugin(
|
|
32
|
-
var
|
|
33
|
+
plugin: function plugin(_ref2) {
|
|
34
|
+
var _options$appearance;
|
|
35
|
+
var getIntl = _ref2.getIntl;
|
|
33
36
|
return createPlugin(_objectSpread(_objectSpread({}, options), {}, {
|
|
34
37
|
getIntl: getIntl,
|
|
35
|
-
appearance: options.appearance
|
|
38
|
+
appearance: (_options$appearance = options === null || options === void 0 ? void 0 : options.appearance) !== null && _options$appearance !== void 0 ? _options$appearance : 'comment'
|
|
36
39
|
}));
|
|
37
40
|
}
|
|
38
41
|
}, {
|
|
@@ -42,8 +45,8 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
|
|
|
42
45
|
}
|
|
43
46
|
}, {
|
|
44
47
|
name: 'codeBlockKeyMap',
|
|
45
|
-
plugin: function plugin(
|
|
46
|
-
var schema =
|
|
48
|
+
plugin: function plugin(_ref3) {
|
|
49
|
+
var schema = _ref3.schema;
|
|
47
50
|
return keymap(schema);
|
|
48
51
|
}
|
|
49
52
|
}, {
|
|
@@ -59,8 +62,8 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
|
|
|
59
62
|
refreshBrowserSelectionOnChange(props.originalTransaction, props.newEditorState);
|
|
60
63
|
},
|
|
61
64
|
pluginsOptions: {
|
|
62
|
-
quickInsert: function quickInsert(
|
|
63
|
-
var formatMessage =
|
|
65
|
+
quickInsert: function quickInsert(_ref4) {
|
|
66
|
+
var formatMessage = _ref4.formatMessage;
|
|
64
67
|
return [{
|
|
65
68
|
id: 'codeblock',
|
|
66
69
|
title: formatMessage(messages.codeblock),
|
|
@@ -72,11 +75,11 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
|
|
|
72
75
|
return /*#__PURE__*/React.createElement(IconCode, null);
|
|
73
76
|
},
|
|
74
77
|
action: function action(insert, state) {
|
|
75
|
-
var _api$
|
|
78
|
+
var _api$analytics;
|
|
76
79
|
var tr = createInsertCodeBlockTransaction({
|
|
77
80
|
state: state
|
|
78
81
|
});
|
|
79
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
82
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.attachAnalyticsEvent({
|
|
80
83
|
action: ACTION.INSERTED,
|
|
81
84
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
82
85
|
actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
|
|
@@ -89,7 +92,7 @@ var codeBlockPlugin = function codeBlockPlugin(options, api) {
|
|
|
89
92
|
}
|
|
90
93
|
}];
|
|
91
94
|
},
|
|
92
|
-
floatingToolbar: getToolbarConfig(options.allowCopyToClipboard, api === null || api === void 0 ? void 0 : api.
|
|
95
|
+
floatingToolbar: getToolbarConfig(options === null || options === void 0 ? void 0 : options.allowCopyToClipboard, api === null || api === void 0 ? void 0 : api.decorations.actions.hoverDecoration)
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
};
|
|
@@ -13,10 +13,10 @@ var ideUX = function ideUX(pluginInjectionApi) {
|
|
|
13
13
|
return new SafePlugin({
|
|
14
14
|
props: {
|
|
15
15
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
16
|
-
var _pluginInjectionApi$
|
|
16
|
+
var _pluginInjectionApi$c;
|
|
17
17
|
var state = view.state,
|
|
18
18
|
dispatch = view.dispatch;
|
|
19
|
-
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
19
|
+
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.composition) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.sharedState.currentState();
|
|
20
20
|
if (isCursorInsideCodeBlock(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
21
21
|
var beforeText = getStartOfCurrentLine(state).text;
|
|
22
22
|
var afterText = getEndOfCurrentLine(state).text;
|
|
@@ -47,9 +47,11 @@ var providerBuilder = function providerBuilder(collabEditProviderPromise) {
|
|
|
47
47
|
};
|
|
48
48
|
}();
|
|
49
49
|
};
|
|
50
|
-
var collabEditPlugin = function collabEditPlugin(
|
|
51
|
-
var _api$
|
|
52
|
-
var
|
|
50
|
+
var collabEditPlugin = function collabEditPlugin(_ref2) {
|
|
51
|
+
var _api$featureFlags;
|
|
52
|
+
var options = _ref2.config,
|
|
53
|
+
api = _ref2.api;
|
|
54
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
53
55
|
var providerResolver = function providerResolver() {};
|
|
54
56
|
var collabEditProviderPromise = new Promise(function (_providerResolver) {
|
|
55
57
|
providerResolver = _providerResolver;
|
|
@@ -58,11 +60,11 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
|
|
|
58
60
|
return {
|
|
59
61
|
name: 'collabEdit',
|
|
60
62
|
pmPlugins: function pmPlugins() {
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
useNativePlugin =
|
|
64
|
-
|
|
65
|
-
userId =
|
|
63
|
+
var _ref3 = options || {},
|
|
64
|
+
_ref3$useNativePlugin = _ref3.useNativePlugin,
|
|
65
|
+
useNativePlugin = _ref3$useNativePlugin === void 0 ? false : _ref3$useNativePlugin,
|
|
66
|
+
_ref3$userId = _ref3.userId,
|
|
67
|
+
userId = _ref3$userId === void 0 ? null : _ref3$userId;
|
|
66
68
|
return [].concat(_toConsumableArray(useNativePlugin ? [{
|
|
67
69
|
name: 'pmCollab',
|
|
68
70
|
plugin: function plugin() {
|
|
@@ -79,22 +81,22 @@ var collabEditPlugin = function collabEditPlugin(options, api) {
|
|
|
79
81
|
}
|
|
80
82
|
}] : []), [{
|
|
81
83
|
name: 'collab',
|
|
82
|
-
plugin: function plugin(
|
|
83
|
-
var dispatch =
|
|
84
|
-
providerFactory =
|
|
84
|
+
plugin: function plugin(_ref4) {
|
|
85
|
+
var dispatch = _ref4.dispatch,
|
|
86
|
+
providerFactory = _ref4.providerFactory;
|
|
85
87
|
return createPlugin(dispatch, providerFactory, providerResolver, executeProviderCode, options, featureFlags, api);
|
|
86
88
|
}
|
|
87
89
|
}]);
|
|
88
90
|
},
|
|
89
91
|
onEditorViewStateUpdated: function onEditorViewStateUpdated(props) {
|
|
90
|
-
var _api$
|
|
91
|
-
var addErrorAnalytics = addSynchronyErrorAnalytics(props.newEditorState, props.newEditorState.tr, featureFlags, api === null || api === void 0 ? void 0 : (_api$
|
|
92
|
+
var _api$analytics, _options$useNativePlu;
|
|
93
|
+
var addErrorAnalytics = addSynchronyErrorAnalytics(props.newEditorState, props.newEditorState.tr, featureFlags, api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
92
94
|
executeProviderCode(sendTransaction({
|
|
93
95
|
originalTransaction: props.originalTransaction,
|
|
94
96
|
transactions: props.transactions,
|
|
95
97
|
oldEditorState: props.oldEditorState,
|
|
96
98
|
newEditorState: props.newEditorState,
|
|
97
|
-
useNativePlugin: options
|
|
99
|
+
useNativePlugin: (_options$useNativePlu = options === null || options === void 0 ? void 0 : options.useNativePlugin) !== null && _options$useNativePlu !== void 0 ? _options$useNativePlu : false
|
|
98
100
|
}), addErrorAnalytics);
|
|
99
101
|
}
|
|
100
102
|
};
|
|
@@ -39,11 +39,11 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, provi
|
|
|
39
39
|
return true;
|
|
40
40
|
},
|
|
41
41
|
view: function view(_view) {
|
|
42
|
-
var _pluginInjectionApi$
|
|
43
|
-
var addErrorAnalytics = addSynchronyErrorAnalytics(_view.state, _view.state.tr, featureFlags, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
42
|
+
var _pluginInjectionApi$a, _pluginInjectionApi$a5;
|
|
43
|
+
var addErrorAnalytics = addSynchronyErrorAnalytics(_view.state, _view.state.tr, featureFlags, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions);
|
|
44
44
|
var onSyncUpError = function onSyncUpError(attributes) {
|
|
45
|
-
var _pluginInjectionApi$
|
|
46
|
-
var fireAnalyticsCallback = fireAnalyticsEvent((_pluginInjectionApi$
|
|
45
|
+
var _pluginInjectionApi$a2, _pluginInjectionApi$a3, _pluginInjectionApi$a4;
|
|
46
|
+
var fireAnalyticsCallback = fireAnalyticsEvent((_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined);
|
|
47
47
|
fireAnalyticsCallback({
|
|
48
48
|
payload: {
|
|
49
49
|
action: ACTION.NEW_COLLAB_SYNC_UP_ERROR_NO_STEPS,
|
|
@@ -59,7 +59,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, provi
|
|
|
59
59
|
options: options,
|
|
60
60
|
providerFactory: providerFactory,
|
|
61
61
|
featureFlags: featureFlags,
|
|
62
|
-
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
62
|
+
editorAnalyticsApi: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions
|
|
63
63
|
}), addErrorAnalytics);
|
|
64
64
|
providerFactory && providerFactory.subscribe('collabEditProvider', function (_name, providerPromise) {
|
|
65
65
|
if (providerPromise) {
|
|
@@ -79,9 +79,10 @@ function ContentComponent(_ref) {
|
|
|
79
79
|
weekStartDay: weekStartDay
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
var datePlugin = function datePlugin() {
|
|
83
|
-
var
|
|
84
|
-
|
|
82
|
+
var datePlugin = function datePlugin(_ref3) {
|
|
83
|
+
var _ref3$config = _ref3.config,
|
|
84
|
+
options = _ref3$config === void 0 ? {} : _ref3$config,
|
|
85
|
+
api = _ref3.api;
|
|
85
86
|
return {
|
|
86
87
|
name: 'date',
|
|
87
88
|
getSharedState: function getSharedState(editorState) {
|
|
@@ -92,10 +93,10 @@ var datePlugin = function datePlugin() {
|
|
|
92
93
|
focusDateInput: false
|
|
93
94
|
};
|
|
94
95
|
}
|
|
95
|
-
var
|
|
96
|
-
showDatePickerAt =
|
|
97
|
-
isNew =
|
|
98
|
-
focusDateInput =
|
|
96
|
+
var _ref4 = datePluginKey.getState(editorState) || {},
|
|
97
|
+
showDatePickerAt = _ref4.showDatePickerAt,
|
|
98
|
+
isNew = _ref4.isNew,
|
|
99
|
+
focusDateInput = _ref4.focusDateInput;
|
|
99
100
|
return {
|
|
100
101
|
showDatePickerAt: showDatePickerAt,
|
|
101
102
|
isNew: !!isNew,
|
|
@@ -123,12 +124,12 @@ var datePlugin = function datePlugin() {
|
|
|
123
124
|
}
|
|
124
125
|
}];
|
|
125
126
|
},
|
|
126
|
-
contentComponent: function contentComponent(
|
|
127
|
-
var editorView =
|
|
128
|
-
dispatchAnalyticsEvent =
|
|
129
|
-
popupsMountPoint =
|
|
130
|
-
popupsBoundariesElement =
|
|
131
|
-
popupsScrollableElement =
|
|
127
|
+
contentComponent: function contentComponent(_ref5) {
|
|
128
|
+
var editorView = _ref5.editorView,
|
|
129
|
+
dispatchAnalyticsEvent = _ref5.dispatchAnalyticsEvent,
|
|
130
|
+
popupsMountPoint = _ref5.popupsMountPoint,
|
|
131
|
+
popupsBoundariesElement = _ref5.popupsBoundariesElement,
|
|
132
|
+
popupsScrollableElement = _ref5.popupsScrollableElement;
|
|
132
133
|
return /*#__PURE__*/React.createElement(ContentComponent, {
|
|
133
134
|
dependencyApi: api,
|
|
134
135
|
editorView: editorView,
|
|
@@ -140,8 +141,8 @@ var datePlugin = function datePlugin() {
|
|
|
140
141
|
});
|
|
141
142
|
},
|
|
142
143
|
pluginsOptions: {
|
|
143
|
-
quickInsert: function quickInsert(
|
|
144
|
-
var formatMessage =
|
|
144
|
+
quickInsert: function quickInsert(_ref6) {
|
|
145
|
+
var formatMessage = _ref6.formatMessage;
|
|
145
146
|
return [{
|
|
146
147
|
id: 'date',
|
|
147
148
|
title: formatMessage(messages.date),
|
|
@@ -153,9 +154,9 @@ var datePlugin = function datePlugin() {
|
|
|
153
154
|
return /*#__PURE__*/React.createElement(IconDate, null);
|
|
154
155
|
},
|
|
155
156
|
action: function action(insert, state) {
|
|
156
|
-
var _api$
|
|
157
|
+
var _api$analytics, _api$analytics$action, _api$analytics$action2;
|
|
157
158
|
var tr = createDate(true)(insert, state);
|
|
158
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
159
|
+
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : (_api$analytics$action2 = _api$analytics$action.attachAnalyticsEvent) === null || _api$analytics$action2 === void 0 ? void 0 : _api$analytics$action2.call(_api$analytics$action, {
|
|
159
160
|
action: ACTION.INSERTED,
|
|
160
161
|
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
161
162
|
actionSubjectId: ACTION_SUBJECT_ID.DATE,
|