@wordpress/editor 14.43.0 → 14.44.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/collab-sidebar/index.cjs.map +2 -2
- 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/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/error-boundary/index.cjs +1 -1
- package/build/components/error-boundary/index.cjs.map +2 -2
- package/build/components/post-revisions-panel/index.cjs +44 -42
- package/build/components/post-revisions-panel/index.cjs.map +2 -2
- package/build/components/post-revisions-preview/revisions-slider.cjs +9 -17
- package/build/components/post-revisions-preview/revisions-slider.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/sidebar/index.cjs +7 -1
- package/build/components/sidebar/index.cjs.map +2 -2
- package/build/components/sidebar/post-revision-summary.cjs +11 -2
- package/build/components/sidebar/post-revision-summary.cjs.map +2 -2
- package/build/components/sidebar/post-summary.cjs +0 -18
- package/build/components/sidebar/post-summary.cjs.map +2 -2
- package/build/components/style-book/categories.cjs.map +2 -2
- package/build/components/style-book/examples.cjs +1 -1
- package/build/components/style-book/examples.cjs.map +2 -2
- package/build/components/style-book/types.cjs.map +1 -1
- 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 +66 -74
- 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/hooks/default-autocompleters.cjs +1 -1
- package/build/hooks/default-autocompleters.cjs.map +2 -2
- package/build/store/private-actions.cjs +1 -6
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +4 -6
- 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/collab-sidebar/index.mjs.map +2 -2
- 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/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/error-boundary/index.mjs +1 -1
- package/build-module/components/error-boundary/index.mjs.map +2 -2
- package/build-module/components/post-revisions-panel/index.mjs +44 -42
- package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +9 -17
- package/build-module/components/post-revisions-preview/revisions-slider.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/sidebar/index.mjs +7 -1
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-revision-summary.mjs +15 -3
- package/build-module/components/sidebar/post-revision-summary.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +1 -18
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/style-book/categories.mjs.map +2 -2
- package/build-module/components/style-book/examples.mjs +1 -1
- package/build-module/components/style-book/examples.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 +66 -75
- 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/hooks/default-autocompleters.mjs +2 -2
- package/build-module/hooks/default-autocompleters.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +1 -6
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +4 -6
- 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 +40 -30
- package/build-style/style.css +40 -30
- 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/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collaborators-overlay/use-render-cursors.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-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.map +1 -1
- 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-visibility/utils.d.ts +6 -6
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-revision-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts +0 -3
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/style-book/categories.d.ts.map +1 -1
- package/build-types/components/style-book/examples.d.ts.map +1 -1
- package/build-types/components/style-book/types.d.ts +1 -13
- package/build-types/components/style-book/types.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/hooks/custom-sources-backwards-compatibility.d.ts +1 -1
- package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -1
- package/build-types/hooks/pattern-overrides.d.ts +1 -1
- package/build-types/hooks/pattern-overrides.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 -45
- 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/collab-sidebar/index.js +1 -0
- package/src/components/collaborators-overlay/cursor-dom-utils.ts +1 -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/error-boundary/index.js +1 -1
- package/src/components/error-boundary/index.native.js +1 -1
- package/src/components/post-revisions-panel/index.js +46 -44
- package/src/components/post-revisions-preview/revisions-slider.js +9 -27
- package/src/components/post-title/index.js +3 -3
- package/src/components/sidebar/index.js +7 -1
- package/src/components/sidebar/post-revision-summary.js +13 -3
- package/src/components/sidebar/post-summary.js +1 -18
- package/src/components/style-book/categories.ts +0 -1
- package/src/components/style-book/examples.tsx +6 -12
- package/src/components/style-book/types.ts +1 -18
- package/src/components/styles-canvas/revisions.js +2 -2
- package/src/components/sync-connection-error-modal/index.tsx +151 -163
- package/src/components/sync-connection-error-modal/use-retry-countdown.ts +46 -10
- package/src/hooks/default-autocompleters.js +2 -2
- package/src/hooks/test/default-autocompleters.js +2 -2
- package/src/store/private-actions.js +1 -6
- package/src/store/private-selectors.js +4 -13
- package/src/store/reducer.js +9 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/examples.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"examples.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/examples.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAe,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAyL9E;;;;;GAKG;AACH,wBAAgB,WAAW,CAAE,MAAM,EAAE,mBAAmB,GAAI,YAAY,EAAE,CA4DzE"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
name: string;
|
|
3
|
-
attributes: Record<string, unknown>;
|
|
4
|
-
innerBlocks?: Block[];
|
|
5
|
-
};
|
|
1
|
+
import type { Block } from '@wordpress/blocks';
|
|
6
2
|
export type StyleBookCategory = {
|
|
7
3
|
title: string;
|
|
8
4
|
slug: string;
|
|
@@ -61,12 +57,4 @@ export type MultiOriginPalettes = {
|
|
|
61
57
|
duotones: Omit<ColorOrigin, 'colors' | 'gradients'>;
|
|
62
58
|
gradients: Omit<ColorOrigin, 'colors' | 'duotones'>;
|
|
63
59
|
};
|
|
64
|
-
export type BlockType = {
|
|
65
|
-
name: string;
|
|
66
|
-
title: string;
|
|
67
|
-
category: string;
|
|
68
|
-
example: BlockType;
|
|
69
|
-
attributes: Record<string, unknown>;
|
|
70
|
-
supports: Record<string, unknown>;
|
|
71
|
-
};
|
|
72
60
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/style-book/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACxC,MAAM,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,IAAI,EAAE,mBAAmB,CAAE,MAAM,CAAE,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,IAAI,CAAE,WAAW,EAAE,WAAW,GAAG,UAAU,CAAE,CAAC;IACtD,QAAQ,EAAE,IAAI,CAAE,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAE,CAAC;IACtD,SAAS,EAAE,IAAI,CAAE,WAAW,EAAE,QAAQ,GAAG,UAAU,CAAE,CAAC;CACtD,CAAC"}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import { type ConnectionError } from '@wordpress/core-data';
|
|
2
|
-
export interface SyncConnectionErrorModalProps {
|
|
3
|
-
description: string;
|
|
4
|
-
error?: ConnectionError;
|
|
5
|
-
manualRetry?: () => void;
|
|
6
|
-
postType?: {
|
|
7
|
-
slug?: string;
|
|
8
|
-
labels?: {
|
|
9
|
-
name?: string;
|
|
10
|
-
};
|
|
11
|
-
} | null;
|
|
12
|
-
secondsRemainingUntilAutoRetry?: number;
|
|
13
|
-
title: string;
|
|
14
|
-
}
|
|
15
1
|
/**
|
|
16
2
|
* Sync connection modal that displays when any entity reports a disconnection.
|
|
17
3
|
* Uses BlockCanvasCover.Fill to render in the block canvas.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/index.tsx"],"names":[],"mappings":"AAsCA;;;;;GAKG;AACH,wBAAgB,wBAAwB,uCAgNvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-retry-countdown.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/use-retry-countdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,UAAU,uBAAuB;IAChC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAChC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,GACxC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"use-retry-countdown.d.ts","sourceRoot":"","sources":["../../../src/components/sync-connection-error-modal/use-retry-countdown.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,UAAU,uBAAuB;IAChC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,iBAAiB,CAChC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,GACxC,uBAAuB,CA+EzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type WPHigherOrderComponent = import("@wordpress/compose").WPHigherOrderComponent;
|
|
2
|
-
export type WPBlockSettings =
|
|
2
|
+
export type WPBlockSettings = import("@wordpress/blocks").WPBlockSettings;
|
|
3
3
|
/**
|
|
4
4
|
* Object whose keys are the names of block attributes, where each value
|
|
5
5
|
* represents the meta key to which the block attribute is intended to save.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-sources-backwards-compatibility.d.ts","sourceRoot":"","sources":["../../src/hooks/custom-sources-backwards-compatibility.js"],"names":[],"mappings":"qCAcc,OAAO,oBAAoB,EAAE,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"custom-sources-backwards-compatibility.d.ts","sourceRoot":"","sources":["../../src/hooks/custom-sources-backwards-compatibility.js"],"names":[],"mappings":"qCAcc,OAAO,oBAAoB,EAAE,sBAAsB;8BACnD,OAAO,mBAAmB,EAAE,eAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type WPBlockSettings =
|
|
1
|
+
export type WPBlockSettings = import("@wordpress/blocks").WPBlockSettings;
|
|
2
2
|
//# sourceMappingURL=pattern-overrides.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern-overrides.d.ts","sourceRoot":"","sources":["../../src/hooks/pattern-overrides.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"pattern-overrides.d.ts","sourceRoot":"","sources":["../../src/hooks/pattern-overrides.js"],"names":[],"mappings":"8BAmBc,OAAO,mBAAmB,EAAE,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../src/store/private-actions.js"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,yCAJW,MAAM,GAEL,MAAM,CAOjB;AA4fD;;;;;GAKG;AACH,oCAHW,MAAM,GACL,MAAM,CAOjB;AAED;;;;;GAKG;AACH,uCAHW,OAAO,GACN,MAAM,CAOjB;AAED;;;;GAIG;AACH,yCAFY,MAAM,CAMjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,MAAM,CAOjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GAAC,IAAI,GACV,MAAM,CAOjB;AAED;;;;;GAKG;AACH,8CAHW,OAAO,GACN,MAAM,CAOjB;
|
|
1
|
+
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../src/store/private-actions.js"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,yCAJW,MAAM,GAEL,MAAM,CAOjB;AA4fD;;;;;GAKG;AACH,oCAHW,MAAM,GACL,MAAM,CAOjB;AAED;;;;;GAKG;AACH,uCAHW,OAAO,GACN,MAAM,CAOjB;AAED;;;;GAIG;AACH,yCAFY,MAAM,CAMjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,MAAM,CAOjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GAAC,IAAI,GACV,MAAM,CAOjB;AAED;;;;;GAKG;AACH,8CAHW,OAAO,GACN,MAAM,CAOjB;AAoFD;;;;;;;GAOG;AACH,mCALW,SAAS,GAAC,MAAM,GAAC,KAAK,YAE9B;IAAyC,KAAK;CAC9C,GAAS,MAAM,CAQjB;;AAlqBM,yCAFK,MAAM,OAAA,IAIT;;;;CAA8B,kBAiCrC;AAOK,2CAFI,MAAM,EAAE,IAIhB;;CAAY,UAgBb;AAOK,2CAFI,MAAM,EAAE,IAIhB;;CAAY,UAcb;AAYK,iHANJ;IAA2B,MAAM;IACN,kBAAkB;IAClB,cAAc;IACd,KAAK;IACL,oBAAoB;CACjD,IASE;;CAAY,UAoGb;AAUK,yCALI,MAAM,kBAEd;IAA0B,SAAS;CAErC,IAGQ;;CAAY,mBA0HnB;AAOK,gDAEE;;CAAY,mBAwHnB;AAOK,8CAFI,MAAM,IAId;;;CAAoB,UAwBrB;AAqFK,4CAFI,MAAM,IAIR;;;;CAA8B,mBAwErC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../src/store/private-selectors.js"],"names":[],"mappings":"AAwHA,sDAEC;AACD,6DAEC;AAsFD,2GAEC;AAED,mEAEC;AAED,yGAEC;AAiGD;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,6CAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,4CAHW,MAAM,GACL,MAAM,GAAC,IAAI,CAItB;AA2DD;;;;;;GAMG;AACH,uCAJW,MAAM,GAEL,SAAS,GAAC,MAAM,GAAC,KAAK,CAIjC;AAED;;;;;;GAMG;AACH,qCAJW,MAAM,GAEL,OAAO,CAIlB;AA7ZD;;;;;;GAMG;AACH;;;;EAqEE;AAeF;;;;EAqCE;AAEF;;;;;;;;;GASG;AACH;;;;EA2BE;AAcF;;;;;;;;GAQG;AACH;;;;EAiCE;AAEF;;;;;;;GAOG;AACH;;;;EAyCE;AA8DF;;;;;GAKG;AACH;;;;EAiDE;AAwBF;;;;;;GAMG;AACH;;;;
|
|
1
|
+
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../../src/store/private-selectors.js"],"names":[],"mappings":"AAwHA,sDAEC;AACD,6DAEC;AAsFD,2GAEC;AAED,mEAEC;AAED,yGAEC;AAiGD;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,wCAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,6CAHW,MAAM,GACL,OAAO,CAIlB;AAED;;;;;GAKG;AACH,4CAHW,MAAM,GACL,MAAM,GAAC,IAAI,CAItB;AA2DD;;;;;;GAMG;AACH,uCAJW,MAAM,GAEL,SAAS,GAAC,MAAM,GAAC,KAAK,CAIjC;AAED;;;;;;GAMG;AACH,qCAJW,MAAM,GAEL,OAAO,CAIlB;AA7ZD;;;;;;GAMG;AACH;;;;EAqEE;AAeF;;;;EAqCE;AAEF;;;;;;;;;GASG;AACH;;;;EA2BE;AAcF;;;;;;;;GAQG;AACH;;;;EAiCE;AAEF;;;;;;;GAOG;AACH;;;;EAyCE;AA8DF;;;;;GAKG;AACH;;;;EAiDE;AAwBF;;;;;;GAMG;AACH;;;;EAqDE"}
|
|
@@ -209,13 +209,6 @@ export function canvasMinHeight(state: number | undefined, action: Object): numb
|
|
|
209
209
|
* @return {number|null} Updated state.
|
|
210
210
|
*/
|
|
211
211
|
export function revisionId(state: number | null | undefined, action: Object): number | null;
|
|
212
|
-
/**
|
|
213
|
-
* Reducer returning the currently selected note and its options.
|
|
214
|
-
*
|
|
215
|
-
* @param {Object} state Current state.
|
|
216
|
-
* @param {Object} action Dispatched action.
|
|
217
|
-
* @return {Object} Updated state.
|
|
218
|
-
*/
|
|
219
212
|
/**
|
|
220
213
|
* Reducer for whether the revision diff is shown.
|
|
221
214
|
* Resets to true when entering/exiting revisions mode.
|
|
@@ -225,7 +218,14 @@ export function revisionId(state: number | null | undefined, action: Object): nu
|
|
|
225
218
|
* @return {boolean} Updated state.
|
|
226
219
|
*/
|
|
227
220
|
export function showRevisionDiff(state: boolean | undefined, action: Object): boolean;
|
|
228
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Reducer returning the currently selected note and its options.
|
|
223
|
+
*
|
|
224
|
+
* @param {Object} state Current state.
|
|
225
|
+
* @param {Object} action Dispatched action.
|
|
226
|
+
* @return {Object} Updated state.
|
|
227
|
+
*/
|
|
228
|
+
export function selectedNote(state: Object | undefined, action: Object): Object;
|
|
229
229
|
declare const _default: import("redux").Reducer<{
|
|
230
230
|
postId: any;
|
|
231
231
|
postType: any;
|
|
@@ -250,7 +250,7 @@ declare const _default: import("redux").Reducer<{
|
|
|
250
250
|
canvasMinHeight: number;
|
|
251
251
|
revisionId: number | null;
|
|
252
252
|
showRevisionDiff: boolean;
|
|
253
|
-
selectedNote:
|
|
253
|
+
selectedNote: Object;
|
|
254
254
|
dataviews: {
|
|
255
255
|
actions: {
|
|
256
256
|
[x: string]: Record<string, import("@wordpress/dataviews").Action<any>[]> | {
|
|
@@ -288,7 +288,7 @@ declare const _default: import("redux").Reducer<{
|
|
|
288
288
|
canvasMinHeight: number | undefined;
|
|
289
289
|
revisionId: number | null | undefined;
|
|
290
290
|
showRevisionDiff: boolean | undefined;
|
|
291
|
-
selectedNote:
|
|
291
|
+
selectedNote: Object | undefined;
|
|
292
292
|
dataviews: never;
|
|
293
293
|
}>>;
|
|
294
294
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAUjB;AAED;;;;;;GAMG;AACH,qCAJW,OAAO,sBACP,MAAM,GACL,OAAO,CAUlB;AAED;;;;;;GAMG;AACH,uCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAQjB;AAED;;;;;;;GAOG;AACH,kCAJW,MAAM,GAAC,IAAI,sBACX,MAAM,GACL,MAAM,GAAC,IAAI,CAQtB;AAED
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../src/store/reducer.js"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,uCAJW,GAAC,GAEA,GAAC,CAQZ;AAED;;;;;;;;GAQG;AACH,+BALW,MAAM,KACN,MAAM,GAEL,OAAO,CASlB;AAED;;;;;;;;;GASG;AACH,mDALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;;;;GASG;AACH,6CALW,MAAM,kBACN,MAAM,GAEL,OAAO,CAYlB;AAED,kEAOC;AAED,sEAOC;AAED,oEAOC;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;;;GAQG;AACH,8BALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAajB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,gCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CASxB;AAED;;;;;;;;;GASG;AACH,sCALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;;;GASG;AACH,0CALW,aAAa,sBACb,MAAM,GAEL,aAAa,CAcxB;AAED;;;;;;;GAOG;AACH,sCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CAYjB;AAED,2EAOC;AAED;;;;;;;GAOG;AACH,kCALW,MAAM,sBACN,MAAM,GAEL,MAAM,CASjB;AAED;;;;;;;GAOG;AACH,gEAJW,MAAM,SAahB;AAED;;;;;;;;GAQG;AACH,0CAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;;;GAQG;AACH,qCAHW,MAAM,sBACN,MAAM,OAUhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACL,MAAM,CAIjB;AAED;;;;;;GAMG;AACH,iDAHW,MAAM,GACL,MAAM,CAIjB;AAED,uFAUC;AAED;;;;;;GAMG;AACH,kCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAUjB;AAED;;;;;;GAMG;AACH,qCAJW,OAAO,sBACP,MAAM,GACL,OAAO,CAUlB;AAED;;;;;;GAMG;AACH,uCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAQjB;AAED;;;;;;;GAOG;AACH,kCAJW,MAAM,GAAC,IAAI,sBACX,MAAM,GACL,MAAM,GAAC,IAAI,CAQtB;AAED;;;;;;;GAOG;AACH,wCAJW,OAAO,sBACP,MAAM,GACL,OAAO,CAWlB;AAED;;;;;;GAMG;AACH,oCAJW,MAAM,sBACN,MAAM,GACL,MAAM,CAQjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjTa,OAAO;;;;gBACN,OAAO,OAAA;;;;oBACP,OAAO,OAAA;;;;UACP,MAAM,OAAA"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {number|string} postId postId of the current post being edited.
|
|
5
5
|
*/
|
|
6
|
-
export default function usePageTypeBadge(postId: number | string): false | import("@wordpress/i18n").
|
|
6
|
+
export default function usePageTypeBadge(postId: number | string): false | import("@wordpress/i18n").TransformedText<"Homepage"> | import("@wordpress/i18n").TransformedText<"Posts Page">;
|
|
7
7
|
//# sourceMappingURL=pageTypeBadge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageTypeBadge.d.ts","sourceRoot":"","sources":["../../src/utils/pageTypeBadge.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,iDAFW,MAAM,GAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"pageTypeBadge.d.ts","sourceRoot":"","sources":["../../src/utils/pageTypeBadge.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,iDAFW,MAAM,GAAC,MAAM,2HA2BvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.44.0",
|
|
4
4
|
"description": "Enhanced block editor for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,49 +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": "^14.
|
|
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/views": "^1.
|
|
105
|
-
"@wordpress/warning": "^3.
|
|
106
|
-
"@wordpress/wordcount": "^4.
|
|
64
|
+
"@wordpress/a11y": "^4.44.0",
|
|
65
|
+
"@wordpress/api-fetch": "^7.44.0",
|
|
66
|
+
"@wordpress/base-styles": "^6.20.0",
|
|
67
|
+
"@wordpress/blob": "^4.44.0",
|
|
68
|
+
"@wordpress/block-editor": "^15.17.0",
|
|
69
|
+
"@wordpress/block-serialization-default-parser": "^5.44.0",
|
|
70
|
+
"@wordpress/blocks": "^15.17.0",
|
|
71
|
+
"@wordpress/commands": "^1.44.0",
|
|
72
|
+
"@wordpress/components": "^32.6.0",
|
|
73
|
+
"@wordpress/compose": "^7.44.0",
|
|
74
|
+
"@wordpress/core-data": "^7.44.0",
|
|
75
|
+
"@wordpress/data": "^10.44.0",
|
|
76
|
+
"@wordpress/dataviews": "^14.1.0",
|
|
77
|
+
"@wordpress/date": "^5.44.0",
|
|
78
|
+
"@wordpress/deprecated": "^4.44.0",
|
|
79
|
+
"@wordpress/dom": "^4.44.0",
|
|
80
|
+
"@wordpress/element": "^6.44.0",
|
|
81
|
+
"@wordpress/fields": "^0.36.0",
|
|
82
|
+
"@wordpress/global-styles-engine": "^1.11.0",
|
|
83
|
+
"@wordpress/global-styles-ui": "^1.11.0",
|
|
84
|
+
"@wordpress/hooks": "^4.44.0",
|
|
85
|
+
"@wordpress/html-entities": "^4.44.0",
|
|
86
|
+
"@wordpress/i18n": "^6.17.0",
|
|
87
|
+
"@wordpress/icons": "^12.2.0",
|
|
88
|
+
"@wordpress/interface": "^9.29.0",
|
|
89
|
+
"@wordpress/keyboard-shortcuts": "^5.44.0",
|
|
90
|
+
"@wordpress/keycodes": "^4.44.0",
|
|
91
|
+
"@wordpress/media-editor": "^0.7.0",
|
|
92
|
+
"@wordpress/media-fields": "^0.9.0",
|
|
93
|
+
"@wordpress/media-utils": "^5.44.0",
|
|
94
|
+
"@wordpress/notices": "^5.44.0",
|
|
95
|
+
"@wordpress/patterns": "^2.44.0",
|
|
96
|
+
"@wordpress/plugins": "^7.44.0",
|
|
97
|
+
"@wordpress/preferences": "^4.44.0",
|
|
98
|
+
"@wordpress/private-apis": "^1.44.0",
|
|
99
|
+
"@wordpress/reusable-blocks": "^5.44.0",
|
|
100
|
+
"@wordpress/rich-text": "^7.44.0",
|
|
101
|
+
"@wordpress/server-side-render": "^6.20.0",
|
|
102
|
+
"@wordpress/upload-media": "^0.29.0",
|
|
103
|
+
"@wordpress/url": "^4.44.0",
|
|
104
|
+
"@wordpress/views": "^1.11.0",
|
|
105
|
+
"@wordpress/warning": "^3.44.0",
|
|
106
|
+
"@wordpress/wordcount": "^4.44.0",
|
|
107
107
|
"change-case": "^4.1.2",
|
|
108
108
|
"client-zip": "^2.4.5",
|
|
109
109
|
"clsx": "^2.1.1",
|
|
@@ -126,5 +126,5 @@
|
|
|
126
126
|
"publishConfig": {
|
|
127
127
|
"access": "public"
|
|
128
128
|
},
|
|
129
|
-
"gitHead": "
|
|
129
|
+
"gitHead": "b862d8c84121a47bbeff882f6c87e61681ce2e0d"
|
|
130
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
|
+
};
|
|
@@ -56,6 +56,7 @@ function NotesSidebarContent( {
|
|
|
56
56
|
// Sometimes previous sidebar unmounts after the new one mounts.
|
|
57
57
|
// This ensures we always have the latest reference.
|
|
58
58
|
if ( node ) {
|
|
59
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
59
60
|
commentSidebarRef.current = node;
|
|
60
61
|
}
|
|
61
62
|
} }
|
|
@@ -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';
|
|
@@ -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' } ) {
|
|
@@ -25,30 +25,23 @@ import { unlock } from '../../lock-unlock';
|
|
|
25
25
|
const { Badge } = unlock( componentsPrivateApis );
|
|
26
26
|
const DAY_IN_MILLISECONDS = 86400000;
|
|
27
27
|
const EMPTY_ARRAY = [];
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
orderby: 'date',
|
|
32
|
-
order: 'desc',
|
|
33
|
-
context: 'embed',
|
|
34
|
-
_fields: 'id,date,author',
|
|
35
|
-
};
|
|
36
|
-
const defaultLayouts = { activity: {} };
|
|
28
|
+
const defaultLayouts = { activity: true };
|
|
29
|
+
const noop = () => {};
|
|
30
|
+
const paginationInfo = {};
|
|
37
31
|
const view = {
|
|
38
32
|
type: 'activity',
|
|
39
33
|
titleField: 'date',
|
|
40
34
|
fields: [ 'author' ],
|
|
41
|
-
layout: {
|
|
42
|
-
density: 'compact',
|
|
43
|
-
},
|
|
35
|
+
layout: { density: 'compact' },
|
|
44
36
|
};
|
|
45
37
|
const fields = [
|
|
46
38
|
{
|
|
47
39
|
id: 'date',
|
|
48
40
|
label: __( 'Date' ),
|
|
49
|
-
render: ( { item } ) => {
|
|
41
|
+
render: ( { item, field } ) => {
|
|
50
42
|
const dateNowInMs = getDate( null ).getTime();
|
|
51
|
-
const
|
|
43
|
+
const _value = field.getValue( { item } );
|
|
44
|
+
const date = getDate( _value ?? null );
|
|
52
45
|
const displayDate =
|
|
53
46
|
dateNowInMs - date.getTime() > DAY_IN_MILLISECONDS
|
|
54
47
|
? dateI18n(
|
|
@@ -59,7 +52,7 @@ const fields = [
|
|
|
59
52
|
return (
|
|
60
53
|
<time
|
|
61
54
|
className="editor-post-revisions-panel__revision-date"
|
|
62
|
-
dateTime={
|
|
55
|
+
dateTime={ _value }
|
|
63
56
|
>
|
|
64
57
|
{ displayDate }
|
|
65
58
|
</time>
|
|
@@ -70,36 +63,45 @@ const fields = [
|
|
|
70
63
|
},
|
|
71
64
|
authorField,
|
|
72
65
|
];
|
|
73
|
-
const noop = () => {};
|
|
74
|
-
const paginationInfo = {};
|
|
75
66
|
|
|
76
67
|
function PostRevisionsPanelContent() {
|
|
77
68
|
const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
|
|
78
|
-
const {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
69
|
+
const {
|
|
70
|
+
revisionsCount,
|
|
71
|
+
revisions,
|
|
72
|
+
revisionKey,
|
|
73
|
+
isLoading,
|
|
74
|
+
lastRevisionId,
|
|
75
|
+
} = useSelect( ( select ) => {
|
|
76
|
+
const { getCurrentPostId, getCurrentPostType } = select( editorStore );
|
|
77
|
+
const { getCurrentPostRevisionsCount, getCurrentPostLastRevisionId } =
|
|
78
|
+
select( editorStore );
|
|
79
|
+
const { getRevisions, getEntityConfig, isResolving } =
|
|
80
|
+
select( coreStore );
|
|
81
|
+
const _postType = getCurrentPostType();
|
|
82
|
+
const entityConfig = getEntityConfig( 'postType', _postType );
|
|
83
|
+
const _revisionKey = entityConfig?.revisionKey || 'id';
|
|
84
|
+
const revisionsQuery = {
|
|
85
|
+
per_page: 3,
|
|
86
|
+
orderby: 'date',
|
|
87
|
+
order: 'desc',
|
|
88
|
+
_fields: `${ _revisionKey },date,author`,
|
|
89
|
+
};
|
|
90
|
+
const query = [
|
|
91
|
+
'postType',
|
|
92
|
+
_postType,
|
|
93
|
+
getCurrentPostId(),
|
|
94
|
+
revisionsQuery,
|
|
95
|
+
];
|
|
96
|
+
const _revisions = getRevisions( ...query );
|
|
97
|
+
return {
|
|
98
|
+
revisionsCount: getCurrentPostRevisionsCount(),
|
|
99
|
+
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
100
|
+
revisions: _revisions,
|
|
101
|
+
revisionKey: _revisionKey,
|
|
102
|
+
isLoading: isResolving( 'getRevisions', query ),
|
|
103
|
+
};
|
|
104
|
+
}, [] );
|
|
103
105
|
return (
|
|
104
106
|
<PanelBody
|
|
105
107
|
title={
|
|
@@ -121,10 +123,10 @@ function PostRevisionsPanelContent() {
|
|
|
121
123
|
isLoading={ isLoading }
|
|
122
124
|
paginationInfo={ paginationInfo }
|
|
123
125
|
defaultLayouts={ defaultLayouts }
|
|
124
|
-
getItemId={ ( item ) => item
|
|
126
|
+
getItemId={ ( item ) => item[ revisionKey ] }
|
|
125
127
|
isItemClickable={ () => true }
|
|
126
128
|
onClickItem={ ( item ) => {
|
|
127
|
-
setCurrentRevisionId( item
|
|
129
|
+
setCurrentRevisionId( item[ revisionKey ] );
|
|
128
130
|
} }
|
|
129
131
|
>
|
|
130
132
|
<DataViews.Layout />
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useMemo } from '@wordpress/element';
|
|
5
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
5
|
import { RangeControl, Spinner } from '@wordpress/components';
|
|
7
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -39,6 +38,8 @@ function RevisionsSlider() {
|
|
|
39
38
|
const query = {
|
|
40
39
|
per_page: -1,
|
|
41
40
|
context: 'edit',
|
|
41
|
+
orderby: 'date',
|
|
42
|
+
order: 'asc',
|
|
42
43
|
_fields: [
|
|
43
44
|
...new Set( [
|
|
44
45
|
'id',
|
|
@@ -72,28 +73,12 @@ function RevisionsSlider() {
|
|
|
72
73
|
|
|
73
74
|
const { setCurrentRevisionId } = unlock( useDispatch( editorStore ) );
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
// 'modified' instead of 'date'.
|
|
77
|
-
const revisionDateField = revisionKey === 'wp_id' ? 'modified' : 'date';
|
|
78
|
-
|
|
79
|
-
const sortedRevisions = useMemo( () => {
|
|
80
|
-
return (
|
|
81
|
-
revisions
|
|
82
|
-
?.slice()
|
|
83
|
-
.sort(
|
|
84
|
-
( a, b ) =>
|
|
85
|
-
new Date( a[ revisionDateField ] ) -
|
|
86
|
-
new Date( b[ revisionDateField ] )
|
|
87
|
-
) ?? []
|
|
88
|
-
);
|
|
89
|
-
}, [ revisions, revisionDateField ] );
|
|
90
|
-
|
|
91
|
-
const selectedIndex = sortedRevisions.findIndex(
|
|
76
|
+
const selectedIndex = revisions?.findIndex(
|
|
92
77
|
( r ) => r[ revisionKey ] === currentRevisionId
|
|
93
78
|
);
|
|
94
79
|
|
|
95
80
|
const handleSliderChange = ( index ) => {
|
|
96
|
-
const revision =
|
|
81
|
+
const revision = revisions?.[ index ];
|
|
97
82
|
if ( revision ) {
|
|
98
83
|
setCurrentRevisionId( revision[ revisionKey ] );
|
|
99
84
|
}
|
|
@@ -102,21 +87,18 @@ function RevisionsSlider() {
|
|
|
102
87
|
// Format date for tooltip.
|
|
103
88
|
const dateSettings = getDateSettings();
|
|
104
89
|
const renderTooltipContent = ( index ) => {
|
|
105
|
-
const revision =
|
|
90
|
+
const revision = revisions?.[ index ];
|
|
106
91
|
if ( ! revision ) {
|
|
107
92
|
return index;
|
|
108
93
|
}
|
|
109
|
-
return dateI18n(
|
|
110
|
-
dateSettings.formats.datetime,
|
|
111
|
-
revision[ revisionDateField ]
|
|
112
|
-
);
|
|
94
|
+
return dateI18n( dateSettings.formats.datetime, revision.date );
|
|
113
95
|
};
|
|
114
96
|
|
|
115
97
|
if ( isLoading ) {
|
|
116
98
|
return <Spinner />;
|
|
117
99
|
}
|
|
118
100
|
|
|
119
|
-
if ( !
|
|
101
|
+
if ( ! revisions?.length ) {
|
|
120
102
|
return (
|
|
121
103
|
<span className="editor-revisions-header__no-revisions">
|
|
122
104
|
{ __( 'No revisions found.' ) }
|
|
@@ -124,7 +106,7 @@ function RevisionsSlider() {
|
|
|
124
106
|
);
|
|
125
107
|
}
|
|
126
108
|
|
|
127
|
-
if (
|
|
109
|
+
if ( revisions?.length === 1 ) {
|
|
128
110
|
return (
|
|
129
111
|
<span className="editor-revisions-header__no-revisions">
|
|
130
112
|
{ __( 'Only one revision found.' ) }
|
|
@@ -138,7 +120,7 @@ function RevisionsSlider() {
|
|
|
138
120
|
className="editor-revisions-header__slider"
|
|
139
121
|
hideLabelFromVision
|
|
140
122
|
label={ __( 'Revision' ) }
|
|
141
|
-
max={
|
|
123
|
+
max={ revisions?.length - 1 }
|
|
142
124
|
min={ 0 }
|
|
143
125
|
marks
|
|
144
126
|
onChange={ handleSliderChange }
|