@atlaskit/editor-plugin-synced-block 8.2.4 → 8.2.6

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 (3) hide show
  1. package/AGENTS.md +36 -4
  2. package/CHANGELOG.md +12 -0
  3. package/package.json +5 -5
package/AGENTS.md CHANGED
@@ -26,20 +26,31 @@ src/
26
26
  ├── index.ts # Re-exports plugin + type
27
27
  ├── syncedBlockPlugin.tsx # Top-level: registers nodes, commands, UI, pm-plugins
28
28
  ├── syncedBlockPluginType.ts # TypeScript interfaces for options, shared state, dependencies
29
+ ├── editor-actions/
30
+ │ └── index.ts # flushBodiedSyncBlocks, flushSyncBlocks,
31
+ │ discardUnpublishedSyncBlocks (EDITOR-6473)
29
32
  ├── editor-commands/
30
33
  │ └── index.ts # createSyncedBlock, copySyncedBlockReferenceToClipboardEditorCommand,
31
34
  │ removeSyncedBlockAtPos, unsyncSyncBlock
32
35
  ├── nodeviews/
33
36
  │ ├── syncedBlock.tsx # NodeView for reference (syncBlock) — read-only, fetches from BE
37
+ │ ├── lazySyncedBlock.tsx # Lazy-loaded wrapper for syncedBlock (EDITOR-6928)
34
38
  │ ├── bodiedSyncedBlock.tsx # NodeView for source (bodiedSyncBlock) — nested editor with content
35
39
  │ └── bodiedSyncBlockNodeWithToDOMFixed.ts # DOM serialization fix variant (experiment-gated)
36
40
  ├── pm-plugins/
37
- │ ├── main.ts # Core state machine: sync block lifecycle, creation, deletion, cache
41
+ │ ├── main.ts # Core state machine: lifecycle, creation, deletion, cache,
42
+ │ │ status decoration apply path (gated by editor_synced_block_perf)
38
43
  │ ├── menu-and-toolbar-experiences.ts # Experience tracking for menu/toolbar interactions
39
44
  │ └── utils/
40
- │ ├── track-sync-blocks.ts # Tracks mutations, updates shared state
41
- │ ├── handle-bodied-sync-block-creation.ts # Creation flow, local cache, retry logic
42
- └── handle-bodied-sync-block-removal.ts # Deletion flow, BE synchronization
45
+ │ ├── track-sync-blocks.ts # Tracks mutations, updates shared state
46
+ │ ├── handle-bodied-sync-block-creation.ts # Creation flow, local cache, retry logic
47
+ ├── handle-bodied-sync-block-removal.ts # Deletion flow, BE synchronization
48
+ │ ├── has-synced-blocks.ts # O(childCount) presence check (EDITOR-6928 lazy init)
49
+ │ ├── transaction-inserts-synced-block.ts # Detect tr inserts a synced block (lazy init)
50
+ │ ├── selection-decorations.ts # Selection decoration helpers
51
+ │ ├── rebase-transaction.ts # Rebase helpers used by main.ts
52
+ │ ├── ignore-dom-event.ts # DOM event guard
53
+ │ └── utils.ts # Misc shared helpers
43
54
  ├── ui/
44
55
  │ ├── toolbar-components.tsx # Primary toolbar button ("Create Synced Block")
45
56
  │ ├── floating-toolbar.tsx # Node-level actions: delete, unsync, copy link, view locations
@@ -52,6 +63,27 @@ src/
52
63
  └── index.ts # FLAG_ID, SyncedBlockSharedState, BodiedSyncBlockDeletionStatus
53
64
  ```
54
65
 
66
+ ### Editor Actions
67
+
68
+ This package exposes top-level **editor actions** (in `editor-actions/index.ts`)
69
+ that products call from outside the plugin lifecycle:
70
+
71
+ - `flushBodiedSyncBlocks(store)` — flush all dirty source blocks
72
+ - `flushSyncBlocks(store)` — flush reference manager (e.g. on save)
73
+ - `discardUnpublishedSyncBlocks(store)` — delete unpublished blocks on cancel
74
+ (added in EDITOR-6473; used by Confluence's editor cancel flow)
75
+
76
+ ### Lazy Init & Perf (EDITOR-6928 / EDITOR-6930)
77
+
78
+ Behind the `editor_synced_block_perf` experiment, `main.ts`:
79
+ - Skips creating synced-block plugin state and node-views for documents
80
+ with no synced blocks (`hasSyncedBlocks(doc)`).
81
+ - Computes `statusDecorationSet` inside `apply()` and stores it on plugin
82
+ state, then exposes it via an O(1) `decorations` prop instead of an
83
+ O(n) `doc.descendants()` walk on every transaction.
84
+ - Uses `sourceSyncBlockStoreManager.hasPendingCreations()` for an O(1)
85
+ pending-creation early return in `buildStatusDecorations()`.
86
+
55
87
  ### Key Code Patterns
56
88
 
57
89
  **Creating a sync block** (flow through the code):
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 8.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 8.2.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 8.2.4
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "8.2.4",
3
+ "version": "8.2.6",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,15 +46,15 @@
46
46
  "@atlaskit/editor-synced-block-provider": "^6.4.0",
47
47
  "@atlaskit/editor-toolbar": "^1.0.0",
48
48
  "@atlaskit/flag": "^17.11.0",
49
- "@atlaskit/icon": "34.3.0",
50
- "@atlaskit/icon-lab": "^6.6.0",
49
+ "@atlaskit/icon": "34.4.0",
50
+ "@atlaskit/icon-lab": "^6.7.0",
51
51
  "@atlaskit/logo": "^20.1.0",
52
52
  "@atlaskit/lozenge": "^13.8.0",
53
53
  "@atlaskit/modal-dialog": "^14.18.0",
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/primitives": "^19.0.0",
56
56
  "@atlaskit/spinner": "19.1.2",
57
- "@atlaskit/tmp-editor-statsig": "^75.2.0",
57
+ "@atlaskit/tmp-editor-statsig": "^76.0.0",
58
58
  "@atlaskit/tokens": "13.0.3",
59
59
  "@atlaskit/tooltip": "^22.0.0",
60
60
  "@atlaskit/visually-hidden": "^3.1.0",
@@ -64,7 +64,7 @@
64
64
  "date-fns": "^2.17.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@atlaskit/editor-common": "^114.19.0",
67
+ "@atlaskit/editor-common": "^114.20.0",
68
68
  "react": "^18.2.0",
69
69
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
70
70
  },