@atlaskit/editor-plugin-synced-block 5.3.12 → 5.3.14

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/afm-cc/tsconfig.json +0 -3
  3. package/afm-jira/tsconfig.json +0 -3
  4. package/afm-products/tsconfig.json +0 -3
  5. package/dist/cjs/editor-commands/index.js +34 -38
  6. package/dist/cjs/nodeviews/bodiedSyncedBlock.js +2 -7
  7. package/dist/cjs/nodeviews/syncedBlock.js +4 -18
  8. package/dist/cjs/pm-plugins/main.js +120 -67
  9. package/dist/cjs/pm-plugins/utils/handle-bodied-sync-block-creation.js +141 -0
  10. package/dist/cjs/pm-plugins/utils/track-sync-blocks.js +2 -2
  11. package/dist/cjs/pm-plugins/utils/utils.js +1 -46
  12. package/dist/cjs/syncedBlockPlugin.js +7 -7
  13. package/dist/cjs/types/index.js +1 -0
  14. package/dist/cjs/ui/DeleteConfirmationModal.js +4 -20
  15. package/dist/cjs/ui/Flag.js +5 -1
  16. package/dist/cjs/ui/SyncBlockLabel.js +4 -10
  17. package/dist/cjs/ui/SyncBlockRefresher.js +7 -9
  18. package/dist/cjs/ui/floating-toolbar.js +6 -3
  19. package/dist/es2019/editor-commands/index.js +34 -38
  20. package/dist/es2019/nodeviews/bodiedSyncedBlock.js +2 -7
  21. package/dist/es2019/nodeviews/syncedBlock.js +4 -15
  22. package/dist/es2019/pm-plugins/main.js +99 -58
  23. package/dist/es2019/pm-plugins/utils/handle-bodied-sync-block-creation.js +134 -0
  24. package/dist/es2019/pm-plugins/utils/track-sync-blocks.js +2 -2
  25. package/dist/es2019/pm-plugins/utils/utils.js +0 -47
  26. package/dist/es2019/syncedBlockPlugin.js +7 -6
  27. package/dist/es2019/types/index.js +1 -0
  28. package/dist/es2019/ui/DeleteConfirmationModal.js +4 -20
  29. package/dist/es2019/ui/Flag.js +5 -0
  30. package/dist/es2019/ui/SyncBlockLabel.js +4 -10
  31. package/dist/es2019/ui/SyncBlockRefresher.js +7 -9
  32. package/dist/es2019/ui/floating-toolbar.js +6 -3
  33. package/dist/esm/editor-commands/index.js +34 -38
  34. package/dist/esm/nodeviews/bodiedSyncedBlock.js +2 -7
  35. package/dist/esm/nodeviews/syncedBlock.js +4 -18
  36. package/dist/esm/pm-plugins/main.js +120 -67
  37. package/dist/esm/pm-plugins/utils/handle-bodied-sync-block-creation.js +134 -0
  38. package/dist/esm/pm-plugins/utils/track-sync-blocks.js +2 -2
  39. package/dist/esm/pm-plugins/utils/utils.js +0 -45
  40. package/dist/esm/syncedBlockPlugin.js +7 -7
  41. package/dist/esm/types/index.js +1 -0
  42. package/dist/esm/ui/DeleteConfirmationModal.js +4 -20
  43. package/dist/esm/ui/Flag.js +5 -1
  44. package/dist/esm/ui/SyncBlockLabel.js +4 -10
  45. package/dist/esm/ui/SyncBlockRefresher.js +7 -9
  46. package/dist/esm/ui/floating-toolbar.js +6 -3
  47. package/dist/types/pm-plugins/main.d.ts +2 -1
  48. package/dist/types/pm-plugins/utils/handle-bodied-sync-block-creation.d.ts +9 -0
  49. package/dist/types/pm-plugins/utils/handle-bodied-sync-block-removal.d.ts +2 -2
  50. package/dist/types/pm-plugins/utils/utils.d.ts +1 -3
  51. package/dist/types/types/index.d.ts +19 -1
  52. package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -1
  53. package/dist/types-ts4.5/pm-plugins/utils/handle-bodied-sync-block-creation.d.ts +9 -0
  54. package/dist/types-ts4.5/pm-plugins/utils/handle-bodied-sync-block-removal.d.ts +2 -2
  55. package/dist/types-ts4.5/pm-plugins/utils/utils.d.ts +1 -3
  56. package/dist/types-ts4.5/types/index.d.ts +19 -1
  57. package/package.json +1 -5
