@wordpress/core-data 6.23.0 → 6.25.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 +5 -0
- package/README.md +51 -2
- package/build/actions.js +38 -0
- package/build/actions.js.map +1 -1
- package/build/entities.js +7 -3
- package/build/entities.js.map +1 -1
- package/build/entity-types/global-styles-revision.js +6 -0
- package/build/entity-types/global-styles-revision.js.map +1 -0
- package/build/entity-types/index.js.map +1 -1
- package/build/entity-types/post-revision.js +6 -0
- package/build/entity-types/post-revision.js.map +1 -0
- package/build/footnotes/get-footnotes-order.js +2 -9
- package/build/footnotes/get-footnotes-order.js.map +1 -1
- package/build/footnotes/index.js +5 -10
- package/build/footnotes/index.js.map +1 -1
- package/build/hooks/use-entity-record.js +16 -5
- package/build/hooks/use-entity-record.js.map +1 -1
- package/build/queried-data/reducer.js +1 -1
- package/build/queried-data/reducer.js.map +1 -1
- package/build/reducer.js +26 -2
- package/build/reducer.js.map +1 -1
- package/build/resolvers.js +133 -3
- package/build/resolvers.js.map +1 -1
- package/build/selectors.js +79 -1
- package/build/selectors.js.map +1 -1
- package/build-module/actions.js +36 -0
- package/build-module/actions.js.map +1 -1
- package/build-module/entities.js +7 -3
- package/build-module/entities.js.map +1 -1
- package/build-module/entity-types/global-styles-revision.js +2 -0
- package/build-module/entity-types/global-styles-revision.js.map +1 -0
- package/build-module/entity-types/index.js.map +1 -1
- package/build-module/entity-types/post-revision.js +2 -0
- package/build-module/entity-types/post-revision.js.map +1 -0
- package/build-module/footnotes/get-footnotes-order.js +2 -9
- package/build-module/footnotes/get-footnotes-order.js.map +1 -1
- package/build-module/footnotes/index.js +6 -11
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/hooks/use-entity-record.js +16 -5
- package/build-module/hooks/use-entity-record.js.map +1 -1
- package/build-module/queried-data/reducer.js +1 -1
- package/build-module/queried-data/reducer.js.map +1 -1
- package/build-module/reducer.js +26 -2
- package/build-module/reducer.js.map +1 -1
- package/build-module/resolvers.js +130 -2
- package/build-module/resolvers.js.map +1 -1
- package/build-module/selectors.js +76 -1
- package/build-module/selectors.js.map +1 -1
- package/build-types/actions.d.ts +5 -0
- package/build-types/actions.d.ts.map +1 -1
- package/build-types/entities.d.ts +11 -1
- package/build-types/entities.d.ts.map +1 -1
- package/build-types/entity-types/global-styles-revision.d.ts +43 -0
- package/build-types/entity-types/global-styles-revision.d.ts.map +1 -0
- package/build-types/entity-types/index.d.ts +4 -2
- package/build-types/entity-types/index.d.ts.map +1 -1
- package/build-types/entity-types/post-revision.d.ts +76 -0
- package/build-types/entity-types/post-revision.d.ts.map +1 -0
- package/build-types/footnotes/get-footnotes-order.d.ts.map +1 -1
- package/build-types/footnotes/index.d.ts.map +1 -1
- package/build-types/hooks/use-entity-record.d.ts.map +1 -1
- package/build-types/index.d.ts +13 -4
- package/build-types/index.d.ts.map +1 -1
- package/build-types/reducer.d.ts.map +1 -1
- package/build-types/resolvers.d.ts +9 -0
- package/build-types/resolvers.d.ts.map +1 -1
- package/build-types/selectors.d.ts +39 -3
- package/build-types/selectors.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/actions.js +45 -0
- package/src/entities.js +13 -1
- package/src/entity-types/global-styles-revision.ts +47 -0
- package/src/entity-types/index.ts +6 -0
- package/src/entity-types/post-revision.ts +93 -0
- package/src/footnotes/get-footnotes-order.js +5 -12
- package/src/footnotes/index.js +14 -8
- package/src/hooks/test/use-entity-record.js +41 -0
- package/src/hooks/use-entity-record.ts +30 -18
- package/src/queried-data/reducer.js +1 -1
- package/src/reducer.js +33 -2
- package/src/resolvers.js +182 -2
- package/src/selectors.ts +119 -1
- package/src/test/entities.js +9 -0
- package/src/test/reducer.js +235 -0
- package/src/test/selectors.js +96 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-footnotes-order.d.ts","sourceRoot":"","sources":["../../src/footnotes/get-footnotes-order.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-footnotes-order.d.ts","sourceRoot":"","sources":["../../src/footnotes/get-footnotes-order.js"],"names":[],"mappings":"AA4BA,4DAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/footnotes/index.js"],"names":[],"mappings":"AAYA;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/footnotes/index.js"],"names":[],"mappings":"AAYA;;EA+GC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-entity-record.d.ts","sourceRoot":"","sources":["../../src/hooks/use-entity-record.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,sBAAsB,CAAE,UAAU;IAClD,kCAAkC;IAClC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAE1B,+BAA+B;IAC/B,YAAY,EAAE,OAAO,CAAE,UAAU,CAAE,CAAC;IAEpC,4CAA4C;IAC5C,KAAK,EAAE,OAAO,CAAE,UAAU,CAAE,CAAC;IAE7B,iEAAiE;IACjE,IAAI,EAAE,CAAE,IAAI,EAAE,OAAO,CAAE,UAAU,CAAE,KAAM,IAAI,CAAC;IAE9C,sCAAsC;IACtC,IAAI,EAAE,MAAM,OAAO,CAAE,IAAI,CAAE,CAAC;IAE5B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACvB;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"use-entity-record.d.ts","sourceRoot":"","sources":["../../src/hooks/use-entity-record.ts"],"names":[],"mappings":"AAYA,O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any;
|
|
62
62
|
dispatch: any;
|
|
63
63
|
}) => Promise<any>;
|
|
64
|
+
receiveRevisions: (kind: string, name: string, recordKey: string | number, records: any, query: any, invalidateCache: boolean | null | undefined, meta: any) => ({ dispatch }: {
|
|
65
|
+
dispatch: any;
|
|
66
|
+
}) => Promise<void>;
|
|
64
67
|
}, {
|
|
65
68
|
getAuthors(state: selectors.State, query?: {
|
|
66
69
|
[x: string]: any;
|
|
@@ -70,7 +73,7 @@ export const store: import("@wordpress/data/build-types/types").StoreDescriptor<
|
|
|
70
73
|
getEntitiesConfig(state: selectors.State, kind: string): any[];
|
|
71
74
|
getEntity(state: selectors.State, kind: string, name: string): any;
|
|
72
75
|
getEntityConfig(state: selectors.State, kind: string, name: string): any;
|
|
73
|
-
__experimentalGetEntityRecordNoResolver<EntityRecord extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, key: string | number): EntityRecord | undefined;
|
|
76
|
+
__experimentalGetEntityRecordNoResolver<EntityRecord extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").GlobalStylesRevision<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").PostRevision<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, key: string | number): EntityRecord | undefined;
|
|
74
77
|
hasEntityRecords(state: selectors.State, kind: string, name: string, query?: {
|
|
75
78
|
[x: string]: any;
|
|
76
79
|
} | undefined): boolean;
|
|
@@ -93,7 +96,7 @@ export const store: import("@wordpress/data/build-types/types").StoreDescriptor<
|
|
|
93
96
|
canUser(state: selectors.State, action: string, resource: string, id?: (string | number) | undefined): boolean | undefined;
|
|
94
97
|
canUserEditEntityRecord(state: selectors.State, kind: string, name: string, recordId: string | number): boolean | undefined;
|
|
95
98
|
getAutosaves(state: selectors.State, postType: string, postId: string | number): any[] | undefined;
|
|
96
|
-
getAutosave<EntityRecord_1 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, postType: string, postId: string | number, authorId: string | number): EntityRecord_1 | undefined;
|
|
99
|
+
getAutosave<EntityRecord_1 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").GlobalStylesRevision<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").PostRevision<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, postType: string, postId: string | number, authorId: string | number): EntityRecord_1 | undefined;
|
|
97
100
|
getReferenceByDistinctEdits(state: any): any;
|
|
98
101
|
__experimentalGetTemplateForLink(state: selectors.State, link: string): (import("./entity-types").Updatable<import("./entity-types").WpTemplate> | undefined) | null;
|
|
99
102
|
__experimentalGetCurrentThemeBaseGlobalStyles(state: selectors.State): any;
|
|
@@ -110,7 +113,7 @@ export const store: import("@wordpress/data/build-types/types").StoreDescriptor<
|
|
|
110
113
|
isRequestingEmbedPreview: Function;
|
|
111
114
|
getUserQueryResults: ((state: selectors.State, queryID: string) => import("./entity-types").User<"edit">[]) & import("rememo").EnhancedSelector;
|
|
112
115
|
getEntityRecord: selectors.GetEntityRecord;
|
|
113
|
-
getRawEntityRecord: (<EntityRecord_2 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, key: string | number) => EntityRecord_2 | undefined) & import("rememo").EnhancedSelector;
|
|
116
|
+
getRawEntityRecord: (<EntityRecord_2 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").GlobalStylesRevision<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").PostRevision<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, key: string | number) => EntityRecord_2 | undefined) & import("rememo").EnhancedSelector;
|
|
114
117
|
getEntityRecords: selectors.GetEntityRecords;
|
|
115
118
|
getEntityRecordsTotalItems: (state: selectors.State, kind: string, name: string, query: {
|
|
116
119
|
[x: string]: any;
|
|
@@ -131,8 +134,14 @@ export const store: import("@wordpress/data/build-types/types").StoreDescriptor<
|
|
|
131
134
|
kind: string;
|
|
132
135
|
}[]) & import("rememo").EnhancedSelector;
|
|
133
136
|
getEntityRecordNonTransientEdits: ((state: selectors.State, kind: string, name: string, recordId: string | number) => any) & import("rememo").EnhancedSelector;
|
|
134
|
-
getEditedEntityRecord: (<EntityRecord_3 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, recordId: string | number) => import("./entity-types").Updatable<EntityRecord_3> | undefined) & import("rememo").EnhancedSelector;
|
|
137
|
+
getEditedEntityRecord: (<EntityRecord_3 extends import("./entity-types").Attachment<any> | import("./entity-types").Comment<any> | import("./entity-types").GlobalStylesRevision<any> | import("./entity-types").MenuLocation<any> | import("./entity-types").NavMenu<any> | import("./entity-types").NavMenuItem<any> | import("./entity-types").Page<any> | import("./entity-types").Plugin<any> | import("./entity-types").Post<any> | import("./entity-types").PostRevision<any> | import("./entity-types").Settings<any> | import("./entity-types").Sidebar<any> | import("./entity-types").Taxonomy<any> | import("./entity-types").Theme<any> | import("./entity-types").User<any> | import("./entity-types").Type<any> | import("./entity-types").Widget<any> | import("./entity-types").WidgetType<any> | import("./entity-types").WpTemplate<any> | import("./entity-types").WpTemplatePart<any>>(state: selectors.State, kind: string, name: string, recordId: string | number) => import("./entity-types").Updatable<EntityRecord_3> | undefined) & import("rememo").EnhancedSelector;
|
|
135
138
|
hasFetchedAutosaves: Function;
|
|
139
|
+
getRevisions: (state: selectors.State, kind: string, name: string, recordKey: string | number, query?: {
|
|
140
|
+
[x: string]: any;
|
|
141
|
+
} | undefined) => (Record<import("./entity-types").Context, Record<number, import("./entity-types").PostRevision>> | Record<import("./entity-types").Context, Record<number, import("./entity-types").GlobalStylesRevision>>)[] | null;
|
|
142
|
+
getRevision: ((state: selectors.State, kind: string, name: string, recordKey: string | number, revisionKey: string | number, query?: {
|
|
143
|
+
[x: string]: any;
|
|
144
|
+
} | undefined) => (Record<import("./entity-types").Context, Record<number, import("./entity-types").PostRevision>> | Record<import("./entity-types").Context, Record<number, import("./entity-types").GlobalStylesRevision>>) | Record<PropertyKey, never> | undefined) & import("rememo").EnhancedSelector;
|
|
136
145
|
}>>;
|
|
137
146
|
export { default as EntityProvider } from "./entity-provider";
|
|
138
147
|
export * from "./entity-provider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA4DA;;;;GAIG;AACH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA4DA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAmE;;;;;;2BAxDxC,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.js"],"names":[],"mappings":"AAmBA,2DAA2D;AAE3D;;;;;;;;;;GAUG;AACH,oDAUC;AAED;;;;;;;GAOG;AACH,oDAuBC;AAED;;;;;;;GAOG;AACH,0DAOC;AAED;;;;;;;GAOG;AACH,yDAOC;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AAED;;;;;;;GAOG;AACH,6CALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AAED;;;;;;;GAOG;AACH,4FAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;AAED;;;;;;;GAOG;AACH,iGAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.js"],"names":[],"mappings":"AAmBA,2DAA2D;AAE3D;;;;;;;;;;GAUG;AACH,oDAUC;AAED;;;;;;;GAOG;AACH,oDAuBC;AAED;;;;;;;GAOG;AACH,0DAOC;AAED;;;;;;;GAOG;AACH,yDAOC;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AAED;;;;;;;GAOG;AACH,6CALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AAED;;;;;;;GAOG;AACH,4FAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;AAED;;;;;;;GAOG;AACH,iGAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;AAiND;;;;;;;GAOG;AACH,6DAOC;AA+DD;;GAEG;AACH,sKAEC;AAED,uEAQC;AAED;;;;;;;GAOG;AACH,4DAUC;AAED;;;;;;;;GAQG;AACH,8DAUC;AAED;;;;;;;GAOG;AACH,wDAYC;AAED,0EAOC;AAED,mFAOC;AAED,kFAMC;AAED,gFAOC;AAED;;;;;;;GAOG;AACH,gGAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;AAED;;;;;;;GAOG;AACH,0FAFY,OAAO,MAAM,EAAE,MAAM,CAAC,CAYjC;AA9MM,uDAmDN;;;;;;;;;;;;;;;;;;;;;;;;0BAjca,OAAO,SAAS,EAAE,WAAW"}
|
|
@@ -90,4 +90,13 @@ export function getNavigationFallbackId(): ({ dispatch, select }: {
|
|
|
90
90
|
export function getDefaultTemplateId(query: any): ({ dispatch }: {
|
|
91
91
|
dispatch: any;
|
|
92
92
|
}) => Promise<void>;
|
|
93
|
+
export function getRevisions(kind: string, name: string, recordKey: number | string, query?: any | undefined): ({ dispatch }: {
|
|
94
|
+
dispatch: any;
|
|
95
|
+
}) => Promise<void>;
|
|
96
|
+
export namespace getRevisions {
|
|
97
|
+
function shouldInvalidate(action: any, kind: any, name: any, recordKey: any): boolean;
|
|
98
|
+
}
|
|
99
|
+
export function getRevision(kind: string, name: string, recordKey: number | string, revisionKey: number | string, query: any | undefined): ({ dispatch }: {
|
|
100
|
+
dispatch: any;
|
|
101
|
+
}) => Promise<void>;
|
|
93
102
|
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../src/resolvers.js"],"names":[],"mappings":"AA0BO,kCAHI,MAAO,SAAS;;oBAYzB;AAKK;;oBAKL;AAYK,sCAPI,MAAM,QACN,MAAM,2CAEN,MAAO,SAAS;;;oBAuHzB;AAEF;;GAEG;AACH,0CAAuE;AAEvE;;GAEG;AACH,6CAA0E;AAUnE,uCALI,MAAM,QACN,MAAM;;oBAwGf;;IAEF,kEAOC;;AAKM;;;oBAU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M,GAAC,MAAM,UACb,MAAO,SAAS;;oBA4GzB;;IAGF,sFAK8B;;AAavB,kCARI,MAAM,QACN,MAAM,aACN,MAAM,GAAC,MAAM,eACb,MAAM,GAAC,MAAM,SACb,MAAO,SAAS;;oBA+CzB"}
|
|
@@ -32,6 +32,12 @@ interface QueriedData {
|
|
|
32
32
|
itemIsComplete: Record<ET.Context, Record<number, boolean>>;
|
|
33
33
|
queries: Record<ET.Context, Record<string, Array<number>>>;
|
|
34
34
|
}
|
|
35
|
+
type RevisionRecord = Record<ET.Context, Record<number, ET.PostRevision>> | Record<ET.Context, Record<number, ET.GlobalStylesRevision>>;
|
|
36
|
+
interface RevisionsQueriedData {
|
|
37
|
+
items: RevisionRecord;
|
|
38
|
+
itemIsComplete: Record<ET.Context, Record<number, boolean>>;
|
|
39
|
+
queries: Record<ET.Context, Record<string, Array<number>>>;
|
|
40
|
+
}
|
|
35
41
|
interface EntityState<EntityRecord extends ET.EntityRecord> {
|
|
36
42
|
edits: Record<string, Partial<EntityRecord>>;
|
|
37
43
|
saving: Record<string, Partial<{
|
|
@@ -44,6 +50,7 @@ interface EntityState<EntityRecord extends ET.EntityRecord> {
|
|
|
44
50
|
error: Error;
|
|
45
51
|
}>>;
|
|
46
52
|
queriedData: QueriedData;
|
|
53
|
+
revisions?: RevisionsQueriedData;
|
|
47
54
|
}
|
|
48
55
|
interface EntityConfig {
|
|
49
56
|
name: string;
|
|
@@ -218,7 +225,7 @@ export declare function __experimentalGetEntityRecordNoResolver<EntityRecord ext
|
|
|
218
225
|
*
|
|
219
226
|
* @return Object with the entity's raw attributes.
|
|
220
227
|
*/
|
|
221
|
-
export declare const getRawEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, key: EntityRecordKey) => EntityRecord | undefined) & import("rememo").EnhancedSelector;
|
|
228
|
+
export declare const getRawEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.GlobalStylesRevision<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.PostRevision<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, key: EntityRecordKey) => EntityRecord | undefined) & import("rememo").EnhancedSelector;
|
|
222
229
|
/**
|
|
223
230
|
* Returns true if records have been received for the given set of parameters,
|
|
224
231
|
* or false otherwise.
|
|
@@ -349,7 +356,7 @@ export declare function hasEditsForEntityRecord(state: State, kind: string, name
|
|
|
349
356
|
*
|
|
350
357
|
* @return The entity record, merged with its edits.
|
|
351
358
|
*/
|
|
352
|
-
export declare const getEditedEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, recordId: EntityRecordKey) => ET.Updatable<EntityRecord> | undefined) & import("rememo").EnhancedSelector;
|
|
359
|
+
export declare const getEditedEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.GlobalStylesRevision<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.PostRevision<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, recordId: EntityRecordKey) => ET.Updatable<EntityRecord> | undefined) & import("rememo").EnhancedSelector;
|
|
353
360
|
/**
|
|
354
361
|
* Returns true if the specified entity record is autosaving, and false otherwise.
|
|
355
362
|
*
|
|
@@ -630,7 +637,9 @@ export declare function getUserPatternCategories(state: State): Array<UserPatter
|
|
|
630
637
|
/**
|
|
631
638
|
* Returns the revisions of the current global styles theme.
|
|
632
639
|
*
|
|
633
|
-
* @
|
|
640
|
+
* @deprecated since WordPress 6.5.0. Callers should use `select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )` instead, where `recordKey` is the id of the global styles parent post.
|
|
641
|
+
*
|
|
642
|
+
* @param state Data state.
|
|
634
643
|
*
|
|
635
644
|
* @return The current global styles.
|
|
636
645
|
*/
|
|
@@ -644,5 +653,32 @@ export declare function getCurrentThemeGlobalStylesRevisions(state: State): Arra
|
|
|
644
653
|
* @return The default template id for the given query.
|
|
645
654
|
*/
|
|
646
655
|
export declare function getDefaultTemplateId(state: State, query: TemplateQuery): string;
|
|
656
|
+
/**
|
|
657
|
+
* Returns an entity's revisions.
|
|
658
|
+
*
|
|
659
|
+
* @param state State tree
|
|
660
|
+
* @param kind Entity kind.
|
|
661
|
+
* @param name Entity name.
|
|
662
|
+
* @param recordKey The key of the entity record whose revisions you want to fetch.
|
|
663
|
+
* @param query Optional query. If requesting specific
|
|
664
|
+
* fields, fields must always include the ID. For valid query parameters see revisions schema in [the REST API Handbook](https://developer.wordpress.org/rest-api/reference/). Then see the arguments available "Retrieve a [Entity kind]".
|
|
665
|
+
*
|
|
666
|
+
* @return Record.
|
|
667
|
+
*/
|
|
668
|
+
export declare const getRevisions: (state: State, kind: string, name: string, recordKey: EntityRecordKey, query?: GetRecordsHttpQuery) => RevisionRecord[] | null;
|
|
669
|
+
/**
|
|
670
|
+
* Returns a single, specific revision of a parent entity.
|
|
671
|
+
*
|
|
672
|
+
* @param state State tree
|
|
673
|
+
* @param kind Entity kind.
|
|
674
|
+
* @param name Entity name.
|
|
675
|
+
* @param recordKey The key of the entity record whose revisions you want to fetch.
|
|
676
|
+
* @param revisionKey The revision's key.
|
|
677
|
+
* @param query Optional query. If requesting specific
|
|
678
|
+
* fields, fields must always include the ID. For valid query parameters see revisions schema in [the REST API Handbook](https://developer.wordpress.org/rest-api/reference/). Then see the arguments available "Retrieve a [entity kind]".
|
|
679
|
+
*
|
|
680
|
+
* @return Record.
|
|
681
|
+
*/
|
|
682
|
+
export declare const getRevision: ((state: State, kind: string, name: string, recordKey: EntityRecordKey, revisionKey: EntityRecordKey, query?: GetRecordsHttpQuery) => RevisionRecord | Record<PropertyKey, never> | undefined) & import("rememo").EnhancedSelector;
|
|
647
683
|
export {};
|
|
648
684
|
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D,MAAM,WAAW,KAAK;IACrB,SAAS,EAAE,MAAM,CAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAE,OAAO,CAAE,CAAE,CAAC;IACvD,aAAa,EAAE,KAAK,CAAE,OAAO,CAAE,CAAC;IAChC,sBAAsB,EAAE,KAAK,CAAE,OAAO,CAAE,CAAC;IACzC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,EAAE,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAE,MAAM,EAAE;QAAE,I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GAQG;AACH,wBAAgB,oCAAoC,CACnD,KAAK,EAAE,KAAK,GACV,KAAK,CAAE,MAAM,CAAE,GAAG,IAAI,CAcxB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,GAClB,MAAM,CAER;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,UACjB,KAAK,QACN,MAAM,QACN,MAAM,aACD,eAAe,UAClB,mBAAmB,KACzB,cAAc,EAAE,GAAG,IAQrB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,WAEf,KAAK,QACN,MAAM,QACN,MAAM,aACD,eAAe,eACb,eAAe,UACpB,mBAAmB,KACzB,cAAc,GAAG,OAAQ,WAAW,EAAE,KAAK,CAAE,GAAG,SAAS,qCAiD5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/core-data",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.25.0",
|
|
4
4
|
"description": "Access to and manipulation of core WordPress entities.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,21 +31,21 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/api-fetch": "^6.
|
|
35
|
-
"@wordpress/block-editor": "^12.
|
|
36
|
-
"@wordpress/blocks": "^12.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/data": "^9.
|
|
39
|
-
"@wordpress/deprecated": "^3.
|
|
40
|
-
"@wordpress/element": "^5.
|
|
41
|
-
"@wordpress/html-entities": "^3.
|
|
42
|
-
"@wordpress/i18n": "^4.
|
|
43
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
44
|
-
"@wordpress/private-apis": "^0.
|
|
45
|
-
"@wordpress/rich-text": "^6.
|
|
46
|
-
"@wordpress/sync": "^0.
|
|
47
|
-
"@wordpress/undo-manager": "^0.
|
|
48
|
-
"@wordpress/url": "^3.
|
|
34
|
+
"@wordpress/api-fetch": "^6.45.0",
|
|
35
|
+
"@wordpress/block-editor": "^12.16.0",
|
|
36
|
+
"@wordpress/blocks": "^12.25.0",
|
|
37
|
+
"@wordpress/compose": "^6.25.0",
|
|
38
|
+
"@wordpress/data": "^9.18.0",
|
|
39
|
+
"@wordpress/deprecated": "^3.48.0",
|
|
40
|
+
"@wordpress/element": "^5.25.0",
|
|
41
|
+
"@wordpress/html-entities": "^3.48.0",
|
|
42
|
+
"@wordpress/i18n": "^4.48.0",
|
|
43
|
+
"@wordpress/is-shallow-equal": "^4.48.0",
|
|
44
|
+
"@wordpress/private-apis": "^0.30.0",
|
|
45
|
+
"@wordpress/rich-text": "^6.25.0",
|
|
46
|
+
"@wordpress/sync": "^0.10.0",
|
|
47
|
+
"@wordpress/undo-manager": "^0.8.0",
|
|
48
|
+
"@wordpress/url": "^3.49.0",
|
|
49
49
|
"change-case": "^4.1.2",
|
|
50
50
|
"equivalent-key-map": "^0.2.2",
|
|
51
51
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
|
|
64
64
|
}
|
package/src/actions.js
CHANGED
|
@@ -218,6 +218,8 @@ export function receiveThemeSupports() {
|
|
|
218
218
|
* Returns an action object used in signalling that the theme global styles CPT post revisions have been received.
|
|
219
219
|
* Ignored from documentation as it's internal to the data store.
|
|
220
220
|
*
|
|
221
|
+
* @deprecated since WordPress 6.5.0. Callers should use `dispatch( 'core' ).receiveRevision` instead.
|
|
222
|
+
*
|
|
221
223
|
* @ignore
|
|
222
224
|
*
|
|
223
225
|
* @param {number} currentId The post id.
|
|
@@ -226,6 +228,13 @@ export function receiveThemeSupports() {
|
|
|
226
228
|
* @return {Object} Action object.
|
|
227
229
|
*/
|
|
228
230
|
export function receiveThemeGlobalStyleRevisions( currentId, revisions ) {
|
|
231
|
+
deprecated(
|
|
232
|
+
"wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",
|
|
233
|
+
{
|
|
234
|
+
since: '6.5.0',
|
|
235
|
+
alternative: "wp.data.dispatch( 'core' ).receiveRevisions",
|
|
236
|
+
}
|
|
237
|
+
);
|
|
229
238
|
return {
|
|
230
239
|
type: 'RECEIVE_THEME_GLOBAL_STYLE_REVISIONS',
|
|
231
240
|
currentId,
|
|
@@ -924,3 +933,39 @@ export function receiveDefaultTemplateId( query, templateId ) {
|
|
|
924
933
|
templateId,
|
|
925
934
|
};
|
|
926
935
|
}
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Action triggered to receive revision items.
|
|
939
|
+
*
|
|
940
|
+
* @param {string} kind Kind of the received entity record revisions.
|
|
941
|
+
* @param {string} name Name of the received entity record revisions.
|
|
942
|
+
* @param {number|string} recordKey The key of the entity record whose revisions you want to fetch.
|
|
943
|
+
* @param {Array|Object} records Revisions received.
|
|
944
|
+
* @param {?Object} query Query Object.
|
|
945
|
+
* @param {?boolean} invalidateCache Should invalidate query caches.
|
|
946
|
+
* @param {?Object} meta Meta information about pagination.
|
|
947
|
+
*/
|
|
948
|
+
export const receiveRevisions =
|
|
949
|
+
( kind, name, recordKey, records, query, invalidateCache = false, meta ) =>
|
|
950
|
+
async ( { dispatch } ) => {
|
|
951
|
+
const configs = await dispatch( getOrLoadEntitiesConfig( kind ) );
|
|
952
|
+
const entityConfig = configs.find(
|
|
953
|
+
( config ) => config.kind === kind && config.name === name
|
|
954
|
+
);
|
|
955
|
+
const key =
|
|
956
|
+
entityConfig && entityConfig?.revisionKey
|
|
957
|
+
? entityConfig.revisionKey
|
|
958
|
+
: DEFAULT_ENTITY_KEY;
|
|
959
|
+
|
|
960
|
+
dispatch( {
|
|
961
|
+
type: 'RECEIVE_ITEM_REVISIONS',
|
|
962
|
+
key,
|
|
963
|
+
items: Array.isArray( records ) ? records : [ records ],
|
|
964
|
+
recordKey,
|
|
965
|
+
meta,
|
|
966
|
+
query,
|
|
967
|
+
kind,
|
|
968
|
+
name,
|
|
969
|
+
invalidateCache,
|
|
970
|
+
} );
|
|
971
|
+
};
|
package/src/entities.js
CHANGED
|
@@ -205,8 +205,13 @@ export const rootEntitiesConfig = [
|
|
|
205
205
|
kind: 'root',
|
|
206
206
|
baseURL: '/wp/v2/global-styles',
|
|
207
207
|
baseURLParams: { context: 'edit' },
|
|
208
|
-
plural: 'globalStylesVariations', // Should be different
|
|
208
|
+
plural: 'globalStylesVariations', // Should be different from name.
|
|
209
209
|
getTitle: ( record ) => record?.title?.rendered || record?.title,
|
|
210
|
+
getRevisionsUrl: ( parentId, revisionId ) =>
|
|
211
|
+
`/wp/v2/global-styles/${ parentId }/revisions${
|
|
212
|
+
revisionId ? '/' + revisionId : ''
|
|
213
|
+
}`,
|
|
214
|
+
supportsPagination: true,
|
|
210
215
|
},
|
|
211
216
|
{
|
|
212
217
|
label: __( 'Themes' ),
|
|
@@ -328,6 +333,13 @@ async function loadPostTypeEntities() {
|
|
|
328
333
|
syncObjectType: 'postType/' + postType.name,
|
|
329
334
|
getSyncObjectId: ( id ) => id,
|
|
330
335
|
supportsPagination: true,
|
|
336
|
+
getRevisionsUrl: ( parentId, revisionId ) =>
|
|
337
|
+
`/${ namespace }/${
|
|
338
|
+
postType.rest_base
|
|
339
|
+
}/${ parentId }/revisions${
|
|
340
|
+
revisionId ? '/' + revisionId : ''
|
|
341
|
+
}`,
|
|
342
|
+
revisionKey: isTemplate ? 'wp_id' : DEFAULT_ENTITY_KEY,
|
|
331
343
|
};
|
|
332
344
|
} );
|
|
333
345
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Context, ContextualField, OmitNevers } from './helpers';
|
|
5
|
+
|
|
6
|
+
import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
|
|
7
|
+
|
|
8
|
+
declare module './base-entity-records' {
|
|
9
|
+
export namespace BaseEntityRecords {
|
|
10
|
+
export interface GlobalStylesRevision< C extends Context > {
|
|
11
|
+
/**
|
|
12
|
+
* The ID for the author of the global styles revision.
|
|
13
|
+
*/
|
|
14
|
+
author: number;
|
|
15
|
+
/**
|
|
16
|
+
* The date the post global styles revision published, in the site's timezone.
|
|
17
|
+
*/
|
|
18
|
+
date: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The date the global styles revision was published, as GMT.
|
|
21
|
+
*/
|
|
22
|
+
date_gmt: ContextualField< string | null, 'view' | 'edit', C >;
|
|
23
|
+
/**
|
|
24
|
+
* Unique identifier for the revision.
|
|
25
|
+
*/
|
|
26
|
+
id: number;
|
|
27
|
+
/**
|
|
28
|
+
* The date the global styles revision was last modified, in the site's timezone.
|
|
29
|
+
*/
|
|
30
|
+
modified: ContextualField< string, 'view' | 'edit', C >;
|
|
31
|
+
/**
|
|
32
|
+
* The date the global styles revision was last modified, as GMT.
|
|
33
|
+
*/
|
|
34
|
+
modified_gmt: ContextualField< string, 'view' | 'edit', C >;
|
|
35
|
+
/**
|
|
36
|
+
* Identifier for the parent of the revision.
|
|
37
|
+
*/
|
|
38
|
+
parent: number;
|
|
39
|
+
styles: Record< string, Object >;
|
|
40
|
+
settings: Record< string, Object >;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type GlobalStylesRevision< C extends Context = 'view' > = OmitNevers<
|
|
46
|
+
_BaseEntityRecords.GlobalStylesRevision< C >
|
|
47
|
+
>;
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
import type { Context, Updatable } from './helpers';
|
|
5
5
|
import type { Attachment } from './attachment';
|
|
6
6
|
import type { Comment } from './comment';
|
|
7
|
+
import type { GlobalStylesRevision } from './global-styles-revision';
|
|
7
8
|
import type { MenuLocation } from './menu-location';
|
|
8
9
|
import type { NavMenu } from './nav-menu';
|
|
9
10
|
import type { NavMenuItem } from './nav-menu-item';
|
|
10
11
|
import type { Page } from './page';
|
|
11
12
|
import type { Plugin } from './plugin';
|
|
12
13
|
import type { Post } from './post';
|
|
14
|
+
import type { PostRevision } from './post-revision';
|
|
13
15
|
import type { Settings } from './settings';
|
|
14
16
|
import type { Sidebar } from './sidebar';
|
|
15
17
|
import type { Taxonomy } from './taxonomy';
|
|
@@ -27,12 +29,14 @@ export type {
|
|
|
27
29
|
Attachment,
|
|
28
30
|
Comment,
|
|
29
31
|
Context,
|
|
32
|
+
GlobalStylesRevision,
|
|
30
33
|
MenuLocation,
|
|
31
34
|
NavMenu,
|
|
32
35
|
NavMenuItem,
|
|
33
36
|
Page,
|
|
34
37
|
Plugin,
|
|
35
38
|
Post,
|
|
39
|
+
PostRevision,
|
|
36
40
|
Settings,
|
|
37
41
|
Sidebar,
|
|
38
42
|
Taxonomy,
|
|
@@ -82,12 +86,14 @@ export interface PerPackageEntityRecords< C extends Context > {
|
|
|
82
86
|
core:
|
|
83
87
|
| Attachment< C >
|
|
84
88
|
| Comment< C >
|
|
89
|
+
| GlobalStylesRevision< C >
|
|
85
90
|
| MenuLocation< C >
|
|
86
91
|
| NavMenu< C >
|
|
87
92
|
| NavMenuItem< C >
|
|
88
93
|
| Page< C >
|
|
89
94
|
| Plugin< C >
|
|
90
95
|
| Post< C >
|
|
96
|
+
| PostRevision< C >
|
|
91
97
|
| Settings< C >
|
|
92
98
|
| Sidebar< C >
|
|
93
99
|
| Taxonomy< C >
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type {
|
|
5
|
+
Context,
|
|
6
|
+
ContextualField,
|
|
7
|
+
RenderedText,
|
|
8
|
+
OmitNevers,
|
|
9
|
+
} from './helpers';
|
|
10
|
+
|
|
11
|
+
import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
|
|
12
|
+
|
|
13
|
+
declare module './base-entity-records' {
|
|
14
|
+
export namespace BaseEntityRecords {
|
|
15
|
+
export interface PostRevision< C extends Context > {
|
|
16
|
+
/**
|
|
17
|
+
* The ID for the author of the post revision.
|
|
18
|
+
*/
|
|
19
|
+
author: number;
|
|
20
|
+
/**
|
|
21
|
+
* The content for the post.
|
|
22
|
+
*/
|
|
23
|
+
content: ContextualField<
|
|
24
|
+
RenderedText< C > & {
|
|
25
|
+
/**
|
|
26
|
+
* Whether the content is protected with a password.
|
|
27
|
+
*/
|
|
28
|
+
is_protected: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Version of the content block format used by the post.
|
|
31
|
+
*/
|
|
32
|
+
block_version: ContextualField< string, 'edit', C >;
|
|
33
|
+
},
|
|
34
|
+
'view' | 'edit',
|
|
35
|
+
C
|
|
36
|
+
>;
|
|
37
|
+
/**
|
|
38
|
+
* The date the post was published, in the site's timezone.
|
|
39
|
+
*/
|
|
40
|
+
date: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* The date the post was published, as GMT.
|
|
43
|
+
*/
|
|
44
|
+
date_gmt: ContextualField< string | null, 'view' | 'edit', C >;
|
|
45
|
+
/**
|
|
46
|
+
* The excerpt for the post revision.
|
|
47
|
+
*/
|
|
48
|
+
excerpt: RenderedText< C > & {
|
|
49
|
+
protected: boolean;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The globally unique identifier for the post.
|
|
53
|
+
*/
|
|
54
|
+
guid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;
|
|
55
|
+
/**
|
|
56
|
+
* Unique identifier for the revision.
|
|
57
|
+
*/
|
|
58
|
+
id: number;
|
|
59
|
+
/**
|
|
60
|
+
* Meta fields.
|
|
61
|
+
*/
|
|
62
|
+
meta: ContextualField<
|
|
63
|
+
Record< string, string >,
|
|
64
|
+
'view' | 'edit',
|
|
65
|
+
C
|
|
66
|
+
>;
|
|
67
|
+
/**
|
|
68
|
+
* The date the post was last modified, in the site's timezone.
|
|
69
|
+
*/
|
|
70
|
+
modified: ContextualField< string, 'view' | 'edit', C >;
|
|
71
|
+
/**
|
|
72
|
+
* The date the post revision was last modified, as GMT.
|
|
73
|
+
*/
|
|
74
|
+
modified_gmt: ContextualField< string, 'view' | 'edit', C >;
|
|
75
|
+
/**
|
|
76
|
+
* Identifier for the parent of the revision.
|
|
77
|
+
*/
|
|
78
|
+
parent: number;
|
|
79
|
+
/**
|
|
80
|
+
* An alphanumeric identifier for the post unique to its type.
|
|
81
|
+
*/
|
|
82
|
+
slug: string;
|
|
83
|
+
/**
|
|
84
|
+
* The title for the post revision.
|
|
85
|
+
*/
|
|
86
|
+
title: RenderedText< C >;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type PostRevision< C extends Context = 'view' > = OmitNevers<
|
|
92
|
+
_BaseEntityRecords.PostRevision< C >
|
|
93
|
+
>;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { create } from '@wordpress/rich-text';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Internal dependencies
|
|
8
3
|
*/
|
|
@@ -14,18 +9,16 @@ function getBlockFootnotesOrder( block ) {
|
|
|
14
9
|
if ( ! cache.has( block ) ) {
|
|
15
10
|
const order = [];
|
|
16
11
|
for ( const value of getRichTextValuesCached( block ) ) {
|
|
17
|
-
if ( ! value
|
|
12
|
+
if ( ! value ) {
|
|
18
13
|
continue;
|
|
19
14
|
}
|
|
20
15
|
|
|
21
16
|
// replacements is a sparse array, use forEach to skip empty slots.
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
order.push( attributes[ 'data-fn' ] );
|
|
26
|
-
}
|
|
17
|
+
value.replacements.forEach( ( { type, attributes } ) => {
|
|
18
|
+
if ( type === 'core/footnote' ) {
|
|
19
|
+
order.push( attributes[ 'data-fn' ] );
|
|
27
20
|
}
|
|
28
|
-
);
|
|
21
|
+
} );
|
|
29
22
|
}
|
|
30
23
|
cache.set( block, order );
|
|
31
24
|
}
|