@atlaskit/editor-core 189.3.14 → 189.3.16
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 +17 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +3 -3
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
- package/dist/cjs/plugins/extension/extension-api.js +3 -3
- package/dist/cjs/plugins/extension/index.js +14 -3
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/actions.js +3 -4
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/index.js +2 -18
- package/dist/cjs/plugins/extension/toolbar.js +1 -1
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/find-replace/keymap.js +4 -4
- package/dist/cjs/plugins/index.js +1 -24
- package/dist/cjs/plugins/insert-block/index.js +36 -53
- package/dist/cjs/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +3 -9
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +3 -3
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +7 -8
- package/dist/cjs/plugins/paste/handlers.js +3 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +12 -8
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +0 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -24
- package/dist/es2019/plugins/breakout/index.js +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/plugins/extension/extension-api.js +2 -2
- package/dist/es2019/plugins/extension/index.js +13 -3
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -14
- package/dist/es2019/plugins/extension/toolbar.js +1 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
- package/dist/es2019/plugins/find-replace/index.js +7 -2
- package/dist/es2019/plugins/find-replace/keymap.js +4 -4
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/insert-block/index.js +19 -36
- package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/es2019/plugins/paste/handlers.js +4 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +10 -6
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
- package/dist/es2019/use-preset.js +0 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/breakout/index.js +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/plugins/extension/extension-api.js +2 -2
- package/dist/esm/plugins/extension/index.js +14 -3
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -17
- package/dist/esm/plugins/extension/toolbar.js +1 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/find-replace/keymap.js +4 -4
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/insert-block/index.js +36 -53
- package/dist/esm/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/esm/plugins/paste/handlers.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +9 -6
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +0 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types-ts4.5/plugins → types/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types/plugins/find-replace/index.d.ts +5 -3
- package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types-ts4.5 → types/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +2 -1
- package/dist/types/presets/context.d.ts +2 -2
- package/dist/types/presets/default.d.ts +8 -0
- package/dist/types/presets/universal.d.ts +5 -0
- package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types/plugins → types-ts4.5/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
- package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types → types-ts4.5/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- package/dist/types-ts4.5/presets/default.d.ts +8 -0
- package/dist/types-ts4.5/presets/universal.d.ts +5 -0
- package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/package.json +5 -9
- package/dist/cjs/plugins/breakout/constants.js +0 -10
- package/dist/cjs/plugins/expand/commands.js +0 -184
- package/dist/cjs/plugins/expand/index.js +0 -111
- package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
- package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
- package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
- package/dist/cjs/plugins/expand/reducer.js +0 -20
- package/dist/cjs/plugins/expand/toolbar.js +0 -59
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
- package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
- package/dist/cjs/plugins/expand/utils.js +0 -24
- package/dist/cjs/ui/ElementBrowser/types.js +0 -5
- package/dist/es2019/plugins/breakout/constants.js +0 -4
- package/dist/es2019/plugins/expand/commands.js +0 -161
- package/dist/es2019/plugins/expand/index.js +0 -95
- package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
- package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
- package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/es2019/plugins/expand/reducer.js +0 -11
- package/dist/es2019/plugins/expand/toolbar.js +0 -52
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
- package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
- package/dist/es2019/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/breakout/constants.js +0 -4
- package/dist/esm/plugins/expand/commands.js +0 -177
- package/dist/esm/plugins/expand/index.js +0 -97
- package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
- package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
- package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/esm/plugins/expand/reducer.js +0 -13
- package/dist/esm/plugins/expand/toolbar.js +0 -52
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
- package/dist/esm/plugins/expand/ui/class-names.js +0 -14
- package/dist/esm/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/macro/types.js +0 -1
- package/dist/esm/ui/ElementBrowser/types.js +0 -1
- package/dist/types/plugins/breakout/constants.d.ts +0 -4
- package/dist/types/plugins/expand/commands.d.ts +0 -13
- package/dist/types/plugins/expand/index.d.ts +0 -31
- package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types/plugins/expand/reducer.d.ts +0 -3
- package/dist/types/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types/plugins/expand/types.d.ts +0 -9
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types/plugins/expand/utils.d.ts +0 -1
- package/dist/types/plugins/macro/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
- package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
- package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
- package/dist/types-ts4.5/plugins/macro/types.d.ts +0 -4
- /package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/cjs/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/cjs/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/es2019/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/{es2019/ui/ElementBrowser → esm/plugins/extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/esm/plugins/{expand → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types-ts4.5/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
|
@@ -1,81 +1,95 @@
|
|
|
1
1
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { withAnalytics } from '../analytics';
|
|
3
2
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
4
4
|
import { activate, find, findNext, findPrevious, replace, replaceAll, cancelSearch } from './commands';
|
|
5
|
-
export var activateWithAnalytics = function activateWithAnalytics(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export var activateWithAnalytics = function activateWithAnalytics(editorAnalyticsAPI) {
|
|
6
|
+
return function (_ref) {
|
|
7
|
+
var triggerMethod = _ref.triggerMethod;
|
|
8
|
+
return withAnalytics(editorAnalyticsAPI, function (state) {
|
|
9
|
+
return {
|
|
10
|
+
eventType: EVENT_TYPE.UI,
|
|
11
|
+
action: ACTION.ACTIVATED,
|
|
12
|
+
actionSubject: ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
13
|
+
attributes: {
|
|
14
|
+
inputMethod: state.selection instanceof TextSelection && !state.selection.empty ? INPUT_METHOD.PREFILL : INPUT_METHOD.KEYBOARD,
|
|
15
|
+
triggerMethod: triggerMethod
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
})(activate());
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export var findWithAnalytics = function findWithAnalytics(editorAnalyticsAPI) {
|
|
22
|
+
return function (_ref2) {
|
|
23
|
+
var editorView = _ref2.editorView,
|
|
24
|
+
containerElement = _ref2.containerElement,
|
|
25
|
+
keyword = _ref2.keyword;
|
|
26
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
27
|
+
eventType: EVENT_TYPE.TRACK,
|
|
28
|
+
action: ACTION.FIND_PERFORMED,
|
|
29
|
+
actionSubject: ACTION_SUBJECT.TEXT
|
|
30
|
+
})(find(editorView, containerElement, keyword));
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export var findNextWithAnalytics = function findNextWithAnalytics(editorAnalyticsAPI) {
|
|
34
|
+
return function (_ref3) {
|
|
35
|
+
var triggerMethod = _ref3.triggerMethod;
|
|
36
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
37
|
+
eventType: EVENT_TYPE.TRACK,
|
|
38
|
+
action: ACTION.FIND_NEXT_PERFORMED,
|
|
39
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
12
40
|
attributes: {
|
|
13
|
-
inputMethod: state.selection instanceof TextSelection && !state.selection.empty ? INPUT_METHOD.PREFILL : INPUT_METHOD.KEYBOARD,
|
|
14
41
|
triggerMethod: triggerMethod
|
|
15
42
|
}
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export var findWithAnalytics = function findWithAnalytics(_ref2) {
|
|
20
|
-
var editorView = _ref2.editorView,
|
|
21
|
-
containerElement = _ref2.containerElement,
|
|
22
|
-
keyword = _ref2.keyword;
|
|
23
|
-
return withAnalytics({
|
|
24
|
-
eventType: EVENT_TYPE.TRACK,
|
|
25
|
-
action: ACTION.FIND_PERFORMED,
|
|
26
|
-
actionSubject: ACTION_SUBJECT.TEXT
|
|
27
|
-
})(find(editorView, containerElement, keyword));
|
|
43
|
+
})(findNext());
|
|
44
|
+
};
|
|
28
45
|
};
|
|
29
|
-
export var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var triggerMethod = _ref4.triggerMethod;
|
|
42
|
-
return withAnalytics({
|
|
43
|
-
eventType: EVENT_TYPE.TRACK,
|
|
44
|
-
action: ACTION.FIND_PREV_PERFORMED,
|
|
45
|
-
actionSubject: ACTION_SUBJECT.TEXT,
|
|
46
|
-
attributes: {
|
|
47
|
-
triggerMethod: triggerMethod
|
|
48
|
-
}
|
|
49
|
-
})(findPrevious());
|
|
46
|
+
export var findPrevWithAnalytics = function findPrevWithAnalytics(editorAnalyticsAPI) {
|
|
47
|
+
return function (_ref4) {
|
|
48
|
+
var triggerMethod = _ref4.triggerMethod;
|
|
49
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
50
|
+
eventType: EVENT_TYPE.TRACK,
|
|
51
|
+
action: ACTION.FIND_PREV_PERFORMED,
|
|
52
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
53
|
+
attributes: {
|
|
54
|
+
triggerMethod: triggerMethod
|
|
55
|
+
}
|
|
56
|
+
})(findPrevious());
|
|
57
|
+
};
|
|
50
58
|
};
|
|
51
|
-
export var replaceWithAnalytics = function replaceWithAnalytics(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
export var replaceWithAnalytics = function replaceWithAnalytics(editorAnalyticsAPI) {
|
|
60
|
+
return function (_ref5) {
|
|
61
|
+
var triggerMethod = _ref5.triggerMethod,
|
|
62
|
+
replaceText = _ref5.replaceText;
|
|
63
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
64
|
+
eventType: EVENT_TYPE.TRACK,
|
|
65
|
+
action: ACTION.REPLACED_ONE,
|
|
66
|
+
actionSubject: ACTION_SUBJECT.TEXT,
|
|
67
|
+
attributes: {
|
|
68
|
+
triggerMethod: triggerMethod
|
|
69
|
+
}
|
|
70
|
+
})(replace(replaceText));
|
|
71
|
+
};
|
|
62
72
|
};
|
|
63
|
-
export var replaceAllWithAnalytics = function replaceAllWithAnalytics(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
export var replaceAllWithAnalytics = function replaceAllWithAnalytics(editorAnalyticsAPI) {
|
|
74
|
+
return function (_ref6) {
|
|
75
|
+
var replaceText = _ref6.replaceText;
|
|
76
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
77
|
+
eventType: EVENT_TYPE.TRACK,
|
|
78
|
+
action: ACTION.REPLACED_ALL,
|
|
79
|
+
actionSubject: ACTION_SUBJECT.TEXT
|
|
80
|
+
})(replaceAll(replaceText));
|
|
81
|
+
};
|
|
70
82
|
};
|
|
71
|
-
export var cancelSearchWithAnalytics = function cancelSearchWithAnalytics(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
export var cancelSearchWithAnalytics = function cancelSearchWithAnalytics(editorAnalyticsAPI) {
|
|
84
|
+
return function (_ref7) {
|
|
85
|
+
var triggerMethod = _ref7.triggerMethod;
|
|
86
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
87
|
+
eventType: EVENT_TYPE.UI,
|
|
88
|
+
action: ACTION.DEACTIVATED,
|
|
89
|
+
actionSubject: ACTION_SUBJECT.FIND_REPLACE_DIALOG,
|
|
90
|
+
attributes: {
|
|
91
|
+
triggerMethod: triggerMethod
|
|
92
|
+
}
|
|
93
|
+
})(cancelSearch());
|
|
94
|
+
};
|
|
81
95
|
};
|
|
@@ -19,7 +19,8 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
|
19
19
|
}, {
|
|
20
20
|
name: 'findReplaceKeymap',
|
|
21
21
|
plugin: function plugin() {
|
|
22
|
-
|
|
22
|
+
var _api$analytics;
|
|
23
|
+
return keymapPlugin(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions);
|
|
23
24
|
}
|
|
24
25
|
}];
|
|
25
26
|
},
|
|
@@ -34,6 +35,7 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
|
34
35
|
if (props !== null && props !== void 0 && props.twoLineEditorToolbar) {
|
|
35
36
|
return null;
|
|
36
37
|
} else {
|
|
38
|
+
var _api$analytics2;
|
|
37
39
|
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
38
40
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
39
41
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -43,7 +45,8 @@ export var findReplacePlugin = function findReplacePlugin(_ref) {
|
|
|
43
45
|
containerElement: containerElement,
|
|
44
46
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
45
47
|
takeFullWidth: props === null || props === void 0 ? void 0 : props.takeFullWidth,
|
|
46
|
-
featureFlags: featureFlags
|
|
48
|
+
featureFlags: featureFlags,
|
|
49
|
+
editorAnalyticsAPI: api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions
|
|
47
50
|
});
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -2,17 +2,17 @@ import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
|
2
2
|
import { bindKeymapWithCommand, find as findKeymap } from '../../keymaps';
|
|
3
3
|
import { activateWithAnalytics } from './commands-with-analytics';
|
|
4
4
|
import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
var activateFindReplace = function activateFindReplace() {
|
|
5
|
+
var activateFindReplace = function activateFindReplace(editorAnalyticsAPI) {
|
|
6
6
|
return function (state, dispatch) {
|
|
7
|
-
activateWithAnalytics({
|
|
7
|
+
activateWithAnalytics(editorAnalyticsAPI)({
|
|
8
8
|
triggerMethod: TRIGGER_METHOD.SHORTCUT
|
|
9
9
|
})(state, dispatch);
|
|
10
10
|
return true;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
var keymapPlugin = function keymapPlugin() {
|
|
13
|
+
var keymapPlugin = function keymapPlugin(editorAnalyticsAPI) {
|
|
14
14
|
var list = {};
|
|
15
|
-
bindKeymapWithCommand(findKeymap.common, activateFindReplace(), list);
|
|
15
|
+
bindKeymapWithCommand(findKeymap.common, activateFindReplace(editorAnalyticsAPI), list);
|
|
16
16
|
return keymap(list);
|
|
17
17
|
};
|
|
18
18
|
export default keymapPlugin;
|
|
@@ -4,7 +4,6 @@ export { default as extensionPlugin } from './extension';
|
|
|
4
4
|
export { default as insertBlockPlugin } from './insert-block';
|
|
5
5
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
6
6
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
7
|
-
export { default as macroPlugin } from './macro';
|
|
8
7
|
export { default as pastePlugin } from './paste';
|
|
9
8
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
10
9
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -15,7 +14,6 @@ export { default as annotationPlugin } from './annotation';
|
|
|
15
14
|
export { default as analyticsPlugin } from './analytics';
|
|
16
15
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
17
16
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
18
|
-
export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
|
|
19
17
|
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
20
18
|
export { default as findReplacePlugin } from './find-replace';
|
|
21
19
|
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { insertMacroFromMacroBrowser } from '../macro';
|
|
4
|
-
import WithPluginState from '../../ui/WithPluginState';
|
|
5
3
|
import ToolbarInsertBlock from './ui/ToolbarInsertBlock';
|
|
6
4
|
import { BLOCK_QUOTE, CODE_BLOCK, PANEL } from '@atlaskit/editor-plugin-block-type/consts';
|
|
7
5
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import {
|
|
9
|
-
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
6
|
+
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
10
7
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
8
|
var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
12
9
|
switch (toolbarSize) {
|
|
@@ -62,34 +59,22 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
62
59
|
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
63
60
|
isLastItem = _ref2.isLastItem;
|
|
64
61
|
var renderNode = function renderNode(providers) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
82
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
83
|
-
toolbarSize: toolbarSize,
|
|
84
|
-
disabled: disabled,
|
|
85
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
86
|
-
isLastItem: isLastItem,
|
|
87
|
-
featureFlags: featureFlags,
|
|
88
|
-
macroState: macroState,
|
|
89
|
-
providers: providers,
|
|
90
|
-
options: options
|
|
91
|
-
});
|
|
92
|
-
}
|
|
62
|
+
return /*#__PURE__*/React.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
63
|
+
pluginInjectionApi: api,
|
|
64
|
+
editorView: editorView,
|
|
65
|
+
editorActions: editorActions,
|
|
66
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
67
|
+
providerFactory: providerFactory,
|
|
68
|
+
popupsMountPoint: popupsMountPoint,
|
|
69
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
70
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
71
|
+
toolbarSize: toolbarSize,
|
|
72
|
+
disabled: disabled,
|
|
73
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
74
|
+
isLastItem: isLastItem,
|
|
75
|
+
featureFlags: featureFlags,
|
|
76
|
+
providers: providers,
|
|
77
|
+
options: options
|
|
93
78
|
});
|
|
94
79
|
};
|
|
95
80
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
@@ -100,23 +85,22 @@ var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
100
85
|
}
|
|
101
86
|
};
|
|
102
87
|
};
|
|
103
|
-
function ToolbarInsertBlockWithInjectionApi(
|
|
104
|
-
var
|
|
105
|
-
var editorView =
|
|
106
|
-
editorActions =
|
|
107
|
-
dispatchAnalyticsEvent =
|
|
108
|
-
popupsMountPoint =
|
|
109
|
-
popupsBoundariesElement =
|
|
110
|
-
popupsScrollableElement =
|
|
111
|
-
toolbarSize =
|
|
112
|
-
disabled =
|
|
113
|
-
isToolbarReducedSpacing =
|
|
114
|
-
isLastItem =
|
|
115
|
-
providers =
|
|
116
|
-
pluginInjectionApi =
|
|
117
|
-
options =
|
|
118
|
-
|
|
119
|
-
featureFlags = _ref4.featureFlags;
|
|
88
|
+
function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
89
|
+
var _ref4, _ref5, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
90
|
+
var editorView = _ref3.editorView,
|
|
91
|
+
editorActions = _ref3.editorActions,
|
|
92
|
+
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
93
|
+
popupsMountPoint = _ref3.popupsMountPoint,
|
|
94
|
+
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
95
|
+
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
96
|
+
toolbarSize = _ref3.toolbarSize,
|
|
97
|
+
disabled = _ref3.disabled,
|
|
98
|
+
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
99
|
+
isLastItem = _ref3.isLastItem,
|
|
100
|
+
providers = _ref3.providers,
|
|
101
|
+
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
102
|
+
options = _ref3.options,
|
|
103
|
+
featureFlags = _ref3.featureFlags;
|
|
120
104
|
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
121
105
|
var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
|
|
122
106
|
dateState = _useSharedPluginState.dateState,
|
|
@@ -144,8 +128,8 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
144
128
|
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
145
129
|
layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
|
|
146
130
|
expandEnabled: !!options.allowExpand,
|
|
147
|
-
mediaUploadsEnabled: (
|
|
148
|
-
onShowMediaPicker: (
|
|
131
|
+
mediaUploadsEnabled: (_ref4 = mediaState && mediaState.allowsUploads) !== null && _ref4 !== void 0 ? _ref4 : undefined,
|
|
132
|
+
onShowMediaPicker: (_ref5 = mediaState && mediaState.showMediaPicker) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
149
133
|
mediaSupported: !!mediaState,
|
|
150
134
|
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
151
135
|
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
@@ -158,8 +142,7 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
158
142
|
nativeStatusSupported: options.nativeStatusSupported,
|
|
159
143
|
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
160
144
|
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
161
|
-
onInsertMacroFromMacroBrowser:
|
|
162
|
-
macroProvider: macroState.macroProvider,
|
|
145
|
+
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
163
146
|
popupsMountPoint: popupsMountPoint,
|
|
164
147
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
165
148
|
popupsScrollableElement: popupsScrollableElement,
|
|
@@ -11,8 +11,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
11
11
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
12
12
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
13
13
|
import { borderRadius } from '@atlaskit/theme';
|
|
14
|
-
import {
|
|
15
|
-
import { DN50, N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
14
|
+
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
16
15
|
import { IconCode, IconDate, IconDecision, IconDivider, IconExpand, IconPanel, IconQuote, IconStatus } from '@atlaskit/editor-common/quick-insert';
|
|
17
16
|
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
18
17
|
import { ElementBrowser, ELEMENT_ITEM_HEIGHT } from '@atlaskit/editor-common/element-browser';
|
|
@@ -86,9 +85,7 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
86
85
|
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems]);
|
|
87
86
|
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 || (_pluginInjectionApi$q7 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.emptyStateHandler;
|
|
88
87
|
return jsx("div", {
|
|
89
|
-
css:
|
|
90
|
-
return insertMenuWrapper(theme, itemCount);
|
|
91
|
-
}
|
|
88
|
+
css: insertMenuWrapper(itemCount)
|
|
92
89
|
}, jsx(ElementBrowserWrapper, {
|
|
93
90
|
handleClickOutside: toggleVisiblity,
|
|
94
91
|
handleEscapeKeydown: toggleVisiblity,
|
|
@@ -132,13 +129,10 @@ var getInsertMenuHeight = function getInsertMenuHeight(_ref3) {
|
|
|
132
129
|
return 560; // For showing 6 Elements.
|
|
133
130
|
};
|
|
134
131
|
|
|
135
|
-
var insertMenuWrapper = function insertMenuWrapper(
|
|
132
|
+
var insertMenuWrapper = function insertMenuWrapper(itemCount) {
|
|
136
133
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n width: 320px;\n height: ", "px;\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n"])), getInsertMenuHeight({
|
|
137
134
|
itemCount: itemCount
|
|
138
|
-
}),
|
|
139
|
-
light: "var(--ds-surface-overlay, ".concat(N0, ")"),
|
|
140
|
-
dark: "var(--ds-surface-overlay, ".concat(DN50, ")")
|
|
141
|
-
})(theme), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ",\n 0 2px 1px ").concat(N30A, ",\n 0 0 20px -6px ").concat(N60A), ")"));
|
|
135
|
+
}), "var(--ds-surface-overlay, ".concat(N0, ")"), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(N30A, ",\n 0 2px 1px ").concat(N30A, ",\n 0 0 20px -6px ").concat(N60A), ")"));
|
|
142
136
|
};
|
|
143
137
|
var flexWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
144
138
|
var FlexWrapper = function FlexWrapper(props) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
3
|
-
import InsertMenu from '
|
|
3
|
+
import InsertMenu from '../ElementBrowser/InsertMenu';
|
|
4
4
|
import { DropDownButton } from './dropdown-button';
|
|
5
5
|
export var BlockInsertElementBrowser = function BlockInsertElementBrowser(props) {
|
|
6
6
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
@@ -7,7 +7,7 @@ import memoize from 'lodash/memoize';
|
|
|
7
7
|
import memoizeOne from 'memoize-one';
|
|
8
8
|
import { messages } from './messages';
|
|
9
9
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
10
|
-
import { ToolTipContent } from '
|
|
10
|
+
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import { sortItems } from './sort-items';
|
|
12
12
|
import { action, link, media, mention, emoji, table, layout, codeblock, panel, blockquote, decision, horizontalrule, expand, date, placeholder, status, more, imageUpload } from './item';
|
|
13
13
|
import { shallowEquals } from './shallow-equals';
|
|
@@ -3,8 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import AddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
5
5
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
6
|
-
import { ToolTipContent } from '
|
|
7
|
-
import ToolbarButton from '
|
|
6
|
+
import { ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
7
|
+
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
8
8
|
import { expandIconWrapperStyle } from '@atlaskit/editor-common/styles';
|
|
9
9
|
import { triggerWrapper } from './styles';
|
|
10
10
|
var DropDownButtonIcon = /*#__PURE__*/React.memo(function (props) {
|
|
@@ -17,7 +17,7 @@ import ReactDOM from 'react-dom';
|
|
|
17
17
|
import { injectIntl } from 'react-intl-next';
|
|
18
18
|
import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
|
|
19
19
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
20
|
-
import ToolbarButton from '
|
|
20
|
+
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
21
21
|
import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
22
22
|
import { akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
23
23
|
import { insertTaskDecisionCommand } from '../../../tasks-and-decisions/commands';
|
|
@@ -25,7 +25,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
25
25
|
import { messages } from './messages';
|
|
26
26
|
import { createItems } from './create-items';
|
|
27
27
|
import { BlockInsertMenu } from './block-insert-menu';
|
|
28
|
-
import withOuterListeners from '
|
|
28
|
+
import { withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Checks if an element is detached (i.e. not in the current document)
|
|
@@ -538,7 +538,6 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
538
538
|
horizontalRuleEnabled: props.horizontalRuleEnabled,
|
|
539
539
|
layoutSectionEnabled: props.layoutSectionEnabled,
|
|
540
540
|
expandEnabled: props.expandEnabled,
|
|
541
|
-
macroProvider: props.macroProvider,
|
|
542
541
|
showElementBrowserLink: props.showElementBrowserLink,
|
|
543
542
|
emojiProvider: props.emojiProvider,
|
|
544
543
|
availableWrapperBlockTypes: props.availableWrapperBlockTypes,
|
|
@@ -19,8 +19,8 @@ import HorizontalRuleIcon from '@atlaskit/icon/glyph/editor/horizontal-rule';
|
|
|
19
19
|
import CodeIcon from '@atlaskit/icon/glyph/editor/code';
|
|
20
20
|
import InfoIcon from '@atlaskit/icon/glyph/editor/info';
|
|
21
21
|
import QuoteIcon from '@atlaskit/icon/glyph/quote';
|
|
22
|
-
import { shortcutStyle } from '
|
|
23
|
-
import { tooltip, addLink, toggleTable } from '
|
|
22
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
23
|
+
import { tooltip, addLink, toggleTable } from '@atlaskit/editor-common/keymaps';
|
|
24
24
|
import { shallowEquals } from './shallow-equals';
|
|
25
25
|
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
26
26
|
var from = function from(init) {
|
|
@@ -17,7 +17,7 @@ import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
|
17
17
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
19
19
|
// TODO: ED-20519 Needs Macro extraction
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
|
|
22
22
|
import { insertSliceForLists } from './edge-cases';
|
|
23
23
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
@@ -486,7 +486,7 @@ function insertAutoMacro(slice, macro, view, from, to) {
|
|
|
486
486
|
}
|
|
487
487
|
return false;
|
|
488
488
|
}
|
|
489
|
-
export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, cardsOptions, extensionAutoConverter) {
|
|
489
|
+
export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, runMacroAutoConvert, cardsOptions, extensionAutoConverter) {
|
|
490
490
|
return function (state, dispatch, view) {
|
|
491
491
|
var macro = null;
|
|
492
492
|
|
|
@@ -500,7 +500,8 @@ export function handleMacroAutoConvert(text, slice, queueCardsFromChangedTr, car
|
|
|
500
500
|
|
|
501
501
|
// then try from macro provider (which will be removed some time in the future)
|
|
502
502
|
if (!macro) {
|
|
503
|
-
|
|
503
|
+
var _runMacroAutoConvert;
|
|
504
|
+
macro = (_runMacroAutoConvert = runMacroAutoConvert === null || runMacroAutoConvert === void 0 ? void 0 : runMacroAutoConvert(state, text)) !== null && _runMacroAutoConvert !== void 0 ? _runMacroAutoConvert : null;
|
|
504
505
|
}
|
|
505
506
|
if (macro) {
|
|
506
507
|
/**
|
|
@@ -241,14 +241,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
241
241
|
// force a "paste as plain text" action by clearing the markdownSlice.
|
|
242
242
|
markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
|
|
243
243
|
if (markdownSlice) {
|
|
244
|
-
var _pluginInjectionApi$c;
|
|
244
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$e;
|
|
245
245
|
// linkify text prior to converting to macro
|
|
246
246
|
if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
|
|
247
247
|
return true;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// run macro autoconvert prior to other conversions
|
|
251
|
-
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
251
|
+
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.card) === null || _pluginInjectionApi$c === void 0 || (_pluginInjectionApi$c = _pluginInjectionApi$c.actions) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.queueCardsFromChangedTr, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 || (_pluginInjectionApi$e = _pluginInjectionApi$e.actions) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.runMacroAutoConvert, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
252
252
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
253
253
|
sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, markdownSlice, {
|
|
254
254
|
type: PasteTypes.markdown
|
|
@@ -313,7 +313,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
313
313
|
|
|
314
314
|
// finally, handle rich-text copy-paste
|
|
315
315
|
if (isRichText) {
|
|
316
|
-
var _pluginInjectionApi$c2, _pluginInjectionApi$l;
|
|
316
|
+
var _pluginInjectionApi$c2, _pluginInjectionApi$e2, _pluginInjectionApi$l;
|
|
317
317
|
// linkify the text where possible
|
|
318
318
|
slice = linkifyContent(state.schema)(slice);
|
|
319
319
|
if (handlePasteLinkOnSelectedTextWithAnalytics(editorAnalyticsAPI)(view, event, slice, PasteTypes.richText)(state, dispatch)) {
|
|
@@ -321,7 +321,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// run macro autoconvert prior to other conversions
|
|
324
|
-
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.card) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
324
|
+
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.card) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.actions) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.queueCardsFromChangedTr, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.extension) === null || _pluginInjectionApi$e2 === void 0 || (_pluginInjectionApi$e2 = _pluginInjectionApi$e2.actions) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.runMacroAutoConvert, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
325
325
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
326
326
|
sendPasteAnalyticsEvent(editorAnalyticsAPI)(view, event, slice, {
|
|
327
327
|
type: PasteTypes.richText
|
|
@@ -14,11 +14,11 @@ export var PresetContextProvider = function PresetContextProvider(_ref) {
|
|
|
14
14
|
}
|
|
15
15
|
}, children);
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export function usePresetContext() {
|
|
18
18
|
var _useContext = useContext(EditorAPIContext),
|
|
19
19
|
editorApi = _useContext.editorApi;
|
|
20
20
|
return editorApi;
|
|
21
|
-
}
|
|
21
|
+
}
|
|
22
22
|
export var useSetPresetContext = function useSetPresetContext() {
|
|
23
23
|
var _useContext2 = useContext(EditorAPIContext),
|
|
24
24
|
setEditorApi = _useContext2.setEditorApi;
|
|
@@ -2,7 +2,7 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin,
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, tasksAndDecisionsPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
6
6
|
import { panelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
7
7
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
8
8
|
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
@@ -31,6 +31,7 @@ import { saveOnEnterPlugin } from '@atlaskit/editor-plugin-save-on-enter';
|
|
|
31
31
|
import { scrollIntoViewPlugin } from '@atlaskit/editor-plugin-scroll-into-view';
|
|
32
32
|
import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
33
33
|
import { placeholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
|
|
34
|
+
import { expandPlugin } from '@atlaskit/editor-plugin-expand';
|
|
34
35
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
35
36
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
36
37
|
import { createDefaultPreset } from './default';
|
|
@@ -265,11 +266,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
265
266
|
}]);
|
|
266
267
|
}
|
|
267
268
|
return builder;
|
|
268
|
-
}).maybeAdd(macroPlugin, function (plugin, builder) {
|
|
269
|
-
if (props.macroProvider) {
|
|
270
|
-
return builder.add(plugin);
|
|
271
|
-
}
|
|
272
|
-
return builder;
|
|
273
269
|
}).maybeAdd(annotationPlugin, function (plugin, builder) {
|
|
274
270
|
// See default list for when adding annotations with a provider
|
|
275
271
|
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
@@ -412,4 +408,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
412
408
|
appearance: appearance
|
|
413
409
|
}]);
|
|
414
410
|
return finalPreset;
|
|
411
|
+
}
|
|
412
|
+
export function isExpandInsertionEnabled(_ref) {
|
|
413
|
+
var allowExpand = _ref.allowExpand;
|
|
414
|
+
if (allowExpand && _typeof(allowExpand) === 'object') {
|
|
415
|
+
return !!allowExpand.allowInsertion;
|
|
416
|
+
}
|
|
417
|
+
return false;
|
|
415
418
|
}
|
|
@@ -203,7 +203,7 @@ function RenderWithPluginState(_ref4) {
|
|
|
203
203
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState;
|
|
204
204
|
return jsx(Fragment, null, renderChrome({
|
|
205
205
|
maxContentSize: maxContentSizeState,
|
|
206
|
-
mediaState: mediaState
|
|
206
|
+
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined
|
|
207
207
|
}));
|
|
208
208
|
}
|
|
209
209
|
export var CommentEditorWithIntl = injectIntl(Editor);
|
|
@@ -14,7 +14,7 @@ import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
|
14
14
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
15
15
|
import { usePresetContext } from '../../../presets/context';
|
|
16
16
|
export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
17
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
17
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _editorAPI$analytics;
|
|
18
18
|
var _useState = useState(false),
|
|
19
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
20
|
shouldSplitToolbar = _useState2[0],
|
|
@@ -66,7 +66,8 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
66
66
|
editorView: props.editorView,
|
|
67
67
|
containerElement: props.containerElement,
|
|
68
68
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
69
|
-
featureFlags: props.featureFlags
|
|
69
|
+
featureFlags: props.featureFlags,
|
|
70
|
+
editorAnalyticsAPI: editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions
|
|
70
71
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
71
72
|
useEffect(function () {
|
|
72
73
|
if (twoLineEditorToolbar) {
|