@atlaskit/editor-core 185.6.5 → 185.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/plugins/card/index.js +14 -0
- package/dist/cjs/plugins/card/nodeviews/datasource.js +2 -4
- package/dist/cjs/plugins/card/pm-plugins/main.js +2 -1
- package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +46 -0
- package/dist/cjs/plugins/card/toolbar.js +4 -5
- package/dist/cjs/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +24 -20
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +2 -2
- package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +2 -2
- package/dist/cjs/plugins/card/utils.js +2 -30
- package/dist/cjs/plugins/hyperlink/Toolbar.js +18 -30
- package/dist/cjs/plugins/hyperlink/commands.js +7 -3
- package/dist/cjs/plugins/hyperlink/index.js +9 -2
- package/dist/cjs/plugins/hyperlink/pm-plugins/toolbar-buttons.js +41 -0
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +8 -4
- package/dist/cjs/plugins/media/index.js +9 -1
- package/dist/cjs/plugins/media/toolbar/index.js +3 -3
- package/dist/cjs/plugins/media/utils/media-common.js +1 -1
- package/dist/cjs/plugins/paste/handlers.js +12 -12
- package/dist/cjs/plugins/paste/index.js +1 -1
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +12 -8
- package/dist/cjs/plugins/paste/pm-plugins/main.js +18 -17
- package/dist/cjs/plugins/paste/util/index.js +29 -2
- package/dist/cjs/ui/ContentStyles/index.js +2 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/card/index.js +12 -0
- package/dist/es2019/plugins/card/nodeviews/datasource.js +1 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +36 -0
- package/dist/es2019/plugins/card/toolbar.js +4 -3
- package/dist/es2019/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +12 -13
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -1
- package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +1 -1
- package/dist/es2019/plugins/card/utils.js +0 -28
- package/dist/es2019/plugins/hyperlink/Toolbar.js +21 -30
- package/dist/es2019/plugins/hyperlink/commands.js +6 -3
- package/dist/es2019/plugins/hyperlink/index.js +9 -2
- package/dist/es2019/plugins/hyperlink/pm-plugins/toolbar-buttons.js +37 -0
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +11 -4
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +13 -5
- package/dist/es2019/plugins/media/index.js +10 -2
- package/dist/es2019/plugins/media/toolbar/index.js +1 -1
- package/dist/es2019/plugins/media/utils/media-common.js +1 -1
- package/dist/es2019/plugins/paste/handlers.js +12 -13
- package/dist/es2019/plugins/paste/index.js +1 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +24 -12
- package/dist/es2019/plugins/paste/pm-plugins/main.js +11 -10
- package/dist/es2019/plugins/paste/util/index.js +28 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/card/index.js +14 -0
- package/dist/esm/plugins/card/nodeviews/datasource.js +1 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +38 -0
- package/dist/esm/plugins/card/toolbar.js +4 -3
- package/dist/esm/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.js +5 -3
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +14 -13
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -1
- package/dist/esm/plugins/card/ui/SmallerEditIcon.js +1 -1
- package/dist/esm/plugins/card/utils.js +0 -27
- package/dist/esm/plugins/hyperlink/Toolbar.js +19 -30
- package/dist/esm/plugins/hyperlink/commands.js +6 -3
- package/dist/esm/plugins/hyperlink/index.js +9 -2
- package/dist/esm/plugins/hyperlink/pm-plugins/toolbar-buttons.js +32 -0
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +7 -4
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +9 -5
- package/dist/esm/plugins/media/index.js +10 -2
- package/dist/esm/plugins/media/toolbar/index.js +1 -1
- package/dist/esm/plugins/media/utils/media-common.js +1 -1
- package/dist/esm/plugins/paste/handlers.js +12 -13
- package/dist/esm/plugins/paste/index.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +12 -8
- package/dist/esm/plugins/paste/pm-plugins/main.js +11 -10
- package/dist/esm/plugins/paste/util/index.js +27 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +6 -0
- package/dist/types/labs/next/presets/default.d.ts +12 -0
- package/dist/types/labs/next/presets/mobile.d.ts +6 -0
- package/dist/types/plugins/card/index.d.ts +5 -1
- package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -1
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +2 -1
- package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +5 -0
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -1
- package/dist/types/plugins/card/types.d.ts +2 -3
- package/dist/types/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.d.ts +2 -0
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +7 -5
- package/dist/types/plugins/card/utils.d.ts +1 -3
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +3 -2
- package/dist/types/plugins/hyperlink/commands.d.ts +2 -0
- package/dist/types/plugins/hyperlink/index.d.ts +11 -0
- package/dist/types/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +19 -0
- package/dist/types/plugins/paste/handlers.d.ts +6 -5
- package/dist/types/plugins/paste/index.d.ts +6 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -5
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/paste/util/index.d.ts +2 -0
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +6 -0
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +12 -0
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +6 -0
- package/dist/types-ts4.5/plugins/card/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +2 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +5 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/types.d.ts +2 -3
- package/dist/types-ts4.5/plugins/{hyperlink → card/ui}/HyperlinkToolbarAppearance.d.ts +2 -0
- package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +7 -5
- package/dist/types-ts4.5/plugins/card/utils.d.ts +1 -3
- package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +3 -2
- package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -0
- package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/hyperlink/pm-plugins/toolbar-buttons.d.ts +19 -0
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +6 -5
- package/dist/types-ts4.5/plugins/paste/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +6 -5
- package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +3 -2
- package/dist/types-ts4.5/plugins/paste/util/index.d.ts +2 -0
- package/package.json +12 -9
- package/dist/cjs/plugins/card/messages.js +0 -90
- package/dist/cjs/plugins/card/styles.js +0 -18
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +0 -63
- package/dist/cjs/plugins/card/ui/assets/card.js +0 -30
- package/dist/cjs/plugins/card/ui/assets/embed.js +0 -30
- package/dist/cjs/plugins/card/ui/assets/inline.js +0 -30
- package/dist/cjs/plugins/card/ui/assets/url.js +0 -32
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +0 -52
- package/dist/cjs/plugins/card/ui/styled.js +0 -16
- package/dist/cjs/plugins/card/ui/types.js +0 -5
- package/dist/es2019/plugins/card/messages.js +0 -83
- package/dist/es2019/plugins/card/styles.js +0 -132
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +0 -61
- package/dist/es2019/plugins/card/ui/assets/card.js +0 -22
- package/dist/es2019/plugins/card/ui/assets/embed.js +0 -22
- package/dist/es2019/plugins/card/ui/assets/inline.js +0 -22
- package/dist/es2019/plugins/card/ui/assets/url.js +0 -24
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +0 -45
- package/dist/es2019/plugins/card/ui/styled.js +0 -27
- package/dist/es2019/plugins/card/ui/types.js +0 -1
- package/dist/esm/plugins/card/messages.js +0 -83
- package/dist/esm/plugins/card/styles.js +0 -10
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +0 -56
- package/dist/esm/plugins/card/ui/assets/card.js +0 -22
- package/dist/esm/plugins/card/ui/assets/embed.js +0 -22
- package/dist/esm/plugins/card/ui/assets/inline.js +0 -22
- package/dist/esm/plugins/card/ui/assets/url.js +0 -24
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +0 -45
- package/dist/esm/plugins/card/ui/styled.js +0 -6
- package/dist/esm/plugins/card/ui/types.js +0 -1
- package/dist/types/plugins/card/messages.d.ts +0 -82
- package/dist/types/plugins/card/styles.d.ts +0 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +0 -16
- package/dist/types/plugins/card/ui/assets/card.d.ts +0 -3
- package/dist/types/plugins/card/ui/assets/embed.d.ts +0 -3
- package/dist/types/plugins/card/ui/assets/inline.d.ts +0 -3
- package/dist/types/plugins/card/ui/assets/url.d.ts +0 -3
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +0 -5
- package/dist/types/plugins/card/ui/styled.d.ts +0 -3
- package/dist/types/plugins/card/ui/types.d.ts +0 -12
- package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -82
- package/dist/types-ts4.5/plugins/card/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/card/ui/LinkToolbarButtonGroup.d.ts +0 -16
- package/dist/types-ts4.5/plugins/card/ui/assets/card.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/ui/assets/embed.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/ui/assets/inline.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/ui/assets/url.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/ui/link-toolbar-button-group-options.d.ts +0 -5
- package/dist/types-ts4.5/plugins/card/ui/styled.d.ts +0 -3
- package/dist/types-ts4.5/plugins/card/ui/types.d.ts +0 -12
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { Slice, Mark } from 'prosemirror-model';
|
|
2
|
+
import { Slice, Mark, Fragment } from 'prosemirror-model';
|
|
3
3
|
import { isMediaBlobUrl } from '@atlaskit/media-client';
|
|
4
4
|
import { ACTION_SUBJECT, addAnalytics, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '../../analytics';
|
|
5
5
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
6
6
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
7
7
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { sortByOrderWithTypeName } from '../../../create-editor/sort-by-order';
|
|
9
|
+
import { isSupportedInParent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
9
10
|
export function isPastedFromWord(html) {
|
|
10
11
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
11
12
|
}
|
|
@@ -165,4 +166,29 @@ export var addReplaceSelectedTableAnalytics = function addReplaceSelectedTableAn
|
|
|
165
166
|
return tr;
|
|
166
167
|
}
|
|
167
168
|
return state.tr;
|
|
169
|
+
};
|
|
170
|
+
export var transformUnsupportedBlockCardToInline = function transformUnsupportedBlockCardToInline(slice, state, cardOptions) {
|
|
171
|
+
var _state$schema$nodes = state.schema.nodes,
|
|
172
|
+
blockCard = _state$schema$nodes.blockCard,
|
|
173
|
+
inlineCard = _state$schema$nodes.inlineCard;
|
|
174
|
+
var children = [];
|
|
175
|
+
mapChildren(slice.content, function (node, i, frag) {
|
|
176
|
+
var _cardOptions$allowBlo;
|
|
177
|
+
if (node.type === blockCard && !isBlockCardSupported(state, frag, (_cardOptions$allowBlo = cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards) !== null && _cardOptions$allowBlo !== void 0 ? _cardOptions$allowBlo : false)) {
|
|
178
|
+
children.push(inlineCard.createChecked(node.attrs, node.content, node.marks));
|
|
179
|
+
} else {
|
|
180
|
+
children.push(node);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return new Slice(Fragment.fromArray(children), slice.openStart, slice.openEnd);
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Function to determine if a block card is supported by the editor
|
|
187
|
+
* @param state
|
|
188
|
+
* @param frag
|
|
189
|
+
* @param allowBlockCards
|
|
190
|
+
* @returns
|
|
191
|
+
*/
|
|
192
|
+
var isBlockCardSupported = function isBlockCardSupported(state, frag, allowBlockCards) {
|
|
193
|
+
return allowBlockCards && isSupportedInParent(state, frag);
|
|
168
194
|
};
|
|
@@ -3,7 +3,7 @@ var _templateObject;
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import { jsx, css, useTheme } from '@emotion/react';
|
|
6
|
-
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles } from '@atlaskit/editor-common/styles';
|
|
6
|
+
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles, resizerStyles, gridStyles, smartCardStyles, embedCardStyles } from '@atlaskit/editor-common/styles';
|
|
7
7
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { unsupportedStyles } from '../../plugins/unsupported-content/styles';
|
|
9
9
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
@@ -29,9 +29,7 @@ import { ClassNames } from '../../plugins/media/pm-plugins/alt-text/style';
|
|
|
29
29
|
import { findReplaceStyles } from '../../plugins/find-replace/styles';
|
|
30
30
|
import { taskDecisionStyles } from '../../plugins/tasks-and-decisions/styles';
|
|
31
31
|
import { statusStyles } from '../../plugins/status/styles';
|
|
32
|
-
import { smartCardStyles } from '../../plugins/card/styles';
|
|
33
32
|
import { dateStyles } from '../../plugins/date/styles';
|
|
34
|
-
import { embedCardStyles } from '../../plugins/card/ui/styled';
|
|
35
33
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
36
34
|
var contentStyles = function contentStyles(props) {
|
|
37
35
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
package/dist/esm/version.json
CHANGED
|
@@ -221,6 +221,9 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
221
221
|
}>];
|
|
222
222
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
223
223
|
}>>];
|
|
224
|
+
actions: {
|
|
225
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
226
|
+
};
|
|
224
227
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
225
228
|
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
226
229
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
@@ -258,5 +261,8 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
258
261
|
}>];
|
|
259
262
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
260
263
|
}>>];
|
|
264
|
+
actions: {
|
|
265
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
266
|
+
};
|
|
261
267
|
}>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>[];
|
|
262
268
|
export declare function EditorPresetCXHTML(props: EditorPresetCXHTMLProps): JSX.Element;
|
|
@@ -250,6 +250,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
250
250
|
}>];
|
|
251
251
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
252
252
|
}>>];
|
|
253
|
+
actions: {
|
|
254
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
255
|
+
};
|
|
253
256
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
254
257
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
255
258
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
@@ -287,6 +290,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
287
290
|
}>];
|
|
288
291
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
289
292
|
}>>];
|
|
293
|
+
actions: {
|
|
294
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
295
|
+
};
|
|
290
296
|
}>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>;
|
|
291
297
|
export declare function useDefaultPreset(props: EditorPresetProps & DefaultPresetPluginOptions): EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "floatingToolbar", "selection", "codeBlock"], [(config: CodeBlockOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"codeBlock", {
|
|
292
298
|
pluginConfiguration: CodeBlockOptions;
|
|
@@ -501,6 +507,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
501
507
|
}>];
|
|
502
508
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
503
509
|
}>>];
|
|
510
|
+
actions: {
|
|
511
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
512
|
+
};
|
|
504
513
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
505
514
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
506
515
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
@@ -538,4 +547,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
538
547
|
}>];
|
|
539
548
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
540
549
|
}>>];
|
|
550
|
+
actions: {
|
|
551
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
552
|
+
};
|
|
541
553
|
}>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>[];
|
|
@@ -224,6 +224,9 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
224
224
|
}>];
|
|
225
225
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
226
226
|
}>>];
|
|
227
|
+
actions: {
|
|
228
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
229
|
+
};
|
|
227
230
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
228
231
|
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
229
232
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
@@ -261,6 +264,9 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
261
264
|
}>];
|
|
262
265
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
263
266
|
}>>];
|
|
267
|
+
actions: {
|
|
268
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
269
|
+
};
|
|
264
270
|
}>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>[];
|
|
265
271
|
export type MobilePresetProps = EditorPresetMobileProps & EditorPresetProps;
|
|
266
272
|
export declare function EditorPresetMobile(props: MobilePresetProps): JSX.Element;
|
|
@@ -6,7 +6,9 @@ import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
6
6
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
7
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
8
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
9
|
+
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
9
10
|
import { CardPluginState } from './types';
|
|
11
|
+
import type hyperlinkPlugin from '../hyperlink';
|
|
10
12
|
declare const cardPlugin: NextEditorPlugin<'card', {
|
|
11
13
|
pluginConfiguration: CardPluginOptions;
|
|
12
14
|
dependencies: [
|
|
@@ -15,8 +17,10 @@ declare const cardPlugin: NextEditorPlugin<'card', {
|
|
|
15
17
|
typeof widthPlugin,
|
|
16
18
|
typeof decorationsPlugin,
|
|
17
19
|
typeof gridPlugin,
|
|
18
|
-
FloatingToolbarPlugin
|
|
20
|
+
FloatingToolbarPlugin,
|
|
21
|
+
typeof hyperlinkPlugin
|
|
19
22
|
];
|
|
20
23
|
sharedState: CardPluginState | null;
|
|
24
|
+
actions: CardPluginActions;
|
|
21
25
|
}>;
|
|
22
26
|
export default cardPlugin;
|
|
@@ -10,7 +10,6 @@ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
10
10
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
11
11
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
12
|
import type cardPlugin from '../index';
|
|
13
|
-
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
14
13
|
interface DatasourceProps extends ReactComponentProps {
|
|
15
14
|
node: PMNode;
|
|
16
15
|
view: EditorView;
|
|
@@ -6,7 +6,8 @@ import { CardAdf, DatasourceAdf, CardAppearance } from '@atlaskit/editor-common/
|
|
|
6
6
|
import { ACTION, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { InlineCardAdf } from '@atlaskit/smart-card';
|
|
9
|
-
import {
|
|
9
|
+
import { Request } from '../types';
|
|
10
|
+
import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
10
11
|
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
11
12
|
export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
13
|
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type cardPlugin from '..';
|
|
4
|
+
import { CardPluginOptions } from '../types';
|
|
5
|
+
export declare const mountHyperlinkPlugin: (pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined, options: CardPluginOptions) => SafePlugin<any, any>;
|
|
@@ -7,7 +7,7 @@ export declare const getPluginStateWithUpdatedPos: (pluginState: CardPluginState
|
|
|
7
7
|
url: string;
|
|
8
8
|
appearance: import("@atlaskit/editor-common/provider-factory").CardAppearance;
|
|
9
9
|
compareLinkText: boolean;
|
|
10
|
-
source: import("
|
|
10
|
+
source: import("@atlaskit/editor-common/card").CardReplacementInputMethod;
|
|
11
11
|
previousAppearance?: "url" | import("@atlaskit/editor-common/provider-factory").CardAppearance | undefined;
|
|
12
12
|
analyticsAction?: import("@atlaskit/editor-common/analytics").ACTION | undefined;
|
|
13
13
|
shouldReplaceLink?: boolean | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { CardProvider, CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
4
4
|
import { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
5
|
+
import type { CardOptions, CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
6
6
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
7
7
|
import { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
8
8
|
import { DatasourceTableLayout } from './ui/LayoutButton/types';
|
|
@@ -162,5 +162,4 @@ export type SetCardLayoutAndDatasourceTableRef = {
|
|
|
162
162
|
datasourceTableRef?: HTMLElement;
|
|
163
163
|
};
|
|
164
164
|
export type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | ShowDatasourceModal | HideDatasourceModal | RegisterSmartCardEvents | RegisterSmartCardEventsNext | SetDatasourceTableRef | SetCardLayout | SetCardLayoutAndDatasourceTableRef;
|
|
165
|
-
export type CardReplacementInputMethod = INPUT_METHOD.CLIPBOARD | INPUT_METHOD.AUTO_DETECT | INPUT_METHOD.FORMATTING | INPUT_METHOD.MANUAL | INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.FLOATING_TB;
|
|
166
165
|
export {};
|
|
@@ -6,6 +6,7 @@ import { EditorState } from 'prosemirror-state';
|
|
|
6
6
|
import { EditorView } from 'prosemirror-view';
|
|
7
7
|
import { CardPlatform } from '@atlaskit/smart-card';
|
|
8
8
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
9
10
|
export interface HyperlinkToolbarAppearanceProps {
|
|
10
11
|
intl: IntlShape;
|
|
11
12
|
editorState: EditorState;
|
|
@@ -15,6 +16,7 @@ export interface HyperlinkToolbarAppearanceProps {
|
|
|
15
16
|
platform?: CardPlatform;
|
|
16
17
|
cardOptions?: CardOptions;
|
|
17
18
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
19
|
+
cardActions: CardPluginActions | undefined;
|
|
18
20
|
}
|
|
19
21
|
export interface HyperlinkToolbarAppearanceState {
|
|
20
22
|
supportedUrlsMap: Map<string, boolean>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { CardContext } from '@atlaskit/link-provider';
|
|
4
|
-
import { CardPlatform } from '@atlaskit/smart-card';
|
|
1
|
+
import React from 'react';
|
|
5
2
|
import PropTypes from 'prop-types';
|
|
6
3
|
import { EditorState } from 'prosemirror-state';
|
|
7
4
|
import { EditorView } from 'prosemirror-view';
|
|
8
|
-
import React from 'react';
|
|
9
5
|
import { IntlShape } from 'react-intl-next';
|
|
6
|
+
import { CardContext } from '@atlaskit/link-provider';
|
|
7
|
+
import { CardPlatform } from '@atlaskit/smart-card';
|
|
8
|
+
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
10
|
+
import { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
10
11
|
export interface LinkToolbarAppearanceProps {
|
|
11
12
|
intl: IntlShape;
|
|
12
13
|
editorAnalyticsApi: EditorAnalyticsAPI | undefined;
|
|
@@ -17,6 +18,7 @@ export interface LinkToolbarAppearanceProps {
|
|
|
17
18
|
allowEmbeds?: boolean;
|
|
18
19
|
allowBlockCards?: boolean;
|
|
19
20
|
platform?: CardPlatform;
|
|
21
|
+
cardActions: CardPluginActions | undefined;
|
|
20
22
|
}
|
|
21
23
|
export declare class LinkToolbarAppearance extends React.Component<LinkToolbarAppearanceProps, {}> {
|
|
22
24
|
static contextTypes: {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
|
-
import { NodeType, Node
|
|
2
|
+
import { NodeType, Node } from 'prosemirror-model';
|
|
3
3
|
import { CardAppearance } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { CardInfo } from './types';
|
|
5
|
-
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
5
|
export declare const appearanceForNodeType: (spec: NodeType) => CardAppearance | undefined;
|
|
7
6
|
export declare const selectedCardAppearance: (state: EditorState) => CardAppearance | undefined;
|
|
8
7
|
export type TitleUrlPair = {
|
|
@@ -18,4 +17,3 @@ export declare const titleUrlPairFromNode: (node: Node) => TitleUrlPair;
|
|
|
18
17
|
export declare const mergeCardInfo: (titleUrlPair: TitleUrlPair, info?: CardInfo) => TitleUrlPair;
|
|
19
18
|
export declare const displayInfoForCard: (node: Node, info?: CardInfo) => TitleUrlPair;
|
|
20
19
|
export declare const findCardInfo: (state: EditorState) => CardInfo | undefined;
|
|
21
|
-
export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FloatingToolbarHandler } from '../floating-toolbar/types';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
4
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
|
-
import
|
|
5
|
-
export declare const getToolbarConfig: (options: HyperlinkPluginOptions, featureFlags: FeatureFlags,
|
|
5
|
+
import type hyperlinkPlugin from './index';
|
|
6
|
+
export declare const getToolbarConfig: (options: HyperlinkPluginOptions, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof hyperlinkPlugin> | undefined) => FloatingToolbarHandler;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
3
|
import { Predicate } from '../../utils/commands';
|
|
3
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
5
|
import type { Command, LinkInputType } from '@atlaskit/editor-common/types';
|
|
@@ -13,3 +14,4 @@ export declare function removeLink(pos: number): Command;
|
|
|
13
14
|
export declare function editInsertedLink(): Command;
|
|
14
15
|
export declare function showLinkToolbar(inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.INSERT_MENU): Command;
|
|
15
16
|
export declare function hideLinkToolbar(): Command;
|
|
17
|
+
export declare function hideLinkToolbarSetMeta(tr: Transaction): Transaction<any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { PrependToolbarButtons } from './pm-plugins/toolbar-buttons';
|
|
2
3
|
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
4
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
5
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -8,6 +9,16 @@ declare const hyperlinkPlugin: NextEditorPlugin<'hyperlink', {
|
|
|
8
9
|
typeof featureFlagsPlugin,
|
|
9
10
|
OptionalPlugin<typeof analyticsPlugin>
|
|
10
11
|
];
|
|
12
|
+
actions: {
|
|
13
|
+
/**
|
|
14
|
+
* Add items to the left of the hyperlink floating toolbar
|
|
15
|
+
* @param props
|
|
16
|
+
* -
|
|
17
|
+
* - items: Retrieve floating toolbar items to add
|
|
18
|
+
* - onEscapeCallback (optional): To be called when the link picker is escaped.
|
|
19
|
+
*/
|
|
20
|
+
prependToolbarButtons: PrependToolbarButtons;
|
|
21
|
+
};
|
|
11
22
|
}>;
|
|
12
23
|
export type { HyperlinkState } from './pm-plugins/main';
|
|
13
24
|
export default hyperlinkPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PluginKey, EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { FloatingToolbarItem } from '@atlaskit/editor-common/types';
|
|
4
|
+
import { EditorView } from 'prosemirror-view';
|
|
5
|
+
import type { IntlShape } from 'react-intl-next';
|
|
6
|
+
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
7
|
+
type HyperlinkToolbarItemsState = {
|
|
8
|
+
items: GetToolbarItems;
|
|
9
|
+
onEscapeCallback: ((tr: Transaction) => Transaction) | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare const toolbarKey: PluginKey<HyperlinkToolbarItemsState | undefined, any>;
|
|
12
|
+
type GetToolbarItems = (state: EditorState, intl: IntlShape, providerFactory: ProviderFactory, link: string) => FloatingToolbarItem<any>[];
|
|
13
|
+
interface PrependToolbarButtonsProps extends HyperlinkToolbarItemsState {
|
|
14
|
+
view: EditorView;
|
|
15
|
+
}
|
|
16
|
+
export type PrependToolbarButtons = (props: PrependToolbarButtonsProps) => void;
|
|
17
|
+
export declare const prependToolbarButtons: ({ items, onEscapeCallback, view, }: PrependToolbarButtonsProps) => void;
|
|
18
|
+
export declare const toolbarButtonsPlugin: () => SafePlugin<any, any>;
|
|
19
|
+
export {};
|
|
@@ -4,18 +4,19 @@ import { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions'
|
|
|
4
4
|
import { Command } from '../../types';
|
|
5
5
|
import { InputMethodInsertMedia } from '../analytics';
|
|
6
6
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
7
|
+
import type { QueueCardsFromTransactionAction } from '@atlaskit/editor-common/card';
|
|
7
8
|
export declare function handleMention(slice: Slice, schema: Schema): Slice;
|
|
8
|
-
export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice): Command;
|
|
9
|
+
export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
|
9
10
|
export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
|
|
10
11
|
export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice): Command;
|
|
11
12
|
export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
|
|
12
13
|
export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
|
|
13
|
-
export declare function handlePastePreservingMarks(slice: Slice): Command;
|
|
14
|
-
export declare function handleMacroAutoConvert(text: string, slice: Slice, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
|
|
14
|
+
export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
|
15
|
+
export declare function handleMacroAutoConvert(text: string, slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, cardsOptions?: CardOptions, extensionAutoConverter?: ExtensionAutoConvertHandler): Command;
|
|
15
16
|
export declare function handleCodeBlock(text: string): Command;
|
|
16
17
|
export declare function handleMediaSingle(inputMethod: InputMethodInsertMedia): (slice: Slice) => Command;
|
|
17
18
|
export declare function handleExpandPasteInTable(slice: Slice): Command;
|
|
18
|
-
export declare function handleMarkdown(markdownSlice: Slice, from?: number, to?: number): Command;
|
|
19
|
+
export declare function handleMarkdown(markdownSlice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined, from?: number, to?: number): Command;
|
|
19
20
|
export declare function handleParagraphBlockMarks(state: EditorState, slice: Slice): Slice<any>;
|
|
20
21
|
/**
|
|
21
22
|
* ED-6300: When a nested list is pasted in a table cell and the slice has openStart > openEnd,
|
|
@@ -45,6 +46,6 @@ export declare function handleParagraphBlockMarks(state: EditorState, slice: Sli
|
|
|
45
46
|
* ┗━p -> "two"
|
|
46
47
|
*/
|
|
47
48
|
export declare function flattenNestedListInSlice(slice: Slice): Slice<any>;
|
|
48
|
-
export declare function handleRichText(slice: Slice): Command;
|
|
49
|
+
export declare function handleRichText(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
|
|
49
50
|
export declare function handlePasteIntoCaption(slice: Slice): Command;
|
|
50
51
|
export declare const handleSelectedTable: (slice: Slice) => Command;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
|
+
import type cardPlugin from '../card';
|
|
4
5
|
export type PastePluginOptions = {
|
|
5
6
|
cardOptions?: CardOptions;
|
|
6
7
|
sanitizePrivateContent?: boolean;
|
|
7
8
|
};
|
|
8
9
|
declare const pastePlugin: NextEditorPlugin<'paste', {
|
|
9
10
|
pluginConfiguration: PastePluginOptions;
|
|
10
|
-
dependencies: [
|
|
11
|
+
dependencies: [
|
|
12
|
+
typeof featureFlagsPlugin,
|
|
13
|
+
OptionalPlugin<typeof cardPlugin>
|
|
14
|
+
];
|
|
11
15
|
}>;
|
|
12
16
|
export default pastePlugin;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AnalyticsEventPayload, PasteType, PasteContent } from '../../analytics';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Slice, Fragment, Schema } from 'prosemirror-model';
|
|
4
|
-
import { Command } from '
|
|
4
|
+
import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
|
|
5
|
+
import type pastePlugin from '../';
|
|
5
6
|
type PasteContext = {
|
|
6
7
|
type: PasteType;
|
|
7
8
|
asPlain?: boolean;
|
|
@@ -20,13 +21,13 @@ export declare function createPasteAnalyticsPayload(view: EditorView, event: Cli
|
|
|
20
21
|
export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
|
|
21
22
|
export declare function pasteCommandWithAnalytics(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): import("../../analytics").HigherOrderCommand;
|
|
22
23
|
export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
23
|
-
export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
|
|
24
|
+
export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
|
|
24
25
|
export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
|
|
25
26
|
export declare const handleCodeBlockWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, text: string) => Command;
|
|
26
27
|
export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
|
|
27
|
-
export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
|
|
28
|
-
export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
29
|
-
export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
28
|
+
export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
|
|
29
|
+
export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
|
|
30
|
+
export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
|
|
30
31
|
export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
31
32
|
export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
32
33
|
export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
|
|
@@ -5,5 +5,6 @@ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
5
5
|
import { DispatchAnalyticsEvent } from '../../analytics';
|
|
6
6
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
7
7
|
import type { Dispatch } from '../../../event-dispatcher';
|
|
8
|
-
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
|
-
|
|
8
|
+
import { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type pastePlugin from '../';
|
|
10
|
+
export declare function createPlugin(schema: Schema, dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, featureFlags: FeatureFlags, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined, cardOptions?: CardOptions, sanitizePrivateContent?: boolean, providerFactory?: ProviderFactory): SafePlugin<import("../types").PastePluginState, Schema<any, any>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Slice, Mark, Node as PMNode, NodeType, Schema } from 'prosemirror-model';
|
|
2
2
|
import { EditorState, Selection, Transaction } from 'prosemirror-state';
|
|
3
3
|
import { PasteSource } from '../../analytics';
|
|
4
|
+
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
5
|
export declare function isPastedFromWord(html?: string): boolean;
|
|
5
6
|
export declare function isPastedFromExcel(html?: string): boolean;
|
|
6
7
|
export declare const isSingleLine: (text: string) => boolean;
|
|
@@ -16,3 +17,4 @@ export declare function isSelectionInsidePanel(selection: Selection): PMNode | n
|
|
|
16
17
|
export declare const htmlHasInvalidLinkTags: (html?: string) => boolean;
|
|
17
18
|
export declare const removeDuplicateInvalidLinks: (html: string) => string;
|
|
18
19
|
export declare const addReplaceSelectedTableAnalytics: (state: EditorState, tr: Transaction) => Transaction;
|
|
20
|
+
export declare const transformUnsupportedBlockCardToInline: (slice: Slice, state: EditorState, cardOptions?: CardOptions) => Slice;
|
|
@@ -276,6 +276,9 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
276
276
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
277
277
|
}>>
|
|
278
278
|
];
|
|
279
|
+
actions: {
|
|
280
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
281
|
+
};
|
|
279
282
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
280
283
|
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
281
284
|
dependencies: [
|
|
@@ -320,6 +323,9 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
320
323
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
321
324
|
}>>
|
|
322
325
|
];
|
|
326
|
+
actions: {
|
|
327
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
328
|
+
};
|
|
323
329
|
}>,
|
|
324
330
|
...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]
|
|
325
331
|
]>[];
|
|
@@ -305,6 +305,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
305
305
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
306
306
|
}>>
|
|
307
307
|
];
|
|
308
|
+
actions: {
|
|
309
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
310
|
+
};
|
|
308
311
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
309
312
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
310
313
|
dependencies: [
|
|
@@ -349,6 +352,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
349
352
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
350
353
|
}>>
|
|
351
354
|
];
|
|
355
|
+
actions: {
|
|
356
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
357
|
+
};
|
|
352
358
|
}>,
|
|
353
359
|
...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]
|
|
354
360
|
]>;
|
|
@@ -620,6 +626,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
620
626
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
621
627
|
}>>
|
|
622
628
|
];
|
|
629
|
+
actions: {
|
|
630
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
631
|
+
};
|
|
623
632
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
624
633
|
pluginConfiguration: HyperlinkPluginOptions | undefined;
|
|
625
634
|
dependencies: [
|
|
@@ -664,6 +673,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
664
673
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
665
674
|
}>>
|
|
666
675
|
];
|
|
676
|
+
actions: {
|
|
677
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
678
|
+
};
|
|
667
679
|
}>,
|
|
668
680
|
...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]
|
|
669
681
|
]>[];
|
|
@@ -279,6 +279,9 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
279
279
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
280
280
|
}>>
|
|
281
281
|
];
|
|
282
|
+
actions: {
|
|
283
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
284
|
+
};
|
|
282
285
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
283
286
|
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
284
287
|
dependencies: [
|
|
@@ -323,6 +326,9 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
323
326
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
324
327
|
}>>
|
|
325
328
|
];
|
|
329
|
+
actions: {
|
|
330
|
+
prependToolbarButtons: import("../../../plugins/hyperlink/pm-plugins/toolbar-buttons").PrependToolbarButtons;
|
|
331
|
+
};
|
|
326
332
|
}>,
|
|
327
333
|
...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]
|
|
328
334
|
]>[];
|
|
@@ -6,7 +6,9 @@ import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
|
6
6
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
7
|
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
8
|
import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
|
|
9
|
+
import type { CardPluginActions } from '@atlaskit/editor-common/card';
|
|
9
10
|
import { CardPluginState } from './types';
|
|
11
|
+
import type hyperlinkPlugin from '../hyperlink';
|
|
10
12
|
declare const cardPlugin: NextEditorPlugin<'card', {
|
|
11
13
|
pluginConfiguration: CardPluginOptions;
|
|
12
14
|
dependencies: [
|
|
@@ -15,8 +17,10 @@ declare const cardPlugin: NextEditorPlugin<'card', {
|
|
|
15
17
|
typeof widthPlugin,
|
|
16
18
|
typeof decorationsPlugin,
|
|
17
19
|
typeof gridPlugin,
|
|
18
|
-
FloatingToolbarPlugin
|
|
20
|
+
FloatingToolbarPlugin,
|
|
21
|
+
typeof hyperlinkPlugin
|
|
19
22
|
];
|
|
20
23
|
sharedState: CardPluginState | null;
|
|
24
|
+
actions: CardPluginActions;
|
|
21
25
|
}>;
|
|
22
26
|
export default cardPlugin;
|
|
@@ -10,7 +10,6 @@ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
10
10
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
11
11
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
12
12
|
import type cardPlugin from '../index';
|
|
13
|
-
export declare const DATASOURCE_INNER_CONTAINER_CLASSNAME = "datasourceView-content-inner-wrap";
|
|
14
13
|
interface DatasourceProps extends ReactComponentProps {
|
|
15
14
|
node: PMNode;
|
|
16
15
|
view: EditorView;
|
|
@@ -6,7 +6,8 @@ import { CardAdf, DatasourceAdf, CardAppearance } from '@atlaskit/editor-common/
|
|
|
6
6
|
import { ACTION, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { InlineCardAdf } from '@atlaskit/smart-card';
|
|
9
|
-
import {
|
|
9
|
+
import { Request } from '../types';
|
|
10
|
+
import type { CardReplacementInputMethod } from '@atlaskit/editor-common/card';
|
|
10
11
|
export declare const replaceQueuedUrlWithCard: (url: string, cardData: CardAdf | DatasourceAdf, analyticsAction?: ACTION, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
11
12
|
export declare const handleFallbackWithAnalytics: (request: Request, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
13
|
export declare const queueCardsFromChangedTr: (state: EditorState, tr: Transaction, source: CardReplacementInputMethod, analyticsAction?: ACTION, normalizeLinkText?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Transaction;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type cardPlugin from '..';
|
|
4
|
+
import { CardPluginOptions } from '../types';
|
|
5
|
+
export declare const mountHyperlinkPlugin: (pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined, options: CardPluginOptions) => SafePlugin<any, any>;
|