@atlaskit/editor-plugin-synced-block 5.3.19 → 5.3.20

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.
@@ -4,7 +4,6 @@ import { copyDomNode, toDOM } from '@atlaskit/editor-common/copy-button';
4
4
  import { DOMSerializer, Fragment } from '@atlaskit/editor-prosemirror/model';
5
5
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { findSelectedNodeOfType, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { syncedBlockPluginKey } from '../pm-plugins/main';
9
8
  import { canBeConvertedToSyncBlock, findSyncBlock, findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
10
9
  import { FLAG_ID } from '../types';
@@ -41,12 +40,6 @@ export const createSyncedBlock = ({
41
40
  });
42
41
  return false;
43
42
  }
44
-
45
- // Save the new node with empty content to backend
46
- // This is so that the node can be copied and referenced without the source being saved/published
47
- if (!fg('platform_synced_block_patch_1')) {
48
- syncBlockStore.sourceManager.createBodiedSyncBlockNode(attrs, () => {});
49
- }
50
43
  if (typeAheadInsert) {
51
44
  tr = typeAheadInsert(newBodiedSyncBlockNode);
52
45
  } else {
@@ -80,13 +73,6 @@ export const createSyncedBlock = ({
80
73
  });
81
74
  return false;
82
75
  }
83
-
84
- // Save the new node with empty content to backend
85
- // This is so that the node can be copied and referenced without the source being saved/published
86
- if (!fg('platform_synced_block_patch_1')) {
87
- // Moved to appendTransaction
88
- syncBlockStore.sourceManager.createBodiedSyncBlockNode(attrs, () => {}, newBodiedSyncBlockNode);
89
- }
90
76
  tr.replaceWith(conversionInfo.from, conversionInfo.to, newBodiedSyncBlockNode).scrollIntoView();
91
77
 
92
78
  // set selection to the start of the previous selection for the position taken up by the start of the new synced block
@@ -108,19 +94,17 @@ export const copySyncedBlockReferenceToClipboard = (syncBlockStore, inputMethod,
108
94
  const copySyncedBlockReferenceToClipboardInternal = (schema, selection, syncBlockStore, inputMethod, api) => {
109
95
  const syncBlockFindResult = findSyncBlockOrBodiedSyncBlock(schema, selection);
110
96
  if (!syncBlockFindResult) {
111
- if (fg('platform_synced_block_patch_1')) {
112
- var _api$analytics, _api$analytics$action;
113
- api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
114
- eventType: EVENT_TYPE.OPERATIONAL,
115
- action: ACTION.ERROR,
116
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
117
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
118
- attributes: {
119
- error: 'No sync block found in selection',
120
- inputMethod
121
- }
122
- });
123
- }
97
+ var _api$analytics, _api$analytics$action;
98
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
99
+ eventType: EVENT_TYPE.OPERATIONAL,
100
+ action: ACTION.ERROR,
101
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
102
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
103
+ attributes: {
104
+ error: 'No sync block found in selection',
105
+ inputMethod
106
+ }
107
+ });
124
108
  return false;
125
109
  }
126
110
  const isBodiedSyncBlock = isBodiedSyncBlockNode(syncBlockFindResult.node, schema.nodes.bodiedSyncBlock);
@@ -137,39 +121,35 @@ const copySyncedBlockReferenceToClipboardInternal = (schema, selection, syncBloc
137
121
  resourceId: syncBlockStore.referenceManager.generateResourceIdForReference(syncBlockFindResult.node.attrs.resourceId)
138
122
  });
