@atlaskit/editor-plugin-synced-block 6.0.43 → 6.0.45

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/AGENTS.md CHANGED
@@ -1,133 +1,54 @@
1
- # Synced Blocks — Developer Agent Guide
1
+ # Synced Blocks Plugin — Developer Agent Guide
2
2
 
3
- > **Purpose**: This guide helps AI agents and developers implement features, fix bugs, and clean up
4
- > feature gates in the Synced Blocks codebase. It provides architectural context, key file
5
- > locations, common patterns, and debugging guidance.
6
- >
7
- > **Full Knowledge Base**:
8
- > [Synced Blocks — Comprehensive Knowledge Base](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6679548384)
9
- > (Confluence)
3
+ > **For workflow guidance, debugging, and cross-package task guides, load the `synced-blocks` skill:**
4
+ > `get_skill(skill_name_or_path="platform/packages/editor/.rovodev/skills/synced-blocks/SKILL.md")`
10
5
 
11
6
  ---
12
7
 
13
8
  ## Quick Context
14
9
 
15
10
  **Synced Blocks** lets users create reusable content blocks (source) that can be referenced across
16
- Confluence pages and Jira issue descriptions. Edits to the source propagate to all references in
17
- near real-time via the Block Service backend and AGG GraphQL WebSocket subscriptions.
11
+ Confluence pages and Jira issue descriptions. This package is the core editor plugin it registers
12
+ ADF nodes, toolbar/menu integration, commands, and ProseMirror plugins.
18
13
 
19
14
  **Two ADF node types:**
20
15
 
21
16
  - `bodiedSyncBlock` — **Source** sync block (contains the editable content)
22
- - `syncBlock` — **Reference** sync block (renders content fetched from block service)
17
+ - `syncBlock` — **Reference** sync block (renders content fetched from Block Service)
23
18
 
24
19
  ---
25
20
 
