@atlaskit/editor-core 189.3.15 → 189.3.17
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 +14 -0
- 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/index.js +0 -7
- 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/universal.js +2 -7
- package/dist/cjs/version-wrapper.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/index.js +0 -1
- 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/universal.js +3 -8
- package/dist/es2019/version-wrapper.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/index.js +0 -1
- 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/universal.js +3 -8
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/extension/extension-api.d.ts +1 -1
- package/dist/types/plugins/{macro → 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/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- 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/paste/handlers.d.ts +2 -1
- package/dist/types/presets/default.d.ts +8 -0
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
- package/dist/types-ts4.5/plugins/{macro → 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/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- 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/paste/handlers.d.ts +2 -1
- package/dist/types-ts4.5/presets/default.d.ts +8 -0
- package/package.json +5 -5
- package/dist/types/plugins/macro/types.d.ts +0 -4
- 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/{macro → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/cjs/{ui → plugins/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/{macro → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/types.js +0 -0
- /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/esm/{ui → plugins/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,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
|
|
@@ -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';
|
|
@@ -33,7 +33,6 @@ import { mentionsPlugin } from '@atlaskit/editor-plugin-mentions';
|
|
|
33
33
|
import { placeholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-text';
|
|
34
34
|
import { expandPlugin } from '@atlaskit/editor-plugin-expand';
|
|
35
35
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
36
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
37
36
|
import { createDefaultPreset } from './default';
|
|
38
37
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
39
38
|
/**
|
|
@@ -137,8 +136,9 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
137
136
|
}
|
|
138
137
|
return builder;
|
|
139
138
|
}).maybeAdd(captionPlugin, function (plugin, builder) {
|
|
139
|
+
var _props$media;
|
|
140
140
|
// EDM-799: inside caption plugin we do the feature flag in enabling the plugin
|
|
141
|
-
if (props.media &&
|
|
141
|
+
if ((_props$media = props.media) !== null && _props$media !== void 0 && _props$media.allowCaptions) {
|
|
142
142
|
return builder.add(plugin);
|
|
143
143
|
}
|
|
144
144
|
return builder;
|
|
@@ -266,11 +266,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
266
266
|
}]);
|
|
267
267
|
}
|
|
268
268
|
return builder;
|
|
269
|
-
}).maybeAdd(macroPlugin, function (plugin, builder) {
|
|
270
|
-
if (props.macroProvider) {
|
|
271
|
-
return builder.add(plugin);
|
|
272
|
-
}
|
|
273
|
-
return builder;
|
|
274
269
|
}).maybeAdd(annotationPlugin, function (plugin, builder) {
|
|
275
270
|
// See default list for when adding annotations with a provider
|
|
276
271
|
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "189.3.
|
|
2
|
+
export var version = "189.3.17";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { MacroProvider } from '
|
|
2
|
+
import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { CreateExtensionAPI } from '@atlaskit/editor-plugin-extension';
|
|
5
5
|
interface EditInLegacyMacroBrowserArgs {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { Dispatch } from '
|
|
4
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
4
|
import type { MacroState } from './types';
|
|
6
5
|
export type { MacroProvider, MacroAttributes, ExtensionType, } from '@atlaskit/editor-common/provider-factory';
|
|
7
6
|
export { insertMacroFromMacroBrowser, resolveMacro, runMacroAutoConvert, setMacroProvider, } from './actions';
|
|
8
7
|
export type { MacroState };
|
|
9
8
|
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory) => SafePlugin<any>;
|
|
10
|
-
declare const macroPlugin: NextEditorPlugin<'macro'>;
|
|
11
|
-
export default macroPlugin;
|
|
@@ -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';
|
|
@@ -4,6 +4,7 @@ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
|
4
4
|
import type { DatePlugin } from '@atlaskit/editor-plugin-date';
|
|
5
5
|
import type { TablePlugin } from '@atlaskit/editor-plugin-table';
|
|
6
6
|
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
7
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
7
8
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
8
9
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
10
|
import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
@@ -37,5 +38,6 @@ export type InsertBlockPluginDependencies = [
|
|
|
37
38
|
OptionalPlugin<StatusPlugin>,
|
|
38
39
|
OptionalPlugin<LayoutPlugin>,
|
|
39
40
|
OptionalPlugin<ExpandPlugin>,
|
|
40
|
-
OptionalPlugin<PlaceholderTextPlugin
|
|
41
|
+
OptionalPlugin<PlaceholderTextPlugin>,
|
|
42
|
+
OptionalPlugin<ExtensionPlugin>
|
|
41
43
|
];
|
|
@@ -2,8 +2,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
|
-
import type { InsertBlockPluginDependencies } from '../../
|
|
6
|
-
import type { BlockMenuItem } from '
|
|
5
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
6
|
+
import type { BlockMenuItem } from '../ToolbarInsertBlock/create-items';
|
|
7
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
8
8
|
export interface InsertMenuProps {
|
|
9
9
|
dropdownItems: BlockMenuItem[];
|
package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { BlockMenuItem } from './create-items';
|
|
4
|
-
import type { OnInsert } from '
|
|
4
|
+
import type { OnInsert } from '../ElementBrowser/types';
|
|
5
5
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { InsertBlockPluginDependencies } from '../../types';
|
|
7
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { OnInsert } from '
|
|
3
|
+
import type { OnInsert } from '../ElementBrowser/types';
|
|
4
4
|
import type { BlockMenuItem } from './create-items';
|
|
5
5
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { InsertBlockPluginDependencies } from '../../types';
|
|
@@ -4,7 +4,6 @@ import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { EmojiProvider } from '@atlaskit/emoji/resource';
|
|
5
5
|
import type { BlockType } from '@atlaskit/editor-plugin-block-type';
|
|
6
6
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
7
|
-
import type { MacroProvider } from '../../../macro';
|
|
8
7
|
export interface CreateItemsConfig {
|
|
9
8
|
isTypeAheadAllowed?: boolean;
|
|
10
9
|
tableSupported?: boolean;
|
|
@@ -28,7 +27,6 @@ export interface CreateItemsConfig {
|
|
|
28
27
|
showElementBrowserLink?: boolean;
|
|
29
28
|
expandEnabled?: boolean;
|
|
30
29
|
insertMenuItems?: MenuItem[];
|
|
31
|
-
macroProvider?: MacroProvider | null;
|
|
32
30
|
emojiProvider?: Promise<EmojiProvider>;
|
|
33
31
|
schema: Schema;
|
|
34
32
|
numberOfButtons: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { ToolbarButtonRef } from '
|
|
3
|
+
import type { ToolbarButtonRef } from '@atlaskit/editor-common/ui-menu';
|
|
4
4
|
export interface DropDownButtonProps {
|
|
5
5
|
label: string;
|
|
6
6
|
selected: boolean;
|
|
@@ -38,7 +38,6 @@ export interface Props {
|
|
|
38
38
|
popupsMountPoint?: HTMLElement;
|
|
39
39
|
popupsBoundariesElement?: HTMLElement;
|
|
40
40
|
popupsScrollableElement?: HTMLElement;
|
|
41
|
-
macroProvider?: MacroProvider | null;
|
|
42
41
|
insertMenuItems?: MenuItem[];
|
|
43
42
|
showElementBrowserLink?: boolean;
|
|
44
43
|
showSeparator?: boolean;
|
|
@@ -4,6 +4,7 @@ import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state'
|
|
|
4
4
|
import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { InputMethodInsertMedia, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { RunMacroAutoConvert } from '@atlaskit/editor-plugin-extension';
|
|
7
8
|
import type { InsertMediaAsMediaSingle } from '@atlaskit/editor-plugin-media/types';
|
|
8
9
|
import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
|
|
9
10
|
import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
|
|
@@ -15,7 +16,7 @@ export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice,
|
|
|
15
16
|
export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
|
|
16
17
|
export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent, editorAnalyticsAPI: EditorAnalyticsAPI | undefined): Command;
|
|
17
18
|
export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
|
18
|
-
export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
|
|
19
|
+
export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, runMacroAutoConvert: RunMacroAutoConvert | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
|
|
19
20
|
export declare function handleCodeBlock(text: string): Command;
|
|
20
21
|
export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia, insertMediaAsMediaSingle: InsertMediaAsMediaSingle | undefined): (slice: Slice) => Command;
|
|
21
22
|
export declare function handleExpandPasteInTable(slice: Slice): Command;
|
|
@@ -113,6 +113,8 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
113
113
|
}, undefined>>];
|
|
114
114
|
actions: {
|
|
115
115
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
116
|
+
insertMacroFromMacroBrowser: (macroProvider: import("@atlaskit/editor-common/provider-factory").MacroProvider, macroNode?: import("prosemirror-model").Node | undefined, isEditing?: boolean | undefined) => (view: import("prosemirror-view").EditorView) => Promise<boolean>;
|
|
117
|
+
runMacroAutoConvert: import("@atlaskit/editor-plugin-extension").RunMacroAutoConvert;
|
|
116
118
|
};
|
|
117
119
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
118
120
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
@@ -252,6 +254,8 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
252
254
|
}, undefined>>];
|
|
253
255
|
actions: {
|
|
254
256
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
257
|
+
insertMacroFromMacroBrowser: (macroProvider: import("@atlaskit/editor-common/provider-factory").MacroProvider, macroNode?: import("prosemirror-model").Node | undefined, isEditing?: boolean | undefined) => (view: import("prosemirror-view").EditorView) => Promise<boolean>;
|
|
258
|
+
runMacroAutoConvert: import("@atlaskit/editor-plugin-extension").RunMacroAutoConvert;
|
|
255
259
|
};
|
|
256
260
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
257
261
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
@@ -598,6 +602,8 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
598
602
|
}, undefined>>];
|
|
599
603
|
actions: {
|
|
600
604
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
605
|
+
insertMacroFromMacroBrowser: (macroProvider: import("@atlaskit/editor-common/provider-factory").MacroProvider, macroNode?: import("prosemirror-model").Node | undefined, isEditing?: boolean | undefined) => (view: import("prosemirror-view").EditorView) => Promise<boolean>;
|
|
606
|
+
runMacroAutoConvert: import("@atlaskit/editor-plugin-extension").RunMacroAutoConvert;
|
|
601
607
|
};
|
|
602
608
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
603
609
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
@@ -737,6 +743,8 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
737
743
|
}, undefined>>];
|
|
738
744
|
actions: {
|
|
739
745
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
746
|
+
insertMacroFromMacroBrowser: (macroProvider: import("@atlaskit/editor-common/provider-factory").MacroProvider, macroNode?: import("prosemirror-model").Node | undefined, isEditing?: boolean | undefined) => (view: import("prosemirror-view").EditorView) => Promise<boolean>;
|
|
747
|
+
runMacroAutoConvert: import("@atlaskit/editor-plugin-extension").RunMacroAutoConvert;
|
|
740
748
|
};
|
|
741
749
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
742
750
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { MacroProvider } from '
|
|
2
|
+
import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import type { CreateExtensionAPI } from '@atlaskit/editor-plugin-extension';
|
|
5
5
|
interface EditInLegacyMacroBrowserArgs {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { Dispatch } from '
|
|
4
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
4
|
import type { MacroState } from './types';
|
|
6
5
|
export type { MacroProvider, MacroAttributes, ExtensionType, } from '@atlaskit/editor-common/provider-factory';
|
|
7
6
|
export { insertMacroFromMacroBrowser, resolveMacro, runMacroAutoConvert, setMacroProvider, } from './actions';
|
|
8
7
|
export type { MacroState };
|
|
9
8
|
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory) => SafePlugin<any>;
|
|
10
|
-
declare const macroPlugin: NextEditorPlugin<'macro'>;
|
|
11
|
-
export default macroPlugin;
|
|
@@ -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';
|
|
@@ -4,6 +4,7 @@ import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
|
4
4
|
import type { DatePlugin } from '@atlaskit/editor-plugin-date';
|
|
5
5
|
import type { TablePlugin } from '@atlaskit/editor-plugin-table';
|
|
6
6
|
import type { HyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
|
|
7
|
+
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
7
8
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
8
9
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
10
|
import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
@@ -37,5 +38,6 @@ export type InsertBlockPluginDependencies = [
|
|
|
37
38
|
OptionalPlugin<StatusPlugin>,
|
|
38
39
|
OptionalPlugin<LayoutPlugin>,
|
|
39
40
|
OptionalPlugin<ExpandPlugin>,
|
|
40
|
-
OptionalPlugin<PlaceholderTextPlugin
|
|
41
|
+
OptionalPlugin<PlaceholderTextPlugin>,
|
|
42
|
+
OptionalPlugin<ExtensionPlugin>
|
|
41
43
|
];
|
|
@@ -2,8 +2,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
|
-
import type { InsertBlockPluginDependencies } from '../../
|
|
6
|
-
import type { BlockMenuItem } from '
|
|
5
|
+
import type { InsertBlockPluginDependencies } from '../../types';
|
|
6
|
+
import type { BlockMenuItem } from '../ToolbarInsertBlock/create-items';
|
|
7
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|
|
8
8
|
export interface InsertMenuProps {
|
|
9
9
|
dropdownItems: BlockMenuItem[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { BlockMenuItem } from './create-items';
|
|
4
|
-
import type { OnInsert } from '
|
|
4
|
+
import type { OnInsert } from '../ElementBrowser/types';
|
|
5
5
|
import type { PluginInjectionAPIWithDependencies } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { InsertBlockPluginDependencies } from '../../types';
|
|
7
7
|
type SimpleEventHandler<T> = (event?: T) => void;
|