@atlaskit/editor-plugin-synced-block 4.5.5 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +0 -3
- package/afm-products/tsconfig.json +0 -3
- package/dist/cjs/editor-commands/index.js +1 -1
- package/dist/cjs/ui/SyncBlockLabel.js +9 -7
- package/dist/cjs/ui/floating-toolbar.js +3 -3
- package/dist/es2019/editor-commands/index.js +2 -2
- package/dist/es2019/ui/SyncBlockLabel.js +9 -7
- package/dist/es2019/ui/floating-toolbar.js +3 -3
- package/dist/esm/editor-commands/index.js +2 -2
- package/dist/esm/ui/SyncBlockLabel.js +9 -7
- package/dist/esm/ui/floating-toolbar.js +3 -3
- package/package.json +9 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 4.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a436afb117ae3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a436afb117ae3) -
|
|
8
|
+
Update edit at source icon/tooltip
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [`7e1f5e6e54c20`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e1f5e6e54c20) -
|
|
13
|
+
Add scrollIntoView after a bodiedSyncBlock node is inserted
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 4.5.6
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`50cf7cca6bb76`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50cf7cca6bb76) -
|
|
21
|
+
[ux] EDITOR-3896 update sync block border styles
|
|
22
|
+
- [`f5c8ad92df993`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f5c8ad92df993) -
|
|
23
|
+
[EDITOR-3950] Fix a bug where bodiedSyncBlock does not get inserted properly when cursor is within
|
|
24
|
+
the bodiedSyncBlock and inbetween content
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 4.5.5
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -34,7 +34,7 @@ var createSyncedBlock = exports.createSyncedBlock = function createSyncedBlock(_
|
|
|
34
34
|
if (typeAheadInsert) {
|
|
35
35
|
tr = typeAheadInsert(newBodiedSyncBlockNode);
|
|
36
36
|
} else {
|
|
37
|
-
tr =
|
|
37
|
+
tr = (0, _utils.safeInsert)(newBodiedSyncBlockNode)(tr).scrollIntoView();
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
40
|
var conversionInfo = (0, _utils2.canBeConvertedToSyncBlock)(tr.selection);
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
11
11
|
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
12
|
-
var
|
|
12
|
+
var _blockSynced = _interopRequireDefault(require("@atlaskit/icon-lab/core/block-synced"));
|
|
13
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
14
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
15
15
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
@@ -39,15 +39,17 @@ var SyncBlockLabelComponent = function SyncBlockLabelComponent(_ref) {
|
|
|
39
39
|
,
|
|
40
40
|
className: _syncBlock.SyncBlockLabelSharedCssClassName.labelClassName,
|
|
41
41
|
"aria-describedby": ariaDescribedById
|
|
42
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement(_blockSynced.default, {
|
|
43
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
44
|
+
size: "small",
|
|
45
|
+
label: ""
|
|
46
46
|
}), isSource || !title ? /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
47
|
-
size: "small"
|
|
47
|
+
size: "small",
|
|
48
|
+
color: "color.text.subtle"
|
|
48
49
|
}, formatMessage(_messages.syncBlockMessages.syncedBlockLabel)) : /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
49
50
|
maxLines: 1,
|
|
50
|
-
size: "small"
|
|
51
|
+
size: "small",
|
|
52
|
+
color: "color.text.subtle"
|
|
51
53
|
}, title)), /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, {
|
|
52
54
|
id: ariaDescribedById
|
|
53
55
|
}, tooltipContent));
|
|
@@ -13,7 +13,7 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
13
13
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
14
14
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
15
15
|
var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
16
|
-
var
|
|
16
|
+
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
17
17
|
var _editorCommands = require("../editor-commands");
|
|
18
18
|
var _utils2 = require("../pm-plugins/utils/utils");
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -57,9 +57,9 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
57
57
|
type: 'button',
|
|
58
58
|
disabled: disabled,
|
|
59
59
|
appearance: 'subtle',
|
|
60
|
-
icon:
|
|
60
|
+
icon: _edit.default,
|
|
61
61
|
title: formatMessage(_messages.syncBlockMessages.editSourceLabel),
|
|
62
|
-
showTitle:
|
|
62
|
+
showTitle: false,
|
|
63
63
|
tooltipContent: disabled ? formatMessage(_messages.syncBlockMessages.editSourceTooltipDisabled) : formatMessage(_messages.syncBlockMessages.editSourceTooltip),
|
|
64
64
|
onClick: (0, _editorCommands.editSyncedBlockSource)(syncBlockStore, api)
|
|
65
65
|
}, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { copyDomNode, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
3
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
6
6
|
import { canBeConvertedToSyncBlock, findSyncBlock, findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
7
7
|
import { FLAG_ID } from '../types';
|
|
@@ -34,7 +34,7 @@ export const createSyncedBlock = ({
|
|
|
34
34
|
if (typeAheadInsert) {
|
|
35
35
|
tr = typeAheadInsert(newBodiedSyncBlockNode);
|
|
36
36
|
} else {
|
|
37
|
-
tr =
|
|
37
|
+
tr = safeInsert(newBodiedSyncBlockNode)(tr).scrollIntoView();
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
40
|
const conversionInfo = canBeConvertedToSyncBlock(tr.selection);
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
5
|
-
import
|
|
5
|
+
import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
6
6
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
@@ -34,15 +34,17 @@ const SyncBlockLabelComponent = ({
|
|
|
34
34
|
,
|
|
35
35
|
className: SyncBlockLabelSharedCssClassName.labelClassName,
|
|
36
36
|
"aria-describedby": ariaDescribedById
|
|
37
|
-
}, /*#__PURE__*/React.createElement(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
}, /*#__PURE__*/React.createElement(BlockSyncedIcon, {
|
|
38
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
39
|
+
size: "small",
|
|
40
|
+
label: ""
|
|
41
41
|
}), isSource || !title ? /*#__PURE__*/React.createElement(Text, {
|
|
42
|
-
size: "small"
|
|
42
|
+
size: "small",
|
|
43
|
+
color: "color.text.subtle"
|
|
43
44
|
}, formatMessage(messages.syncedBlockLabel)) : /*#__PURE__*/React.createElement(Text, {
|
|
44
45
|
maxLines: 1,
|
|
45
|
-
size: "small"
|
|
46
|
+
size: "small",
|
|
47
|
+
color: "color.text.subtle"
|
|
46
48
|
}, title)), /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
47
49
|
id: ariaDescribedById
|
|
48
50
|
}, tooltipContent));
|
|
@@ -4,7 +4,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
4
4
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles/consts';
|
|
5
5
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
6
6
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
7
|
-
import
|
|
7
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
8
8
|
import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock } from '../editor-commands';
|
|
9
9
|
import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
10
10
|
export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
|
|
@@ -52,9 +52,9 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
|
|
|
52
52
|
type: 'button',
|
|
53
53
|
disabled,
|
|
54
54
|
appearance: 'subtle',
|
|
55
|
-
icon:
|
|
55
|
+
icon: EditIcon,
|
|
56
56
|
title: formatMessage(messages.editSourceLabel),
|
|
57
|
-
showTitle:
|
|
57
|
+
showTitle: false,
|
|
58
58
|
tooltipContent: disabled ? formatMessage(messages.editSourceTooltipDisabled) : formatMessage(messages.editSourceTooltip),
|
|
59
59
|
onClick: editSyncedBlockSource(syncBlockStore, api),
|
|
60
60
|
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { copyDomNode, toDOM } from '@atlaskit/editor-common/copy-button';
|
|
3
3
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode } from '@atlaskit/editor-prosemirror/utils';
|
|
4
|
+
import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
6
6
|
import { canBeConvertedToSyncBlock, findSyncBlock, findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
7
7
|
import { FLAG_ID } from '../types';
|
|
@@ -28,7 +28,7 @@ export var createSyncedBlock = function createSyncedBlock(_ref) {
|
|
|
28
28
|
if (typeAheadInsert) {
|
|
29
29
|
tr = typeAheadInsert(newBodiedSyncBlockNode);
|
|
30
30
|
} else {
|
|
31
|
-
tr =
|
|
31
|
+
tr = safeInsert(newBodiedSyncBlockNode)(tr).scrollIntoView();
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
34
|
var conversionInfo = canBeConvertedToSyncBlock(tr.selection);
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { SyncBlockLabelSharedCssClassName } from '@atlaskit/editor-common/sync-block';
|
|
5
|
-
import
|
|
5
|
+
import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
|
|
6
6
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
@@ -32,15 +32,17 @@ var SyncBlockLabelComponent = function SyncBlockLabelComponent(_ref) {
|
|
|
32
32
|
,
|
|
33
33
|
className: SyncBlockLabelSharedCssClassName.labelClassName,
|
|
34
34
|
"aria-describedby": ariaDescribedById
|
|
35
|
-
}, /*#__PURE__*/React.createElement(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
}, /*#__PURE__*/React.createElement(BlockSyncedIcon, {
|
|
36
|
+
color: "var(--ds-icon-subtle, #505258)",
|
|
37
|
+
size: "small",
|
|
38
|
+
label: ""
|
|
39
39
|
}), isSource || !title ? /*#__PURE__*/React.createElement(Text, {
|
|
40
|
-
size: "small"
|
|
40
|
+
size: "small",
|
|
41
|
+
color: "color.text.subtle"
|
|
41
42
|
}, formatMessage(messages.syncedBlockLabel)) : /*#__PURE__*/React.createElement(Text, {
|
|
42
43
|
maxLines: 1,
|
|
43
|
-
size: "small"
|
|
44
|
+
size: "small",
|
|
45
|
+
color: "color.text.subtle"
|
|
44
46
|
}, title)), /*#__PURE__*/React.createElement(VisuallyHidden, {
|
|
45
47
|
id: ariaDescribedById
|
|
46
48
|
}, tooltipContent));
|
|
@@ -7,7 +7,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
|
7
7
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles/consts';
|
|
8
8
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
9
9
|
import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
10
|
-
import
|
|
10
|
+
import EditIcon from '@atlaskit/icon/core/edit';
|
|
11
11
|
import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock } from '../editor-commands';
|
|
12
12
|
import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
13
13
|
export var getToolbarConfig = function getToolbarConfig(state, intl, api, syncBlockStore) {
|
|
@@ -48,9 +48,9 @@ export var getToolbarConfig = function getToolbarConfig(state, intl, api, syncBl
|
|
|
48
48
|
type: 'button',
|
|
49
49
|
disabled: disabled,
|
|
50
50
|
appearance: 'subtle',
|
|
51
|
-
icon:
|
|
51
|
+
icon: EditIcon,
|
|
52
52
|
title: formatMessage(messages.editSourceLabel),
|
|
53
|
-
showTitle:
|
|
53
|
+
showTitle: false,
|
|
54
54
|
tooltipContent: disabled ? formatMessage(messages.editSourceTooltipDisabled) : formatMessage(messages.editSourceTooltip),
|
|
55
55
|
onClick: editSyncedBlockSource(syncBlockStore, api)
|
|
56
56
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,35 +29,34 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
32
|
-
"@atlaskit/button": "23.
|
|
32
|
+
"@atlaskit/button": "23.8.0",
|
|
33
33
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
35
35
|
"@atlaskit/editor-plugin-block-menu": "^5.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-connectivity": "6.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
38
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^8.
|
|
38
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^8.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
42
42
|
"@atlaskit/editor-synced-block-provider": "^2.15.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^0.18.0",
|
|
45
|
-
"@atlaskit/flag": "^17.
|
|
46
|
-
"@atlaskit/icon": "29.
|
|
45
|
+
"@atlaskit/flag": "^17.7.0",
|
|
46
|
+
"@atlaskit/icon": "29.2.0",
|
|
47
47
|
"@atlaskit/icon-lab": "^5.12.0",
|
|
48
|
-
"@atlaskit/
|
|
49
|
-
"@atlaskit/lozenge": "^13.1.0",
|
|
48
|
+
"@atlaskit/lozenge": "^13.2.0",
|
|
50
49
|
"@atlaskit/modal-dialog": "^14.9.0",
|
|
51
50
|
"@atlaskit/primitives": "^16.4.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^15.
|
|
53
|
-
"@atlaskit/tokens": "8.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^15.12.0",
|
|
52
|
+
"@atlaskit/tokens": "8.6.0",
|
|
54
53
|
"@atlaskit/tooltip": "^20.11.0",
|
|
55
54
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
56
55
|
"@babel/runtime": "^7.0.0",
|
|
57
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
58
57
|
},
|
|
59
58
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^110.
|
|
59
|
+
"@atlaskit/editor-common": "^110.45.0",
|
|
61
60
|
"react": "^18.2.0"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|