139
123
  if (!referenceSyncBlockNode) {
140
- if (fg('platform_synced_block_patch_1')) {
141
- var _api$analytics2, _api$analytics2$actio;
142
- api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : (_api$analytics2$actio = _api$analytics2.actions) === null || _api$analytics2$actio === void 0 ? void 0 : _api$analytics2$actio.fireAnalyticsEvent({
143
- eventType: EVENT_TYPE.OPERATIONAL,
144
- action: ACTION.ERROR,
145
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
146
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
147
- attributes: {
148
- error: 'Failed to create reference sync block node',
149
- resourceId: syncBlockFindResult.node.attrs.resourceId,
150
- inputMethod
151
- }
152
- });
153
- }
154
- return false;
155
- }
156
- } else {
157
- referenceSyncBlockNode = syncBlockFindResult.node;
158
- }
159
- if (!referenceSyncBlockNode) {
160
- if (fg('platform_synced_block_patch_1')) {
161
- var _api$analytics3, _api$analytics3$actio;
162
- api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : (_api$analytics3$actio = _api$analytics3.actions) === null || _api$analytics3$actio === void 0 ? void 0 : _api$analytics3$actio.fireAnalyticsEvent({
124
+ var _api$analytics2, _api$analytics2$actio;
125
+ api === null || api === void 0 ? void 0 : (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : (_api$analytics2$actio = _api$analytics2.actions) === null || _api$analytics2$actio === void 0 ? void 0 : _api$analytics2$actio.fireAnalyticsEvent({
163
126
  eventType: EVENT_TYPE.OPERATIONAL,
164
127
  action: ACTION.ERROR,
165
128
  actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
166
129
  actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
167
130
  attributes: {
168
- error: 'No reference sync block node available',
131
+ error: 'Failed to create reference sync block node',
132
+ resourceId: syncBlockFindResult.node.attrs.resourceId,
169
133
  inputMethod
170
134
  }
171
135
  });
136
+ return false;
172
137
  }
138
+ } else {
139
+ referenceSyncBlockNode = syncBlockFindResult.node;
140
+ }
141
+ if (!referenceSyncBlockNode) {
142
+ var _api$analytics3, _api$analytics3$actio;
143
+ api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : (_api$analytics3$actio = _api$analytics3.actions) === null || _api$analytics3$actio === void 0 ? void 0 : _api$analytics3$actio.fireAnalyticsEvent({
144
+ eventType: EVENT_TYPE.OPERATIONAL,
145
+ action: ACTION.ERROR,
146
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
147
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
148
+ attributes: {
149
+ error: 'No reference sync block node available',
150
+ inputMethod
151
+ }
152
+ });
173
153
  return false;
174
154
  }
175
155
  const domNode = toDOM(referenceSyncBlockNode, schema);
@@ -180,19 +160,17 @@ const copySyncedBlockReferenceToClipboardInternal = (schema, selection, syncBloc
180
160
  api === null || api === void 0 ? void 0 : api.core.actions.execute(({
181
161
  tr
182
162
  }) => {
183
- if (fg('platform_synced_block_patch_1')) {
184
- var _api$analytics4, _api$analytics4$actio;
185
- api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : (_api$analytics4$actio = _api$analytics4.actions) === null || _api$analytics4$actio === void 0 ? void 0 : _api$analytics4$actio.fireAnalyticsEvent({
186
- eventType: EVENT_TYPE.OPERATIONAL,
187
- action: ACTION.COPIED,
188
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
189
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
190
- attributes: {
191
- resourceId: referenceSyncBlockNode.attrs.resourceId,
192
- inputMethod
193
- }
194
- });
195
- }
163
+ var _api$analytics4, _api$analytics4$actio;
164
+ api === null || api === void 0 ? void 0 : (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 ? void 0 : (_api$analytics4$actio = _api$analytics4.actions) === null || _api$analytics4$actio === void 0 ? void 0 : _api$analytics4$actio.fireAnalyticsEvent({
165
+ eventType: EVENT_TYPE.OPERATIONAL,
166
+ action: ACTION.COPIED,
167
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
168
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_COPY,
169
+ attributes: {
170
+ resourceId: referenceSyncBlockNode.attrs.resourceId,
171
+ inputMethod
172
+ }
173
+ });
196
174
  return tr.setMeta(syncedBlockPluginKey, {
197
175
  activeFlag: {
198
176
  id: FLAG_ID.SYNC_BLOCK_COPIED
@@ -211,18 +189,16 @@ export const editSyncedBlockSource = (syncBlockStore, api) => (state, dispatch,
211
189
  }
212
190
  const syncBlockURL = syncBlockStore.referenceManager.getSyncBlockURL(resourceId);
213
191
  if (syncBlockURL) {
214
- if (fg('platform_synced_block_patch_1')) {
215
- var _api$analytics5;
216
- api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions.fireAnalyticsEvent({
217
- eventType: EVENT_TYPE.OPERATIONAL,
218
- action: ACTION.SYNCED_BLOCK_EDIT_SOURCE,
219
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
220
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_SOURCE_URL,
221
- attributes: {
222
- resourceId: resourceId
223
- }
224
- });
225
- }
192
+ var _api$analytics5;
193
+ api === null || api === void 0 ? void 0 : (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 ? void 0 : _api$analytics5.actions.fireAnalyticsEvent({
194
+ eventType: EVENT_TYPE.OPERATIONAL,
195
+ action: ACTION.SYNCED_BLOCK_EDIT_SOURCE,
196
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
197
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_SOURCE_URL,
198
+ attributes: {
199
+ resourceId: resourceId
200
+ }
201
+ });
226
202
  window.open(syncBlockURL, '_blank');
227
203
  } else {
228
204
  var _api$analytics6, _api$analytics6$actio;
@@ -7,7 +7,6 @@ import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
7
7
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
8
8
  import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
9
9
  import { convertPMNodesToSyncBlockNodes, rebaseTransaction } from '@atlaskit/editor-synced-block-provider';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { lazyBodiedSyncBlockView } from '../nodeviews/bodiedLazySyncedBlock';
12
11
  import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
13
12
  import { FLAG_ID } from '../types';
@@ -118,11 +117,8 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
118
117
  if (!tr.selection.eq(oldEditorState.selection)) {
119
118
  newDecorationSet = calculateDecorations(tr.doc, tr.selection, tr.doc.type.schema);
120
119
  }
121
- let newRetryCreationPosMap = retryCreationPosMap;
122
- if (fg('platform_synced_block_patch_1')) {
123
- const newPosEntry = meta === null || meta === void 0 ? void 0 : meta.retryCreationPos;
124
- newRetryCreationPosMap = mapRetryCreationPosMap(retryCreationPosMap, newPosEntry, tr.mapping.map.bind(tr.mapping));
125
- }
120
+ const newPosEntry = meta === null || meta === void 0 ? void 0 : meta.retryCreationPos;
121
+ const newRetryCreationPosMap = mapRetryCreationPosMap(retryCreationPosMap, newPosEntry, tr.mapping.map.bind(tr.mapping));
126
122
  return {
127
123
  activeFlag: (_meta$activeFlag = meta === null || meta === void 0 ? void 0 : meta.activeFlag) !== null && _meta$activeFlag !== void 0 ? _meta$activeFlag : activeFlag,
128
124
  selectionDecorationSet: newDecorationSet,
@@ -180,7 +176,7 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
180
176
  class: SyncBlockStateCssClassName.viewModeClassName
181
177
  }));
182
178
  }
183
- if (node.type.name === 'bodiedSyncBlock' && syncBlockStore.sourceManager.isPendingCreation(node.attrs.resourceId) && fg('platform_synced_block_patch_1')) {
179
+ if (node.type.name === 'bodiedSyncBlock' && syncBlockStore.sourceManager.isPendingCreation(node.attrs.resourceId)) {
184
180
  loadingDecorations.push(Decoration.node(pos, pos + node.nodeSize, {
185
181
  class: SyncBlockStateCssClassName.creationLoadingClassName
186
182
  }));
@@ -249,12 +245,6 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
249
245
  var _api$connectivity2, _api$connectivity2$sh;
250
246
  const isOffline = isOfflineMode(api === null || api === void 0 ? void 0 : (_api$connectivity2 = api.connectivity) === null || _api$connectivity2 === void 0 ? void 0 : (_api$connectivity2$sh = _api$connectivity2.sharedState.currentState()) === null || _api$connectivity2$sh === void 0 ? void 0 : _api$connectivity2$sh.mode);
251
247
  const isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
252
- const hasNoPendingRequest = fg('platform_synced_block_patch_1') ? false :
253
- // requireConfirmationBeforeDelete is always true, so this evaluates to false and hence redundant
254
- !(syncBlockStore !== null && syncBlockStore !== void 0 && syncBlockStore.sourceManager.requireConfirmationBeforeDelete()) && !syncBlockStore.sourceManager.hasPendingCreation();
255
- const isCommitsCreation = fg('platform_synced_block_patch_1') ? false :
256
- // For patch 1, we don't intercept the insert transaction, hence it's redundant
257
- Boolean(tr.getMeta('isCommitSyncBlockCreation'));
258
248
 
259
249
  // Track newly added reference sync blocks before processing the transaction
260
250
  if (tr.docChanged && !tr.getMeta('isRemote')) {
@@ -274,7 +264,7 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
274
264
  // or are from remote (collab) or already confirmed sync block deletion
275
265
  // We only care about local changes that change the document
276
266
  // and are not yet confirmed for sync block deletion
277
- if (!tr.docChanged || hasNoPendingRequest || Boolean(tr.getMeta('isRemote')) || isCommitsCreation || !isOffline && isConfirmedSyncBlockDeletion) {
267
+ if (!tr.docChanged || Boolean(tr.getMeta('isRemote')) || !isOffline && isConfirmedSyncBlockDeletion) {
278
268
  return true;
279
269
  }
280
270
  const {
@@ -323,22 +313,8 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
323
313
  // After true is returned here and the node is created, we delete the node in the filterTransaction immediately, which cancels out the creation
324
314
  return true;
325
315
  }
326
- if (fg('platform_synced_block_patch_1')) {
327
- handleBodiedSyncBlockCreation(bodiedSyncBlockAdded, state, api);
328
- return true;
329
- } else {
330
- // If there is bodiedSyncBlock node addition and it's waiting for the result of saving the node to backend (syncBlockStore.hasPendingCreation()),
331
- // we need to intercept the transaction and save it in insert callback so that we only insert it to the document when backend call if backend call is successful
332
- // The callback will be evoked by in SourceSyncBlockStoreManager.commitPendingCreation
333
- syncBlockStore.sourceManager.registerCreationCallback(() => {
334
- var _api$core;
335
- api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(() => {
336
- return tr.setMeta('isCommitSyncBlockCreation', true);
337
- });
338
- api === null || api === void 0 ? void 0 : api.core.actions.focus();
339
- });
340
- return false;
341
- }
316
+ handleBodiedSyncBlockCreation(bodiedSyncBlockAdded, state, api);
317
+ return true;
342
318
  }
343
319
  } else {
344
320
  const {
@@ -3,7 +3,6 @@ import { ACTION, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
3
3
  import { Experience, EXPERIENCE_ID, ExperienceCheckDomMutation, ExperienceCheckTimeout, getNodeQuery, getPopupContainerFromEditorView, popupWithNestedElement } from '@atlaskit/editor-common/experiences';
4
4
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
8
7
  const TIMEOUT_DURATION = 30000;
9
8
  const pluginKey = new PluginKey('syncedBlockMenuAndToolbarExperience');
@@ -54,44 +53,38 @@ export const getMenuAndToolbarExperiencesPlugin = ({
54
53
  durationMs: TIMEOUT_DURATION
55
54
  }), referenceSyncBlockRemovedFromDomCheck(refs)]
56
55
  });
57
- let unsyncReferenceSyncedBlockExperience;
58
- let unsyncSourceSyncedBlockExperience;
59
- let deleteSourceSyncedBlockExperience;
60
- let syncedLocationsExperience;
61
- if (fg('platform_synced_block_patch_1')) {
62
- unsyncReferenceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
63
- action: ACTION.REFERENCE_SYNCED_BLOCK_UNSYNC,
64
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
65
- dispatchAnalyticsEvent,
66
- checks: [new ExperienceCheckTimeout({
67
- durationMs: TIMEOUT_DURATION
68
- }), referenceSyncBlockRemovedFromDomCheck(refs)]
69
- });
70
- unsyncSourceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
71
- action: ACTION.SYNCED_BLOCK_UNSYNC,
72
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
73
- dispatchAnalyticsEvent,
74
- checks: [new ExperienceCheckTimeout({
75
- durationMs: TIMEOUT_DURATION
76
- }), syncBlockDeleteConfirmationModalAddedCheck(refs)]
77
- });
78
- deleteSourceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
79
- action: ACTION.SYNCED_BLOCK_DELETE,
80
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
81
- dispatchAnalyticsEvent,
82
- checks: [new ExperienceCheckTimeout({
83
- durationMs: TIMEOUT_DURATION
84
- }), syncBlockDeleteConfirmationModalAddedCheck(refs)]
85
- });
86
- syncedLocationsExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
87
- action: ACTION.SYNCED_BLOCK_VIEW_SYNCED_LOCATIONS,
88
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
89
- dispatchAnalyticsEvent,
90
- checks: [new ExperienceCheckTimeout({
91
- durationMs: TIMEOUT_DURATION
92
- }), syncedLocationsDropdownOpenedCheck(refs)]
93
- });
94
- }
56
+ const unsyncReferenceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
57
+ action: ACTION.REFERENCE_SYNCED_BLOCK_UNSYNC,
58
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
59
+ dispatchAnalyticsEvent,
60
+ checks: [new ExperienceCheckTimeout({
61
+ durationMs: TIMEOUT_DURATION
62
+ }), referenceSyncBlockRemovedFromDomCheck(refs)]
63
+ });
64
+ const unsyncSourceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
65
+ action: ACTION.SYNCED_BLOCK_UNSYNC,
66
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
67
+ dispatchAnalyticsEvent,
68
+ checks: [new ExperienceCheckTimeout({
69
+ durationMs: TIMEOUT_DURATION
70
+ }), syncBlockDeleteConfirmationModalAddedCheck(refs)]
71
+ });
72
+ const deleteSourceSyncedBlockExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
73
+ action: ACTION.SYNCED_BLOCK_DELETE,
74
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
75
+ dispatchAnalyticsEvent,
76
+ checks: [new ExperienceCheckTimeout({
77
+ durationMs: TIMEOUT_DURATION
78
+ }), syncBlockDeleteConfirmationModalAddedCheck(refs)]
79
+ });
80
+ const syncedLocationsExperience = new Experience(EXPERIENCE_ID.TOOLBAR_ACTION, {
81
+ action: ACTION.SYNCED_BLOCK_VIEW_SYNCED_LOCATIONS,
82
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_TOOLBAR,
83
+ dispatchAnalyticsEvent,
84
+ checks: [new ExperienceCheckTimeout({
85
+ durationMs: TIMEOUT_DURATION
86
+ }), syncedLocationsDropdownOpenedCheck(refs)]
87
+ });
95
88
  const unbindClickListener = bind(document, {
96
89
  type: 'click',
97
90
  listener: event => {
@@ -155,7 +148,6 @@ export const getMenuAndToolbarExperiencesPlugin = ({
155
148
  editorViewEl = editorView.dom;
156
149
  return {
157
150
  destroy: () => {
158
- var _deleteSourceSyncedBl, _unsyncReferenceSynce, _unsyncSourceSyncedBl, _syncedLocationsExper;
159
151
  createSourcePrimaryToolbarExperience.abort({
160
152
  reason: 'editorDestroyed'
161
153
  });
@@ -168,16 +160,16 @@ export const getMenuAndToolbarExperiencesPlugin = ({
168
160
  deleteReferenceSyncedBlockExperience.abort({
169
161
  reason: 'editorDestroyed'
170
162
  });
171
- (_deleteSourceSyncedBl = deleteSourceSyncedBlockExperience) === null || _deleteSourceSyncedBl === void 0 ? void 0 : _deleteSourceSyncedBl.abort({
163
+ deleteSourceSyncedBlockExperience === null || deleteSourceSyncedBlockExperience === void 0 ? void 0 : deleteSourceSyncedBlockExperience.abort({
172
164
  reason: 'editorDestroyed'
173
165
  });
174
- (_unsyncReferenceSynce = unsyncReferenceSyncedBlockExperience) === null || _unsyncReferenceSynce === void 0 ? void 0 : _unsyncReferenceSynce.abort({
166
+ unsyncReferenceSyncedBlockExperience === null || unsyncReferenceSyncedBlockExperience === void 0 ? void 0 : unsyncReferenceSyncedBlockExperience.abort({
175
167
  reason: 'editorDestroyed'
176
168
  });
177
- (_unsyncSourceSyncedBl = unsyncSourceSyncedBlockExperience) === null || _unsyncSourceSyncedBl === void 0 ? void 0 : _unsyncSourceSyncedBl.abort({
169
+ unsyncSourceSyncedBlockExperience === null || unsyncSourceSyncedBlockExperience === void 0 ? void 0 : unsyncSourceSyncedBlockExperience.abort({
178
170
  reason: 'editorDestroyed'
179
171
  });
180
- (_syncedLocationsExper = syncedLocationsExperience) === null || _syncedLocationsExper === void 0 ? void 0 : _syncedLocationsExper.abort({
172
+ syncedLocationsExperience === null || syncedLocationsExperience === void 0 ? void 0 : syncedLocationsExperience.abort({
181
173
  reason: 'editorDestroyed'
182
174
  });
183
175
  unbindClickListener();
@@ -17,7 +17,6 @@ import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
17
17
  import StatusErrorIcon from '@atlaskit/icon/core/status-error';
18
18
  import { ConfluenceIcon, JiraIcon, AtlassianIcon } from '@atlaskit/logo';
19
19
  import Lozenge from '@atlaskit/lozenge';
20
- import { fg } from '@atlaskit/platform-feature-flags';
21
20
  import { Box, Text, Inline, Anchor, Stack } from '@atlaskit/primitives/compiled';
22
21
  import Spinner from '@atlaskit/spinner';
23
22
  import Tooltip from '@atlaskit/tooltip';
@@ -162,14 +161,14 @@ export const SyncedLocationDropdown = ({
162
161
  onOpenChange: ({
163
162
  isOpen
164
163
  }) => setIsOpen(isOpen),
165
- testId: fg('platform_synced_block_patch_1') ? 'synced-block-synced-locations-dropdown' : undefined,
164
+ testId: "synced-block-synced-locations-dropdown",
166
165
  trigger: ({
167
166
  triggerRef,
168
167
  ...triggerProps
169
168
  }) => /*#__PURE__*/React.createElement(Button, _extends({
170
169
  ref: triggerRef,
171
170
  areAnyNewToolbarFlagsEnabled: true,
172
- selected: fg('platform_synced_block_patch_1') ? isOpen : undefined,
171
+ selected: isOpen,
173
172
  iconAfter: /*#__PURE__*/React.createElement(ChevronDownIcon, {
174
173
  color: "currentColor",
175
174
  spacing: "spacious",
@@ -214,18 +213,16 @@ const DropdownContent = ({
214
213
  getReferenceData();
215
214
  }, [syncBlockStore, intl, isSource, localId, resourceId]);
216
215
  const handleLocationClick = () => {
217
- if (fg('platform_synced_block_patch_1')) {
218
- var _api$analytics, _api$analytics$action;
219
- api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
220
- eventType: EVENT_TYPE.OPERATIONAL,
221
- action: ACTION.CLICKED,
222
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
223
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CLICK_SYNCED_LOCATION,
224
- attributes: {
225
- resourceId
226
- }
227
- });
228
- }
216
+ var _api$analytics, _api$analytics$action;
217
+ api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : (_api$analytics$action = _api$analytics.actions) === null || _api$analytics$action === void 0 ? void 0 : _api$analytics$action.fireAnalyticsEvent({
218
+ eventType: EVENT_TYPE.OPERATIONAL,
219
+ action: ACTION.CLICKED,
220
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
221
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CLICK_SYNCED_LOCATION,
222
+ attributes: {
223
+ resourceId
224
+ }
225
+ });
229
226
  };
230
227
  const content = () => {
231
228
  switch (fetchStatus) {
@@ -284,7 +281,7 @@ const ErrorScreen = ({
284
281
  }) => {
285
282
  return /*#__PURE__*/React.createElement(Box, {
286
283
  xcss: styles.errorContainer,
287
- testId: fg('platform_synced_block_patch_1') ? 'synced-locations-dropdown-content-error' : undefined
284
+ testId: "synced-locations-dropdown-content-error"
288
285
  }, /*#__PURE__*/React.createElement(Box, {
289
286
  xcss: styles.errorIcon
290
287
  }, /*#__PURE__*/React.createElement(StatusErrorIcon, {
@@ -303,7 +300,7 @@ const NoResultScreen = ({
303
300
  return /*#__PURE__*/React.createElement(Stack, {
304
301
  xcss: styles.noResultsContainer,
305
302
  space: "space.100",
306
- testId: fg('platform_synced_block_patch_1') ? 'synced-locations-dropdown-content-no-results' : undefined
303
+ testId: "synced-locations-dropdown-content-no-results"
307
304
  }, /*#__PURE__*/React.createElement(Text, {
308
305
  as: "p"
309
306
  }, formatMessage(messages.syncedLocationDropdownNoResults)), /*#__PURE__*/React.createElement(Text, {
@@ -9,7 +9,6 @@ import CopyIcon from '@atlaskit/icon/core/copy';
9
9
  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
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { copySyncedBlockReferenceToClipboard, editSyncedBlockSource, removeSyncedBlock, unsync } from '../editor-commands';
14
13
  import { findSyncBlockOrBodiedSyncBlock, isBodiedSyncBlockNode } from '../pm-plugins/utils/utils';
15
14
  import { SYNCED_BLOCK_BUTTON_TEST_ID } from '../types';
@@ -20,7 +19,7 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
20
19
  if (!syncBlockObject) {
21
20
  return;
22
21
  }
23
- if (syncBlockStore.sourceManager.isPendingCreation(syncBlockObject.node.attrs.resourceId) && fg('platform_synced_block_patch_1')) {
22
+ if (syncBlockStore.sourceManager.isPendingCreation(syncBlockObject.node.attrs.resourceId)) {
24
23
  return;
25
24
  }
26
25
  const syncBlockInstance = syncBlockStore.referenceManager.getFromCache(syncBlockObject.node.attrs.resourceId);
@@ -87,7 +86,7 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
87
86
  }),
88
87
  title: formatMessage(messages.unsyncButton),
89
88
  onClick: () => unsync(syncBlockStore, isBodiedSyncBlock, view),
90
- testId: fg('platform_synced_block_patch_1') ? isBodiedSyncBlock ? SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarSourceUnsync : SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceUnsync : undefined
89
+ testId: isBodiedSyncBlock ? SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarSourceUnsync : SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceUnsync
91
90
  });
92
91
  }
93
92
  };
@@ -134,7 +133,7 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
134
133
  icon: /*#__PURE__*/React.createElement(DeleteIcon, {
135
134
  label: ""
136
135
  }),
137
- testId: fg('platform_synced_block_patch_1') ? isBodiedSyncBlock ? SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarSourceDelete : SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceDelete : undefined,
136
+ testId: isBodiedSyncBlock ? SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarSourceDelete : SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceDelete,
138
137
  ...hoverDecorationProps(nodeType)
139
138
  }]
140
139
  }];