Commit 8332801
committed
Real-time collaboration: Remove block client IDs from Awareness, fix "Show Template" view (WordPress#75590)
* Use relative position .parent traversal instead of block client ID when sharing and drawing awareness information
* Fix "Show Template" mode by mapping remote positions into absolute block paths
* Add tests for block resolution for post-editor-awareness
* Remove inner blockPathResolver, use getBlockPathForLocalClientId utility funciton
* Make utility function naming a bit easier to follow - change "getAbsolutePositionIndex()" to "convertSelectionStateToAbsolute()", have it return "localClientId" instead of "blockClientId"
* Move block lookup functions into block-lookup utils file, improve types
* Remove EditorStoreBlock from exported types
* Compare relative positions with Yjs built-in function
* Replace areSelectionsStatesEqual() relative position comparison with compareRelativePositions() as well
* Fix types and tests from crdt-user-selections
* Add a guard to avoid getting blocks when path is empty
* Rename "useConvertSelectionStateToAbsolute" to "useResolvedSelection"
* Add unit tests for getBlockPathInYdoc, resolveBlockClientIdByPath, avoid exporting inner helper functionsFile tree
80 files changed
+2250
-814
lines changed- .github/workflows
- backport-changelog
- 7.0
- 7.1
- docs/reference-guides/block-api
- lib
- compat/wordpress-7.0
- packages
- block-editor/src/components
- block-list
- grid
- block-library/src
- accordion-item
- accordion
- cover
- page-list-item
- core-data/src
- test
- utils
- test
- dataviews
- src
- components
- dataform-layouts
- card
- regular
- dataviews-item-actions
- dataform/stories
- editor/src/components
- post-text-editor
- eslint-plugin
- docs/rules
- rules
- __tests__
- global-styles-engine/src
- core
- test
- media-fields/src/media_thumbnail
- test
- rich-text/src/hook
- sync/src
- test
- theme
- src
- esbuild-plugins
- postcss-plugins
- vite-plugins
- ui
- src
- dialog
- stories
- stack
- upload-media/src
- test
- wp-build
- lib
- templates
- phpunit
- schemas/json
- storybook
- test
- e2e
- assets
- specs
- editor/blocks
- site-editor
- emptytheme/templates
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
80 files changed
+2250
-814
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
439 | 449 | | |
440 | 450 | | |
441 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
71 | 79 | | |
72 | 80 | | |
73 | 81 | | |
| |||
81 | 89 | | |
82 | 90 | | |
83 | 91 | | |
84 | | - | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
88 | 105 | | |
89 | 106 | | |
90 | 107 | | |
| |||
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
107 | 151 | | |
108 | 152 | | |
109 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
80 | 116 | | |
81 | 117 | | |
82 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3215 | 3215 | | |
3216 | 3216 | | |
3217 | 3217 | | |
3218 | | - | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
3219 | 3224 | | |
3220 | 3225 | | |
3221 | 3226 | | |
| |||
4537 | 4542 | | |
4538 | 4543 | | |
4539 | 4544 | | |
4540 | | - | |
4541 | | - | |
4542 | | - | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
4543 | 4548 | | |
4544 | 4549 | | |
4545 | 4550 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments