@atlaskit/editor-core 189.3.2 → 189.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/plugins/code-block/actions.js +1 -1
- package/dist/cjs/plugins/code-block/ide-ux/line-handling.js +1 -1
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/cjs/plugins/code-block/pm-plugins/keymaps.js +7 -4
- package/dist/cjs/plugins/code-block/toolbar.js +5 -3
- package/dist/cjs/plugins/code-block/utils.js +5 -1
- package/dist/cjs/plugins/expand/index.js +3 -3
- package/dist/cjs/plugins/feedback-dialog/index.js +3 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +2 -2
- package/dist/cjs/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +1 -2
- package/dist/cjs/ui/ContentStyles/index.js +7 -7
- package/dist/cjs/utils/deprecation-warnings.js +1 -3
- package/dist/cjs/utils/editorDeprecationWarnings.js +2 -4
- package/dist/cjs/utils/index.js +0 -53
- package/dist/cjs/version-wrapper.js +2 -5
- package/dist/es2019/plugins/code-block/actions.js +1 -1
- package/dist/es2019/plugins/code-block/ide-ux/line-handling.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/keymaps.js +5 -2
- package/dist/es2019/plugins/code-block/toolbar.js +1 -2
- package/dist/es2019/plugins/code-block/utils.js +4 -1
- package/dist/es2019/plugins/expand/index.js +1 -1
- package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
- package/dist/es2019/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +5 -6
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/utils/deprecation-warnings.js +1 -3
- package/dist/es2019/utils/editorDeprecationWarnings.js +2 -4
- package/dist/es2019/utils/index.js +0 -36
- package/dist/es2019/version-wrapper.js +1 -4
- package/dist/esm/plugins/code-block/actions.js +1 -1
- package/dist/esm/plugins/code-block/ide-ux/line-handling.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/keymaps.js +5 -2
- package/dist/esm/plugins/code-block/toolbar.js +1 -2
- package/dist/esm/plugins/code-block/utils.js +4 -1
- package/dist/esm/plugins/expand/index.js +1 -1
- package/dist/esm/plugins/feedback-dialog/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
- package/dist/esm/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +2 -3
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/utils/deprecation-warnings.js +1 -3
- package/dist/esm/utils/editorDeprecationWarnings.js +2 -4
- package/dist/esm/utils/index.js +0 -50
- package/dist/esm/version-wrapper.js +1 -4
- package/dist/types/plugins/code-block/actions.d.ts +1 -1
- package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/code-block/types.d.ts +1 -2
- package/dist/types/plugins/code-block/utils.d.ts +3 -0
- package/dist/{types-ts4.5/plugins/code-block/styles.d.ts → types/ui/ContentStyles/code-block.d.ts} +1 -1
- package/dist/types/utils/index.d.ts +2 -18
- package/dist/types/version-wrapper.d.ts +0 -1
- package/dist/types-ts4.5/plugins/code-block/actions.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/nodeviews/code-block.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/main.d.ts +2 -2
- package/dist/types-ts4.5/plugins/code-block/types.d.ts +1 -2
- package/dist/types-ts4.5/plugins/code-block/utils.d.ts +3 -0
- package/dist/{types/plugins/code-block/styles.d.ts → types-ts4.5/ui/ContentStyles/code-block.d.ts} +1 -1
- package/dist/types-ts4.5/utils/index.d.ts +2 -39
- package/dist/types-ts4.5/version-wrapper.d.ts +0 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#42754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42754) [`21c26ae2798`](https://bitbucket.org/atlassian/atlassian-frontend/commits/21c26ae2798) - stop explicitly stating the version in which deprecations will be actioned in
|
|
8
|
+
- [#42757](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42757) [`73c66d2c6db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73c66d2c6db) - remove media securedClipboard FF
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 189.3.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#42734](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42734) [`9a298d1b3c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9a298d1b3c3) - Decouple code-block plugin from editor-core.
|
|
16
|
+
|
|
3
17
|
## 189.3.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -13,7 +13,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
13
13
|
var _pluginKey = require("./plugin-key");
|
|
14
14
|
var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
|
|
15
15
|
var _actions = require("./pm-plugins/actions");
|
|
16
|
-
var _clipboard = require("
|
|
16
|
+
var _clipboard = require("@atlaskit/editor-common/clipboard");
|
|
17
17
|
var _insert = require("@atlaskit/editor-common/insert");
|
|
18
18
|
var _transformToCodeBlock = require("./transform-to-code-block");
|
|
19
19
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getLineInfo = exports.getEndOfCurrentLine = exports.forEachLine = void 0;
|
|
7
7
|
exports.getLinesFromSelection = getLinesFromSelection;
|
|
8
8
|
exports.isSelectionEntirelyInsideCodeBlock = exports.isCursorInsideCodeBlock = exports.getStartOfCurrentLine = void 0;
|
|
9
|
-
var _utils = require("
|
|
9
|
+
var _utils = require("../utils");
|
|
10
10
|
var isSelectionEntirelyInsideCodeBlock = exports.isSelectionEntirelyInsideCodeBlock = function isSelectionEntirelyInsideCodeBlock(state) {
|
|
11
11
|
return state.selection.$from.sameParent(state.selection.$to) && state.selection.$from.parent.type === state.schema.nodes.codeBlock;
|
|
12
12
|
};
|
|
@@ -8,7 +8,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
|
-
var _utils2 = require("
|
|
11
|
+
var _utils2 = require("../utils");
|
|
12
12
|
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _pairedCharacterHandling = require("../ide-ux/paired-character-handling");
|
|
14
14
|
var _bracketHandling = require("../ide-ux/bracket-handling");
|
|
@@ -8,7 +8,8 @@ exports.keymapPlugin = keymapPlugin;
|
|
|
8
8
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
9
9
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
10
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
11
|
-
var _utils2 = require("
|
|
11
|
+
var _utils2 = require("../utils");
|
|
12
|
+
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
12
13
|
var deleteCurrentItem = function deleteCurrentItem($from) {
|
|
13
14
|
return function (tr) {
|
|
14
15
|
return tr.delete($from.before($from.depth), $from.after($from.depth));
|
|
@@ -44,15 +45,17 @@ function keymapPlugin(schema) {
|
|
|
44
45
|
dispatch(state.tr.setNodeMarkup(node.pos, node.node.type, node.node.attrs, []).setBlockType($cursor.pos, $cursor.pos, paragraph));
|
|
45
46
|
return true;
|
|
46
47
|
}
|
|
47
|
-
if ($cursor.node && (0,
|
|
48
|
+
if ($cursor.node && (0, _utils3.isEmptyNode)(schema)($cursor.node()) && ((0, _utils.hasParentNodeOfType)(layoutColumn)(state.selection) || (0, _utils.hasParentNodeOfType)(table)(state.selection))) {
|
|
48
49
|
var tr = state.tr;
|
|
49
50
|
var insertPos = $cursor.pos;
|
|
50
|
-
|
|
51
|
+
deleteCurrentItem($cursor)(tr);
|
|
52
|
+
setTextSelection(insertPos)(tr);
|
|
53
|
+
dispatch(tr.scrollIntoView());
|
|
51
54
|
return true;
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
// Handle not nested empty code block
|
|
55
|
-
if ((0,
|
|
58
|
+
if ((0, _utils3.isEmptyNode)(schema)($cursor.node())) {
|
|
56
59
|
dispatch(deleteCurrentItem($cursor)(state === null || state === void 0 ? void 0 : state.tr));
|
|
57
60
|
return true;
|
|
58
61
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -10,11 +11,12 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
|
|
|
10
11
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
|
|
11
12
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
12
13
|
var _actions = require("./actions");
|
|
13
|
-
var _messages =
|
|
14
|
-
var _messages2 = require("@atlaskit/editor-common/messages");
|
|
14
|
+
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
15
15
|
var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
|
|
16
16
|
var _pluginKey = require("./plugin-key");
|
|
17
17
|
var _languageList = require("./language-list");
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
20
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
19
21
|
selectLanguage: {
|
|
20
22
|
id: 'fabric.editor.selectLanguage',
|
|
@@ -80,7 +82,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
80
82
|
// note: copyContentToClipboard contains logic that also removes the
|
|
81
83
|
// visual feedback for the copy button
|
|
82
84
|
onClick: _actions.copyContentToClipboard,
|
|
83
|
-
title: formatMessage(codeBlockState.contentCopied ?
|
|
85
|
+
title: formatMessage(codeBlockState.contentCopied ? _messages.codeBlockButtonMessages.copiedCodeToClipboard : _messages.codeBlockButtonMessages.copyCodeToClipboard),
|
|
84
86
|
onMouseEnter: _codeBlockCopySelectionPlugin.provideVisualFeedbackForCopyButton,
|
|
85
87
|
// note: resetCopiedState contains logic that also removes the
|
|
86
88
|
// visual feedback for the copy button
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "findCodeBlock", {
|
|
|
9
9
|
return _transforms.findCodeBlock;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
exports.getCursor = getCursor;
|
|
12
13
|
Object.defineProperty(exports, "transformSingleLineCodeBlockToCodeMark", {
|
|
13
14
|
enumerable: true,
|
|
14
15
|
get: function get() {
|
|
@@ -21,4 +22,7 @@ Object.defineProperty(exports, "transformSliceToJoinAdjacentCodeBlocks", {
|
|
|
21
22
|
return _transforms.transformSliceToJoinAdjacentCodeBlocks;
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
25
|
+
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
26
|
+
function getCursor(selection) {
|
|
27
|
+
return selection.$cursor || undefined;
|
|
28
|
+
}
|
|
@@ -21,7 +21,7 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
|
21
21
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
22
22
|
var _toolbar = require("./toolbar");
|
|
23
23
|
var _commands = require("./commands");
|
|
24
|
-
var _messages = require("
|
|
24
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
25
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
26
26
|
var _pluginFactory = require("./pm-plugins/plugin-factory");
|
|
27
27
|
var expandPlugin = function expandPlugin(_ref) {
|
|
@@ -68,8 +68,8 @@ var expandPlugin = function expandPlugin(_ref) {
|
|
|
68
68
|
}
|
|
69
69
|
return [{
|
|
70
70
|
id: 'expand',
|
|
71
|
-
title: formatMessage(_messages.
|
|
72
|
-
description: formatMessage(_messages.
|
|
71
|
+
title: formatMessage(_messages.toolbarInsertBlockMessages.expand),
|
|
72
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.expandDescription),
|
|
73
73
|
keywords: ['accordion', 'collapse'],
|
|
74
74
|
priority: 600,
|
|
75
75
|
icon: function icon() {
|
|
@@ -14,7 +14,7 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
|
14
14
|
var _versionWrapper = require("../../version-wrapper");
|
|
15
15
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
16
|
var _loadJiraCollectorDialogScript = _interopRequireDefault(require("./loadJiraCollectorDialogScript"));
|
|
17
|
-
var _messages = require("
|
|
17
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
18
|
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; }
|
|
19
19
|
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) { (0, _defineProperty2.default)(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; }
|
|
20
20
|
var showJiraCollectorDialog;
|
|
@@ -98,8 +98,8 @@ var feedbackDialog = function feedbackDialog(_ref3) {
|
|
|
98
98
|
var formatMessage = _ref4.formatMessage;
|
|
99
99
|
return [{
|
|
100
100
|
id: 'feedbackdialog',
|
|
101
|
-
title: formatMessage(_messages.
|
|
102
|
-
description: formatMessage(_messages.
|
|
101
|
+
title: formatMessage(_messages.toolbarInsertBlockMessages.feedbackDialog),
|
|
102
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.feedbackDialogDescription),
|
|
103
103
|
priority: 400,
|
|
104
104
|
keywords: ['bug'],
|
|
105
105
|
icon: function icon() {
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _reactIntlNext = require("react-intl-next");
|
|
18
18
|
var _decision = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/decision"));
|
|
19
19
|
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
20
|
-
var _messages = require("
|
|
20
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
21
21
|
var _commands = require("../../commands");
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -57,7 +57,7 @@ var ToolbarDecision = exports.ToolbarDecision = /*#__PURE__*/function (_PureComp
|
|
|
57
57
|
isDisabled = _this$props2.isDisabled,
|
|
58
58
|
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
59
59
|
formatMessage = _this$props2.intl.formatMessage;
|
|
60
|
-
var label = formatMessage(_messages.
|
|
60
|
+
var label = formatMessage(_messages.toolbarInsertBlockMessages.decision);
|
|
61
61
|
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
62
62
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.DECISION_LIST,
|
|
63
63
|
onClick: this.handleInsertDecision,
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
var _reactIntlNext = require("react-intl-next");
|
|
18
18
|
var _task = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/task"));
|
|
19
19
|
var _ToolbarButton = _interopRequireWildcard(require("../../../../ui/ToolbarButton"));
|
|
20
|
-
var _messages = require("
|
|
20
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
21
21
|
var _commands = require("../../commands");
|
|
22
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -57,7 +57,7 @@ var ToolbarTask = exports.ToolbarTask = /*#__PURE__*/function (_PureComponent) {
|
|
|
57
57
|
isDisabled = _this$props2.isDisabled,
|
|
58
58
|
isReducedSpacing = _this$props2.isReducedSpacing,
|
|
59
59
|
formatMessage = _this$props2.intl.formatMessage;
|
|
60
|
-
var label = formatMessage(_messages.
|
|
60
|
+
var label = formatMessage(_messages.toolbarInsertBlockMessages.action);
|
|
61
61
|
return /*#__PURE__*/_react.default.createElement(_ToolbarButton.default, {
|
|
62
62
|
buttonId: _ToolbarButton.TOOLBAR_BUTTON.TASK_LIST,
|
|
63
63
|
onClick: this.handleInsertTask,
|
|
@@ -9,12 +9,11 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
|
-
var _classNames = require("./ui/class-names");
|
|
13
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
13
|
var _templateObject, _templateObject2;
|
|
15
14
|
var GutterDangerOverlay = function GutterDangerOverlay() {
|
|
16
15
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n &::after {\n height: 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: 24px;\n background-color: ", ";\n }\n"])), "var(--ds-blanket-danger, none)");
|
|
17
16
|
};
|
|
18
17
|
var codeBlockStyles = exports.codeBlockStyles = function codeBlockStyles(props) {
|
|
19
|
-
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _styles.codeBlockSharedStyles)(props), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"),
|
|
18
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), (0, _styles.codeBlockSharedStyles)(props), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(_editorSharedStyles.akEditorDeleteBorder, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, ".concat(_colors.R75, ")"), "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(_editorSharedStyles.akEditorDeleteIconColor, ")"), GutterDangerOverlay(), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))");
|
|
20
19
|
};
|
|
@@ -16,15 +16,15 @@ var _styles2 = require("../../plugins/collab-edit/styles");
|
|
|
16
16
|
var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
|
|
17
17
|
var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
|
|
18
18
|
var _styles4 = require("@atlaskit/editor-plugin-paste-options-toolbar/styles");
|
|
19
|
-
var
|
|
19
|
+
var _codeBlock = require("./code-block");
|
|
20
20
|
var _media = require("./media");
|
|
21
21
|
var _layout = require("./layout");
|
|
22
22
|
var _panel = require("./panel");
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
23
|
+
var _styles5 = require("@atlaskit/editor-plugin-placeholder-text/styles");
|
|
24
|
+
var _styles6 = require("../../plugins/extension/ui/styles");
|
|
25
|
+
var _styles7 = require("../../plugins/expand/ui/styles");
|
|
26
|
+
var _styles8 = require("../../plugins/find-replace/styles");
|
|
27
|
+
var _styles9 = require("../../plugins/tasks-and-decisions/styles");
|
|
28
28
|
var _status = require("./status");
|
|
29
29
|
var _date = require("./date");
|
|
30
30
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
|
|
|
47
47
|
var contentStyles = function contentStyles(props) {
|
|
48
48
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
49
49
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)",
|
|
50
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles6.extensionStyles, (0, _styles7.expandStyles)(props), _styles8.findReplaceStyles, _styles4.textHighlightStyle, _styles9.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
51
|
};
|
|
52
52
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _versionWrapper = require("../version-wrapper");
|
|
8
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
8
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
@@ -12,7 +11,6 @@ var deprecationWarnings = function deprecationWarnings(className, props, depreca
|
|
|
12
11
|
if (process.env.NODE_ENV === 'production') {
|
|
13
12
|
return;
|
|
14
13
|
}
|
|
15
|
-
var nextVersion = (0, _versionWrapper.nextMajorVersion)();
|
|
16
14
|
var _iterator = _createForOfIteratorHelper(deprecations),
|
|
17
15
|
_step;
|
|
18
16
|
try {
|
|
@@ -30,7 +28,7 @@ var deprecationWarnings = function deprecationWarnings(className, props, depreca
|
|
|
30
28
|
if (props.hasOwnProperty(property)) {
|
|
31
29
|
if (condition(props)) {
|
|
32
30
|
// eslint-disable-next-line no-console
|
|
33
|
-
console.warn("".concat(property, " property for ").concat(className, " is deprecated. ").concat(description, " [Will be ").concat(type, " in editor-core
|
|
31
|
+
console.warn("".concat(property, " property for ").concat(className, " is deprecated. ").concat(description, " [Will be ").concat(type, " in the next major editor-core version]"));
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
}
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = editorDeprecationWarnings;
|
|
7
|
-
var _versionWrapper = require("../version-wrapper");
|
|
8
7
|
function editorDeprecationWarnings(props) {
|
|
9
8
|
if (process.env.NODE_ENV === 'production') {
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
12
|
-
var nextVersion = (0, _versionWrapper.nextMajorVersion)();
|
|
13
11
|
var deprecatedProperties = {
|
|
14
12
|
allowTasksAndDecisions: {
|
|
15
13
|
message: 'To allow tasks and decisions use taskDecisionProvider – <Editor taskDecisionProvider={{ provider }} />',
|
|
@@ -30,11 +28,11 @@ function editorDeprecationWarnings(props) {
|
|
|
30
28
|
var type = meta.type || 'enabled by default';
|
|
31
29
|
|
|
32
30
|
// eslint-disable-next-line no-console
|
|
33
|
-
console.warn("".concat(property, " property is deprecated. ").concat(meta.message || '', " [Will be ").concat(type, " in editor-core
|
|
31
|
+
console.warn("".concat(property, " property is deprecated. ").concat(meta.message || '', " [Will be ").concat(type, " in the next major editor-core version]"));
|
|
34
32
|
}
|
|
35
33
|
});
|
|
36
34
|
if (props.hasOwnProperty('allowTables') && typeof props.allowTables !== 'boolean' && (!props.allowTables || !props.allowTables.advanced)) {
|
|
37
35
|
// eslint-disable-next-line no-console
|
|
38
|
-
console.warn("Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in editor-core
|
|
36
|
+
console.warn("Advanced table options are deprecated (except isHeaderRowRequired) to continue using advanced table features use - <Editor allowTables={{ advanced: true }} /> [Will be changed in the next major editor-core version]");
|
|
39
37
|
}
|
|
40
38
|
}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -16,14 +16,12 @@ Object.defineProperty(exports, "checkNodeDown", {
|
|
|
16
16
|
return _utils2.checkNodeDown;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
exports.compose = compose;
|
|
20
19
|
Object.defineProperty(exports, "findFarthestParentNode", {
|
|
21
20
|
enumerable: true,
|
|
22
21
|
get: function get() {
|
|
23
22
|
return _document.findFarthestParentNode;
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
|
-
exports.getCursor = getCursor;
|
|
27
25
|
Object.defineProperty(exports, "getNodesCount", {
|
|
28
26
|
enumerable: true,
|
|
29
27
|
get: function get() {
|
|
@@ -124,7 +122,6 @@ Object.defineProperty(exports, "nonNullable", {
|
|
|
124
122
|
return _utils2.nonNullable;
|
|
125
123
|
}
|
|
126
124
|
});
|
|
127
|
-
exports.pipe = pipe;
|
|
128
125
|
Object.defineProperty(exports, "setNodeSelection", {
|
|
129
126
|
enumerable: true,
|
|
130
127
|
get: function get() {
|
|
@@ -161,9 +158,6 @@ function isMarkTypeCompatibleWithMark(markType, mark) {
|
|
|
161
158
|
function isMarkTypeAllowedInNode(markType, state) {
|
|
162
159
|
return (0, _commands.toggleMark)(markType)(state);
|
|
163
160
|
}
|
|
164
|
-
function getCursor(selection) {
|
|
165
|
-
return selection.$cursor || undefined;
|
|
166
|
-
}
|
|
167
161
|
|
|
168
162
|
/**
|
|
169
163
|
* Check if a mark is allowed at the current selection / cursor based on a given state.
|
|
@@ -250,53 +244,6 @@ var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuot
|
|
|
250
244
|
var blockquote = state.schema.nodes.blockquote;
|
|
251
245
|
return (0, _utils.hasParentNodeOfType)(blockquote)(state.selection);
|
|
252
246
|
};
|
|
253
|
-
/** Helper type for single arg function */
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Compose 1 to n functions.
|
|
257
|
-
* @param func first function
|
|
258
|
-
* @param funcs additional functions
|
|
259
|
-
*/
|
|
260
|
-
function compose(func) {
|
|
261
|
-
for (var _len = arguments.length, funcs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
262
|
-
funcs[_key - 1] = arguments[_key];
|
|
263
|
-
}
|
|
264
|
-
var allFuncs = [func].concat(funcs);
|
|
265
|
-
return function composed(raw) {
|
|
266
|
-
return allFuncs.reduceRight(function (memo, func) {
|
|
267
|
-
return func(memo);
|
|
268
|
-
}, raw);
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// one function
|
|
273
|
-
|
|
274
|
-
// two function
|
|
275
|
-
|
|
276
|
-
// three function
|
|
277
|
-
|
|
278
|
-
// If needed add more than 3 function
|
|
279
|
-
// Generic
|
|
280
|
-
|
|
281
|
-
// rest
|
|
282
|
-
function pipe() {
|
|
283
|
-
for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
284
|
-
fns[_key2] = arguments[_key2];
|
|
285
|
-
}
|
|
286
|
-
if (fns.length === 0) {
|
|
287
|
-
return function (a) {
|
|
288
|
-
return a;
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
if (fns.length === 1) {
|
|
292
|
-
return fns[0];
|
|
293
|
-
}
|
|
294
|
-
return fns.reduce(function (prevFn, nextFn) {
|
|
295
|
-
return function () {
|
|
296
|
-
return nextFn(prevFn.apply(void 0, arguments));
|
|
297
|
-
};
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
247
|
function sum(arr, f) {
|
|
301
248
|
return arr.reduce(function (val, x) {
|
|
302
249
|
return val + f(x);
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.version = exports.
|
|
6
|
+
exports.version = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "189.3.
|
|
9
|
-
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
|
-
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
|
-
};
|
|
8
|
+
var version = exports.version = "189.3.4";
|
|
@@ -3,7 +3,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { pluginKey } from './plugin-key';
|
|
4
4
|
import { copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
5
5
|
import { ACTIONS } from './pm-plugins/actions';
|
|
6
|
-
import { copyToClipboard } from '
|
|
6
|
+
import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
|
|
7
7
|
import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
8
8
|
import { transformToCodeBlockAction } from './transform-to-code-block';
|
|
9
9
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCursor } from '
|
|
1
|
+
import { getCursor } from '../utils';
|
|
2
2
|
export const isSelectionEntirelyInsideCodeBlock = state => state.selection.$from.sameParent(state.selection.$to) && state.selection.$from.parent.type === state.schema.nodes.codeBlock;
|
|
3
3
|
export const isCursorInsideCodeBlock = state => !!getCursor(state.selection) && isSelectionEntirelyInsideCodeBlock(state);
|
|
4
4
|
export const getStartOfCurrentLine = state => {
|
|
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
4
4
|
import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
|
|
5
|
-
import { getCursor } from '
|
|
5
|
+
import { getCursor } from '../utils';
|
|
6
6
|
import { filterCommand as filter } from '@atlaskit/editor-common/utils';
|
|
7
7
|
import { isCursorBeforeClosingCharacter, isClosingCharacter } from '../ide-ux/paired-character-handling';
|
|
8
8
|
import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from '../ide-ux/bracket-handling';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
2
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
-
import { getCursor
|
|
4
|
+
import { getCursor } from '../utils';
|
|
5
|
+
import { isEmptyNode } from '@atlaskit/editor-common/utils';
|
|
5
6
|
const deleteCurrentItem = $from => tr => {
|
|
6
7
|
return tr.delete($from.before($from.depth), $from.after($from.depth));
|
|
7
8
|
};
|
|
@@ -39,7 +40,9 @@ export function keymapPlugin(schema) {
|
|
|
39
40
|
tr
|
|
40
41
|
} = state;
|
|
41
42
|
const insertPos = $cursor.pos;
|
|
42
|
-
|
|
43
|
+
deleteCurrentItem($cursor)(tr);
|
|
44
|
+
setTextSelection(insertPos)(tr);
|
|
45
|
+
dispatch(tr.scrollIntoView());
|
|
43
46
|
return true;
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -3,8 +3,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
3
3
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
4
4
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
|
|
6
|
-
import commonMessages from '
|
|
7
|
-
import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
6
|
+
import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
|
|
8
7
|
import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
9
8
|
import { pluginKey } from './plugin-key';
|
|
10
9
|
import { createLanguageList, getLanguageIdentifier, DEFAULT_LANGUAGES } from './language-list';
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
|
|
1
|
+
export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
|
|
2
|
+
export function getCursor(selection) {
|
|
3
|
+
return selection.$cursor || undefined;
|
|
4
|
+
}
|
|
@@ -6,7 +6,7 @@ import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import { getToolbarConfig } from './toolbar';
|
|
8
8
|
import { createExpandNode, insertExpand } from './commands';
|
|
9
|
-
import { messages } from '
|
|
9
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
10
10
|
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
11
11
|
const expandPlugin = ({
|
|
12
12
|
config: options = {},
|
|
@@ -3,7 +3,7 @@ import { IconFeedback } from '@atlaskit/editor-common/quick-insert';
|
|
|
3
3
|
import { version as coreVersion } from '../../version-wrapper';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
|
|
6
|
-
import { messages } from '
|
|
6
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
let showJiraCollectorDialog;
|
|
8
8
|
let feedbackInfoHash;
|
|
9
9
|
let defaultFeedbackInfo;
|
|
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
|
|
|
3
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
|
|
5
5
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
6
|
-
import { messages } from '
|
|
6
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { insertTaskDecisionCommand } from '../../commands';
|
|
8
8
|
export class ToolbarDecision extends PureComponent {
|
|
9
9
|
constructor(...args) {
|
|
@@ -3,7 +3,7 @@ import React, { PureComponent } from 'react';
|
|
|
3
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import TaskIcon from '@atlaskit/icon/glyph/editor/task';
|
|
5
5
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
|
|
6
|
-
import { messages } from '
|
|
6
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { insertTaskDecisionCommand } from '../../commands';
|
|
8
8
|
export class ToolbarTask extends PureComponent {
|
|
9
9
|
constructor(...args) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { R75 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
5
|
-
import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
|
|
4
|
+
import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
5
|
const GutterDangerOverlay = () => css`
|
|
7
6
|
&::after {
|
|
8
7
|
height: 100%;
|
|
@@ -43,26 +42,26 @@ export const codeBlockStyles = props => css`
|
|
|
43
42
|
box-shadow: 0 0 0 ${akEditorSelectedBorderSize}px
|
|
44
43
|
${`var(--ds-border-danger, ${akEditorDeleteBorder})`};
|
|
45
44
|
|
|
46
|
-
.${
|
|
45
|
+
.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
|
|
47
46
|
background-color: ${`var(--ds-background-danger, ${R75})`};
|
|
48
47
|
color: ${`var(--ds-text-danger, ${akEditorDeleteIconColor})`};
|
|
49
48
|
${GutterDangerOverlay()};
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
.${
|
|
51
|
+
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT} {
|
|
53
52
|
background-color: ${`var(--ds-blanket-danger, ${akEditorDeleteBackground})`};
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
/* Danger when nested node */
|
|
58
57
|
.ProseMirror .danger .code-block {
|
|
59
|
-
.${
|
|
58
|
+
.${CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER} {
|
|
60
59
|
background-color: ${"var(--ds-background-danger, rgba(255, 143, 115, 0.5))"};
|
|
61
60
|
color: ${`var(--ds-text-danger, ${akEditorDeleteIconColor})`};
|
|
62
61
|
${GutterDangerOverlay()};
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
.${
|
|
64
|
+
.${CodeBlockSharedCssClassName.CODEBLOCK_CONTENT} {
|
|
66
65
|
background-color: ${"var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))"};
|
|
67
66
|
}
|
|
68
67
|
}
|
|
@@ -8,7 +8,7 @@ import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
|
8
8
|
import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
9
9
|
import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
|
|
10
10
|
import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
|
|
11
|
-
import { codeBlockStyles } from '
|
|
11
|
+
import { codeBlockStyles } from './code-block';
|
|
12
12
|
import { mediaStyles } from './media';
|
|
13
13
|
import { layoutStyles } from './layout';
|
|
14
14
|
import { panelStyles } from './panel';
|