@atlaskit/editor-plugin-synced-block 20.0.5 → 20.0.7
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/ui/Flag.js +13 -5
- package/dist/es2019/ui/Flag.js +13 -5
- package/dist/esm/ui/Flag.js +13 -5
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Flag.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-synced-block
|
|
2
2
|
|
|
3
|
+
## 20.0.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 20.0.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8013afd2c90d0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8013afd2c90d0) -
|
|
14
|
+
Add Jira synced block copy guidance behind the platform_editor_blocks_patch_11 experiment.
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 20.0.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/ui/Flag.js
CHANGED
|
@@ -21,6 +21,7 @@ var _flagGroup = require("@atlaskit/flag/flag-group");
|
|
|
21
21
|
var _megaphone = _interopRequireDefault(require("@atlaskit/icon/core/megaphone"));
|
|
22
22
|
var _statusSuccess = _interopRequireDefault(require("@atlaskit/icon/core/status-success"));
|
|
23
23
|
var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
|
|
24
|
+
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
24
25
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
25
26
|
var _main = require("../pm-plugins/main");
|
|
26
27
|
var _types = require("../types");
|
|
@@ -72,8 +73,14 @@ var flagMap = (_flagMap = {}, (0, _defineProperty2.default)((0, _defineProperty2
|
|
|
72
73
|
description: _messages.syncBlockMessages.feedbackFlagDescription,
|
|
73
74
|
type: 'feedback'
|
|
74
75
|
}));
|
|
75
|
-
var getSyncBlockCopiedDescription = exports.getSyncBlockCopiedDescription = function getSyncBlockCopiedDescription(activeFlag,
|
|
76
|
-
if (!activeFlag || activeFlag.id !== _types.FLAG_ID.SYNC_BLOCK_COPIED ||
|
|
76
|
+
var getSyncBlockCopiedDescription = exports.getSyncBlockCopiedDescription = function getSyncBlockCopiedDescription(activeFlag, isCopiedDescriptionEnabled) {
|
|
77
|
+
if (!activeFlag || activeFlag.id !== _types.FLAG_ID.SYNC_BLOCK_COPIED || !isCopiedDescriptionEnabled) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (activeFlag.sourceProduct === 'jira-work-item') {
|
|
81
|
+
return activeFlag.isSourceContentUnpublished ? _messages.syncBlockMessages.syncBlockCopiedJiraUnsavedFieldDescription : _messages.syncBlockMessages.syncBlockCopiedLivePageDescription;
|
|
82
|
+
}
|
|
83
|
+
if (activeFlag.sourceProduct !== 'confluence-page') {
|
|
77
84
|
return undefined;
|
|
78
85
|
}
|
|
79
86
|
return activeFlag.isLivePage || !activeFlag.isSourceContentUnpublished ? _messages.syncBlockMessages.syncBlockCopiedLivePageDescription : _messages.syncBlockMessages.syncBlockCopiedUnpublishedDescription;
|
|
@@ -116,10 +123,11 @@ var Flag = exports.Flag = function Flag(_ref) {
|
|
|
116
123
|
var onRetry = activeFlag.onRetry,
|
|
117
124
|
onDismissedCallback = activeFlag.onDismissed;
|
|
118
125
|
|
|
119
|
-
//
|
|
120
|
-
// is a Jira work item. Other flags don't currently vary by product.
|
|
126
|
+
// Copy and unpublished-paste flags vary their guidance by source product.
|
|
121
127
|
var isJiraUnpublishedPaste = activeFlag.id === _types.FLAG_ID.UNPUBLISHED_SYNC_BLOCK_PASTED && activeFlag.sourceProduct === 'jira-work-item';
|
|
122
|
-
var
|
|
128
|
+
var isCopiedFlag = activeFlag.id === _types.FLAG_ID.SYNC_BLOCK_COPIED;
|
|
129
|
+
var isCopiedDescriptionEnabled = isCopiedFlag && ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_blocks_patch_11') || activeFlag.sourceProduct === 'confluence-page' && (0, _expValEquals.expValEquals)('platform_editor_sync_block_activation', 'isEnabled', true));
|
|
130
|
+
var copiedDescription = getSyncBlockCopiedDescription(activeFlag, isCopiedDescriptionEnabled);
|
|
123
131
|
var title = isJiraUnpublishedPaste ? _messages.syncBlockMessages.unpublishedSyncBlockPastedTitleJiraWorkItem : defaultTitle;
|
|
124
132
|
var description = copiedDescription !== null && copiedDescription !== void 0 ? copiedDescription : isJiraUnpublishedPaste ? _messages.syncBlockMessages.unpublishedSyncBlockPastedDescriptionJiraWorkItem : defaultDescription;
|
|
125
133
|
|
package/dist/es2019/ui/Flag.js
CHANGED
|
@@ -13,6 +13,7 @@ import { FlagGroup } from '@atlaskit/flag/flag-group';
|
|
|
13
13
|
import MegaphoneIcon from '@atlaskit/icon/core/megaphone';
|
|
14
14
|
import StatusSuccessIcon from '@atlaskit/icon/core/status-success';
|
|
15
15
|
import StatusWarningIcon from '@atlaskit/icon/core/status-warning';
|
|
16
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
16
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
17
18
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
18
19
|
import { FLAG_ID } from '../types';
|
|
@@ -73,8 +74,14 @@ const flagMap = {
|
|
|
73
74
|
type: 'feedback'
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
export const getSyncBlockCopiedDescription = (activeFlag,
|
|
77
|
-
if (!activeFlag || activeFlag.id !== FLAG_ID.SYNC_BLOCK_COPIED ||
|
|
77
|
+
export const getSyncBlockCopiedDescription = (activeFlag, isCopiedDescriptionEnabled) => {
|
|
78
|
+
if (!activeFlag || activeFlag.id !== FLAG_ID.SYNC_BLOCK_COPIED || !isCopiedDescriptionEnabled) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
if (activeFlag.sourceProduct === 'jira-work-item') {
|
|
82
|
+
return activeFlag.isSourceContentUnpublished ? messages.syncBlockCopiedJiraUnsavedFieldDescription : messages.syncBlockCopiedLivePageDescription;
|
|
83
|
+
}
|
|
84
|
+
if (activeFlag.sourceProduct !== 'confluence-page') {
|
|
78
85
|
return undefined;
|
|
79
86
|
}
|
|
80
87
|
return activeFlag.isLivePage || !activeFlag.isSourceContentUnpublished ? messages.syncBlockCopiedLivePageDescription : messages.syncBlockCopiedUnpublishedDescription;
|
|
@@ -123,10 +130,11 @@ export const Flag = ({
|
|
|
123
130
|
onDismissed: onDismissedCallback
|
|
124
131
|
} = activeFlag;
|
|
125
132
|
|
|
126
|
-
//
|
|
127
|
-
// is a Jira work item. Other flags don't currently vary by product.
|
|
133
|
+
// Copy and unpublished-paste flags vary their guidance by source product.
|
|
128
134
|
const isJiraUnpublishedPaste = activeFlag.id === FLAG_ID.UNPUBLISHED_SYNC_BLOCK_PASTED && activeFlag.sourceProduct === 'jira-work-item';
|
|
129
|
-
const
|
|
135
|
+
const isCopiedFlag = activeFlag.id === FLAG_ID.SYNC_BLOCK_COPIED;
|
|
136
|
+
const isCopiedDescriptionEnabled = isCopiedFlag && (isExperimentEnabled('platform_editor_blocks_patch_11') || activeFlag.sourceProduct === 'confluence-page' && expValEquals('platform_editor_sync_block_activation', 'isEnabled', true));
|
|
137
|
+
const copiedDescription = getSyncBlockCopiedDescription(activeFlag, isCopiedDescriptionEnabled);
|
|
130
138
|
const title = isJiraUnpublishedPaste ? messages.unpublishedSyncBlockPastedTitleJiraWorkItem : defaultTitle;
|
|
131
139
|
const description = copiedDescription !== null && copiedDescription !== void 0 ? copiedDescription : isJiraUnpublishedPaste ? messages.unpublishedSyncBlockPastedDescriptionJiraWorkItem : defaultDescription;
|
|
132
140
|
|
package/dist/esm/ui/Flag.js
CHANGED
|
@@ -17,6 +17,7 @@ import { FlagGroup } from '@atlaskit/flag/flag-group';
|
|
|
17
17
|
import MegaphoneIcon from '@atlaskit/icon/core/megaphone';
|
|
18
18
|
import StatusSuccessIcon from '@atlaskit/icon/core/status-success';
|
|
19
19
|
import StatusWarningIcon from '@atlaskit/icon/core/status-warning';
|
|
20
|
+
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
20
21
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
21
22
|
import { syncedBlockPluginKey } from '../pm-plugins/main';
|
|
22
23
|
import { FLAG_ID } from '../types';
|
|
@@ -65,8 +66,14 @@ var flagMap = (_flagMap = {}, _defineProperty(_defineProperty(_defineProperty(_d
|
|
|
65
66
|
description: messages.feedbackFlagDescription,
|
|
66
67
|
type: 'feedback'
|
|
67
68
|
}));
|
|
68
|
-
export var getSyncBlockCopiedDescription = function getSyncBlockCopiedDescription(activeFlag,
|
|
69
|
-
if (!activeFlag || activeFlag.id !== FLAG_ID.SYNC_BLOCK_COPIED ||
|
|
69
|
+
export var getSyncBlockCopiedDescription = function getSyncBlockCopiedDescription(activeFlag, isCopiedDescriptionEnabled) {
|
|
70
|
+
if (!activeFlag || activeFlag.id !== FLAG_ID.SYNC_BLOCK_COPIED || !isCopiedDescriptionEnabled) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
if (activeFlag.sourceProduct === 'jira-work-item') {
|
|
74
|
+
return activeFlag.isSourceContentUnpublished ? messages.syncBlockCopiedJiraUnsavedFieldDescription : messages.syncBlockCopiedLivePageDescription;
|
|
75
|
+
}
|
|
76
|
+
if (activeFlag.sourceProduct !== 'confluence-page') {
|
|
70
77
|
return undefined;
|
|
71
78
|
}
|
|
72
79
|
return activeFlag.isLivePage || !activeFlag.isSourceContentUnpublished ? messages.syncBlockCopiedLivePageDescription : messages.syncBlockCopiedUnpublishedDescription;
|
|
@@ -109,10 +116,11 @@ export var Flag = function Flag(_ref) {
|
|
|
109
116
|
var onRetry = activeFlag.onRetry,
|
|
110
117
|
onDismissedCallback = activeFlag.onDismissed;
|
|
111
118
|
|
|
112
|
-
//
|
|
113
|
-
// is a Jira work item. Other flags don't currently vary by product.
|
|
119
|
+
// Copy and unpublished-paste flags vary their guidance by source product.
|
|
114
120
|
var isJiraUnpublishedPaste = activeFlag.id === FLAG_ID.UNPUBLISHED_SYNC_BLOCK_PASTED && activeFlag.sourceProduct === 'jira-work-item';
|
|
115
|
-
var
|
|
121
|
+
var isCopiedFlag = activeFlag.id === FLAG_ID.SYNC_BLOCK_COPIED;
|
|
122
|
+
var isCopiedDescriptionEnabled = isCopiedFlag && (isExperimentEnabled('platform_editor_blocks_patch_11') || activeFlag.sourceProduct === 'confluence-page' && expValEquals('platform_editor_sync_block_activation', 'isEnabled', true));
|
|
123
|
+
var copiedDescription = getSyncBlockCopiedDescription(activeFlag, isCopiedDescriptionEnabled);
|
|
116
124
|
var title = isJiraUnpublishedPaste ? messages.unpublishedSyncBlockPastedTitleJiraWorkItem : defaultTitle;
|
|
117
125
|
var description = copiedDescription !== null && copiedDescription !== void 0 ? copiedDescription : isJiraUnpublishedPaste ? messages.unpublishedSyncBlockPastedDescriptionJiraWorkItem : defaultDescription;
|
|
118
126
|
|
|
@@ -28,7 +28,7 @@ type FlagConfig = {
|
|
|
28
28
|
onRetry?: () => void;
|
|
29
29
|
/**
|
|
30
30
|
* Optional source product for the synced block triggering this flag. Used to tailor
|
|
31
|
-
* unpublished paste copy and
|
|
31
|
+
* unpublished paste copy and copied-block reuse guidance by product.
|
|
32
32
|
*/
|
|
33
33
|
sourceProduct?: SyncBlockProduct;
|
|
34
34
|
};
|
package/dist/types/ui/Flag.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ type Props = {
|
|
|
12
12
|
onFeedbackPromptShown?: SyncedBlockPluginOptions['onFeedbackPromptShown'];
|
|
13
13
|
onGiveFeedback?: SyncedBlockPluginOptions['onGiveFeedback'];
|
|
14
14
|
};
|
|
15
|
-
export declare const getSyncBlockCopiedDescription: (activeFlag: ActiveFlag,
|
|
15
|
+
export declare const getSyncBlockCopiedDescription: (activeFlag: ActiveFlag, isCopiedDescriptionEnabled: boolean) => MessageDescriptor | undefined;
|
|
16
16
|
export declare const Flag: ({ api, onFeedbackPromptShown, onGiveFeedback, }: Props) => React.JSX.Element | undefined;
|
|
17
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-synced-block",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.7",
|
|
4
4
|
"description": "SyncedBlock plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@atlaskit/editor-synced-block-provider": "^18.0.0",
|
|
45
45
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
46
46
|
"@atlaskit/flag": "^19.0.0",
|
|
47
|
-
"@atlaskit/icon": "38.0.
|
|
48
|
-
"@atlaskit/icon-lab": "^7.
|
|
47
|
+
"@atlaskit/icon": "38.0.2",
|
|
48
|
+
"@atlaskit/icon-lab": "^7.11.0",
|
|
49
49
|
"@atlaskit/logo": "^23.3.0",
|
|
50
50
|
"@atlaskit/lozenge": "^15.4.0",
|
|
51
51
|
"@atlaskit/modal-dialog": "^17.0.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"memoize-one": "^6.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@atlaskit/editor-common": "^126.
|
|
68
|
+
"@atlaskit/editor-common": "^126.2.0",
|
|
69
69
|
"react": "^18.2.0 || ^19.2.0",
|
|
70
70
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
71
71
|
},
|