@atlaskit/editor-plugin-paste-options-toolbar 0.3.6 → 0.3.8
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/toolbar.js +10 -12
- package/dist/es2019/toolbar.js +4 -6
- package/dist/esm/toolbar.js +4 -6
- package/package.json +3 -3
- package/dist/cjs/messages.js +0 -29
- package/dist/es2019/messages.js +0 -23
- package/dist/esm/messages.js +0 -23
- package/dist/types/messages.d.ts +0 -22
- package/dist/types-ts4.5/messages.d.ts +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste-options-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.3.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#71136](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/71136) [`c803fea1e6a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c803fea1e6a4) - Move all plugin translations to editor-common
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 0.3.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#69790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69790) [`0de5e8a05235`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0de5e8a05235) - ED-21955-update: Correcting outdated comments
|
|
15
|
+
|
|
3
16
|
## 0.3.6
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.isToolbarVisible = exports.getToolbarMenuConfig = exports.buildToolbar = void 0;
|
|
8
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
8
9
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
9
10
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
11
|
var _commands = require("./commands");
|
|
11
|
-
var _messages = require("./messages");
|
|
12
12
|
var _constants = require("./pm-plugins/constants");
|
|
13
13
|
var _types = require("./types");
|
|
14
14
|
var _pasteIcon = _interopRequireDefault(require("./ui/paste-icon"));
|
|
@@ -18,12 +18,10 @@ var isToolbarVisible = exports.isToolbarVisible = function isToolbarVisible(stat
|
|
|
18
18
|
/**
|
|
19
19
|
* Conditions for not showing the toolbar:
|
|
20
20
|
* 1. Feature flag is disabled
|
|
21
|
-
* 2.
|
|
22
|
-
* 3.
|
|
23
|
-
* 4. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
24
|
-
* 5. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
21
|
+
* 2. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
22
|
+
* 3. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
25
23
|
* (grandParent node should be root doc for showing up the toolbar)
|
|
26
|
-
*
|
|
24
|
+
* 4. Cursor is inside the codeblock.
|
|
27
25
|
*/
|
|
28
26
|
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-options-toolbar')) {
|
|
29
27
|
return false;
|
|
@@ -42,18 +40,18 @@ var isToolbarVisible = exports.isToolbarVisible = function isToolbarVisible(stat
|
|
|
42
40
|
var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMenuConfig(pluginState, intl, editorAnalyticsAPI) {
|
|
43
41
|
var options = [{
|
|
44
42
|
id: 'editor.paste.richText',
|
|
45
|
-
title: intl.formatMessage(_messages.
|
|
43
|
+
title: intl.formatMessage(_messages.pasteOptionsToolbarMessages.richText),
|
|
46
44
|
selected: pluginState.selectedOption === _types.ToolbarDropdownOption.RichText,
|
|
47
45
|
hidden: pluginState.isPlainText,
|
|
48
46
|
onClick: (0, _commands.changeToRichTextWithAnalytics)(editorAnalyticsAPI)()
|
|
49
47
|
}, {
|
|
50
48
|
id: 'editor.paste.markdown',
|
|
51
|
-
title: intl.formatMessage(_messages.
|
|
49
|
+
title: intl.formatMessage(_messages.pasteOptionsToolbarMessages.markdown),
|
|
52
50
|
selected: pluginState.selectedOption === _types.ToolbarDropdownOption.Markdown,
|
|
53
51
|
onClick: (0, _commands.changeToMarkdownWithAnalytics)(editorAnalyticsAPI, pluginState.plaintext.length)()
|
|
54
52
|
}, {
|
|
55
53
|
id: 'editor.paste.plainText',
|
|
56
|
-
title: intl.formatMessage(_messages.
|
|
54
|
+
title: intl.formatMessage(_messages.pasteOptionsToolbarMessages.plainText),
|
|
57
55
|
selected: pluginState.selectedOption === _types.ToolbarDropdownOption.PlainText,
|
|
58
56
|
onClick: (0, _commands.changeToPlainTextWithAnalytics)(editorAnalyticsAPI, pluginState.plaintext.length)()
|
|
59
57
|
}];
|
|
@@ -62,7 +60,7 @@ var getToolbarMenuConfig = exports.getToolbarMenuConfig = function getToolbarMen
|
|
|
62
60
|
icon: _pasteIcon.default,
|
|
63
61
|
type: 'dropdown',
|
|
64
62
|
testId: _constants.PASTE_OPTIONS_TEST_ID,
|
|
65
|
-
title: intl.formatMessage(_messages.
|
|
63
|
+
title: intl.formatMessage(_messages.pasteOptionsToolbarMessages.pasteOptions),
|
|
66
64
|
options: options,
|
|
67
65
|
onToggle: onToggleHandler
|
|
68
66
|
};
|
|
@@ -76,7 +74,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, edi
|
|
|
76
74
|
var pluginState = _types.pasteOptionsPluginKey.getState(state);
|
|
77
75
|
var menu = getToolbarMenuConfig(pluginState, intl, editorAnalyticsAPI);
|
|
78
76
|
return {
|
|
79
|
-
title: intl.formatMessage(_messages.
|
|
77
|
+
title: intl.formatMessage(_messages.pasteOptionsToolbarMessages.pasteOptions),
|
|
80
78
|
nodeType: validNodes,
|
|
81
79
|
zIndex: _editorSharedStyles.akEditorFloatingPanelZIndex,
|
|
82
80
|
className: _constants.PASTE_TOOLBAR_CLASS,
|
|
@@ -88,7 +86,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, edi
|
|
|
88
86
|
var onPositionCalculated = function onPositionCalculated(editorView, nextPos) {
|
|
89
87
|
var from = editorView.state.selection.from;
|
|
90
88
|
var fromCoords = editorView.coordsAtPos(from);
|
|
91
|
-
var toolbar = document.querySelector("div[aria-label=\"".concat(_messages.
|
|
89
|
+
var toolbar = document.querySelector("div[aria-label=\"".concat(_messages.pasteOptionsToolbarMessages.pasteOptions.defaultMessage, "\"]"));
|
|
92
90
|
var offsetParent = (toolbar === null || toolbar === void 0 ? void 0 : toolbar.offsetParent) || editorView.dom;
|
|
93
91
|
var offsetParentRect = offsetParent === null || offsetParent === void 0 ? void 0 : offsetParent.getBoundingClientRect();
|
|
94
92
|
var offsetTop = (offsetParentRect === null || offsetParentRect === void 0 ? void 0 : offsetParentRect.top) || 0;
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { pasteOptionsToolbarMessages as messages } from '@atlaskit/editor-common/messages';
|
|
1
2
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
2
3
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { changeToMarkdownWithAnalytics, changeToPlainTextWithAnalytics, changeToRichTextWithAnalytics, dropdownClickHandler } from './commands';
|
|
4
|
-
import { messages } from './messages';
|
|
5
5
|
import { PASTE_OPTIONS_TEST_ID, PASTE_TOOLBAR_CLASS, PASTE_TOOLBAR_ITEM_CLASS } from './pm-plugins/constants';
|
|
6
6
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types';
|
|
7
7
|
import EditorPasteIcon from './ui/paste-icon';
|
|
@@ -11,12 +11,10 @@ export const isToolbarVisible = (state, lastContentPasted) => {
|
|
|
11
11
|
/**
|
|
12
12
|
* Conditions for not showing the toolbar:
|
|
13
13
|
* 1. Feature flag is disabled
|
|
14
|
-
* 2.
|
|
15
|
-
* 3.
|
|
16
|
-
* 4. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
17
|
-
* 5. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
14
|
+
* 2. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
15
|
+
* 3. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
18
16
|
* (grandParent node should be root doc for showing up the toolbar)
|
|
19
|
-
*
|
|
17
|
+
* 4. Cursor is inside the codeblock.
|
|
20
18
|
*/
|
|
21
19
|
if (!getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
22
20
|
return false;
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { pasteOptionsToolbarMessages as messages } from '@atlaskit/editor-common/messages';
|
|
1
2
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
2
3
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { changeToMarkdownWithAnalytics, changeToPlainTextWithAnalytics, changeToRichTextWithAnalytics, dropdownClickHandler } from './commands';
|
|
4
|
-
import { messages } from './messages';
|
|
5
5
|
import { PASTE_OPTIONS_TEST_ID, PASTE_TOOLBAR_CLASS, PASTE_TOOLBAR_ITEM_CLASS } from './pm-plugins/constants';
|
|
6
6
|
import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types';
|
|
7
7
|
import EditorPasteIcon from './ui/paste-icon';
|
|
@@ -11,12 +11,10 @@ export var isToolbarVisible = function isToolbarVisible(state, lastContentPasted
|
|
|
11
11
|
/**
|
|
12
12
|
* Conditions for not showing the toolbar:
|
|
13
13
|
* 1. Feature flag is disabled
|
|
14
|
-
* 2.
|
|
15
|
-
* 3.
|
|
16
|
-
* 4. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
17
|
-
* 5. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
14
|
+
* 2. Pasting link, media or text containing media(note: markdown link and images are allowed)
|
|
15
|
+
* 3. Content is pasted in a nested node(i.e. inside a table, panel etc.).
|
|
18
16
|
* (grandParent node should be root doc for showing up the toolbar)
|
|
19
|
-
*
|
|
17
|
+
* 4. Cursor is inside the codeblock.
|
|
20
18
|
*/
|
|
21
19
|
if (!getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
22
20
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste-options-toolbar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Paste options toolbar for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"./styles": "./src/styles.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@atlaskit/editor-common": "^77.
|
|
37
|
+
"@atlaskit/editor-common": "^77.3.0",
|
|
38
38
|
"@atlaskit/editor-markdown-transformer": "^5.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
40
40
|
"@atlaskit/editor-plugin-paste": "^0.2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
43
43
|
"@atlaskit/icon": "^22.0.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.2.4",
|
|
45
|
-
"@atlaskit/tokens": "^1.
|
|
45
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
package/dist/cjs/messages.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.messages = void 0;
|
|
7
|
-
var _reactIntlNext = require("react-intl-next");
|
|
8
|
-
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
-
pasteOptions: {
|
|
10
|
-
id: 'fabric.editor.pasteOptions',
|
|
11
|
-
defaultMessage: 'Paste options floating controls',
|
|
12
|
-
description: 'Opens a menu with additional paste options'
|
|
13
|
-
},
|
|
14
|
-
plainText: {
|
|
15
|
-
id: 'fabric.editor.plainText',
|
|
16
|
-
defaultMessage: 'Use plain text',
|
|
17
|
-
description: 'Converts pasted text into plain text'
|
|
18
|
-
},
|
|
19
|
-
markdown: {
|
|
20
|
-
id: 'fabric.editor.useMarkdown',
|
|
21
|
-
defaultMessage: 'Use Markdown',
|
|
22
|
-
description: 'Converts pasted text into Markdown'
|
|
23
|
-
},
|
|
24
|
-
richText: {
|
|
25
|
-
id: 'fabric.editor.richText',
|
|
26
|
-
defaultMessage: 'Use rich text',
|
|
27
|
-
description: 'Converts pasted text into Rich text'
|
|
28
|
-
}
|
|
29
|
-
});
|
package/dist/es2019/messages.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl-next';
|
|
2
|
-
export const messages = defineMessages({
|
|
3
|
-
pasteOptions: {
|
|
4
|
-
id: 'fabric.editor.pasteOptions',
|
|
5
|
-
defaultMessage: 'Paste options floating controls',
|
|
6
|
-
description: 'Opens a menu with additional paste options'
|
|
7
|
-
},
|
|
8
|
-
plainText: {
|
|
9
|
-
id: 'fabric.editor.plainText',
|
|
10
|
-
defaultMessage: 'Use plain text',
|
|
11
|
-
description: 'Converts pasted text into plain text'
|
|
12
|
-
},
|
|
13
|
-
markdown: {
|
|
14
|
-
id: 'fabric.editor.useMarkdown',
|
|
15
|
-
defaultMessage: 'Use Markdown',
|
|
16
|
-
description: 'Converts pasted text into Markdown'
|
|
17
|
-
},
|
|
18
|
-
richText: {
|
|
19
|
-
id: 'fabric.editor.richText',
|
|
20
|
-
defaultMessage: 'Use rich text',
|
|
21
|
-
description: 'Converts pasted text into Rich text'
|
|
22
|
-
}
|
|
23
|
-
});
|
package/dist/esm/messages.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl-next';
|
|
2
|
-
export var messages = defineMessages({
|
|
3
|
-
pasteOptions: {
|
|
4
|
-
id: 'fabric.editor.pasteOptions',
|
|
5
|
-
defaultMessage: 'Paste options floating controls',
|
|
6
|
-
description: 'Opens a menu with additional paste options'
|
|
7
|
-
},
|
|
8
|
-
plainText: {
|
|
9
|
-
id: 'fabric.editor.plainText',
|
|
10
|
-
defaultMessage: 'Use plain text',
|
|
11
|
-
description: 'Converts pasted text into plain text'
|
|
12
|
-
},
|
|
13
|
-
markdown: {
|
|
14
|
-
id: 'fabric.editor.useMarkdown',
|
|
15
|
-
defaultMessage: 'Use Markdown',
|
|
16
|
-
description: 'Converts pasted text into Markdown'
|
|
17
|
-
},
|
|
18
|
-
richText: {
|
|
19
|
-
id: 'fabric.editor.richText',
|
|
20
|
-
defaultMessage: 'Use rich text',
|
|
21
|
-
description: 'Converts pasted text into Rich text'
|
|
22
|
-
}
|
|
23
|
-
});
|
package/dist/types/messages.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
pasteOptions: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
plainText: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
markdown: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
richText: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const messages: {
|
|
2
|
-
pasteOptions: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
plainText: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
markdown: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
richText: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
};
|