@@ -8,7 +8,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
8
8
  import { syncBlockMessages as messages } from '@atlaskit/editor-common/messages';
9
9
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
10
10
  import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { Text, Box } from '@atlaskit/primitives/compiled';
13
12
  import Spinner from '@atlaskit/spinner';
14
13
  import { syncedBlockPluginKey } from '../pm-plugins/main';
@@ -35,7 +34,7 @@ export const DeleteConfirmationModal = ({
35
34
  syncBlockStoreManager,
36
35
  api
37
36
  }) => {
38
- var _api$core2, _api$core4, _api$core6, _syncBlockIds$length;
37
+ var _api$core2, _api$core4, _api$core6;
39
38
  const [isOpen, setIsOpen] = useState(false);
40
39
  const [syncBlockIds, setSyncBlockIds] = useState(undefined);
41
40
  const [referenceCount, setReferenceCount] = useState(undefined);
@@ -119,7 +118,7 @@ export const DeleteConfirmationModal = ({
119
118
  }
120
119
  }, [api === null || api === void 0 ? void 0 : (_api$core6 = api.core) === null || _api$core6 === void 0 ? void 0 : _api$core6.actions, bodiedSyncBlockDeletionStatus, isOpen]);
121
120
  useEffect(() => {
122
- if (isOpen && syncBlockIds !== undefined && fg('platform_synced_block_dogfooding')) {
121
+ if (isOpen && syncBlockIds !== undefined) {
123
122
  const fetchReferences = async () => {
124
123
  try {
125
124
  const references = await Promise.all(syncBlockIds.map(async syncBlockId => {
@@ -144,7 +143,7 @@ export const DeleteConfirmationModal = ({
144
143
  onClose: handleClick(false),
145
144
  testId: "sync-block-delete-confirmation",
146
145
  height: 184
147
- }, fg('platform_synced_block_dogfooding') ? /*#__PURE__*/React.createElement(React.Fragment, null, referenceCount === undefined ? /*#__PURE__*/React.createElement(Box, {
146
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, referenceCount === undefined ? /*#__PURE__*/React.createElement(Box, {
148
147
  xcss: styles.spinner
149
148
  }, /*#__PURE__*/React.createElement(Spinner, {
150
149
  size: "large"
@@ -157,22 +156,7 @@ export const DeleteConfirmationModal = ({
157
156
  isDisabled: isOfflineMode(mode),
158
157
  deleteReason: deleteReason,
159
158
  sourceCount: (syncBlockIds === null || syncBlockIds === void 0 ? void 0 : syncBlockIds.length) || 0
160
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalHeader, {
161
- hasCloseButton: true
162
- }, /*#__PURE__*/React.createElement(ModalTitle, {
163
- appearance: "warning"
164
- }, formatMessage(messages.deleteConfirmationModalTitleSingle))), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Text, null, formatMessage(messages.deleteConfirmationModalDescription, {
165
- syncBlockCount: (_syncBlockIds$length = syncBlockIds === null || syncBlockIds === void 0 ? void 0 : syncBlockIds.length) !== null && _syncBlockIds$length !== void 0 ? _syncBlockIds$length : 1
166
- }))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
167
- appearance: "subtle",
168
- onClick: handleClick(false)
169
- }, formatMessage(messages.deleteConfirmationModalCancelButton)), /*#__PURE__*/React.createElement(Button, {
170
- appearance: "warning",
171
- onClick: handleClick(true),
172
- autoFocus: true,
173
- isDisabled: isOfflineMode(mode),
174
- isLoading: bodiedSyncBlockDeletionStatus === 'processing'
175
- }, formatMessage(messages.deleteConfirmationModalDeleteButton))))));
159
+ }))));
176
160
  };
177
161
  const ModalContent = ({
178
162
  content,
@@ -37,6 +37,11 @@ const flagMap = {
37
37
  title: messages.unpublishedSyncBlockPastedTitle,
38
38
  description: messages.unpublishedSyncBlockPastedDescription,
39
39
  type: 'info'
40
+ },
41
+ [FLAG_ID.CANNOT_CREATE_SYNC_BLOCK]: {
42
+ title: messages.cannotCreateSyncBlockTitle,
43
+ description: messages.CannotCreateSyncBlockDescription,
44
+ type: 'error'
40
45
  }
41
46
  };
42
47
  export const Flag = ({
@@ -3,7 +3,6 @@ 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
5
  import BlockSyncedIcon from '@atlaskit/icon-lab/core/block-synced';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { Text } from '@atlaskit/primitives/compiled';
8
7
  import Tooltip from '@atlaskit/tooltip';
9
8
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -22,17 +21,12 @@ const SyncBlockLabelComponent = ({
22
21
  } = intl;
23
22
  const [tooltipContent, setTooltipContent] = useState(formatMessage(messages.defaultSyncBlockTooltip));
24
23
  let tooltipMessage = formatMessage(messages.defaultSyncBlockTooltip);
25
- if (isSource && !fg('platform_synced_block_dogfooding')) {
26
- tooltipMessage = formatMessage(messages.sourceSyncBlockTooltip);
27
- } else if (title) {
24
+ if (title) {
28
25
  tooltipMessage = formatMessage(messages.referenceSyncBlockTooltip, {
29
26
  title
30
27
  });
31
28
  }
32
29
  const updateTooltipContent = useCallback(() => {
33
- if (!fg('platform_synced_block_dogfooding')) {
34
- return;
35
- }
36
30
  let tooltipContent = tooltipMessage;
37
31
  if (contentUpdatedAt) {
38
32
  const elapsedTime = formatElapsedTime(contentUpdatedAt, intl);
@@ -52,7 +46,7 @@ const SyncBlockLabelComponent = ({
52
46
  }, [contentUpdatedAt, formatMessage, intl, tooltipMessage]);
53
47
  const ariaDescribedById = `sync-block-label-description-${localId}`;
54
48
  const getLabelContent = useMemo(() => {
55
- if (isUnsyncedBlock && fg('platform_synced_block_dogfooding')) {
49
+ if (isUnsyncedBlock) {
56
50
  return /*#__PURE__*/React.createElement(Text, {
57
51
  size: "small",
58
52
  color: "color.text.subtle"
@@ -81,12 +75,12 @@ const SyncBlockLabelComponent = ({
81
75
  size: "small",
82
76
  label: ""
83
77
  }), getLabelContent);
84
- if ((isSource || isUnsyncedBlock) && fg('platform_synced_block_dogfooding')) {
78
+ if (isSource || isUnsyncedBlock) {
85
79
  return label;
86
80
  }
87
81
  return /*#__PURE__*/React.createElement(Tooltip, {
88
82
  position: "top",
89
- content: fg('platform_synced_block_dogfooding') ? tooltipContent : tooltipMessage
83
+ content: tooltipContent
90
84
  // workaround because tooltip adds aria-describedby with a new id every time the tooltip is opened
91
85
  // this causes an infinite rerender loop because of the forwardRef from the node view we are inside in bodiedSyncBlock
92
86
  // tooltip content is available for screen readers in visually hidden content after the label
@@ -1,13 +1,12 @@
1
1
  import { useEffect } from 'react';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
4
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  export const SYNC_BLOCK_FETCH_INTERVAL = 3000;
6
5
 
7
6
  // Component that manages synced block data synchronization.
8
- // When the feature flag 'platform_synced_block_dogfooding' is enabled,
9
- // it uses provider-based GraphQL subscriptions for updates.
10
- // When disabled, it falls back to polling at regular intervals.
7
+ // Component that manages synced block data synchronization.
8
+ // Uses provider-based GraphQL subscriptions for updates when online.
9
+ // Falls back to polling at regular intervals when offline.
11
10
  export const SyncBlockRefresher = ({
12
11
  syncBlockStoreManager,
13
12
  api
@@ -20,14 +19,13 @@ export const SyncBlockRefresher = ({
20
19
  mode: (_states$connectivityS = states.connectivityState) === null || _states$connectivityS === void 0 ? void 0 : _states$connectivityS.mode
21
20
  };
22
21
  });
23
- const featureFlagEnabled = fg('platform_synced_block_dogfooding');
24
22
  const isOnline = !isOfflineMode(mode);
25
23
  useEffect(() => {
26
- const useRealTimeSubscriptions = featureFlagEnabled && isOnline;
24
+ const useRealTimeSubscriptions = isOnline;
27
25
  syncBlockStoreManager.referenceManager.setRealTimeSubscriptionsEnabled(useRealTimeSubscriptions);
28
- }, [syncBlockStoreManager, featureFlagEnabled, isOnline]);
26
+ }, [syncBlockStoreManager, isOnline]);
29
27
  useEffect(() => {
30
- const useRealTimeSubscriptions = featureFlagEnabled && isOnline;
28
+ const useRealTimeSubscriptions = isOnline;
31
29
  if (useRealTimeSubscriptions) {
32
30
  return;
33
31
  }
@@ -46,6 +44,6 @@ export const SyncBlockRefresher = ({
46
44
  return () => {
47
45
  window.clearInterval(interval);
48
46
  };
49
- }, [syncBlockStoreManager, isOnline, featureFlagEnabled]);
47
+ }, [syncBlockStoreManager, isOnline]);
50
48
  return null;
51
49
  };
@@ -20,6 +20,9 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
20
20
  if (!syncBlockObject) {
21
21
  return;
22
22
  }
23
+ if (syncBlockStore.sourceManager.isPendingCreation(syncBlockObject.node.attrs.resourceId) && fg('platform_synced_block_patch_1')) {
24
+ return;
25
+ }
23
26
  const syncBlockInstance = syncBlockStore.referenceManager.getFromCache(syncBlockObject.node.attrs.resourceId);
24
27
  const isUnsyncedBlock = (syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : (_syncBlockInstance$er = syncBlockInstance.error) === null || _syncBlockInstance$er === void 0 ? void 0 : _syncBlockInstance$er.type) === SyncBlockError.NotFound;
25
28
  const isErroredBlock = syncBlockInstance === null || syncBlockInstance === void 0 ? void 0 : syncBlockInstance.error;
@@ -53,12 +56,12 @@ export const getToolbarConfig = (state, intl, api, syncBlockStore) => {
53
56
  title: formatMessage(commonMessages.delete),
54
57
  onClick: removeSyncedBlock(api),
55
58
  icon: DeleteIcon,
56
- testId: fg('platform_synced_block_dogfooding') ? SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceDelete : undefined,
57
- ...hoverDecorationProps(nodeType, fg('platform_synced_block_dogfooding') ? undefined : akEditorSelectedNodeClassName)
59
+ testId: SYNCED_BLOCK_BUTTON_TEST_ID.syncedBlockToolbarReferenceDelete,
60
+ ...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
58
61
  };
59
62
  items.push(deleteButton);
60
63
  } else {
61
- if (!isErroredBlock && fg('platform_synced_block_dogfooding')) {
64
+ if (!isErroredBlock) {
62
65
  const syncedLocation = {
63
66
  type: 'custom',
64
67
  fallback: [],
@@ -24,23 +24,23 @@ export var createSyncedBlock = function createSyncedBlock(_ref) {
24
24
  var paragraphNode = paragraph.createAndFill({});
25
25
  var newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(attrs, paragraphNode ? [paragraphNode] : []);
26
26
  if (!newBodiedSyncBlockNode) {
27
- if (fg('platform_synced_block_dogfooding')) {
28
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
29
- action: ACTION.ERROR,
30
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
31
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
32
- attributes: {
33
- error: 'Create and fill for empty content failed'
34
- },
35
- eventType: EVENT_TYPE.OPERATIONAL
36
- });
37
- }
27
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
28
+ action: ACTION.ERROR,
29
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
30
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
31
+ attributes: {
32
+ error: 'Create and fill for empty content failed'
33
+ },
34
+ eventType: EVENT_TYPE.OPERATIONAL
35
+ });
38
36
  return false;
39
37
  }
40
38
 
41
39
  // Save the new node with empty content to backend
42
40
  // This is so that the node can be copied and referenced without the source being saved/published
43
- syncBlockStore.sourceManager.createBodiedSyncBlockNode(attrs);
41
+ if (!fg('platform_synced_block_patch_1')) {
42
+ syncBlockStore.sourceManager.createBodiedSyncBlockNode(attrs, function () {});
43
+ }
44
44
  if (typeAheadInsert) {
45
45
  tr = typeAheadInsert(newBodiedSyncBlockNode);
46
46
  } else {
@@ -49,47 +49,43 @@ export var createSyncedBlock = function createSyncedBlock(_ref) {
49
49
  } else {
50
50
  var conversionInfo = canBeConvertedToSyncBlock(tr.selection);
51
51
  if (!conversionInfo) {
52
- if (fg('platform_synced_block_dogfooding')) {
53
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
54
- action: ACTION.ERROR,
55
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
56
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
57
- attributes: {
58
- error: 'Content cannot be converted to sync block'
59
- },
60
- eventType: EVENT_TYPE.OPERATIONAL
61
- });
62
- }
52
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
53
+ action: ACTION.ERROR,
54
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
55
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
56
+ attributes: {
57
+ error: 'Content cannot be converted to sync block'
58
+ },
59
+ eventType: EVENT_TYPE.OPERATIONAL
60
+ });
63
61
  return false;
64
62
  }
65
63
  var _attrs = syncBlockStore.sourceManager.generateBodiedSyncBlockAttrs();
66
64
  var _newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_attrs, conversionInfo.contentToInclude);
67
65
  if (!_newBodiedSyncBlockNode) {
68
- if (fg('platform_synced_block_dogfooding')) {
69
- fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
70
- action: ACTION.ERROR,
71
- actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
72
- actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
73
- attributes: {
74
- error: 'Create and fill for content failed'
75
- },
76
- eventType: EVENT_TYPE.OPERATIONAL
77
- });
78
- }
66
+ fireAnalyticsEvent === null || fireAnalyticsEvent === void 0 || fireAnalyticsEvent({
67
+ action: ACTION.ERROR,
68
+ actionSubject: ACTION_SUBJECT.SYNCED_BLOCK,
69
+ actionSubjectId: ACTION_SUBJECT_ID.SYNCED_BLOCK_CREATE,
70
+ attributes: {
71
+ error: 'Create and fill for content failed'
72
+ },
73
+ eventType: EVENT_TYPE.OPERATIONAL
74
+ });
79
75
  return false;
80
76
  }
81
77
 
82
78
  // Save the new node with empty content to backend
83
79
  // This is so that the node can be copied and referenced without the source being saved/published
84
- syncBlockStore.sourceManager.createBodiedSyncBlockNode(_attrs, _newBodiedSyncBlockNode);
80
+ if (!fg('platform_synced_block_patch_1')) {
81
+ // Moved to appendTransaction
82
+ syncBlockStore.sourceManager.createBodiedSyncBlockNode(_attrs, function () {}, _newBodiedSyncBlockNode);
83
+ }
85
84
  tr.replaceWith(conversionInfo.from, conversionInfo.to, _newBodiedSyncBlockNode).scrollIntoView();
86
85
 
87
86
  // set selection to the start of the previous selection for the position taken up by the start of the new synced block
88
87
  tr.setSelection(TextSelection.create(tr.doc, conversionInfo.from));
89
88
  }
90
-
91
- // This transaction will be intercepted in filterTransaction and dispatched when saving to backend succeeds
92
- // see filterTransaction for more details
93
89
  return tr;
94
90
  };
95
91
  export var copySyncedBlockReferenceToClipboardEditorCommand = function copySyncedBlockReferenceToClipboardEditorCommand(syncBlockStore, inputMethod, api) {
@@ -12,7 +12,6 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
12
12
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
13
13
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
14
14
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
15
  import { BodiedSyncBlockWrapper } from '../ui/BodiedSyncBlockWrapper';
17
16
  var toDOM = function toDOM() {
18
17
  return ['div', {
@@ -90,7 +89,7 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
90
89
  if (!syncBlockStore) {
91
90
  return null;
92
91
  }
93
- return fg('platform_synced_block_dogfooding') ? /*#__PURE__*/React.createElement(ErrorBoundary, {
92
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
94
93
  component: ACTION_SUBJECT.SYNCED_BLOCK,
95
94
  dispatchAnalyticsEvent: (_this$api6 = this.api) === null || _this$api6 === void 0 || (_this$api6 = _this$api6.analytics) === null || _this$api6 === void 0 ? void 0 : _this$api6.actions.fireAnalyticsEvent,
96
95
  fallbackComponent: null
@@ -98,11 +97,7 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
98
97
  ref: forwardRef,
99
98
  syncBlockStore: syncBlockStore,
100
99
  node: this.node
101
- })) : /*#__PURE__*/React.createElement(BodiedSyncBlockWrapper, {
102
- ref: forwardRef,
103
- syncBlockStore: syncBlockStore,
104
- node: this.node
105
- });
100
+ }));
106
101
  }
107
102
  }, {
108
103
  key: "getContentDOM",
@@ -13,7 +13,6 @@ import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
13
13
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
14
14
  import { SyncBlockSharedCssClassName, SyncBlockActionsProvider } from '@atlaskit/editor-common/sync-block';
15
15
  import { useFetchSyncBlockData as _useFetchSyncBlockData, useFetchSyncBlockTitle as _useFetchSyncBlockTitle } from '@atlaskit/editor-synced-block-provider';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { removeSyncedBlockAtPos } from '../editor-commands';
18
17
  import { SyncBlockRendererWrapper } from '../ui/SyncBlockRendererWrapper';
19
18
  export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
@@ -42,8 +41,7 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
42
41
  _this$api,
43
42
  _this$api2,
44
43
  _this2 = this,
45
- _this$options2,
46
- _this$options3;
44
+ _this$options2;
47
45
  var getPos = _ref.getPos;
48
46
  if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
49
47
  return null;
@@ -54,14 +52,13 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
54
52
  if (!resourceId || !localId) {
55
53
  return null;
56
54
  }
57
- var initialSyncBlockStore = fg('platform_synced_block_dogfooding') ? this.syncBlockStore : undefined;
58
- var syncBlockStore = (_this$api$syncedBlock = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.syncedBlock) === null || _this$api === void 0 || (_this$api = _this$api.sharedState.currentState()) === null || _this$api === void 0 ? void 0 : _this$api.syncBlockStore) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : initialSyncBlockStore;
55
+ var syncBlockStore = (_this$api$syncedBlock = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.syncedBlock) === null || _this$api === void 0 || (_this$api = _this$api.sharedState.currentState()) === null || _this$api === void 0 ? void 0 : _this$api.syncBlockStore) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : this.syncBlockStore;
59
56
  if (!syncBlockStore) {
60
57
  return null;
61
58
  }
62
59
 
63
60
  // get document node from data provider
64
- return fg('platform_synced_block_dogfooding') ? /*#__PURE__*/React.createElement(ErrorBoundary, {
61
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
65
62
  component: ACTION_SUBJECT.SYNCED_BLOCK,
66
63
  dispatchAnalyticsEvent: (_this$api2 = this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.analytics) === null || _this$api2 === void 0 ? void 0 : _this$api2.actions.fireAnalyticsEvent,
67
64
  fallbackComponent: null
@@ -86,18 +83,7 @@ export var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
86
83
  return _useFetchSyncBlockData(syncBlockStore, resourceId, localId, (_this2$api = _this2.api) === null || _this2$api === void 0 || (_this2$api = _this2$api.analytics) === null || _this2$api === void 0 || (_this2$api = _this2$api.actions) === null || _this2$api === void 0 ? void 0 : _this2$api.fireAnalyticsEvent);
87
84
  },
88
85
  api: this.api
89
- }))) : /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
90
- localId: this.node.attrs.localId,
91
- syncedBlockRenderer: (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.syncedBlockRenderer,
92
- useFetchSyncBlockTitle: function useFetchSyncBlockTitle() {
93
- return _useFetchSyncBlockTitle(syncBlockStore, _this2.node);
94
- },
95
- useFetchSyncBlockData: function useFetchSyncBlockData() {
96
- var _this2$api2;
97
- return _useFetchSyncBlockData(syncBlockStore, resourceId, localId, (_this2$api2 = _this2.api) === null || _this2$api2 === void 0 || (_this2$api2 = _this2$api2.analytics) === null || _this2$api2 === void 0 || (_this2$api2 = _this2$api2.actions) === null || _this2$api2 === void 0 ? void 0 : _this2$api2.fireAnalyticsEvent);
98
- },
99
- api: this.api
100
- });
86
+ })));
101
87
  }
102
88
  }, {
103
89
  key: "destroy",