26
- ## Package Map
27
-
28
- ### Platform (shared across products)
29
-
30
- | Package | Path | Purpose |
31
- | ------------------ | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
32
- | **Plugin** | `platform/packages/editor/editor-plugin-synced-block/` | Core editor plugin — registers nodes, toolbar, commands, block menu integration |
33
- | **Provider** | `platform/packages/editor/editor-synced-block-provider/` | Data layer — store managers, block service API client, ARI generation, permissions, media tokens |
34
- | **Renderer** | `platform/packages/editor/editor-synced-block-renderer/` | View-mode rendering of reference sync blocks using nested renderer |
35
- | **Plugin Tests** | `platform/packages/editor/editor-plugin-synced-block-tests/` | Integration tests for the plugin |
36
- | **Provider Tests** | `platform/packages/editor/editor-synced-block-provider-tests/` | Tests for store managers and provider hooks |
37
- | **Renderer Tests** | `platform/packages/editor/editor-synced-block-renderer-tests/` | Tests for renderer components |
38
-
39
- Also touches:
40
-
41
- - `platform/packages/editor/editor-common` — shared types
42
- - `platform/packages/editor/editor-core` — plugin registration
43
- - `platform/packages/renderer` — reference rendering in view mode
44
-
45
- ### Confluence
46
-
47
- | File/Package | Path | Purpose |
48
- | ------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
49
- | SyncedBlockProvider | `confluence/next/packages/fabric-providers/src/SyncedBlockProvider.ts` | Wraps platform provider with Confluence config (AGG endpoint, media tokens, permissions) |
50
- | SyncedBlockPreload | `confluence/next/packages/fabric-providers/src/SyncedBlockPreload.ts` | Preloads sync block data for SSR |
51
- | SSR Data Loading | `confluence/next/packages/fabric-providers/src/SyncedBlockLoadSSRData.ts` | Loads SSR data |
52
- | Edit Page Preload | `confluence/next/packages/load-edit-page/src/preload/preloadSyncedBlocksData.ts` | Preloads data for edit page |
53
- | Editor Preload | `confluence/next/packages/load-edit-page/src/preload/preloadEditorSyncedBlocksData.ts` | Editor-specific preloading |
54
- | Full Page Editor | `confluence/next/packages/full-page-editor/src/FullPageEditorComponent.tsx` | Integrates sync block plugin into editor |
55
-
56
- ### Jira
57
-
58
- | File/Package | Path | Purpose |
59
- | ------------------- | ----------------------------------------------------------- | --------------------------------------------- |
60
- | Provider Package | `jira/src/packages/issue/issue-view-synced-block-provider/` | Core Jira integration package |
61
- | Node Component Hook | `src/useSyncedBlockProviderNodeComponent.tsx` | Creates synced block node components for Jira |
62
- | Editor HOC | `src/withSyncedBlockProviderEditor.tsx` | Wraps Jira editor with sync block support |
63
- | Renderer HOC | `src/withSyncedBlockProviderRenderer.tsx` | Wraps Jira renderer with sync block support |
64
- | Prefetch | `src/prefetchSyncedBlocks.ts` | Prefetches sync block data in issue view |
65
- | Relay Fetch | `src/useRelaySyncBlockFetchProvider.tsx` | Real-time updates via Relay subscriptions |
66
-
67
- ---
68
-
69
- ## Key Concepts
70
-
71
- ### Source vs Reference
72
-
73
- - **Source** (`bodiedSyncBlock`): The original content block. Content is stored in the page ADF AND
74
- in the Block Service. Editable inline.
75
- - **Reference** (`syncBlock`): A read-only copy that fetches content from Block Service. Rendered
76
- via nested renderer. Shows "Synced from [page]" label.
77
-
78
- ### Data Flow
79
-
80
- 1. **Create source** → Content saved to Block Service via API → ARI generated from page ID + local
81
- ID
82
- 2. **Create reference** → Copy source link → Paste → `syncBlock` node inserted with `resourceId`
83
- 3. **Edit source** → Content pushed to Block Service → AGG subscription notifies references →
84
- References re-fetch and re-render
85
- 4. **SSR** → On page load, Confluence/Jira preloads sync block data from Block Service in bulk
86
-
87
- ### ARI Format
88
-
89
- - Confluence: `ari:cloud:block::{cloudId}/confluence-page:{pageId}/{localId}`
90
- - Jira: `ari:cloud:block::{cloudId}/jira-work-item:{issueId}/{localId}`
91
-
92
- ### Store Managers
93
-
94
- - `SyncBlockStoreManager` — Manages source sync block state (create, update, delete, flush)
95
- - `ReferenceSyncBlockStoreManager` — Manages reference sync block state (fetch, subscribe, cache)
96
- - `SyncBlockInMemorySessionCache` — Caches data for view→edit transitions
97
-
98
- ---
99
-
100
- ## Plugin Internals (`editor-plugin-synced-block/src/`)
101
-
102
- The plugin follows a layered architecture:
21
+ ## Plugin Internals (`src/`)
103
22
 
104
23
  ```
105
- syncedBlockPlugin.tsx ← Top-level: registers nodes, commands, UI, pm-plugins
106
- ├── syncedBlockPluginType.ts TypeScript interfaces for options, shared state, dependencies
24
+ src/
25
+ ├── index.ts # Re-exports plugin + type
26
+ ├── syncedBlockPlugin.tsx # Top-level: registers nodes, commands, UI, pm-plugins
27
+ ├── syncedBlockPluginType.ts # TypeScript interfaces for options, shared state, dependencies
107
28
  ├── editor-commands/
108
- │ └── index.ts createSyncedBlock, copySyncedBlockReferenceToClipboardEditorCommand,
29
+ │ └── index.ts # createSyncedBlock, copySyncedBlockReferenceToClipboardEditorCommand,
109
30
  │ removeSyncedBlockAtPos, unsyncSyncBlock
110
31
  ├── nodeviews/
111
- │ ├── syncedBlock.tsx NodeView for reference (syncBlock) — read-only, fetches from BE
112
- │ ├── bodiedSyncedBlock.tsx NodeView for source (bodiedSyncBlock) — nested editor with content
113
- │ └── bodiedSyncBlockNodeWithToDOMFixed.ts DOM serialization fix variant (experiment-gated)
32
+ │ ├── syncedBlock.tsx # NodeView for reference (syncBlock) — read-only, fetches from BE
33
+ │ ├── bodiedSyncedBlock.tsx # NodeView for source (bodiedSyncBlock) — nested editor with content
34
+ │ └── bodiedSyncBlockNodeWithToDOMFixed.ts # DOM serialization fix variant (experiment-gated)
114
35
  ├── pm-plugins/
115
- │ ├── main.ts Core state machine: sync block lifecycle, creation, deletion, cache
116
- │ ├── menu-and-toolbar-experiences.ts Experience tracking for menu/toolbar interactions
36
+ │ ├── main.ts # Core state machine: sync block lifecycle, creation, deletion, cache
37
+ │ ├── menu-and-toolbar-experiences.ts # Experience tracking for menu/toolbar interactions
117
38
  │ └── utils/
118
- │ ├── track-sync-blocks.ts Tracks mutations, updates shared state
119
- │ ├── handle-bodied-sync-block-creation.ts Creation flow, local cache, retry logic
120
- │ └── handle-bodied-sync-block-removal.ts Deletion flow, BE synchronization
39
+ │ ├── track-sync-blocks.ts # Tracks mutations, updates shared state
40
+ │ ├── handle-bodied-sync-block-creation.ts # Creation flow, local cache, retry logic
41
+ │ └── handle-bodied-sync-block-removal.ts # Deletion flow, BE synchronization
121
42
  ├── ui/
122
- │ ├── toolbar-components.tsx Primary toolbar button ("Create Synced Block")
123
- │ ├── floating-toolbar.tsx Node-level actions: delete, unsync, copy link, view locations
124
- │ ├── block-menu-components.tsx Block menu entry
125
- │ ├── quick-insert.tsx Slash command / quick insert config
126
- │ ├── DeleteConfirmationModal.tsx Deletion confirmation dialog
127
- │ ├── SyncBlockRefresher.tsx Periodic data refresh from backend
128
- │ └── Flag.tsx Error/info flags (offline, copy notifications)
43
+ │ ├── toolbar-components.tsx # Primary toolbar button ("Create Synced Block")
44
+ │ ├── floating-toolbar.tsx # Node-level actions: delete, unsync, copy link, view locations
45
+ │ ├── block-menu-components.tsx # Block menu entry
46
+ │ ├── quick-insert.tsx # Slash command / quick insert config
47
+ │ ├── DeleteConfirmationModal.tsx # Deletion confirmation dialog
48
+ │ ├── SyncBlockRefresher.tsx # Periodic data refresh from backend
49
+ │ └── Flag.tsx # Error/info flags (offline, copy notifications)
129
50
  └── types/
130
- └── index.ts FLAG_ID, SyncedBlockSharedState, BodiedSyncBlockDeletionStatus
51
+ └── index.ts # FLAG_ID, SyncedBlockSharedState, BodiedSyncBlockDeletionStatus
131
52
  ```
132
53
 
133
54
  ### Key Code Patterns
@@ -147,124 +68,3 @@ syncedBlockPlugin.tsx ← Top-level: registers nodes, commands, UI, pm-
147
68
  2. Calls `ReferenceSyncBlockStoreManager.fetch(resourceId)` → Block Service API
148
69
  3. Renders content via nested renderer from `editor-synced-block-renderer`
149
70
  4. Subscribes to AGG WebSocket for real-time updates
