@atlaskit/editor-core 187.43.11 → 187.43.13
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 +13 -0
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/labs/next/presets/universal.js +1 -1
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +13 -54
- package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
- package/dist/cjs/plugins/floating-toolbar/index.js +1 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/media/toolbar/index.js +3 -5
- package/dist/cjs/plugins/selection/utils.js +29 -80
- package/dist/cjs/utils/clipboard.js +19 -127
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -2
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -53
- package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +6 -0
- package/dist/es2019/plugins/media/toolbar/index.js +3 -7
- package/dist/es2019/plugins/selection/utils.js +3 -74
- package/dist/es2019/utils/clipboard.js +1 -53
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/labs/next/presets/universal.js +2 -2
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +3 -49
- package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
- package/dist/esm/plugins/floating-toolbar/index.js +1 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +6 -0
- package/dist/esm/plugins/media/toolbar/index.js +3 -5
- package/dist/esm/plugins/selection/utils.js +3 -72
- package/dist/esm/utils/clipboard.js +1 -119
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +68 -4
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +2 -3
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/selection/utils.d.ts +2 -5
- package/dist/types/utils/clipboard.d.ts +1 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +86 -0
- package/dist/types-ts4.5/plugins/clipboard/pm-plugins/main.d.ts +2 -3
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/selection/utils.d.ts +2 -5
- package/dist/types-ts4.5/utils/clipboard.d.ts +1 -3
- package/package.json +7 -7
- package/report.api.md +2 -0
- package/tmp/api-report-tmp.d.ts +2 -0
- package/dist/cjs/plugins/copy-button/commands.js +0 -171
- package/dist/cjs/plugins/copy-button/index.js +0 -23
- package/dist/cjs/plugins/copy-button/pm-plugins/main.js +0 -104
- package/dist/cjs/plugins/copy-button/pm-plugins/plugin-key.js +0 -9
- package/dist/cjs/plugins/copy-button/toolbar.js +0 -99
- package/dist/cjs/plugins/copy-button/utils.js +0 -22
- package/dist/es2019/plugins/copy-button/commands.js +0 -157
- package/dist/es2019/plugins/copy-button/index.js +0 -11
- package/dist/es2019/plugins/copy-button/pm-plugins/main.js +0 -97
- package/dist/es2019/plugins/copy-button/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/copy-button/toolbar.js +0 -82
- package/dist/es2019/plugins/copy-button/utils.js +0 -15
- package/dist/esm/plugins/copy-button/commands.js +0 -159
- package/dist/esm/plugins/copy-button/index.js +0 -15
- package/dist/esm/plugins/copy-button/pm-plugins/main.js +0 -96
- package/dist/esm/plugins/copy-button/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/copy-button/toolbar.js +0 -89
- package/dist/esm/plugins/copy-button/utils.js +0 -14
- package/dist/types/plugins/copy-button/commands.d.ts +0 -9
- package/dist/types/plugins/copy-button/index.d.ts +0 -3
- package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +0 -4
- package/dist/types/plugins/copy-button/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types/plugins/copy-button/toolbar.d.ts +0 -13
- package/dist/types/plugins/copy-button/utils.d.ts +0 -8
- package/dist/types-ts4.5/plugins/copy-button/commands.d.ts +0 -9
- package/dist/types-ts4.5/plugins/copy-button/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/copy-button/pm-plugins/main.d.ts +0 -4
- package/dist/types-ts4.5/plugins/copy-button/pm-plugins/plugin-key.d.ts +0 -2
- package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +0 -13
- package/dist/types-ts4.5/plugins/copy-button/utils.d.ts +0 -8
|
@@ -1,119 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import * as clipboard from 'clipboard-polyfill';
|
|
5
|
-
var isClipboardApiSupported = function isClipboardApiSupported() {
|
|
6
|
-
return !!navigator.clipboard && typeof navigator.clipboard.writeText === 'function';
|
|
7
|
-
};
|
|
8
|
-
var isIEClipboardApiSupported = function isIEClipboardApiSupported() {
|
|
9
|
-
return window.clipboardData && typeof window.clipboardData.setData === 'function';
|
|
10
|
-
};
|
|
11
|
-
export var copyToClipboard = /*#__PURE__*/function () {
|
|
12
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(textToCopy) {
|
|
13
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14
|
-
while (1) switch (_context.prev = _context.next) {
|
|
15
|
-
case 0:
|
|
16
|
-
if (!isClipboardApiSupported()) {
|
|
17
|
-
_context.next = 11;
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
_context.prev = 1;
|
|
21
|
-
_context.next = 4;
|
|
22
|
-
return navigator.clipboard.writeText(textToCopy);
|
|
23
|
-
case 4:
|
|
24
|
-
_context.next = 9;
|
|
25
|
-
break;
|
|
26
|
-
case 6:
|
|
27
|
-
_context.prev = 6;
|
|
28
|
-
_context.t0 = _context["catch"](1);
|
|
29
|
-
throw new Error('Clipboard api is not supported');
|
|
30
|
-
case 9:
|
|
31
|
-
_context.next = 23;
|
|
32
|
-
break;
|
|
33
|
-
case 11:
|
|
34
|
-
if (!isIEClipboardApiSupported()) {
|
|
35
|
-
_context.next = 22;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
_context.prev = 12;
|
|
39
|
-
_context.next = 15;
|
|
40
|
-
return window.clipboardData.setData('text', textToCopy);
|
|
41
|
-
case 15:
|
|
42
|
-
_context.next = 20;
|
|
43
|
-
break;
|
|
44
|
-
case 17:
|
|
45
|
-
_context.prev = 17;
|
|
46
|
-
_context.t1 = _context["catch"](12);
|
|
47
|
-
throw new Error('IE clipboard api is not supported');
|
|
48
|
-
case 20:
|
|
49
|
-
_context.next = 23;
|
|
50
|
-
break;
|
|
51
|
-
case 22:
|
|
52
|
-
throw new Error('Clipboard api is not supported');
|
|
53
|
-
case 23:
|
|
54
|
-
case "end":
|
|
55
|
-
return _context.stop();
|
|
56
|
-
}
|
|
57
|
-
}, _callee, null, [[1, 6], [12, 17]]);
|
|
58
|
-
}));
|
|
59
|
-
return function copyToClipboard(_x) {
|
|
60
|
-
return _ref.apply(this, arguments);
|
|
61
|
-
};
|
|
62
|
-
}();
|
|
63
|
-
export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
64
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
65
|
-
var data;
|
|
66
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
67
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
68
|
-
case 0:
|
|
69
|
-
if (!(isClipboardApiSupported() && typeof ClipboardItem !== 'undefined')) {
|
|
70
|
-
_context2.next = 12;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
_context2.prev = 1;
|
|
74
|
-
data = new ClipboardItem({
|
|
75
|
-
'text/plain': new Blob([plainTextToCopy || elementToCopy.innerText], {
|
|
76
|
-
type: 'text/plain'
|
|
77
|
-
}),
|
|
78
|
-
'text/html': new Blob([elementToCopy.innerHTML], {
|
|
79
|
-
type: 'text/html'
|
|
80
|
-
})
|
|
81
|
-
}); // @ts-ignore
|
|
82
|
-
_context2.next = 5;
|
|
83
|
-
return navigator.clipboard.write([data]);
|
|
84
|
-
case 5:
|
|
85
|
-
_context2.next = 10;
|
|
86
|
-
break;
|
|
87
|
-
case 7:
|
|
88
|
-
_context2.prev = 7;
|
|
89
|
-
_context2.t0 = _context2["catch"](1);
|
|
90
|
-
throw new Error('Clipboard api is not supported');
|
|
91
|
-
case 10:
|
|
92
|
-
_context2.next = 13;
|
|
93
|
-
break;
|
|
94
|
-
case 12:
|
|
95
|
-
if ((typeof document === "undefined" ? "undefined" : _typeof(document)) !== undefined) {
|
|
96
|
-
// ED-17083 extension copy seems have issue with ClipboardItem API
|
|
97
|
-
// Hence of use of this polyfill
|
|
98
|
-
copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy);
|
|
99
|
-
}
|
|
100
|
-
case 13:
|
|
101
|
-
case "end":
|
|
102
|
-
return _context2.stop();
|
|
103
|
-
}
|
|
104
|
-
}, _callee2, null, [[1, 7]]);
|
|
105
|
-
}));
|
|
106
|
-
return function copyHTMLToClipboard(_x2, _x3) {
|
|
107
|
-
return _ref2.apply(this, arguments);
|
|
108
|
-
};
|
|
109
|
-
}();
|
|
110
|
-
|
|
111
|
-
// At the time of development, Firefox doesn't support ClipboardItem API
|
|
112
|
-
// Hence of use of this polyfill
|
|
113
|
-
export var copyHTMLToClipboardPolyfill = function copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy) {
|
|
114
|
-
var Clipboard = clipboard;
|
|
115
|
-
var dt = new Clipboard.DT();
|
|
116
|
-
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
117
|
-
dt.setData('text/html', elementToCopy.innerHTML);
|
|
118
|
-
Clipboard.write(dt);
|
|
119
|
-
};
|
|
1
|
+
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '@atlaskit/editor-common/clipboard';
|
|
@@ -34,7 +34,7 @@ export type DefaultPresetPluginOptions = {
|
|
|
34
34
|
* Note: The order that presets are added determines
|
|
35
35
|
* their placement in the editor toolbar
|
|
36
36
|
*/
|
|
37
|
-
export declare function createDefaultPreset(options: EditorPresetProps & DefaultPresetPluginOptions): EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "placeholder", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "floatingToolbar", "selection", "codeBlock"], [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
|
|
37
|
+
export declare function createDefaultPreset(options: EditorPresetProps & DefaultPresetPluginOptions): EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "placeholder", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "copyButton", "floatingToolbar", "selection", "codeBlock"], [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
|
|
38
38
|
pluginConfiguration: CodeBlockOptions;
|
|
39
39
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
40
40
|
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
@@ -99,7 +99,23 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
99
99
|
actions: {
|
|
100
100
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
101
101
|
};
|
|
102
|
-
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
102
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
103
|
+
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
104
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
105
|
+
sharedState: {
|
|
106
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
107
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
108
|
+
};
|
|
109
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
110
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
111
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
112
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
113
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
114
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
115
|
+
actions: {
|
|
116
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
117
|
+
};
|
|
118
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
103
119
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
104
120
|
}, undefined>];
|
|
105
121
|
actions: {
|
|
@@ -109,6 +125,22 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
109
125
|
configWithNodeInfo: import("@atlaskit/editor-plugin-floating-toolbar").ConfigWithNodeInfo | undefined;
|
|
110
126
|
floatingToolbarData: import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData | undefined;
|
|
111
127
|
} | undefined;
|
|
128
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
129
|
+
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
130
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
131
|
+
sharedState: {
|
|
132
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
133
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
134
|
+
};
|
|
135
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
136
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
137
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
138
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
139
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
140
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
141
|
+
actions: {
|
|
142
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
143
|
+
};
|
|
112
144
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
113
145
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView) => void) | undefined;
|
|
114
146
|
}, ((editorView: import("prosemirror-view").EditorView) => void) | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
@@ -210,7 +242,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
210
242
|
};
|
|
211
243
|
sharedState: import("@atlaskit/editor-common/link").HyperlinkState | undefined;
|
|
212
244
|
}, HyperlinkPluginOptions | undefined>, ...import("@atlaskit/editor-common/types").AllEditorPresetPluginTypes[]]>;
|
|
213
|
-
export declare function useDefaultPreset(props: EditorPresetProps & DefaultPresetPluginOptions): EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "placeholder", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "floatingToolbar", "selection", "codeBlock"], [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
|
|
245
|
+
export declare function useDefaultPreset(props: EditorPresetProps & DefaultPresetPluginOptions): EditorPresetBuilder<[...string[], "hyperlink", "textFormatting", "width", "quickInsert", "typeAhead", "placeholder", "unsupportedContent", "editorDisabled", "submitEditor", "fakeTextCursor", "copyButton", "floatingToolbar", "selection", "codeBlock"], [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"codeBlock", {
|
|
214
246
|
pluginConfiguration: CodeBlockOptions;
|
|
215
247
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"decorations", {
|
|
216
248
|
sharedState: import("@atlaskit/editor-plugin-decorations").DecorationState;
|
|
@@ -275,7 +307,23 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
275
307
|
actions: {
|
|
276
308
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
277
309
|
};
|
|
278
|
-
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"
|
|
310
|
+
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
311
|
+
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
312
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
313
|
+
sharedState: {
|
|
314
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
315
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
316
|
+
};
|
|
317
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
318
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
319
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
320
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
321
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
322
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
323
|
+
actions: {
|
|
324
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
325
|
+
};
|
|
326
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
279
327
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
280
328
|
}, undefined>];
|
|
281
329
|
actions: {
|
|
@@ -285,6 +333,22 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
285
333
|
configWithNodeInfo: import("@atlaskit/editor-plugin-floating-toolbar").ConfigWithNodeInfo | undefined;
|
|
286
334
|
floatingToolbarData: import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData | undefined;
|
|
287
335
|
} | undefined;
|
|
336
|
+
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
337
|
+
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
338
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
339
|
+
sharedState: {
|
|
340
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
341
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
342
|
+
};
|
|
343
|
+
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
344
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
345
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
346
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
347
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
348
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
349
|
+
actions: {
|
|
350
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
351
|
+
};
|
|
288
352
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
289
353
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView) => void) | undefined;
|
|
290
354
|
}, ((editorView: import("prosemirror-view").EditorView) => void) | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
3
|
import type { PMPluginFactoryParams } from '../../../types';
|
|
5
4
|
import type { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
6
|
-
import type { AnalyticsEventPayload } from '../../../plugins/analytics';
|
|
7
5
|
import { ACTION } from '../../analytics/types/enums';
|
|
8
6
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
7
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
10
9
|
export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any>;
|
|
11
10
|
/**
|
|
12
11
|
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
@@ -16,4 +15,4 @@ export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPlugi
|
|
|
16
15
|
*/
|
|
17
16
|
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
18
17
|
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
19
|
-
export
|
|
18
|
+
export { getAnalyticsPayload };
|
|
@@ -48,5 +48,4 @@ export { default as avatarGroupPlugin } from './avatar-group';
|
|
|
48
48
|
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
49
49
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
50
50
|
export { default as codeBidiWarningPlugin } from './code-bidi-warning';
|
|
51
|
-
export { default as copyButtonPlugin } from './copy-button';
|
|
52
51
|
export { default as borderPlugin } from './border';
|
|
@@ -37,6 +37,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
37
37
|
newInsertionBehaviour?: boolean;
|
|
38
38
|
isResizing: boolean;
|
|
39
39
|
resizingWidth: number;
|
|
40
|
+
currentMaxWidth?: number;
|
|
40
41
|
private view;
|
|
41
42
|
private destroyed;
|
|
42
43
|
private contextIdentifierProvider?;
|
|
@@ -34,6 +34,7 @@ export interface MediaPluginState {
|
|
|
34
34
|
mediaOptions?: MediaOptions;
|
|
35
35
|
isResizing: boolean;
|
|
36
36
|
resizingWidth: number;
|
|
37
|
+
currentMaxWidth?: number;
|
|
37
38
|
dispatch?: Dispatch;
|
|
38
39
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
39
40
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
@@ -4,15 +4,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import
|
|
7
|
+
import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload } from '@atlaskit/editor-common/selection';
|
|
8
8
|
export declare function createSelectionClickHandler(nodes: string[], isValidTarget: (target: HTMLElement) => boolean, options: {
|
|
9
9
|
useLongPressSelection: boolean;
|
|
10
10
|
getNodeSelectionPos?: (state: EditorState, nodePos: number) => number;
|
|
11
11
|
}): (view: EditorView, pos: number, node: PmNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean;
|
|
12
12
|
export declare const getDecorations: (tr: Transaction | ReadonlyTransaction) => DecorationSet;
|
|
13
|
-
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
14
|
-
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
15
|
-
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
16
13
|
/**
|
|
17
14
|
* Use `getNodesToDecorateFromSelection` to collect and return
|
|
18
15
|
* a list of nodes within the Selection that should have Selection
|
|
@@ -25,7 +22,6 @@ export declare const getNodesToDecorateFromSelection: (selection: Selection, doc
|
|
|
25
22
|
node: PmNode;
|
|
26
23
|
pos: number;
|
|
27
24
|
}[];
|
|
28
|
-
export declare function getRangeSelectionAnalyticsPayload(selection: Selection, doc: PmNode): AnalyticsEventPayload | undefined;
|
|
29
25
|
export declare function shouldRecalcDecorations({ oldEditorState, newEditorState, }: {
|
|
30
26
|
oldEditorState: EditorState;
|
|
31
27
|
newEditorState: EditorState;
|
|
@@ -64,3 +60,4 @@ export declare const findFirstChildNodeToSelect: (parent: PmNode) => NodeWithPos
|
|
|
64
60
|
export declare const findLastChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
|
|
65
61
|
export declare const isSelectionAtStartOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
66
62
|
export declare const isSelectionAtEndOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
63
|
+
export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, };
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const copyHTMLToClipboard: (elementToCopy: HTMLElement, plainTextToCopy?: string) => Promise<void>;
|
|
3
|
-
export declare const copyHTMLToClipboardPolyfill: (elementToCopy: HTMLElement, plainTextToCopy?: string) => void;
|
|
1
|
+
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill, } from '@atlaskit/editor-common/clipboard';
|
|
@@ -46,6 +46,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
46
46
|
"editorDisabled",
|
|
47
47
|
"submitEditor",
|
|
48
48
|
"fakeTextCursor",
|
|
49
|
+
"copyButton",
|
|
49
50
|
"floatingToolbar",
|
|
50
51
|
"selection",
|
|
51
52
|
"codeBlock"
|
|
@@ -133,6 +134,27 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
133
134
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
134
135
|
};
|
|
135
136
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>,
|
|
137
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
138
|
+
dependencies: [
|
|
139
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
140
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
141
|
+
sharedState: {
|
|
142
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
143
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
144
|
+
};
|
|
145
|
+
dependencies: [
|
|
146
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
147
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
148
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
149
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>
|
|
150
|
+
];
|
|
151
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
152
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
153
|
+
];
|
|
154
|
+
actions: {
|
|
155
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
156
|
+
};
|
|
157
|
+
}, undefined>,
|
|
136
158
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
137
159
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
138
160
|
}, undefined>
|
|
@@ -145,6 +167,27 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
145
167
|
floatingToolbarData: import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData | undefined;
|
|
146
168
|
} | undefined;
|
|
147
169
|
}, undefined>,
|
|
170
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
171
|
+
dependencies: [
|
|
172
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
173
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
174
|
+
sharedState: {
|
|
175
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
176
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
177
|
+
};
|
|
178
|
+
dependencies: [
|
|
179
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
180
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
181
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
182
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>
|
|
183
|
+
];
|
|
184
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
185
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
186
|
+
];
|
|
187
|
+
actions: {
|
|
188
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
189
|
+
};
|
|
190
|
+
}, undefined>,
|
|
148
191
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
149
192
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
150
193
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView) => void) | undefined;
|
|
@@ -282,6 +325,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
282
325
|
"editorDisabled",
|
|
283
326
|
"submitEditor",
|
|
284
327
|
"fakeTextCursor",
|
|
328
|
+
"copyButton",
|
|
285
329
|
"floatingToolbar",
|
|
286
330
|
"selection",
|
|
287
331
|
"codeBlock"
|
|
@@ -369,6 +413,27 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
369
413
|
api: () => import("@atlaskit/editor-common/extensions").ExtensionAPI<import("@atlaskit/editor-common/extensions").Parameters>;
|
|
370
414
|
};
|
|
371
415
|
}, import("@atlaskit/editor-plugin-extension").ExtensionPluginOptions | undefined>>,
|
|
416
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
417
|
+
dependencies: [
|
|
418
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
419
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
420
|
+
sharedState: {
|
|
421
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
422
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
423
|
+
};
|
|
424
|
+
dependencies: [
|
|
425
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
426
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
427
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
428
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>
|
|
429
|
+
];
|
|
430
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
431
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
432
|
+
];
|
|
433
|
+
actions: {
|
|
434
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
435
|
+
};
|
|
436
|
+
}, undefined>,
|
|
372
437
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
373
438
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
374
439
|
}, undefined>
|
|
@@ -381,6 +446,27 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
381
446
|
floatingToolbarData: import("@atlaskit/editor-plugin-floating-toolbar").FloatingToolbarPluginData | undefined;
|
|
382
447
|
} | undefined;
|
|
383
448
|
}, undefined>,
|
|
449
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"copyButton", {
|
|
450
|
+
dependencies: [
|
|
451
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
|
|
452
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
453
|
+
sharedState: {
|
|
454
|
+
createAnalyticsEvent: CreateUIAnalyticsEvent | null;
|
|
455
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
456
|
+
};
|
|
457
|
+
dependencies: [
|
|
458
|
+
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
459
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
460
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
461
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>
|
|
462
|
+
];
|
|
463
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
464
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
465
|
+
];
|
|
466
|
+
actions: {
|
|
467
|
+
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
468
|
+
};
|
|
469
|
+
}, undefined>,
|
|
384
470
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
385
471
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
386
472
|
pluginConfiguration: ((editorView: import("prosemirror-view").EditorView) => void) | undefined;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
3
|
import type { PMPluginFactoryParams } from '../../../types';
|
|
5
4
|
import type { DispatchAnalyticsEvent } from '../../analytics/types/dispatch-analytics-event';
|
|
6
|
-
import type { AnalyticsEventPayload } from '../../../plugins/analytics';
|
|
7
5
|
import { ACTION } from '../../analytics/types/enums';
|
|
8
6
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
7
|
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
import { getAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
|
|
10
9
|
export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPluginFactoryParams) => SafePlugin<any>;
|
|
11
10
|
/**
|
|
12
11
|
* Overrides Prosemirror's default clipboardSerializer, in order to fix table row copy/paste bug raised in ED-13003.
|
|
@@ -16,4 +15,4 @@ export declare const createPlugin: ({ dispatchAnalyticsEvent, schema, }: PMPlugi
|
|
|
16
15
|
*/
|
|
17
16
|
export declare const createClipboardSerializer: (schema: Schema, getEditorView: () => EditorView) => DOMSerializer;
|
|
18
17
|
export declare const sendClipboardAnalytics: (view: EditorView, dispatchAnalyticsEvent: DispatchAnalyticsEvent, action: ACTION.CUT | ACTION.COPIED) => boolean;
|
|
19
|
-
export
|
|
18
|
+
export { getAnalyticsPayload };
|
|
@@ -48,5 +48,4 @@ export { default as avatarGroupPlugin } from './avatar-group';
|
|
|
48
48
|
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
49
49
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
50
50
|
export { default as codeBidiWarningPlugin } from './code-bidi-warning';
|
|
51
|
-
export { default as copyButtonPlugin } from './copy-button';
|
|
52
51
|
export { default as borderPlugin } from './border';
|
|
@@ -37,6 +37,7 @@ export declare class MediaPluginStateImplementation implements MediaPluginState
|
|
|
37
37
|
newInsertionBehaviour?: boolean;
|
|
38
38
|
isResizing: boolean;
|
|
39
39
|
resizingWidth: number;
|
|
40
|
+
currentMaxWidth?: number;
|
|
40
41
|
private view;
|
|
41
42
|
private destroyed;
|
|
42
43
|
private contextIdentifierProvider?;
|
|
@@ -34,6 +34,7 @@ export interface MediaPluginState {
|
|
|
34
34
|
mediaOptions?: MediaOptions;
|
|
35
35
|
isResizing: boolean;
|
|
36
36
|
resizingWidth: number;
|
|
37
|
+
currentMaxWidth?: number;
|
|
37
38
|
dispatch?: Dispatch;
|
|
38
39
|
onContextIdentifierProvider: (_name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
39
40
|
setMediaProvider: (mediaProvider?: Promise<MediaProvider>) => Promise<void>;
|
|
@@ -4,15 +4,12 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
4
4
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
7
|
-
import
|
|
7
|
+
import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload } from '@atlaskit/editor-common/selection';
|
|
8
8
|
export declare function createSelectionClickHandler(nodes: string[], isValidTarget: (target: HTMLElement) => boolean, options: {
|
|
9
9
|
useLongPressSelection: boolean;
|
|
10
10
|
getNodeSelectionPos?: (state: EditorState, nodePos: number) => number;
|
|
11
11
|
}): (view: EditorView, pos: number, node: PmNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean;
|
|
12
12
|
export declare const getDecorations: (tr: Transaction | ReadonlyTransaction) => DecorationSet;
|
|
13
|
-
export declare function getNodeSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
14
|
-
export declare function getAllSelectionAnalyticsPayload(selection: Selection): AnalyticsEventPayload | undefined;
|
|
15
|
-
export declare function getCellSelectionAnalyticsPayload(state: EditorState): AnalyticsEventPayload | undefined;
|
|
16
13
|
/**
|
|
17
14
|
* Use `getNodesToDecorateFromSelection` to collect and return
|
|
18
15
|
* a list of nodes within the Selection that should have Selection
|
|
@@ -25,7 +22,6 @@ export declare const getNodesToDecorateFromSelection: (selection: Selection, doc
|
|
|
25
22
|
node: PmNode;
|
|
26
23
|
pos: number;
|
|
27
24
|
}[];
|
|
28
|
-
export declare function getRangeSelectionAnalyticsPayload(selection: Selection, doc: PmNode): AnalyticsEventPayload | undefined;
|
|
29
25
|
export declare function shouldRecalcDecorations({ oldEditorState, newEditorState, }: {
|
|
30
26
|
oldEditorState: EditorState;
|
|
31
27
|
newEditorState: EditorState;
|
|
@@ -64,3 +60,4 @@ export declare const findFirstChildNodeToSelect: (parent: PmNode) => NodeWithPos
|
|
|
64
60
|
export declare const findLastChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
|
|
65
61
|
export declare const isSelectionAtStartOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
66
62
|
export declare const isSelectionAtEndOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
|
|
63
|
+
export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, };
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const copyHTMLToClipboard: (elementToCopy: HTMLElement, plainTextToCopy?: string) => Promise<void>;
|
|
3
|
-
export declare const copyHTMLToClipboardPolyfill: (elementToCopy: HTMLElement, plainTextToCopy?: string) => void;
|
|
1
|
+
export { copyToClipboard, copyHTMLToClipboard, copyHTMLToClipboardPolyfill, } from '@atlaskit/editor-common/clipboard';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.43.
|
|
3
|
+
"version": "187.43.13",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
58
|
-
"@atlaskit/editor-common": "^75.
|
|
58
|
+
"@atlaskit/editor-common": "^75.2.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
"@atlaskit/editor-plugin-composition": "^0.1.0",
|
|
66
66
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
67
67
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
68
|
-
"@atlaskit/editor-plugin-copy-button": "^0.
|
|
68
|
+
"@atlaskit/editor-plugin-copy-button": "^0.2.0",
|
|
69
69
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
70
70
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
71
71
|
"@atlaskit/editor-plugin-emoji": "^0.3.0",
|
|
72
72
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
73
73
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
74
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^0.
|
|
74
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^0.5.0",
|
|
75
75
|
"@atlaskit/editor-plugin-focus": "^0.2.0",
|
|
76
76
|
"@atlaskit/editor-plugin-grid": "^0.2.0",
|
|
77
77
|
"@atlaskit/editor-plugin-guideline": "^0.5.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@atlaskit/radio": "^5.6.0",
|
|
112
112
|
"@atlaskit/section-message": "^6.4.0",
|
|
113
113
|
"@atlaskit/select": "^16.7.0",
|
|
114
|
-
"@atlaskit/smart-card": "^26.
|
|
114
|
+
"@atlaskit/smart-card": "^26.27.0",
|
|
115
115
|
"@atlaskit/smart-user-picker": "^6.3.0",
|
|
116
116
|
"@atlaskit/spinner": "^15.5.0",
|
|
117
117
|
"@atlaskit/status": "^1.3.0",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@atlaskit/textfield": "^5.6.0",
|
|
122
122
|
"@atlaskit/theme": "^12.6.0",
|
|
123
123
|
"@atlaskit/toggle": "^12.6.0",
|
|
124
|
-
"@atlaskit/tokens": "^1.
|
|
124
|
+
"@atlaskit/tokens": "^1.23.0",
|
|
125
125
|
"@atlaskit/tooltip": "^17.8.0",
|
|
126
126
|
"@atlaskit/width-detector": "^4.1.0",
|
|
127
127
|
"@babel/runtime": "^7.0.0",
|
|
@@ -129,7 +129,6 @@
|
|
|
129
129
|
"@types/react-loadable": "^5.4.1",
|
|
130
130
|
"@types/react-virtualized": "^9.18.12",
|
|
131
131
|
"classnames": "^2.2.5",
|
|
132
|
-
"clipboard-polyfill": "2.4.3",
|
|
133
132
|
"date-fns": "^2.17.0",
|
|
134
133
|
"is-number": "^7.0.0",
|
|
135
134
|
"lodash": "^4.17.21",
|
|
@@ -199,6 +198,7 @@
|
|
|
199
198
|
"@types/raf-schd": "^4.0.1",
|
|
200
199
|
"@types/rison": "^0.0.6",
|
|
201
200
|
"async-retry": "^1.2.3",
|
|
201
|
+
"clipboard-polyfill": "2.4.3",
|
|
202
202
|
"diff": "^4.0.1",
|
|
203
203
|
"enzyme": "^3.10.0",
|
|
204
204
|
"eslint-import-resolver-typescript": "^3.5.1",
|
package/report.api.md
CHANGED