@atlaskit/editor-plugin-synced-block 10.2.7 → 10.2.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 +11 -0
- package/dist/cjs/ui/floating-toolbar.js +28 -11
- package/dist/es2019/ui/floating-toolbar.js +29 -12
- package/dist/esm/ui/floating-toolbar.js +28 -11
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 10.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c1e8426f607ad`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c1e8426f607ad) -
|
|
8
|
+
[EDITOR-8060] Behind the `platform_editor_sync_block_activation` experiment, the synced block
|
|
9
|
+
floating toolbar copy button is now the primary action: it shows a visible "Copy to sync" label
|
|
10
|
+
and is moved to the first position, ahead of the informational synced-location dropdown. Existing
|
|
11
|
+
behaviour is unchanged for users outside the experiment.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 10.2.7
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -19,6 +19,7 @@ var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
|
|
|
19
19
|
var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
|
|
20
20
|
var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
|
|
21
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
22
23
|
var _editorCommands = require("../editor-commands");
|
|
23
24
|
var _utils2 = require("../pm-plugins/utils/utils");
|
|
24
25
|
var _types = require("../types");
|
|
@@ -65,6 +66,27 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
65
66
|
}, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
|
|
66
67
|
items.push(deleteButton);
|
|
67
68
|
} else {
|
|
69
|
+
// When the synced block activation experiment is enabled, the copy action is
|
|
70
|
+
// re-framed as the primary "Copy to sync" action: it shows a visible label and
|
|
71
|
+
// is moved to the first toolbar position (before the synced-location info). See
|
|
72
|
+
// EDITOR-8060.
|
|
73
|
+
var isSyncBlockActivationEnabled = (0, _expValEquals.expValEquals)('platform_editor_sync_block_activation', 'isEnabled', true);
|
|
74
|
+
var copyButton = _objectSpread({
|
|
75
|
+
id: 'editor.syncedBlock.copy',
|
|
76
|
+
type: 'button',
|
|
77
|
+
appearance: 'subtle',
|
|
78
|
+
icon: _copy.default,
|
|
79
|
+
title: isSyncBlockActivationEnabled ? formatMessage(_messages.syncBlockMessages.copyToSyncLabel) : formatMessage(_messages.syncBlockMessages.copySyncBlockLabel),
|
|
80
|
+
showTitle: isSyncBlockActivationEnabled,
|
|
81
|
+
tooltipContent: isSyncBlockActivationEnabled ? undefined : formatMessage(_messages.syncBlockMessages.copySyncedBlockTooltip),
|
|
82
|
+
onClick: (0, _editorCommands.copySyncedBlockReferenceToClipboard)(syncBlockStore, _analytics.INPUT_METHOD.SYNCED_BLOCK_TB, api)
|
|
83
|
+
}, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
|
|
84
|
+
|
|
85
|
+
// In the activation experience the primary "Copy to sync" action leads the
|
|
86
|
+
// toolbar, ahead of the informational synced-location dropdown.
|
|
87
|
+
if (isSyncBlockActivationEnabled) {
|
|
88
|
+
items.push(copyButton);
|
|
89
|
+
}
|
|
68
90
|
if (!isErroredBlock) {
|
|
69
91
|
var syncedLocation = {
|
|
70
92
|
type: 'custom',
|
|
@@ -104,17 +126,12 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(stat
|
|
|
104
126
|
};
|
|
105
127
|
items.push(syncedLocation, unsyncButton);
|
|
106
128
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
showTitle: false,
|
|
114
|
-
tooltipContent: formatMessage(_messages.syncBlockMessages.copySyncedBlockTooltip),
|
|
115
|
-
onClick: (0, _editorCommands.copySyncedBlockReferenceToClipboard)(syncBlockStore, _analytics.INPUT_METHOD.SYNCED_BLOCK_TB, api)
|
|
116
|
-
}, hoverDecorationProps(nodeType, _consts.akEditorSelectedNodeClassName));
|
|
117
|
-
items.push(copyButton);
|
|
129
|
+
|
|
130
|
+
// Outside the activation experience the copy button keeps its original
|
|
131
|
+
// (icon-only, secondary) position after the synced-location info.
|
|
132
|
+
if (!isSyncBlockActivationEnabled) {
|
|
133
|
+
items.push(copyButton);
|
|
134
|
+
}
|
|
118
135
|
var disabled = !syncBlockStore.referenceManager.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
|
|
119
136
|
if (!isBodiedSyncBlock) {
|
|
120
137
|
var editSourceButton = _objectSpread({
|
|
@@ -10,6 +10,7 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
10
10
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
11
11
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock, unsync } from '../editor-commands';
|
|
14
15
|
import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
15
16
|
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
@@ -61,6 +62,28 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
|
|
|
61
62
|
};
|
|
62
63
|
items.push(deleteButton);
|
|
63
64
|
} else {
|
|
65
|
+
// When the synced block activation experiment is enabled, the copy action is
|
|
66
|
+
// re-framed as the primary "Copy to sync" action: it shows a visible label and
|
|
67
|
+
// is moved to the first toolbar position (before the synced-location info). See
|
|
68
|
+
// EDITOR-8060.
|
|
69
|
+
const isSyncBlockActivationEnabled = expValEquals('platform_editor_sync_block_activation', 'isEnabled', true);
|
|
70
|
+
const copyButton = {
|
|
71
|
+
id: 'editor.syncedBlock.copy',
|
|
72
|
+
type: 'button',
|
|
73
|
+
appearance: 'subtle',
|
|
74
|
+
icon: CopyIcon,
|
|
75
|
+
title: isSyncBlockActivationEnabled ? formatMessage(messages.copyToSyncLabel) : formatMessage(messages.copySyncBlockLabel),
|
|
76
|
+
showTitle: isSyncBlockActivationEnabled,
|
|
77
|
+
tooltipContent: isSyncBlockActivationEnabled ? undefined : formatMessage(messages.copySyncedBlockTooltip),
|
|
78
|
+
onClick: copySyncedBlockReferenceToClipboard(syncBlockStore, INPUT_METHOD.SYNCED_BLOCK_TB, api),
|
|
79
|
+
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// In the activation experience the primary "Copy to sync" action leads the
|
|
83
|
+
// toolbar, ahead of the informational synced-location dropdown.
|
|
84
|
+
if (isSyncBlockActivationEnabled) {
|
|
85
|
+
items.push(copyButton);
|
|
86
|
+
}
|
|
64
87
|
if (!isErroredBlock) {
|
|
65
88
|
const syncedLocation = {
|
|
66
89
|
type: 'custom',
|
|
@@ -98,18 +121,12 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
|
|
|
98
121
|
};
|
|
99
122
|
items.push(syncedLocation, unsyncButton);
|
|
100
123
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
showTitle: false,
|
|
108
|
-
tooltipContent: formatMessage(messages.copySyncedBlockTooltip),
|
|
109
|
-
onClick: copySyncedBlockReferenceToClipboard(syncBlockStore, INPUT_METHOD.SYNCED_BLOCK_TB, api),
|
|
110
|
-
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
111
|
-
};
|
|
112
|
-
items.push(copyButton);
|
|
124
|
+
|
|
125
|
+
// Outside the activation experience the copy button keeps its original
|
|
126
|
+
// (icon-only, secondary) position after the synced-location info.
|
|
127
|
+
if (!isSyncBlockActivationEnabled) {
|
|
128
|
+
items.push(copyButton);
|
|
129
|
+
}
|
|
113
130
|
const disabled = !syncBlockStore.referenceManager.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
|
|
114
131
|
if (!isBodiedSyncBlock) {
|
|
115
132
|
const editSourceButton = {
|
|
@@ -13,6 +13,7 @@ import DeleteIcon from '@atlaskit/icon/core/delete';
|
|
|
13
13
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
14
14
|
import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
17
|
import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock, unsync } from '../editor-commands';
|
|
17
18
|
import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
|
|
18
19
|
import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
|
|
@@ -56,6 +57,27 @@ export var getToolbarConfig = function getToolbarConfig(state, intl, api, syncBl
|
|
|
56
57
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
|
|
57
58
|
items.push(deleteButton);
|
|
58
59
|
} else {
|
|
60
|
+
// When the synced block activation experiment is enabled, the copy action is
|
|
61
|
+
// re-framed as the primary "Copy to sync" action: it shows a visible label and
|
|
62
|
+
// is moved to the first toolbar position (before the synced-location info). See
|
|
63
|
+
// EDITOR-8060.
|
|
64
|
+
var isSyncBlockActivationEnabled = expValEquals('platform_editor_sync_block_activation', 'isEnabled', true);
|
|
65
|
+
var copyButton = _objectSpread({
|
|
66
|
+
id: 'editor.syncedBlock.copy',
|
|
67
|
+
type: 'button',
|
|
68
|
+
appearance: 'subtle',
|
|
69
|
+
icon: CopyIcon,
|
|
70
|
+
title: isSyncBlockActivationEnabled ? formatMessage(messages.copyToSyncLabel) : formatMessage(messages.copySyncBlockLabel),
|
|
71
|
+
showTitle: isSyncBlockActivationEnabled,
|
|
72
|
+
tooltipContent: isSyncBlockActivationEnabled ? undefined : formatMessage(messages.copySyncedBlockTooltip),
|
|
73
|
+
onClick: copySyncedBlockReferenceToClipboard(syncBlockStore, INPUT_METHOD.SYNCED_BLOCK_TB, api)
|
|
74
|
+
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
|
|
75
|
+
|
|
76
|
+
// In the activation experience the primary "Copy to sync" action leads the
|
|
77
|
+
// toolbar, ahead of the informational synced-location dropdown.
|
|
78
|
+
if (isSyncBlockActivationEnabled) {
|
|
79
|
+
items.push(copyButton);
|
|
80
|
+
}
|
|
59
81
|
if (!isErroredBlock) {
|
|
60
82
|
var syncedLocation = {
|
|
61
83
|
type: 'custom',
|
|
@@ -95,17 +117,12 @@ export var getToolbarConfig = function getToolbarConfig(state, intl, api, syncBl
|
|
|
95
117
|
};
|
|
96
118
|
items.push(syncedLocation, unsyncButton);
|
|
97
119
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
showTitle: false,
|
|
105
|
-
tooltipContent: formatMessage(messages.copySyncedBlockTooltip),
|
|
106
|
-
onClick: copySyncedBlockReferenceToClipboard(syncBlockStore, INPUT_METHOD.SYNCED_BLOCK_TB, api)
|
|
107
|
-
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName));
|
|
108
|
-
items.push(copyButton);
|
|
120
|
+
|
|
121
|
+
// Outside the activation experience the copy button keeps its original
|
|
122
|
+
// (icon-only, secondary) position after the synced-location info.
|
|
123
|
+
if (!isSyncBlockActivationEnabled) {
|
|
124
|
+
items.push(copyButton);
|
|
125
|
+
}
|
|
109
126
|
var disabled = !syncBlockStore.referenceManager.getSyncBlockURL(syncBlockObject.node.attrs.resourceId);
|
|
110
127
|
if (!isBodiedSyncBlock) {
|
|
111
128
|
var editSourceButton = _objectSpread({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.8",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^2.0.0",
|
|
47
47
|
"@atlaskit/primitives": "^20.6.0",
|
|
48
48
|
"@atlaskit/spinner": "20.1.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^125.0.0",
|
|
50
50
|
"@atlaskit/tokens": "15.8.0",
|
|
51
51
|
"@atlaskit/tooltip": "^23.1.0",
|
|
52
52
|
"@atlaskit/visually-hidden": "^4.1.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"memoize-one": "^6.0.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^116.
|
|
60
|
+
"@atlaskit/editor-common": "^116.30.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
63
63
|
},
|