150
-
151
- ---
152
-
153
- ## Common Tasks
154
-
155
- ### Implementing a new feature in sync blocks
156
-
157
- 1. **Identify scope**: Does it affect source, reference, or both? Editor, renderer, or both?
158
- 2. **Platform first**: Make changes in `editor-plugin-synced-block` or
159
- `editor-synced-block-provider`
160
- 3. **Product integration**: Update Confluence (`fabric-providers`) and/or Jira
161
- (`issue-view-synced-block-provider`)
162
- 4. **Feature gate**: Use a DnH **Experiment** (not a feature gate) for production changes. See
163
- [Experiment and gates page](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6390978659)
164
- 5. **Analytics**: Add experience tracking events (see `EDITOR-1665` pattern)
165
- 6. **Test**: Add tests in the corresponding test package
166
-
167
- ### Fixing a bug
168
-
169
- 1. **Check supported node types**:
170
- [Edit at source](https://hello.atlassian.net/wiki/spaces/egcuc/pages/5926568979) |
171
- [Edit anywhere](https://hello.atlassian.net/wiki/spaces/egcuc/pages/5864526866)
172
- 2. **Check unsupported content handling**:
173
- [Unsupported content](https://hello.atlassian.net/wiki/spaces/egcuc/pages/5687277297)
174
- 3. **Debug with analytics**:
175
- [HOW-TO: Use analytics to debug errors](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6342760320)
176
- 4. **Gate the fix**: Use DnH Experiment, not a feature gate
177
- 5. **Test on staging**: Verify on Hello (hello.atlassian.net) with experiment enabled
178
-
179
- ### Cleaning up a feature gate
180
-
181
- 1. Find the gate key in
182
- [Experiment and gates](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6390978659)
183
- 2. Search codebase: `grep -r "gate_key_name" platform/ confluence/ jira/`
184
- 3. Remove conditional logic, keep the "enabled" code path
185
- 4. Remove the Switcheroo/Statsig configuration
186
- 5. Update the Confluence page to mark as "Cleaned up"
187
-
188
- ### Adding support for a new node type in sync blocks
189
-
190
- 1. Check if node is in the supported list:
191
- [Supported node types](https://hello.atlassian.net/wiki/spaces/egcuc/pages/5926568979)
192
- 2. For **source**: Update the allowed node schema in `editor-plugin-synced-block`
193
- 3. For **reference**: Ensure nested renderer in `editor-synced-block-renderer` can render the node
194
- 4. Test in both classic pages and live pages
195
- 5. Test in Jira issue description renderer
196
-
197
- ---
198
-
199
- ## Performance Considerations
200
-
201
- - **VC90**: Sync blocks can regress VC90 due to content shift (CLS). Reference blocks fetch content
202
- async and shift the page. Use SSR preloading to mitigate.
203
- - **SSR**: Bulk fetch endpoint reduces waterfall. Configurable via
204
- `platform_editor_sync_block_ssr_config`.
205
- - **View→Edit transition**: Cache sync block data in session storage (see
206
- `SyncBlockInMemorySessionCache`)
207
- - **Criterion tests**:
208
- [Perf test page](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6498888237)
209
-
210
- ---
211
-
212
- ## Analytics Events Quick Reference
213
-
214
- **Experience events** (SLO-driving): `asyncOperation` type
215
-
216
- - `fetchSyncedBlock`, `fetchSyncedBlockSourceInfo`, `fetchSyncedBlockReferencesInfo`
217
- - `syncedBlockCreate`, `syncedBlockUpdate`, `syncedBlockDelete`
218
- - `referenceSyncedBlockUpdate`
219
-
220
- **Menu/toolbar events**: `menuAction` and `toolbarAction` types
221
-
222
- - `syncedBlockCreate` (quickInsertMenu, blockMenu, primaryToolbar)
223
- - `syncedBlockDelete`, `referenceSyncedBlockDelete` (syncedBlockToolbar)
224
- - `syncedBlockUnsync`, `referenceSyncedBlockUnsync` (syncedBlockToolbar)
225
- - `syncedBlockViewLocations`, `syncedBlockEditSource` (syncedBlockToolbar)
226
-
227
- **Standard analytics events**: Track individual sync block operations
228
-
229
- - `fetched/fetchSyncedBlock` — attributes: `resourceId`, `blockInstanceId`, `sourceProduct`
230
- - `rendered/renderSyncedBlock` — attributes: `resourceId`, `sourceProduct`, state
231
- (`loaded`/`error`/`permissionDenied`/`missingSource`)
232
- - `inserted/documentInserted` (page save) — attributes: `numberOfSyncedBlocks`,
233
- `numberOfReferencedSyncedBlocks`
234
-
235
- Full catalogue:
236
- [Synced Block Analytics Catalogue](https://hello.atlassian.net/wiki/spaces/egcuc/pages/6332253480)
237
-
238
- ---
239
-
240
- ## Key Jira Queries
241
-
242
- ```
243
- # All synced block tickets
244
- "Epic Link" in (EDITOR-1519, EDITOR-2441, EDITOR-1783, EDITOR-3936, EDITOR-3586, EDITOR-5010)
245
-
246
- # Open bugs
247
- ... AND type = Bug AND status not in (Done, "Won't do") ORDER BY priority DESC
248
-
249
- # M2 (Jira source creation)
250
- "Epic Link" = EDITOR-5010 ORDER BY created DESC
251
- ```
252
-
253
- ---
254
-
255
- ## Key Confluence Pages
256
-
257
- - **Architecture**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/5505188521
258
- - **Implementation view**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/5997083214
259
- - **Decisions record**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/5882558842
260
- - **Feature flags**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/6390978659
261
- - **Analytics catalogue**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/6332253480
262
- - **Debug errors HOW-TO**: https://hello.atlassian.net/wiki/spaces/egcuc/pages/6342760320
263
-
264
- ---
265
-
266
- ## Slack Channels
267
-
268
- - **Engineering**: https://atlassian.enterprise.slack.com/archives/C09DZT1TBNW
269
- - **Product & Design**: https://atlassian.enterprise.slack.com/archives/C091Y69RBGU
270
- - **M2 / Jira**: https://atlassian.enterprise.slack.com/archives/C09RS7JCBED
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 6.0.45
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 6.0.44
10
+
11
+ ### Patch Changes
12
+
13
+ - [`38e89dd6515da`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38e89dd6515da) -
14
+ Read viewMode from the editorViewMode plugin and pass it to SyncBlockStoreManager so that synced
15
+ block side effects are suppressed when the editor is in view mode (e.g. Version History).
16
+ - Updated dependencies
17
+
3
18
  ## 6.0.43
4
19
 
5
20
  ### Patch Changes
@@ -472,7 +472,11 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
472
472
  }
473
473
  },
474
474
  filterTransaction: function filterTransaction(tr, state) {
475
- var _api$connectivity3;
475
+ var _api$editorViewMode2, _api$connectivity3;
476
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode;
477
+ if (viewMode === 'view' && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8')) {
478
+ return true;
479
+ }
476
480
  var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(api === null || api === void 0 || (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 || (_api$connectivity3 = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3 === void 0 ? void 0 : _api$connectivity3.mode);
477
481
  var isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
478
482
 
@@ -514,6 +518,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
514
518
  });
515
519
  },
516
520
  appendTransaction: function appendTransaction(trs, oldState, newState) {
521
+ var _api$editorViewMode3;
522
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 || (_api$editorViewMode3 = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3 === void 0 ? void 0 : _api$editorViewMode3.mode;
523
+ if (viewMode === 'view' && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_8')) {
524
+ return null;
525
+ }
526
+
517
527
  // Update source sync block cache for user-initiated changes only
518
528
  // When fg is ON, cache updates are handled here instead of in the nodeview update()
519
529
  if ((0, _platformFeatureFlags.fg)('platform_synced_block_update_refactor')) {
@@ -22,11 +22,12 @@ var _quickInsert = require("./ui/quick-insert");
22
22
  var _SyncBlockRefresher = require("./ui/SyncBlockRefresher");
23
23
  var _toolbarComponents = require("./ui/toolbar-components");
24
24
  var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_ref) {
25
- var _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
25
+ var _api$editorViewMode, _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
26
26
  var config = _ref.config,
27
27
  api = _ref.api;
28
28
  var refs = {};
29
- var syncBlockStore = new _editorSyncedBlockProvider.SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider);
29
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode;
30
+ var syncBlockStore = new _editorSyncedBlockProvider.SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
30
31
  syncBlockStore.setFireAnalyticsEvent(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
31
32
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents((0, _blockMenuComponents.getBlockMenuComponents)(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
32
33
  api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
@@ -436,7 +436,11 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
436
436
  }
437
437
  },
438
438
  filterTransaction: (tr, state) => {
439
- var _api$connectivity3, _api$connectivity3$sh;
439
+ var _api$editorViewMode2, _api$editorViewMode2$, _api$connectivity3, _api$connectivity3$sh;
440
+ const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 ? void 0 : (_api$editorViewMode2$ = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2$ === void 0 ? void 0 : _api$editorViewMode2$.mode;
441
+ if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
442
+ return true;
443
+ }
440
444
  const isOffline = isOfflineMode(api === null || api === void 0 ? void 0 : (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 ? void 0 : (_api$connectivity3$sh = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3$sh === void 0 ? void 0 : _api$connectivity3$sh.mode);
441
445
  const isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
442
446
 
@@ -478,6 +482,12 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
478
482
  });
479
483
  },
480
484
  appendTransaction: (trs, oldState, newState) => {
485
+ var _api$editorViewMode3, _api$editorViewMode3$;
486
+ const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 ? void 0 : (_api$editorViewMode3$ = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3$ === void 0 ? void 0 : _api$editorViewMode3$.mode;
487
+ if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
488
+ return null;
489
+ }
490
+
481
491
  // Update source sync block cache for user-initiated changes only
482
492
  // When fg is ON, cache updates are handled here instead of in the nodeview update()
483
493
  if (fg('platform_synced_block_update_refactor')) {
@@ -18,9 +18,10 @@ export const syncedBlockPlugin = ({
18
18
  config,
19
19
  api
20
20
  }) => {
21
- var _api$analytics, _api$analytics$action, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
21
+ var _api$editorViewMode, _api$editorViewMode$s, _api$analytics, _api$analytics$action, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
22
22
  const refs = {};
23
- const syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider);
23
+ const viewMode = api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : (_api$editorViewMode$s = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode$s === void 0 ? void 0 : _api$editorViewMode$s.mode;
24
+ const syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
24
25
  syncBlockStore.setFireAnalyticsEvent(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);
25
26
  api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents(getBlockMenuComponents(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
26
27
  api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
@@ -465,7 +465,11 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
465
465
  }
466
466
  },
467
467
  filterTransaction: function filterTransaction(tr, state) {
468
- var _api$connectivity3;
468
+ var _api$editorViewMode2, _api$connectivity3;
469
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode2 = api.editorViewMode) === null || _api$editorViewMode2 === void 0 || (_api$editorViewMode2 = _api$editorViewMode2.sharedState.currentState()) === null || _api$editorViewMode2 === void 0 ? void 0 : _api$editorViewMode2.mode;
470
+ if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
471
+ return true;
472
+ }
469
473
  var isOffline = isOfflineMode(api === null || api === void 0 || (_api$connectivity3 = api.connectivity) === null || _api$connectivity3 === void 0 || (_api$connectivity3 = _api$connectivity3.sharedState.currentState()) === null || _api$connectivity3 === void 0 ? void 0 : _api$connectivity3.mode);
470
474
  var isConfirmedSyncBlockDeletion = Boolean(tr.getMeta('isConfirmedSyncBlockDeletion'));
471
475
 
@@ -507,6 +511,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
507
511
  });
508
512
  },
509
513
  appendTransaction: function appendTransaction(trs, oldState, newState) {
514
+ var _api$editorViewMode3;
515
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode3 = api.editorViewMode) === null || _api$editorViewMode3 === void 0 || (_api$editorViewMode3 = _api$editorViewMode3.sharedState.currentState()) === null || _api$editorViewMode3 === void 0 ? void 0 : _api$editorViewMode3.mode;
516
+ if (viewMode === 'view' && fg('platform_synced_block_patch_8')) {
517
+ return null;
518
+ }
519
+
510
520
  // Update source sync block cache for user-initiated changes only
511
521
  // When fg is ON, cache updates are handled here instead of in the nodeview update()
512
522
  if (fg('platform_synced_block_update_refactor')) {
@@ -15,11 +15,12 @@ import { getQuickInsertConfig } from './ui/quick-insert';
15
15
  import { SyncBlockRefresher } from './ui/SyncBlockRefresher';
16
16
  import { getToolbarComponents } from './ui/toolbar-components';
17
17
  export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
18
- var _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
18
+ var _api$editorViewMode, _api$analytics, _api$blockMenu, _config$enableSourceC, _api$toolbar, _config$enableSourceC2;
19
19
  var config = _ref.config,
20
20
  api = _ref.api;
21
21
  var refs = {};
22
- var syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider);
22
+ var viewMode = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 || (_api$editorViewMode = _api$editorViewMode.sharedState.currentState()) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.mode;
23
+ var syncBlockStore = new SyncBlockStoreManager(config === null || config === void 0 ? void 0 : config.syncBlockDataProvider, viewMode);
23
24
  syncBlockStore.setFireAnalyticsEvent(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || (_api$analytics = _api$analytics.actions) === null || _api$analytics === void 0 ? void 0 : _api$analytics.fireAnalyticsEvent);
24
25
  api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents(getBlockMenuComponents(api, (_config$enableSourceC = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC !== void 0 ? _config$enableSourceC : false));
25
26
  api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api, (_config$enableSourceC2 = config === null || config === void 0 ? void 0 : config.enableSourceCreation) !== null && _config$enableSourceC2 !== void 0 ? _config$enableSourceC2 : false));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "6.0.43",
3
+ "version": "6.0.45",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,8 +29,8 @@
29
29
  "atlaskit:src": "src/index.ts",
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^52.4.0",
32
- "@atlaskit/button": "23.10.9",
33
- "@atlaskit/dropdown-menu": "16.8.5",
32
+ "@atlaskit/button": "23.10.10",
33
+ "@atlaskit/dropdown-menu": "16.8.6",
34
34
  "@atlaskit/editor-json-transformer": "^8.31.0",
35
35
  "@atlaskit/editor-plugin-analytics": "^8.0.0",
36
36
  "@atlaskit/editor-plugin-block-menu": "^7.0.0",
@@ -46,16 +46,16 @@
46
46
  "@atlaskit/editor-synced-block-provider": "^4.3.0",
47
47
  "@atlaskit/editor-toolbar": "^0.20.0",
48
48
  "@atlaskit/flag": "^17.9.0",
49
- "@atlaskit/icon": "34.0.1",
50
- "@atlaskit/icon-lab": "^6.2.0",
49
+ "@atlaskit/icon": "34.0.2",
50
+ "@atlaskit/icon-lab": "^6.4.0",
51
51
  "@atlaskit/logo": "^19.10.0",
52
52
  "@atlaskit/lozenge": "^13.5.0",
53
53
  "@atlaskit/modal-dialog": "^14.14.0",
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/primitives": "^18.1.0",
56
- "@atlaskit/spinner": "19.0.13",
57
- "@atlaskit/tmp-editor-statsig": "^54.1.0",
58
- "@atlaskit/tokens": "11.4.2",
56
+ "@atlaskit/spinner": "19.0.14",
57
+ "@atlaskit/tmp-editor-statsig": "^54.3.0",
58
+ "@atlaskit/tokens": "11.4.3",
59
59
  "@atlaskit/tooltip": "^21.1.0",
60
60
  "@atlaskit/visually-hidden": "^3.0.0",
61
61
  "@babel/runtime": "^7.0.0",
@@ -65,7 +65,7 @@
65
65
  "react-intl-next": "npm:react-intl@^5.18.1"
66
66
  },
67
67
  "peerDependencies": {
68
- "@atlaskit/editor-common": "^112.16.0",
68
+ "@atlaskit/editor-common": "^112.18.0",
69
69
  "react": "^18.2.0"
70
70
  },
71
71
  "devDependencies": {