@wordpress/editor 14.42.0 → 14.43.1-next.v.202604091042.0
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/CHANGELOG.md +2 -0
- package/README.md +8 -0
- package/build/components/autocompleters/index.cjs +3 -0
- package/build/components/autocompleters/index.cjs.map +2 -2
- package/build/components/autocompleters/link.cjs +71 -0
- package/build/components/autocompleters/link.cjs.map +7 -0
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs +1 -1
- package/build/components/collaborators-overlay/cursor-dom-utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/cursor-registry.cjs +86 -0
- package/build/components/collaborators-overlay/cursor-registry.cjs.map +7 -0
- package/build/components/collaborators-overlay/index.cjs +7 -2
- package/build/components/collaborators-overlay/index.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +1 -1
- package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +2 -2
- package/build/components/collaborators-overlay/overlay.cjs +31 -1
- package/build/components/collaborators-overlay/overlay.cjs.map +2 -2
- package/build/components/collaborators-overlay/timing-utils.cjs +1 -1
- package/build/components/collaborators-overlay/timing-utils.cjs.map +2 -2
- package/build/components/collaborators-overlay/use-render-cursors.cjs.map +2 -2
- package/build/components/collaborators-presence/index.cjs +14 -4
- package/build/components/collaborators-presence/index.cjs.map +2 -2
- package/build/components/collaborators-presence/list.cjs +20 -4
- package/build/components/collaborators-presence/list.cjs.map +2 -2
- package/build/components/error-boundary/index.cjs +1 -1
- package/build/components/error-boundary/index.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +4 -15
- package/build/components/post-card-panel/index.cjs.map +2 -2
- package/build/components/post-content-information/index.cjs +10 -13
- package/build/components/post-content-information/index.cjs.map +2 -2
- package/build/components/post-revisions-panel/index.cjs +164 -0
- package/build/components/post-revisions-panel/index.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs +23 -12
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/components/post-template/create-new-template-modal.cjs +39 -46
- package/build/components/post-template/create-new-template-modal.cjs.map +2 -2
- package/build/components/post-template/hooks.cjs +52 -6
- package/build/components/post-template/hooks.cjs.map +2 -2
- package/build/components/post-template/swap-template-button.cjs +31 -20
- package/build/components/post-template/swap-template-button.cjs.map +2 -2
- package/build/components/post-title/index.cjs +2 -2
- package/build/components/post-title/index.cjs.map +2 -2
- package/build/components/preferences-modal/index.cjs +35 -27
- package/build/components/preferences-modal/index.cjs.map +2 -2
- package/build/components/revision-block-diff/index.cjs +9 -32
- package/build/components/revision-block-diff/index.cjs.map +3 -3
- package/build/components/revision-diff-panel/index.cjs +68 -0
- package/build/components/revision-diff-panel/index.cjs.map +7 -0
- package/build/components/revision-fields-diff/index.cjs +96 -0
- package/build/components/revision-fields-diff/index.cjs.map +7 -0
- package/build/components/sidebar/dataform-post-summary.cjs +8 -53
- package/build/components/sidebar/dataform-post-summary.cjs.map +2 -2
- package/build/components/sidebar/index.cjs +25 -22
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-revision-summary.cjs +74 -0
- package/build/components/sidebar/post-revision-summary.cjs.map +7 -0
- package/build/components/sidebar/post-summary.cjs +35 -42
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/style-book/index.cjs +4 -3
- package/build/components/style-book/index.cjs.map +2 -2
- package/build/components/styles-canvas/revisions.cjs +2 -2
- package/build/components/styles-canvas/revisions.cjs.map +1 -1
- package/build/components/sync-connection-error-modal/index.cjs +58 -75
- package/build/components/sync-connection-error-modal/index.cjs.map +3 -3
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs +32 -9
- package/build/components/sync-connection-error-modal/use-retry-countdown.cjs.map +2 -2
- package/build/components/template-actions-panel/block-theme-content.cjs +188 -0
- package/build/components/template-actions-panel/block-theme-content.cjs.map +7 -0
- package/build/components/template-actions-panel/classic-theme-content.cjs +159 -0
- package/build/components/template-actions-panel/classic-theme-content.cjs.map +7 -0
- package/build/components/template-actions-panel/index.cjs +59 -0
- package/build/components/template-actions-panel/index.cjs.map +7 -0
- package/build/dataviews/store/private-actions.cjs +2 -0
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/hooks/default-autocompleters.cjs +1 -1
- package/build/hooks/default-autocompleters.cjs.map +2 -2
- package/build/store/private-actions.cjs +15 -1
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +42 -19
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +1 -1
- package/build/store/reducer.cjs.map +2 -2
- package/build-module/components/autocompleters/index.mjs +4 -2
- package/build-module/components/autocompleters/index.mjs.map +2 -2
- package/build-module/components/autocompleters/link.mjs +40 -0
- package/build-module/components/autocompleters/link.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs +1 -1
- package/build-module/components/collaborators-overlay/cursor-dom-utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/cursor-registry.mjs +61 -0
- package/build-module/components/collaborators-overlay/cursor-registry.mjs.map +7 -0
- package/build-module/components/collaborators-overlay/index.mjs +7 -2
- package/build-module/components/collaborators-overlay/index.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +1 -1
- package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/overlay.mjs +32 -2
- package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/timing-utils.mjs +1 -1
- package/build-module/components/collaborators-overlay/timing-utils.mjs.map +2 -2
- package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
- package/build-module/components/collaborators-presence/index.mjs +14 -4
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +20 -4
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/error-boundary/index.mjs +1 -1
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +6 -17
- package/build-module/components/post-card-panel/index.mjs.map +2 -2
- package/build-module/components/post-content-information/index.mjs +6 -13
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +139 -0
- package/build-module/components/post-revisions-panel/index.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +23 -12
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/post-template/create-new-template-modal.mjs +39 -46
- package/build-module/components/post-template/create-new-template-modal.mjs.map +2 -2
- package/build-module/components/post-template/hooks.mjs +53 -7
- package/build-module/components/post-template/hooks.mjs.map +2 -2
- package/build-module/components/post-template/swap-template-button.mjs +27 -20
- package/build-module/components/post-template/swap-template-button.mjs.map +2 -2
- package/build-module/components/post-title/index.mjs +2 -2
- package/build-module/components/post-title/index.mjs.map +2 -2
- package/build-module/components/preferences-modal/index.mjs +35 -27
- package/build-module/components/preferences-modal/index.mjs.map +2 -2
- package/build-module/components/revision-block-diff/index.mjs +9 -32
- package/build-module/components/revision-block-diff/index.mjs.map +2 -2
- package/build-module/components/revision-diff-panel/index.mjs +37 -0
- package/build-module/components/revision-diff-panel/index.mjs.map +7 -0
- package/build-module/components/revision-fields-diff/index.mjs +65 -0
- package/build-module/components/revision-fields-diff/index.mjs.map +7 -0
- package/build-module/components/sidebar/dataform-post-summary.mjs +8 -53
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +25 -22
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-revision-summary.mjs +43 -0
- package/build-module/components/sidebar/post-revision-summary.mjs.map +7 -0
- package/build-module/components/sidebar/post-summary.mjs +31 -42
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/style-book/index.mjs +4 -3
- package/build-module/components/style-book/index.mjs.map +2 -2
- package/build-module/components/styles-canvas/revisions.mjs +2 -2
- package/build-module/components/styles-canvas/revisions.mjs.map +1 -1
- package/build-module/components/sync-connection-error-modal/index.mjs +58 -76
- package/build-module/components/sync-connection-error-modal/index.mjs.map +2 -2
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs +33 -10
- package/build-module/components/sync-connection-error-modal/use-retry-countdown.mjs.map +2 -2
- package/build-module/components/template-actions-panel/block-theme-content.mjs +167 -0
- package/build-module/components/template-actions-panel/block-theme-content.mjs.map +7 -0
- package/build-module/components/template-actions-panel/classic-theme-content.mjs +138 -0
- package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +7 -0
- package/build-module/components/template-actions-panel/index.mjs +28 -0
- package/build-module/components/template-actions-panel/index.mjs.map +7 -0
- package/build-module/dataviews/store/private-actions.mjs +5 -1
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/hooks/default-autocompleters.mjs +2 -2
- package/build-module/hooks/default-autocompleters.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +15 -1
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +42 -19
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +1 -1
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-style/style-rtl.css +124 -44
- package/build-style/style.css +124 -44
- package/build-types/bindings/post-data.d.ts +3 -3
- package/build-types/bindings/term-data.d.ts +14 -14
- package/build-types/components/autocompleters/index.d.ts +1 -0
- package/build-types/components/autocompleters/link.d.ts +12 -0
- package/build-types/components/autocompleters/link.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts +36 -0
- package/build-types/components/collaborators-overlay/cursor-registry.d.ts.map +1 -0
- package/build-types/components/collaborators-overlay/index.d.ts +7 -4
- package/build-types/components/collaborators-overlay/index.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +1 -1
- package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts +4 -1
- package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/list.d.ts +4 -1
- package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
- package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +11 -11
- package/build-types/components/post-actions/set-as-homepage.d.ts +1 -1
- package/build-types/components/post-actions/set-as-posts-page.d.ts +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts +4 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-format/index.d.ts +10 -10
- package/build-types/components/post-locked-modal/index.d.ts +2 -2
- package/build-types/components/post-revisions-panel/index.d.ts +2 -0
- package/build-types/components/post-revisions-panel/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-status/index.d.ts +10 -10
- package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -1
- package/build-types/components/post-template/hooks.d.ts +1 -1
- package/build-types/components/post-template/hooks.d.ts.map +1 -1
- package/build-types/components/post-template/swap-template-button.d.ts +4 -0
- package/build-types/components/post-template/swap-template-button.d.ts.map +1 -1
- package/build-types/components/post-visibility/utils.d.ts +6 -6
- package/build-types/components/revision-block-diff/index.d.ts.map +1 -1
- package/build-types/components/revision-diff-panel/index.d.ts +14 -0
- package/build-types/components/revision-diff-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-fields-diff/index.d.ts +6 -0
- package/build-types/components/revision-fields-diff/index.d.ts.map +1 -0
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts +2 -0
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -0
- package/build-types/components/sidebar/post-summary.d.ts +3 -0
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/style-book/index.d.ts +2 -1
- package/build-types/components/style-book/index.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/index.d.ts +0 -14
- package/build-types/components/sync-connection-error-modal/index.d.ts.map +1 -1
- package/build-types/components/sync-connection-error-modal/use-retry-countdown.d.ts.map +1 -1
- package/build-types/components/template-actions-panel/block-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts +2 -0
- package/build-types/components/template-actions-panel/classic-theme-content.d.ts.map +1 -0
- package/build-types/components/template-actions-panel/index.d.ts +2 -0
- package/build-types/components/template-actions-panel/index.d.ts.map +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +10 -10
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/utils/pageTypeBadge.d.ts +1 -1
- package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
- package/package.json +45 -44
- package/src/components/autocompleters/index.js +1 -0
- package/src/components/autocompleters/link.js +47 -0
- package/src/components/autocompleters/style.scss +6 -0
- package/src/components/collaborators-overlay/cursor-dom-utils.ts +1 -1
- package/src/components/collaborators-overlay/cursor-registry.ts +96 -0
- package/src/components/collaborators-overlay/index.tsx +12 -4
- package/src/components/collaborators-overlay/overlay-iframe-styles.ts +1 -1
- package/src/components/collaborators-overlay/overlay.tsx +45 -1
- package/src/components/collaborators-overlay/timing-utils.ts +1 -1
- package/src/components/collaborators-overlay/use-render-cursors.ts +4 -2
- package/src/components/collaborators-presence/index.tsx +9 -1
- package/src/components/collaborators-presence/list.tsx +25 -1
- package/src/components/error-boundary/index.js +1 -1
- package/src/components/error-boundary/index.native.js +1 -1
- package/src/components/post-card-panel/index.js +7 -21
- package/src/components/post-content-information/index.js +5 -16
- package/src/components/post-revisions-panel/index.js +151 -0
- package/src/components/post-revisions-panel/style.scss +16 -0
- package/src/components/post-revisions-preview/revisions-slider.js +23 -19
- package/src/components/post-template/create-new-template-modal.js +1 -4
- package/src/components/post-template/hooks.js +65 -9
- package/src/components/post-template/style.scss +0 -6
- package/src/components/post-template/swap-template-button.js +30 -21
- package/src/components/post-title/index.js +3 -3
- package/src/components/preferences-modal/index.js +37 -25
- package/src/components/revision-block-diff/index.js +8 -43
- package/src/components/revision-diff-panel/index.js +59 -0
- package/src/components/revision-fields-diff/index.js +91 -0
- package/src/components/sidebar/dataform-post-summary.js +8 -55
- package/src/components/sidebar/index.js +33 -22
- package/src/components/sidebar/post-revision-summary.js +50 -0
- package/src/components/sidebar/post-summary.js +22 -40
- package/src/components/sidebar/style.scss +7 -0
- package/src/components/style-book/index.js +4 -2
- package/src/components/styles-canvas/revisions.js +2 -2
- package/src/components/sync-connection-error-modal/index.tsx +128 -155
- package/src/components/sync-connection-error-modal/use-retry-countdown.ts +46 -10
- package/src/components/template-actions-panel/block-theme-content.js +196 -0
- package/src/components/template-actions-panel/classic-theme-content.js +170 -0
- package/src/components/template-actions-panel/index.js +32 -0
- package/src/components/template-actions-panel/style.scss +39 -0
- package/src/dataviews/store/private-actions.ts +6 -0
- package/src/hooks/default-autocompleters.js +2 -2
- package/src/hooks/test/default-autocompleters.js +2 -2
- package/src/store/private-actions.js +18 -2
- package/src/store/private-selectors.js +43 -22
- package/src/store/reducer.js +9 -8
- package/src/style.scss +3 -1
- /package/src/components/{revision-block-diff → revision-diff-panel}/style.scss +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.43.1-next.v.202604091042.0+668146787",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,48 +61,49 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@floating-ui/react-dom": "2.0.8",
|
|
64
|
-
"@wordpress/a11y": "^4.
|
|
65
|
-
"@wordpress/api-fetch": "^7.
|
|
66
|
-
"@wordpress/base-styles": "^6.
|
|
67
|
-
"@wordpress/blob": "^4.
|
|
68
|
-
"@wordpress/block-editor": "^15.
|
|
69
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
70
|
-
"@wordpress/blocks": "^15.
|
|
71
|
-
"@wordpress/commands": "^1.
|
|
72
|
-
"@wordpress/components": "^32.
|
|
73
|
-
"@wordpress/compose": "^7.
|
|
74
|
-
"@wordpress/core-data": "^7.
|
|
75
|
-
"@wordpress/data": "^10.
|
|
76
|
-
"@wordpress/dataviews": "^
|
|
77
|
-
"@wordpress/date": "^5.
|
|
78
|
-
"@wordpress/deprecated": "^4.
|
|
79
|
-
"@wordpress/dom": "^4.
|
|
80
|
-
"@wordpress/element": "^6.
|
|
81
|
-
"@wordpress/fields": "^0.
|
|
82
|
-
"@wordpress/global-styles-engine": "^1.
|
|
83
|
-
"@wordpress/global-styles-ui": "^1.
|
|
84
|
-
"@wordpress/hooks": "^4.
|
|
85
|
-
"@wordpress/html-entities": "^4.
|
|
86
|
-
"@wordpress/i18n": "^6.
|
|
87
|
-
"@wordpress/icons": "^12.
|
|
88
|
-
"@wordpress/interface": "^9.
|
|
89
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
90
|
-
"@wordpress/keycodes": "^4.
|
|
91
|
-
"@wordpress/media-editor": "^0.
|
|
92
|
-
"@wordpress/media-fields": "^0.
|
|
93
|
-
"@wordpress/media-utils": "^5.
|
|
94
|
-
"@wordpress/notices": "^5.
|
|
95
|
-
"@wordpress/patterns": "^2.
|
|
96
|
-
"@wordpress/plugins": "^7.
|
|
97
|
-
"@wordpress/preferences": "^4.
|
|
98
|
-
"@wordpress/private-apis": "^1.
|
|
99
|
-
"@wordpress/reusable-blocks": "^5.
|
|
100
|
-
"@wordpress/rich-text": "^7.
|
|
101
|
-
"@wordpress/server-side-render": "^6.
|
|
102
|
-
"@wordpress/upload-media": "^0.
|
|
103
|
-
"@wordpress/url": "^4.
|
|
104
|
-
"@wordpress/
|
|
105
|
-
"@wordpress/
|
|
64
|
+
"@wordpress/a11y": "^4.43.1-next.v.202604091042.0+668146787",
|
|
65
|
+
"@wordpress/api-fetch": "^7.43.1-next.v.202604091042.0+668146787",
|
|
66
|
+
"@wordpress/base-styles": "^6.19.1-next.v.202604091042.0+668146787",
|
|
67
|
+
"@wordpress/blob": "^4.43.1-next.v.202604091042.0+668146787",
|
|
68
|
+
"@wordpress/block-editor": "^15.16.1-next.v.202604091042.0+668146787",
|
|
69
|
+
"@wordpress/block-serialization-default-parser": "^5.43.1-next.v.202604091042.0+668146787",
|
|
70
|
+
"@wordpress/blocks": "^15.16.1-next.v.202604091042.0+668146787",
|
|
71
|
+
"@wordpress/commands": "^1.43.1-next.v.202604091042.0+668146787",
|
|
72
|
+
"@wordpress/components": "^32.5.2-next.v.202604091042.0+668146787",
|
|
73
|
+
"@wordpress/compose": "^7.43.1-next.v.202604091042.0+668146787",
|
|
74
|
+
"@wordpress/core-data": "^7.43.2-next.v.202604091042.0+668146787",
|
|
75
|
+
"@wordpress/data": "^10.43.1-next.v.202604091042.0+668146787",
|
|
76
|
+
"@wordpress/dataviews": "^14.1.1-next.v.202604091042.0+668146787",
|
|
77
|
+
"@wordpress/date": "^5.43.1-next.v.202604091042.0+668146787",
|
|
78
|
+
"@wordpress/deprecated": "^4.43.1-next.v.202604091042.0+668146787",
|
|
79
|
+
"@wordpress/dom": "^4.43.1-next.v.202604091042.0+668146787",
|
|
80
|
+
"@wordpress/element": "^6.44.1-next.v.202604091042.0+668146787",
|
|
81
|
+
"@wordpress/fields": "^0.35.1-next.v.202604091042.0+668146787",
|
|
82
|
+
"@wordpress/global-styles-engine": "^1.10.1-next.v.202604091042.0+668146787",
|
|
83
|
+
"@wordpress/global-styles-ui": "^1.10.1-next.v.202604091042.0+668146787",
|
|
84
|
+
"@wordpress/hooks": "^4.43.1-next.v.202604091042.0+668146787",
|
|
85
|
+
"@wordpress/html-entities": "^4.43.1-next.v.202604091042.0+668146787",
|
|
86
|
+
"@wordpress/i18n": "^6.17.1-next.v.202604091042.0+668146787",
|
|
87
|
+
"@wordpress/icons": "^12.1.1-next.v.202604091042.0+668146787",
|
|
88
|
+
"@wordpress/interface": "^9.28.1-next.v.202604091042.0+668146787",
|
|
89
|
+
"@wordpress/keyboard-shortcuts": "^5.43.1-next.v.202604091042.0+668146787",
|
|
90
|
+
"@wordpress/keycodes": "^4.43.1-next.v.202604091042.0+668146787",
|
|
91
|
+
"@wordpress/media-editor": "^0.6.1-next.v.202604091042.0+668146787",
|
|
92
|
+
"@wordpress/media-fields": "^0.8.1-next.v.202604091042.0+668146787",
|
|
93
|
+
"@wordpress/media-utils": "^5.43.1-next.v.202604091042.0+668146787",
|
|
94
|
+
"@wordpress/notices": "^5.43.1-next.v.202604091042.0+668146787",
|
|
95
|
+
"@wordpress/patterns": "^2.43.1-next.v.202604091042.0+668146787",
|
|
96
|
+
"@wordpress/plugins": "^7.43.1-next.v.202604091042.0+668146787",
|
|
97
|
+
"@wordpress/preferences": "^4.43.1-next.v.202604091042.0+668146787",
|
|
98
|
+
"@wordpress/private-apis": "^1.43.1-next.v.202604091042.0+668146787",
|
|
99
|
+
"@wordpress/reusable-blocks": "^5.43.1-next.v.202604091042.0+668146787",
|
|
100
|
+
"@wordpress/rich-text": "^7.43.1-next.v.202604091042.0+668146787",
|
|
101
|
+
"@wordpress/server-side-render": "^6.19.1-next.v.202604091042.0+668146787",
|
|
102
|
+
"@wordpress/upload-media": "^0.28.1-next.v.202604091042.0+668146787",
|
|
103
|
+
"@wordpress/url": "^4.43.1-next.v.202604091042.0+668146787",
|
|
104
|
+
"@wordpress/views": "^1.10.1-next.v.202604091042.0+668146787",
|
|
105
|
+
"@wordpress/warning": "^3.43.1-next.v.202604091042.0+668146787",
|
|
106
|
+
"@wordpress/wordcount": "^4.43.1-next.v.202604091042.0+668146787",
|
|
106
107
|
"change-case": "^4.1.2",
|
|
107
108
|
"client-zip": "^2.4.5",
|
|
108
109
|
"clsx": "^2.1.1",
|
|
@@ -125,5 +126,5 @@
|
|
|
125
126
|
"publishConfig": {
|
|
126
127
|
"access": "public"
|
|
127
128
|
},
|
|
128
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "73606df74f1c38a084bfa5db97205259ef817593"
|
|
129
130
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import apiFetch from '@wordpress/api-fetch';
|
|
5
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
6
|
+
import { Icon, page, post } from '@wordpress/icons';
|
|
7
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
8
|
+
|
|
9
|
+
const SHOWN_SUGGESTIONS = 10;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A link completer for posts and pages.
|
|
13
|
+
*
|
|
14
|
+
* @type {Object}
|
|
15
|
+
*/
|
|
16
|
+
export default {
|
|
17
|
+
name: 'links',
|
|
18
|
+
className: 'editor-autocompleters__link',
|
|
19
|
+
triggerPrefix: '[[',
|
|
20
|
+
isDebounced: true,
|
|
21
|
+
async options( filterValue ) {
|
|
22
|
+
const options = await apiFetch( {
|
|
23
|
+
path: addQueryArgs( '/wp/v2/search', {
|
|
24
|
+
per_page: SHOWN_SUGGESTIONS,
|
|
25
|
+
search: filterValue,
|
|
26
|
+
type: 'post',
|
|
27
|
+
} ),
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
return options.filter( ( option ) => option.title !== '' );
|
|
31
|
+
},
|
|
32
|
+
getOptionKeywords( item ) {
|
|
33
|
+
const expansionWords = item.title.split( /\s+/ );
|
|
34
|
+
return [ ...expansionWords ];
|
|
35
|
+
},
|
|
36
|
+
getOptionLabel( item ) {
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<Icon icon={ item.subtype === 'page' ? page : post } />
|
|
40
|
+
{ decodeEntities( item.title ) }
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
getOptionCompletion( item ) {
|
|
45
|
+
return <a href={ item.url }>{ item.title }</a>;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
interface ScrollToCursorOptions {
|
|
2
|
+
behavior?: ScrollBehavior;
|
|
3
|
+
block?: ScrollLogicalPosition;
|
|
4
|
+
inline?: ScrollLogicalPosition;
|
|
5
|
+
highlightDuration?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Cursor Registry
|
|
10
|
+
* ===
|
|
11
|
+
* This registry stores references to cursor elements so that we can access them
|
|
12
|
+
* in different parts of the component tree. This would more ideally be solved
|
|
13
|
+
* with React context or state in the awareness store, but:
|
|
14
|
+
*
|
|
15
|
+
* 1. EditorPresence and BlockCanvasCover slot/fill break context propagation. We
|
|
16
|
+
* don't currently have a way to provide context to both the slot and fill.
|
|
17
|
+
* 2. Storing pointers to the cursor elements in the awareness store might be a
|
|
18
|
+
* better solution, but would require broader refactoring.
|
|
19
|
+
*
|
|
20
|
+
* For now, we create a single instance of this registry and pass it down to the
|
|
21
|
+
* components that need it. It's important that we create a single instance and
|
|
22
|
+
* not a new instance per component or render; use useState with a lazy
|
|
23
|
+
* initializer to accomplish this.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
function highlightCursor( element: HTMLElement, duration: number ): void {
|
|
27
|
+
element.classList.add( 'collaborators-overlay-cursor-highlighted' );
|
|
28
|
+
|
|
29
|
+
setTimeout( () => {
|
|
30
|
+
element.classList.remove( 'collaborators-overlay-cursor-highlighted' );
|
|
31
|
+
}, duration );
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function createCursorRegistry() {
|
|
35
|
+
const cursorMap = new Map< number, HTMLElement >();
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
/**
|
|
39
|
+
* Register a cursor element when it's created.
|
|
40
|
+
*
|
|
41
|
+
* @param clientId - The clientId of the cursor to register.
|
|
42
|
+
* @param element - The cursor element to register.
|
|
43
|
+
*/
|
|
44
|
+
registerCursor( clientId: number, element: HTMLElement ): void {
|
|
45
|
+
cursorMap.set( clientId, element );
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Unregister a cursor element when it's removed.
|
|
50
|
+
*
|
|
51
|
+
* @param clientId - The clientId of the cursor to unregister.
|
|
52
|
+
*/
|
|
53
|
+
unregisterCursor( clientId: number ): void {
|
|
54
|
+
cursorMap.delete( clientId );
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Scroll to a cursor by clientId.
|
|
59
|
+
*
|
|
60
|
+
* @param clientId - The clientId of the cursor to scroll to.
|
|
61
|
+
* @param options - The options for the scroll.
|
|
62
|
+
* @return true if cursor was found and scrolled to, false otherwise.
|
|
63
|
+
*/
|
|
64
|
+
scrollToCursor(
|
|
65
|
+
clientId: number,
|
|
66
|
+
options?: ScrollToCursorOptions
|
|
67
|
+
): boolean {
|
|
68
|
+
const cursorElement = cursorMap.get( clientId );
|
|
69
|
+
|
|
70
|
+
if ( ! cursorElement ) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
cursorElement.scrollIntoView( {
|
|
75
|
+
behavior: options?.behavior ?? 'smooth',
|
|
76
|
+
block: options?.block ?? 'center',
|
|
77
|
+
inline: options?.inline ?? 'nearest',
|
|
78
|
+
} );
|
|
79
|
+
|
|
80
|
+
if ( options?.highlightDuration ) {
|
|
81
|
+
highlightCursor( cursorElement, options.highlightDuration );
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return true;
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Clear the registry.
|
|
89
|
+
*/
|
|
90
|
+
removeAll(): void {
|
|
91
|
+
cursorMap.clear();
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type CursorRegistry = ReturnType< typeof createCursorRegistry >;
|
|
@@ -9,22 +9,29 @@ import { privateApis } from '@wordpress/block-editor';
|
|
|
9
9
|
*/
|
|
10
10
|
import { unlock } from '../../lock-unlock';
|
|
11
11
|
import { Overlay } from './overlay';
|
|
12
|
+
import { type CursorRegistry } from './cursor-registry';
|
|
12
13
|
|
|
13
14
|
const { BlockCanvasCover } = unlock( privateApis );
|
|
14
15
|
|
|
15
16
|
interface Props {
|
|
16
17
|
postId: number | null;
|
|
17
18
|
postType: string | null;
|
|
19
|
+
cursorRegistry?: CursorRegistry;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Collaborators Overlay component
|
|
22
|
-
* @param props
|
|
23
|
-
* @param props.postId
|
|
24
|
-
* @param props.postType
|
|
24
|
+
* @param props - The props for the CollaboratorsOverlay component
|
|
25
|
+
* @param props.postId - The ID of the post
|
|
26
|
+
* @param props.postType - The type of the post
|
|
27
|
+
* @param props.cursorRegistry - The shared cursor registry
|
|
25
28
|
* @return The CollaboratorsOverlay component
|
|
26
29
|
*/
|
|
27
|
-
export function CollaboratorsOverlay( {
|
|
30
|
+
export function CollaboratorsOverlay( {
|
|
31
|
+
postId,
|
|
32
|
+
postType,
|
|
33
|
+
cursorRegistry,
|
|
34
|
+
}: Props ) {
|
|
28
35
|
return (
|
|
29
36
|
<BlockCanvasCover.Fill>
|
|
30
37
|
{ ( {
|
|
@@ -36,6 +43,7 @@ export function CollaboratorsOverlay( { postId, postType }: Props ) {
|
|
|
36
43
|
blockEditorDocument={ containerRef.current?.ownerDocument }
|
|
37
44
|
postId={ postId }
|
|
38
45
|
postType={ postType }
|
|
46
|
+
cursorRegistry={ cursorRegistry }
|
|
39
47
|
/>
|
|
40
48
|
) }
|
|
41
49
|
</BlockCanvasCover.Fill>
|
|
@@ -119,7 +119,7 @@ export const OVERLAY_IFRAME_STYLES = `
|
|
|
119
119
|
outline-style: solid;
|
|
120
120
|
outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
121
121
|
outline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
|
|
122
|
-
box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus
|
|
122
|
+
box-shadow: inset 0 0 0 calc((var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1)) + 0.5px) rgba(${ WHITE }, 0.7);
|
|
123
123
|
z-index: 1;
|
|
124
124
|
}
|
|
125
125
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useResizeObserver, useMergeRefs } from '@wordpress/compose';
|
|
2
|
-
import { useCallback, useEffect, useState } from '@wordpress/element';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from '@wordpress/element';
|
|
3
3
|
import { __ } from '@wordpress/i18n';
|
|
4
4
|
|
|
5
5
|
import Avatar from '../collaborators-presence/avatar';
|
|
@@ -8,6 +8,7 @@ import { OVERLAY_IFRAME_STYLES } from './overlay-iframe-styles';
|
|
|
8
8
|
import { setDelayedInterval } from './timing-utils';
|
|
9
9
|
import { useBlockHighlighting } from './use-block-highlighting';
|
|
10
10
|
import { useRenderCursors } from './use-render-cursors';
|
|
11
|
+
import { type CursorRegistry } from './cursor-registry';
|
|
11
12
|
|
|
12
13
|
// Milliseconds to wait after a change before recomputing cursor positions.
|
|
13
14
|
const RERENDER_DELAY_MS = 500;
|
|
@@ -22,6 +23,7 @@ interface OverlayProps {
|
|
|
22
23
|
blockEditorDocument?: Document;
|
|
23
24
|
postId: number | null;
|
|
24
25
|
postType: string | null;
|
|
26
|
+
cursorRegistry?: CursorRegistry;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
@@ -31,12 +33,14 @@ interface OverlayProps {
|
|
|
31
33
|
* @param props.blockEditorDocument - The block editor document.
|
|
32
34
|
* @param props.postId - The ID of the post.
|
|
33
35
|
* @param props.postType - The type of the post.
|
|
36
|
+
* @param props.cursorRegistry - The shared cursor registry.
|
|
34
37
|
* @return The Overlay component.
|
|
35
38
|
*/
|
|
36
39
|
export function Overlay( {
|
|
37
40
|
blockEditorDocument,
|
|
38
41
|
postId,
|
|
39
42
|
postType,
|
|
43
|
+
cursorRegistry,
|
|
40
44
|
}: OverlayProps ) {
|
|
41
45
|
// Use state for the overlay element so that the hook re-runs once the ref is attached.
|
|
42
46
|
const [ overlayElement, setOverlayElement ] =
|
|
@@ -93,6 +97,45 @@ export function Overlay( {
|
|
|
93
97
|
resizeObserverRef,
|
|
94
98
|
] );
|
|
95
99
|
|
|
100
|
+
// Track cursor element refs for registry registration.
|
|
101
|
+
const cursorRefsMap = useRef< Map< number, HTMLElement > >( new Map() );
|
|
102
|
+
|
|
103
|
+
// Keep the registry in sync whenever the rendered cursors change.
|
|
104
|
+
useEffect( () => {
|
|
105
|
+
if ( ! cursorRegistry ) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const refs = cursorRefsMap.current;
|
|
109
|
+
const currentIds = new Set( cursors.map( ( c ) => c.clientId ) );
|
|
110
|
+
|
|
111
|
+
// Unregister cursors that are no longer rendered.
|
|
112
|
+
for ( const id of refs.keys() ) {
|
|
113
|
+
if ( ! currentIds.has( id ) ) {
|
|
114
|
+
cursorRegistry.unregisterCursor( id );
|
|
115
|
+
refs.delete( id );
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Register or update cursors that are currently rendered.
|
|
120
|
+
for ( const [ id, el ] of refs.entries() ) {
|
|
121
|
+
cursorRegistry.registerCursor( id, el );
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return () => cursorRegistry.removeAll();
|
|
125
|
+
}, [ cursors, cursorRegistry ] );
|
|
126
|
+
|
|
127
|
+
// Callback ref factory to capture each cursor's DOM element.
|
|
128
|
+
const setCursorRef = useCallback(
|
|
129
|
+
( clientId: number ) => ( el: HTMLDivElement | null ) => {
|
|
130
|
+
if ( el ) {
|
|
131
|
+
cursorRefsMap.current.set( clientId, el );
|
|
132
|
+
} else {
|
|
133
|
+
cursorRefsMap.current.delete( clientId );
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
[]
|
|
137
|
+
);
|
|
138
|
+
|
|
96
139
|
// This is a full overlay that covers the entire iframe document. Good for
|
|
97
140
|
// scrollable elements like cursor indicators.
|
|
98
141
|
return (
|
|
@@ -115,6 +158,7 @@ export function Overlay( {
|
|
|
115
158
|
/>
|
|
116
159
|
) ) }
|
|
117
160
|
<div
|
|
161
|
+
ref={ setCursorRef( cursor.clientId ) }
|
|
118
162
|
className="collaborators-overlay-user"
|
|
119
163
|
style={ {
|
|
120
164
|
left: `${ cursor.x }px`,
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
privateApis as coreDataPrivateApis,
|
|
3
3
|
SelectionType,
|
|
4
|
-
|
|
4
|
+
} from '@wordpress/core-data';
|
|
5
|
+
import type {
|
|
6
|
+
ResolvedSelection,
|
|
7
|
+
PostEditorAwarenessState as ActiveCollaborator,
|
|
5
8
|
} from '@wordpress/core-data';
|
|
6
9
|
import { useSelect } from '@wordpress/data';
|
|
7
10
|
import { useEffect, useState } from '@wordpress/element';
|
|
8
11
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
-
import type { ResolvedSelection } from '@wordpress/core-data';
|
|
10
12
|
|
|
11
13
|
import { unlock } from '../../lock-unlock';
|
|
12
14
|
import { getAvatarUrl } from './get-avatar-url';
|
|
@@ -12,6 +12,7 @@ import { CollaboratorsList } from './list';
|
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
14
14
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
15
|
+
import { createCursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
15
16
|
|
|
16
17
|
import './styles/collaborators-presence.scss';
|
|
17
18
|
import { CollaboratorsOverlay } from '../collaborators-overlay';
|
|
@@ -57,6 +58,8 @@ export function CollaboratorsPresence( {
|
|
|
57
58
|
} );
|
|
58
59
|
}, [ activeCollaborators ] );
|
|
59
60
|
|
|
61
|
+
const [ cursorRegistry ] = useState( createCursorRegistry );
|
|
62
|
+
|
|
60
63
|
const [ isPopoverVisible, setIsPopoverVisible ] = useState( false );
|
|
61
64
|
const [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(
|
|
62
65
|
null
|
|
@@ -123,10 +126,15 @@ export function CollaboratorsPresence( {
|
|
|
123
126
|
activeCollaborators={ collaboratorsForList }
|
|
124
127
|
popoverAnchor={ popoverAnchor }
|
|
125
128
|
setIsPopoverVisible={ setIsPopoverVisible }
|
|
129
|
+
cursorRegistry={ cursorRegistry }
|
|
126
130
|
/>
|
|
127
131
|
) }
|
|
128
132
|
</div>
|
|
129
|
-
<CollaboratorsOverlay
|
|
133
|
+
<CollaboratorsOverlay
|
|
134
|
+
postId={ postId }
|
|
135
|
+
postType={ postType }
|
|
136
|
+
cursorRegistry={ cursorRegistry }
|
|
137
|
+
/>
|
|
130
138
|
</>
|
|
131
139
|
);
|
|
132
140
|
}
|
|
@@ -2,10 +2,12 @@ import { __ } from '@wordpress/i18n';
|
|
|
2
2
|
import { Popover, Button } from '@wordpress/components';
|
|
3
3
|
import { closeSmall } from '@wordpress/icons';
|
|
4
4
|
import { type PostEditorAwarenessState } from '@wordpress/core-data';
|
|
5
|
+
import { speak } from '@wordpress/a11y';
|
|
5
6
|
|
|
6
7
|
import Avatar from './avatar';
|
|
7
8
|
import { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';
|
|
8
9
|
import { getAvatarBorderColor } from '../collab-sidebar/utils';
|
|
10
|
+
import { type CursorRegistry } from '../collaborators-overlay/cursor-registry';
|
|
9
11
|
|
|
10
12
|
import './styles/collaborators-list.scss';
|
|
11
13
|
|
|
@@ -13,6 +15,7 @@ interface CollaboratorsListProps {
|
|
|
13
15
|
activeCollaborators: PostEditorAwarenessState[];
|
|
14
16
|
popoverAnchor?: HTMLElement | null;
|
|
15
17
|
setIsPopoverVisible: ( isVisible: boolean ) => void;
|
|
18
|
+
cursorRegistry: CursorRegistry;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
/**
|
|
@@ -23,12 +26,28 @@ interface CollaboratorsListProps {
|
|
|
23
26
|
* @param props.activeCollaborators List of active collaborators
|
|
24
27
|
* @param props.popoverAnchor Anchor element for the popover
|
|
25
28
|
* @param props.setIsPopoverVisible Callback to set the visibility of the popover
|
|
29
|
+
* @param props.cursorRegistry Shared registry for scroll-to-cursor support
|
|
26
30
|
*/
|
|
27
31
|
export function CollaboratorsList( {
|
|
28
32
|
activeCollaborators,
|
|
29
33
|
popoverAnchor,
|
|
30
34
|
setIsPopoverVisible,
|
|
35
|
+
cursorRegistry,
|
|
31
36
|
}: CollaboratorsListProps ) {
|
|
37
|
+
const handleCollaboratorClick = ( clientId: number ) => {
|
|
38
|
+
const success = cursorRegistry.scrollToCursor( clientId, {
|
|
39
|
+
behavior: 'smooth',
|
|
40
|
+
block: 'center',
|
|
41
|
+
highlightDuration: 2000,
|
|
42
|
+
} );
|
|
43
|
+
|
|
44
|
+
if ( success ) {
|
|
45
|
+
speak( __( 'Scrolled to cursor' ), 'polite' );
|
|
46
|
+
|
|
47
|
+
setIsPopoverVisible( false );
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
32
51
|
return (
|
|
33
52
|
<Popover
|
|
34
53
|
anchor={ popoverAnchor }
|
|
@@ -60,7 +79,12 @@ export function CollaboratorsList( {
|
|
|
60
79
|
<button
|
|
61
80
|
key={ collaboratorState.clientId }
|
|
62
81
|
className="editor-collaborators-presence__list-item"
|
|
63
|
-
disabled
|
|
82
|
+
disabled={ isCurrentUser }
|
|
83
|
+
onClick={ () =>
|
|
84
|
+
handleCollaboratorClick(
|
|
85
|
+
collaboratorState.clientId
|
|
86
|
+
)
|
|
87
|
+
}
|
|
64
88
|
>
|
|
65
89
|
<Avatar
|
|
66
90
|
src={ getAvatarUrl(
|
|
@@ -26,7 +26,7 @@ function getContent() {
|
|
|
26
26
|
// content serialization throughout the lifetime of a non-erroring
|
|
27
27
|
// application.
|
|
28
28
|
return select( editorStore ).getEditedPostContent();
|
|
29
|
-
} catch
|
|
29
|
+
} catch {}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
function CopyButton( { text, children, variant = 'secondary' } ) {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
__experimentalText as Text,
|
|
10
10
|
privateApis as componentsPrivateApis,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
|
-
import {
|
|
12
|
+
import { close } from '@wordpress/icons';
|
|
13
13
|
import { store as coreStore } from '@wordpress/core-data';
|
|
14
14
|
import { useSelect } from '@wordpress/data';
|
|
15
15
|
import { useMemo } from '@wordpress/element';
|
|
@@ -52,7 +52,7 @@ export default function PostCardPanel( {
|
|
|
52
52
|
() => ( Array.isArray( postId ) ? postId : [ postId ] ),
|
|
53
53
|
[ postId ]
|
|
54
54
|
);
|
|
55
|
-
const { postTitle, icon, labels
|
|
55
|
+
const { postTitle, icon, labels } = useSelect(
|
|
56
56
|
( select ) => {
|
|
57
57
|
const { getEditedEntityRecord, getCurrentTheme, getPostType } =
|
|
58
58
|
select( coreStore );
|
|
@@ -75,7 +75,6 @@ export default function PostCardPanel( {
|
|
|
75
75
|
area: _record?.area,
|
|
76
76
|
} ),
|
|
77
77
|
labels: getPostType( parentPostType )?.labels,
|
|
78
|
-
isRevision: true,
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
80
|
|
|
@@ -146,24 +145,11 @@ export default function PostCardPanel( {
|
|
|
146
145
|
) }
|
|
147
146
|
</Text>
|
|
148
147
|
{ ! hideActions && postIds.length === 1 && (
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
label={ __( 'Actions' ) }
|
|
155
|
-
disabled
|
|
156
|
-
accessibleWhenDisabled
|
|
157
|
-
className="editor-all-actions-button"
|
|
158
|
-
/>
|
|
159
|
-
) : (
|
|
160
|
-
<PostActions
|
|
161
|
-
postType={ postType }
|
|
162
|
-
postId={ postIds[ 0 ] }
|
|
163
|
-
onActionPerformed={ onActionPerformed }
|
|
164
|
-
/>
|
|
165
|
-
) }
|
|
166
|
-
</>
|
|
148
|
+
<PostActions
|
|
149
|
+
postType={ postType }
|
|
150
|
+
postId={ postIds[ 0 ] }
|
|
151
|
+
onActionPerformed={ onActionPerformed }
|
|
152
|
+
/>
|
|
167
153
|
) }
|
|
168
154
|
{ onClose && (
|
|
169
155
|
<Button
|
|
@@ -12,7 +12,6 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import { store as editorStore } from '../../store';
|
|
15
|
-
import { unlock } from '../../lock-unlock';
|
|
16
15
|
import {
|
|
17
16
|
TEMPLATE_POST_TYPE,
|
|
18
17
|
TEMPLATE_PART_POST_TYPE,
|
|
@@ -23,19 +22,9 @@ const AVERAGE_READING_RATE = 189;
|
|
|
23
22
|
|
|
24
23
|
// This component renders the wordcount and reading time for the post.
|
|
25
24
|
export default function PostContentInformation() {
|
|
26
|
-
const
|
|
25
|
+
const postContent = useSelect( ( select ) => {
|
|
27
26
|
const { getEditedPostAttribute, getCurrentPostType, getCurrentPostId } =
|
|
28
27
|
select( editorStore );
|
|
29
|
-
const { getCurrentRevision, isRevisionsMode } = unlock(
|
|
30
|
-
select( editorStore )
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
if ( isRevisionsMode() ) {
|
|
34
|
-
return {
|
|
35
|
-
postContent: getCurrentRevision()?.content?.raw,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
28
|
const { canUser } = select( coreStore );
|
|
40
29
|
const { getEntityRecord } = select( coreStore );
|
|
41
30
|
const siteSettings = canUser( 'read', {
|
|
@@ -52,12 +41,12 @@ export default function PostContentInformation() {
|
|
|
52
41
|
! [ TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE ].includes(
|
|
53
42
|
postType
|
|
54
43
|
);
|
|
55
|
-
return
|
|
56
|
-
postContent:
|
|
57
|
-
showPostContentInfo && getEditedPostAttribute( 'content' ),
|
|
58
|
-
};
|
|
44
|
+
return showPostContentInfo && getEditedPostAttribute( 'content' );
|
|
59
45
|
}, [] );
|
|
46
|
+
return <PostContentInformationUI postContent={ postContent } />;
|
|
47
|
+
}
|
|
60
48
|
|
|
49
|
+
export function PostContentInformationUI( { postContent } ) {
|
|
61
50
|
/*
|
|
62
51
|
* translators: If your word count is based on single characters (e.g. East Asian characters),
|
|
63
52
|
* enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
|