@atlaskit/editor-core 187.43.12 → 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.
Files changed (69) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/labs/next/presets/default.js +2 -1
  3. package/dist/cjs/labs/next/presets/universal.js +1 -1
  4. package/dist/cjs/plugins/clipboard/pm-plugins/main.js +13 -54
  5. package/dist/cjs/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
  6. package/dist/cjs/plugins/floating-toolbar/index.js +1 -2
  7. package/dist/cjs/plugins/index.js +0 -7
  8. package/dist/cjs/plugins/selection/utils.js +29 -80
  9. package/dist/cjs/utils/clipboard.js +19 -127
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/labs/next/presets/default.js +2 -1
  12. package/dist/es2019/labs/next/presets/universal.js +2 -2
  13. package/dist/es2019/plugins/clipboard/pm-plugins/main.js +3 -53
  14. package/dist/es2019/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
  15. package/dist/es2019/plugins/floating-toolbar/index.js +1 -2
  16. package/dist/es2019/plugins/index.js +0 -1
  17. package/dist/es2019/plugins/selection/utils.js +3 -74
  18. package/dist/es2019/utils/clipboard.js +1 -53
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/labs/next/presets/default.js +2 -1
  21. package/dist/esm/labs/next/presets/universal.js +2 -2
  22. package/dist/esm/plugins/clipboard/pm-plugins/main.js +3 -49
  23. package/dist/esm/plugins/code-block/pm-plugins/codeBlockCopySelectionPlugin.js +1 -1
  24. package/dist/esm/plugins/floating-toolbar/index.js +1 -2
  25. package/dist/esm/plugins/index.js +0 -1
  26. package/dist/esm/plugins/selection/utils.js +3 -72
  27. package/dist/esm/utils/clipboard.js +1 -119
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/labs/next/presets/default.d.ts +68 -4
  30. package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +2 -3
  31. package/dist/types/plugins/index.d.ts +0 -1
  32. package/dist/types/plugins/selection/utils.d.ts +2 -5
  33. package/dist/types/utils/clipboard.d.ts +1 -3
  34. package/dist/types-ts4.5/labs/next/presets/default.d.ts +86 -0
  35. package/dist/types-ts4.5/plugins/clipboard/pm-plugins/main.d.ts +2 -3
  36. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  37. package/dist/types-ts4.5/plugins/selection/utils.d.ts +2 -5
  38. package/dist/types-ts4.5/utils/clipboard.d.ts +1 -3
  39. package/package.json +7 -7
  40. package/dist/cjs/plugins/copy-button/commands.js +0 -171
  41. package/dist/cjs/plugins/copy-button/index.js +0 -23
  42. package/dist/cjs/plugins/copy-button/pm-plugins/main.js +0 -104
  43. package/dist/cjs/plugins/copy-button/pm-plugins/plugin-key.js +0 -9
  44. package/dist/cjs/plugins/copy-button/toolbar.js +0 -99
  45. package/dist/cjs/plugins/copy-button/utils.js +0 -22
  46. package/dist/es2019/plugins/copy-button/commands.js +0 -157
  47. package/dist/es2019/plugins/copy-button/index.js +0 -11
  48. package/dist/es2019/plugins/copy-button/pm-plugins/main.js +0 -97
  49. package/dist/es2019/plugins/copy-button/pm-plugins/plugin-key.js +0 -2
  50. package/dist/es2019/plugins/copy-button/toolbar.js +0 -82
  51. package/dist/es2019/plugins/copy-button/utils.js +0 -15
  52. package/dist/esm/plugins/copy-button/commands.js +0 -159
  53. package/dist/esm/plugins/copy-button/index.js +0 -15
  54. package/dist/esm/plugins/copy-button/pm-plugins/main.js +0 -96
  55. package/dist/esm/plugins/copy-button/pm-plugins/plugin-key.js +0 -2
  56. package/dist/esm/plugins/copy-button/toolbar.js +0 -89
  57. package/dist/esm/plugins/copy-button/utils.js +0 -14
  58. package/dist/types/plugins/copy-button/commands.d.ts +0 -9
  59. package/dist/types/plugins/copy-button/index.d.ts +0 -3
  60. package/dist/types/plugins/copy-button/pm-plugins/main.d.ts +0 -4
  61. package/dist/types/plugins/copy-button/pm-plugins/plugin-key.d.ts +0 -2
  62. package/dist/types/plugins/copy-button/toolbar.d.ts +0 -13
  63. package/dist/types/plugins/copy-button/utils.d.ts +0 -8
  64. package/dist/types-ts4.5/plugins/copy-button/commands.d.ts +0 -9
  65. package/dist/types-ts4.5/plugins/copy-button/index.d.ts +0 -3
  66. package/dist/types-ts4.5/plugins/copy-button/pm-plugins/main.d.ts +0 -4
  67. package/dist/types-ts4.5/plugins/copy-button/pm-plugins/plugin-key.d.ts +0 -2
  68. package/dist/types-ts4.5/plugins/copy-button/toolbar.d.ts +0 -13
  69. package/dist/types-ts4.5/plugins/copy-button/utils.d.ts +0 -8
@@ -1,159 +0,0 @@
1
- import { copyButtonPluginKey } from './pm-plugins/plugin-key';
2
- import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
- import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill } from '../../utils/clipboard';
4
- import { getSelectedNodeOrNodeParentByNodeType, toDOM } from './utils';
5
- import { addAnalytics, ACTION, INPUT_METHOD } from '../analytics';
6
- import { getAnalyticsPayload } from '../clipboard/pm-plugins/main';
7
- import { browser } from '@atlaskit/editor-common/utils';
8
- export function createToolbarCopyCommandForMark(markType) {
9
- function command(state, dispatch) {
10
- var textNode = state.tr.selection.$head.parent.maybeChild(state.tr.selection.$head.index());
11
- if (!textNode) {
12
- return false;
13
- }
14
- if (dispatch) {
15
- // As calling copyHTMLToClipboard causes side effects -- we only run this when
16
- // dispatch is provided -- as otherwise the consumer is only testing to see if
17
- // the action is availble.
18
- var domNode = toDOM(textNode, state.schema);
19
- if (domNode) {
20
- var div = document.createElement('div');
21
- var p = document.createElement('p');
22
- div.appendChild(p);
23
- p.appendChild(domNode);
24
- // The "1 1" refers to the start and end depth of the slice
25
- // since we're copying the text inside a paragraph, it will always be 1 1
26
- // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
27
- div.firstChild.setAttribute('data-pm-slice', '1 1 []');
28
-
29
- // If we're copying a hyperlink, we'd copy the url as the fallback plain text
30
- var linkUrl = domNode.getAttribute('href');
31
- copyHTMLToClipboard(div, markType.name === 'link' && linkUrl ? linkUrl : undefined);
32
- }
33
- var copyToClipboardTr = state.tr;
34
- copyToClipboardTr.setMeta(copyButtonPluginKey, {
35
- copied: true
36
- });
37
- var analyticsPayload = getAnalyticsPayload(state, ACTION.COPIED);
38
- if (analyticsPayload) {
39
- analyticsPayload.attributes.inputMethod = INPUT_METHOD.FLOATING_TB;
40
- analyticsPayload.attributes.markType = markType.name;
41
- addAnalytics(state, copyToClipboardTr, analyticsPayload);
42
- }
43
- dispatch(copyToClipboardTr);
44
- }
45
- return true;
46
- }
47
- return command;
48
- }
49
- export function getProvideMarkVisualFeedbackForCopyButtonCommand(markType) {
50
- function provideMarkVisualFeedbackForCopyButtonCommand(state, dispatch) {
51
- var tr = state.tr;
52
- tr.setMeta(copyButtonPluginKey, {
53
- showSelection: true,
54
- markType: markType
55
- });
56
- if (dispatch) {
57
- dispatch(tr);
58
- }
59
- return true;
60
- }
61
- return provideMarkVisualFeedbackForCopyButtonCommand;
62
- }
63
- export function removeMarkVisualFeedbackForCopyButtonCommand(state, dispatch) {
64
- var tr = state.tr;
65
- tr.setMeta(copyButtonPluginKey, {
66
- removeSelection: true
67
- });
68
- var copyButtonState = copyButtonPluginKey.getState(state);
69
- if (copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied) {
70
- tr.setMeta(copyButtonPluginKey, {
71
- copied: false
72
- });
73
- }
74
- if (dispatch) {
75
- dispatch(tr);
76
- }
77
- return true;
78
- }
79
- export var createToolbarCopyCommandForNode = function createToolbarCopyCommandForNode(nodeType) {
80
- return function (state, dispatch) {
81
- var tr = state.tr,
82
- schema = state.schema;
83
-
84
- // This command should only be triggered by the Copy button in the floating toolbar
85
- // which is only visible when selection is inside the target node
86
- var contentNodeWithPos = getSelectedNodeOrNodeParentByNodeType({
87
- nodeType: nodeType,
88
- selection: tr.selection
89
- });
90
- if (!contentNodeWithPos) {
91
- return false;
92
- }
93
- var copyToClipboardTr = tr;
94
- copyToClipboardTr.setMeta(copyButtonPluginKey, {
95
- copied: true
96
- });
97
- var analyticsPayload = getAnalyticsPayload(state, ACTION.COPIED);
98
- if (analyticsPayload) {
99
- analyticsPayload.attributes.inputMethod = INPUT_METHOD.FLOATING_TB;
100
- analyticsPayload.attributes.nodeType = contentNodeWithPos.node.type.name;
101
- addAnalytics(state, copyToClipboardTr, analyticsPayload);
102
- }
103
- if (dispatch) {
104
- // As calling copyHTMLToClipboard causes side effects -- we only run this when
105
- // dispatch is provided -- as otherwise the consumer is only testing to see if
106
- // the action is availble.
107
- var domNode = toDOM(contentNodeWithPos.node, schema);
108
- if (domNode) {
109
- var div = document.createElement('div');
110
- div.appendChild(domNode);
111
-
112
- // if copying inline content
113
- if (contentNodeWithPos.node.type.inlineContent) {
114
- // The "1 1" refers to the start and end depth of the slice
115
- // since we're copying the text inside a paragraph, it will always be 1 1
116
- // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
117
- div.firstChild.setAttribute('data-pm-slice', '1 1 []');
118
- } else {
119
- // The "0 0" refers to the start and end depth of the slice
120
- // since we're copying the block node only, it will always be 0 0
121
- // https://github.com/ProseMirror/prosemirror-view/blob/master/src/clipboard.ts#L32
122
- div.firstChild.setAttribute('data-pm-slice', '0 0 []');
123
- }
124
- // ED-17083 safari seems have bugs for extension copy because exntension do not have a child text(innerText) and it will not recognized as html in clipboard, this could be merge into one if this extension fixed children issue or safari fix the copy bug
125
- // MEX-2528 safari has a bug related to the mediaSingle node with border or link. The image tag within the clipboard is not recognized as HTML when using the ClipboardItem API. To address this, we have to switch to ClipboardPolyfill
126
- if (browser.safari && state.selection instanceof NodeSelection && (state.selection.node.type === state.schema.nodes.extension || state.selection.node.type === state.schema.nodes.mediaSingle)) {
127
- copyHTMLToClipboardPolyfill(div);
128
- } else {
129
- copyHTMLToClipboard(div);
130
- }
131
- }
132
- copyToClipboardTr.setMeta('scrollIntoView', false);
133
- dispatch(copyToClipboardTr);
134
- }
135
- return true;
136
- };
137
- };
138
- export var resetCopiedState = function resetCopiedState(nodeType, hoverDecoration, onMouseLeave) {
139
- return function (state, dispatch) {
140
- var customTr = state.tr;
141
-
142
- // Avoid multipe dispatch
143
- // https://product-fabric.atlassian.net/wiki/spaces/E/pages/2241659456/All+about+dispatch+and+why+there+shouldn+t+be+multiple#How-do-I-avoid-them%3F
144
- var customDispatch = function customDispatch(tr) {
145
- customTr = tr;
146
- };
147
- onMouseLeave ? onMouseLeave(state, customDispatch) : hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false)(state, customDispatch);
148
- var copyButtonState = copyButtonPluginKey.getState(state);
149
- if (copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied) {
150
- customTr.setMeta(copyButtonPluginKey, {
151
- copied: false
152
- });
153
- }
154
- if (dispatch) {
155
- dispatch(customTr);
156
- }
157
- return true;
158
- };
159
- };
@@ -1,15 +0,0 @@
1
- import createPlugin from './pm-plugins/main';
2
- var copyButtonPlugin = function copyButtonPlugin() {
3
- return {
4
- name: 'copyButton',
5
- pmPlugins: function pmPlugins() {
6
- return [{
7
- name: 'copyButton',
8
- plugin: function plugin() {
9
- return createPlugin();
10
- }
11
- }];
12
- }
13
- };
14
- };
15
- export default copyButtonPlugin;
@@ -1,96 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
- import { copyButtonPluginKey } from './plugin-key';
4
- function getMarkSelectionDecorationStartAndEnd(_ref) {
5
- var markType = _ref.markType,
6
- transaction = _ref.transaction;
7
- var headResolvedPos = transaction.selection.$head;
8
- var textNodeIndex = transaction.selection.$head.index();
9
- var textNode = headResolvedPos.parent.maybeChild(textNodeIndex);
10
- var textNodeOffset = 0;
11
- headResolvedPos.parent.forEach(function (_node, nodeOffset, index) {
12
- if (index === textNodeIndex) {
13
- textNodeOffset = nodeOffset;
14
- }
15
- });
16
- var start = headResolvedPos.start(headResolvedPos.depth) + textNodeOffset;
17
- var end = start + textNode.text.length;
18
- return {
19
- start: start,
20
- end: end,
21
- markType: markType
22
- };
23
- }
24
- export function copyButtonPlugin() {
25
- return new SafePlugin({
26
- key: copyButtonPluginKey,
27
- state: {
28
- init: function init() {
29
- return {
30
- copied: false,
31
- markSelection: undefined
32
- };
33
- },
34
- apply: function apply(tr, currentPluginState) {
35
- var meta = tr.getMeta(copyButtonPluginKey);
36
- if ((meta === null || meta === void 0 ? void 0 : meta.copied) !== undefined) {
37
- return {
38
- copied: meta.copied,
39
- markSelection: undefined
40
- };
41
- }
42
- if (meta !== null && meta !== void 0 && meta.showSelection) {
43
- return {
44
- copied: currentPluginState.copied,
45
- markSelection: getMarkSelectionDecorationStartAndEnd({
46
- markType: meta.markType,
47
- transaction: tr
48
- })
49
- };
50
- }
51
- if (meta !== null && meta !== void 0 && meta.removeSelection) {
52
- return {
53
- copied: currentPluginState.copied,
54
- markSelection: undefined
55
- };
56
- }
57
- if (currentPluginState.markSelection) {
58
- return {
59
- copied: currentPluginState.copied,
60
- markSelection: getMarkSelectionDecorationStartAndEnd({
61
- markType: currentPluginState.markSelection.markType,
62
- transaction: tr
63
- })
64
- };
65
- }
66
- return currentPluginState;
67
- }
68
- },
69
- props: {
70
- decorations: function decorations(_state) {
71
- // Showing visual hints for the hyperlink copy button has been disabled
72
- // due to an issue where invalid hyperlink marks cause the floating toolbar
73
- // to jump around when the copy button is hovered.
74
- // See the following bug for details -- once that is resolved -- the visual
75
- // hints can be re enabled.
76
- // https://product-fabric.atlassian.net/browse/DTR-722
77
-
78
- // const copyButtonPluginState = copyButtonPluginKey.getState(
79
- // state,
80
- // ) as CopyButtonPluginState;
81
- // if (copyButtonPluginState.markSelection) {
82
- // const { start, end } = copyButtonPluginState.markSelection;
83
-
84
- // return DecorationSet.create(state.doc, [
85
- // Decoration.inline(start, end, {
86
- // class: 'ProseMirror-fake-text-selection',
87
- // }),
88
- // ]);
89
- // }
90
-
91
- return DecorationSet.empty;
92
- }
93
- }
94
- });
95
- }
96
- export default copyButtonPlugin;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export var copyButtonPluginKey = new PluginKey('copyButtonPlugin');
@@ -1,89 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- import CopyIcon from '@atlaskit/icon/glyph/copy';
5
- import commonMessages from '../../messages';
6
- import { createToolbarCopyCommandForNode, createToolbarCopyCommandForMark, resetCopiedState, getProvideMarkVisualFeedbackForCopyButtonCommand, removeMarkVisualFeedbackForCopyButtonCommand } from './commands';
7
- import { copyButtonPluginKey } from './pm-plugins/plugin-key';
8
- function isSeparator(item) {
9
- return (item === null || item === void 0 ? void 0 : item.type) === 'separator';
10
- }
11
- function isNodeOptions(options) {
12
- return 'nodeType' in options && options.nodeType !== undefined;
13
- }
14
- export function getCopyButtonConfig(options, hoverDecoration) {
15
- var state = options.state,
16
- formatMessage = options.formatMessage,
17
- onMouseEnter = options.onMouseEnter,
18
- onMouseLeave = options.onMouseLeave,
19
- onFocus = options.onFocus,
20
- onBlur = options.onBlur;
21
- var copyButtonState = copyButtonPluginKey.getState(state);
22
- var buttonActionHandlers;
23
- if (isNodeOptions(options)) {
24
- buttonActionHandlers = {
25
- onClick: createToolbarCopyCommandForNode(options.nodeType),
26
- // Note for future changes: these two handlers should perform
27
- // the same action.
28
- onMouseEnter: onMouseEnter || (hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(options.nodeType, true, 'ak-editor-selected-node')),
29
- onFocus: onFocus || (hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(options.nodeType, true, 'ak-editor-selected-node')),
30
- // Note for future changes: these two handlers should perform
31
- // the same action.
32
- onMouseLeave: resetCopiedState(options.nodeType, hoverDecoration, onMouseLeave),
33
- onBlur: resetCopiedState(options.nodeType, hoverDecoration, onBlur)
34
- };
35
- } else {
36
- buttonActionHandlers = {
37
- onClick: createToolbarCopyCommandForMark(options.markType),
38
- onMouseEnter: getProvideMarkVisualFeedbackForCopyButtonCommand(options.markType),
39
- onFocus: getProvideMarkVisualFeedbackForCopyButtonCommand(options.markType),
40
- onMouseLeave: removeMarkVisualFeedbackForCopyButtonCommand,
41
- onBlur: removeMarkVisualFeedbackForCopyButtonCommand
42
- };
43
- }
44
- return _objectSpread(_objectSpread({
45
- id: 'editor.floatingToolbar.copy',
46
- type: 'button',
47
- appearance: 'subtle',
48
- icon: CopyIcon,
49
- title: formatMessage(copyButtonState !== null && copyButtonState !== void 0 && copyButtonState.copied ? commonMessages.copiedToClipboard : commonMessages.copyToClipboard)
50
- }, buttonActionHandlers), {}, {
51
- hideTooltipOnClick: false,
52
- tabIndex: null
53
- // TODO select and delete styling needs to be removed when keyboard cursor moves away
54
- // problem already exist with delete as well
55
- });
56
- }
57
-
58
- export var showCopyButton = function showCopyButton(state) {
59
- return state &&
60
- // Check if the Copy button plugin is enabled
61
- // @ts-ignore copyButtonPluginKey.key
62
- state.plugins.find(function (p) {
63
- return p.key === copyButtonPluginKey.key;
64
- });
65
- };
66
-
67
- /**
68
- * Process floatingToolbar items for copyButton
69
- *
70
- * If copy button plugin not enabled, remove copy button item from toolbar items
71
- * else process copy button to standard floatingtoobarbutton
72
- */
73
- export function processCopyButtonItems(state) {
74
- return function (items, hoverDecoration) {
75
- return items.flatMap(function (item) {
76
- switch (item.type) {
77
- case 'copy-button':
78
- if (item !== null && item !== void 0 && item.hidden || !showCopyButton(state)) {
79
- return [];
80
- }
81
- return item === null || item === void 0 ? void 0 : item.items.map(function (copyButtonItem) {
82
- return isSeparator(copyButtonItem) ? copyButtonItem : getCopyButtonConfig(copyButtonItem, hoverDecoration);
83
- });
84
- default:
85
- return [item];
86
- }
87
- });
88
- };
89
- }
@@ -1,14 +0,0 @@
1
- import { findSelectedNodeOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
2
- import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
3
- export function getSelectedNodeOrNodeParentByNodeType(_ref) {
4
- var nodeType = _ref.nodeType,
5
- selection = _ref.selection;
6
- var node = findSelectedNodeOfType(nodeType)(selection);
7
- if (!node) {
8
- node = findParentNodeOfType(nodeType)(selection);
9
- }
10
- return node;
11
- }
12
- export var toDOM = function toDOM(node, schema) {
13
- return DOMSerializer.fromSchema(schema).serializeNode(node);
14
- };
@@ -1,9 +0,0 @@
1
- import type { Command, CommandDispatch } from '../../types';
2
- import type { MarkType, NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
5
- export declare function createToolbarCopyCommandForMark(markType: MarkType): Command;
6
- export declare function getProvideMarkVisualFeedbackForCopyButtonCommand(markType: MarkType): (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
7
- export declare function removeMarkVisualFeedbackForCopyButtonCommand(state: EditorState, dispatch: CommandDispatch | undefined): boolean;
8
- export declare const createToolbarCopyCommandForNode: (nodeType: NodeType | Array<NodeType>) => Command;
9
- export declare const resetCopiedState: (nodeType: NodeType | Array<NodeType>, hoverDecoration: HoverDecorationHandler | undefined, onMouseLeave?: Command) => Command;
@@ -1,3 +0,0 @@
1
- import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
2
- declare const copyButtonPlugin: CopyButtonPlugin;
3
- export default copyButtonPlugin;
@@ -1,4 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { CopyButtonPluginState } from '@atlaskit/editor-plugin-copy-button';
3
- export declare function copyButtonPlugin(): SafePlugin<CopyButtonPluginState>;
4
- export default copyButtonPlugin;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const copyButtonPluginKey: PluginKey<any>;
@@ -1,13 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Command } from '../../../src/types';
3
- import type { FloatingToolbarButton, FloatingToolbarItem, MarkOptions, NodeOptions } from '@atlaskit/editor-common/types';
4
- import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
5
- export declare function getCopyButtonConfig(options: MarkOptions | NodeOptions, hoverDecoration: HoverDecorationHandler | undefined): FloatingToolbarButton<Command>;
6
- export declare const showCopyButton: (state?: EditorState) => import("prosemirror-state").Plugin<any> | undefined;
7
- /**
8
- * Process floatingToolbar items for copyButton
9
- *
10
- * If copy button plugin not enabled, remove copy button item from toolbar items
11
- * else process copy button to standard floatingtoobarbutton
12
- */
13
- export declare function processCopyButtonItems(state: EditorState): (items: Array<FloatingToolbarItem<Command>>, hoverDecoration: HoverDecorationHandler | undefined) => Array<FloatingToolbarItem<Command>>;
@@ -1,8 +0,0 @@
1
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
2
- import type { Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
- export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
5
- nodeType: NodeType | Array<NodeType>;
6
- selection: Transaction['selection'];
7
- }): import("prosemirror-utils/dist/types").FindResult;
8
- export declare const toDOM: (node: PMNode, schema: Schema) => Node;
@@ -1,9 +0,0 @@
1
- import type { Command, CommandDispatch } from '../../types';
2
- import type { MarkType, NodeType } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
5
- export declare function createToolbarCopyCommandForMark(markType: MarkType): Command;
6
- export declare function getProvideMarkVisualFeedbackForCopyButtonCommand(markType: MarkType): (state: EditorState, dispatch: CommandDispatch | undefined) => boolean;
7
- export declare function removeMarkVisualFeedbackForCopyButtonCommand(state: EditorState, dispatch: CommandDispatch | undefined): boolean;
8
- export declare const createToolbarCopyCommandForNode: (nodeType: NodeType | Array<NodeType>) => Command;
9
- export declare const resetCopiedState: (nodeType: NodeType | Array<NodeType>, hoverDecoration: HoverDecorationHandler | undefined, onMouseLeave?: Command) => Command;
@@ -1,3 +0,0 @@
1
- import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
2
- declare const copyButtonPlugin: CopyButtonPlugin;
3
- export default copyButtonPlugin;
@@ -1,4 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { CopyButtonPluginState } from '@atlaskit/editor-plugin-copy-button';
3
- export declare function copyButtonPlugin(): SafePlugin<CopyButtonPluginState>;
4
- export default copyButtonPlugin;
@@ -1,2 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- export declare const copyButtonPluginKey: PluginKey<any>;
@@ -1,13 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Command } from '../../../src/types';
3
- import type { FloatingToolbarButton, FloatingToolbarItem, MarkOptions, NodeOptions } from '@atlaskit/editor-common/types';
4
- import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
5
- export declare function getCopyButtonConfig(options: MarkOptions | NodeOptions, hoverDecoration: HoverDecorationHandler | undefined): FloatingToolbarButton<Command>;
6
- export declare const showCopyButton: (state?: EditorState) => import("prosemirror-state").Plugin<any> | undefined;
7
- /**
8
- * Process floatingToolbar items for copyButton
9
- *
10
- * If copy button plugin not enabled, remove copy button item from toolbar items
11
- * else process copy button to standard floatingtoobarbutton
12
- */
13
- export declare function processCopyButtonItems(state: EditorState): (items: Array<FloatingToolbarItem<Command>>, hoverDecoration: HoverDecorationHandler | undefined) => Array<FloatingToolbarItem<Command>>;
@@ -1,8 +0,0 @@
1
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
2
- import type { Schema, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
- export declare function getSelectedNodeOrNodeParentByNodeType({ nodeType, selection, }: {
5
- nodeType: NodeType | Array<NodeType>;
6
- selection: Transaction['selection'];
7
- }): import("prosemirror-utils/dist/types").FindResult;
8
- export declare const toDOM: (node: PMNode, schema: Schema) => Node;