@wordpress/core-data 7.45.0 → 7.45.1-next.v.202605131032.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/build/actions.cjs +8 -6
- package/build/actions.cjs.map +2 -2
- package/build/awareness/post-editor-awareness.cjs +1 -1
- package/build/awareness/post-editor-awareness.cjs.map +2 -2
- package/build/resolvers.cjs +2 -1
- package/build/resolvers.cjs.map +2 -2
- package/build/types.cjs.map +2 -2
- package/build/utils/block-selection-history.cjs +4 -1
- package/build/utils/block-selection-history.cjs.map +2 -2
- package/build/utils/crdt-blocks.cjs +157 -89
- package/build/utils/crdt-blocks.cjs.map +2 -2
- package/build/utils/crdt-selection.cjs +1 -1
- package/build/utils/crdt-selection.cjs.map +2 -2
- package/build/utils/crdt-user-selections.cjs +4 -1
- package/build/utils/crdt-user-selections.cjs.map +2 -2
- package/build/utils/crdt-utils.cjs +18 -6
- package/build/utils/crdt-utils.cjs.map +2 -2
- package/build/utils/crdt.cjs +12 -2
- package/build/utils/crdt.cjs.map +2 -2
- package/build-module/actions.mjs +8 -6
- package/build-module/actions.mjs.map +2 -2
- package/build-module/awareness/post-editor-awareness.mjs +5 -2
- package/build-module/awareness/post-editor-awareness.mjs.map +2 -2
- package/build-module/resolvers.mjs +2 -1
- package/build-module/resolvers.mjs.map +2 -2
- package/build-module/types.mjs.map +2 -2
- package/build-module/utils/block-selection-history.mjs +5 -1
- package/build-module/utils/block-selection-history.mjs.map +2 -2
- package/build-module/utils/crdt-blocks.mjs +162 -90
- package/build-module/utils/crdt-blocks.mjs.map +2 -2
- package/build-module/utils/crdt-selection.mjs +2 -1
- package/build-module/utils/crdt-selection.mjs.map +2 -2
- package/build-module/utils/crdt-user-selections.mjs +9 -2
- package/build-module/utils/crdt-user-selections.mjs.map +2 -2
- package/build-module/utils/crdt-utils.mjs +16 -6
- package/build-module/utils/crdt-utils.mjs.map +2 -2
- package/build-module/utils/crdt.mjs +13 -2
- package/build-module/utils/crdt.mjs.map +2 -2
- package/build-types/actions.d.ts +177 -64
- package/build-types/actions.d.ts.map +1 -1
- package/build-types/awareness/awareness-state.d.ts.map +1 -1
- package/build-types/awareness/base-awareness.d.ts +0 -3
- package/build-types/awareness/base-awareness.d.ts.map +1 -1
- package/build-types/awareness/post-editor-awareness.d.ts +1 -8
- package/build-types/awareness/post-editor-awareness.d.ts.map +1 -1
- package/build-types/awareness/typed-awareness.d.ts.map +1 -1
- package/build-types/batch/create-batch.d.ts +1 -1
- package/build-types/batch/create-batch.d.ts.map +1 -1
- package/build-types/batch/default-processor.d.ts.map +1 -1
- package/build-types/batch/index.d.ts +2 -2
- package/build-types/batch/index.d.ts.map +1 -1
- package/build-types/entities.d.ts +114 -87
- package/build-types/entities.d.ts.map +1 -1
- package/build-types/entity-context.d.ts +1 -1
- package/build-types/entity-context.d.ts.map +1 -1
- package/build-types/entity-provider.d.ts +2 -2
- package/build-types/entity-provider.d.ts.map +1 -1
- package/build-types/entity-types/attachment.d.ts.map +1 -1
- package/build-types/entity-types/base-entity-records.d.ts.map +1 -1
- package/build-types/entity-types/base.d.ts.map +1 -1
- package/build-types/entity-types/comment.d.ts.map +1 -1
- package/build-types/entity-types/font-collection.d.ts.map +1 -1
- package/build-types/entity-types/font-family.d.ts.map +1 -1
- package/build-types/entity-types/global-styles-revision.d.ts.map +1 -1
- package/build-types/entity-types/icon.d.ts.map +1 -1
- package/build-types/entity-types/menu-location.d.ts.map +1 -1
- package/build-types/entity-types/nav-menu-item.d.ts.map +1 -1
- package/build-types/entity-types/nav-menu.d.ts.map +1 -1
- package/build-types/entity-types/page.d.ts.map +1 -1
- package/build-types/entity-types/plugin.d.ts.map +1 -1
- package/build-types/entity-types/post-revision.d.ts.map +1 -1
- package/build-types/entity-types/post-status.d.ts.map +1 -1
- package/build-types/entity-types/post.d.ts.map +1 -1
- package/build-types/entity-types/settings.d.ts.map +1 -1
- package/build-types/entity-types/sidebar.d.ts.map +1 -1
- package/build-types/entity-types/taxonomy.d.ts.map +1 -1
- package/build-types/entity-types/term.d.ts.map +1 -1
- package/build-types/entity-types/theme.d.ts.map +1 -1
- package/build-types/entity-types/type.d.ts.map +1 -1
- package/build-types/entity-types/user.d.ts.map +1 -1
- package/build-types/entity-types/widget-type.d.ts.map +1 -1
- package/build-types/entity-types/widget.d.ts.map +1 -1
- package/build-types/entity-types/wp-template-part.d.ts.map +1 -1
- package/build-types/entity-types/wp-template.d.ts.map +1 -1
- package/build-types/fetch/__experimental-fetch-url-data.d.ts +2 -5
- package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -1
- package/build-types/fetch/index.d.ts +3 -3
- package/build-types/fetch/index.d.ts.map +1 -1
- package/build-types/footnotes/get-footnotes-order.d.ts.map +1 -1
- package/build-types/footnotes/get-rich-text-values-cached.d.ts.map +1 -1
- package/build-types/footnotes/index.d.ts +1 -1
- package/build-types/footnotes/index.d.ts.map +1 -1
- package/build-types/hooks/use-entity-block-editor.d.ts +1 -1
- package/build-types/hooks/use-entity-block-editor.d.ts.map +1 -1
- package/build-types/hooks/use-entity-id.d.ts.map +1 -1
- package/build-types/hooks/use-entity-prop.d.ts.map +1 -1
- package/build-types/hooks/use-resource-permissions.d.ts.map +1 -1
- package/build-types/index.d.ts +155 -153
- package/build-types/index.d.ts.map +1 -1
- package/build-types/locks/actions.d.ts +1 -1
- package/build-types/locks/actions.d.ts.map +1 -1
- package/build-types/locks/engine.d.ts +1 -1
- package/build-types/locks/engine.d.ts.map +1 -1
- package/build-types/locks/reducer.d.ts.map +1 -1
- package/build-types/locks/selectors.d.ts +2 -2
- package/build-types/locks/selectors.d.ts.map +1 -1
- package/build-types/locks/utils.d.ts +5 -5
- package/build-types/locks/utils.d.ts.map +1 -1
- package/build-types/name.d.ts +1 -1
- package/build-types/name.d.ts.map +1 -1
- package/build-types/private-actions.d.ts +45 -29
- package/build-types/private-actions.d.ts.map +1 -1
- package/build-types/private-apis.d.ts +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/queried-data/actions.d.ts +3 -3
- package/build-types/queried-data/actions.d.ts.map +1 -1
- package/build-types/queried-data/get-query-parts.d.ts +10 -34
- package/build-types/queried-data/get-query-parts.d.ts.map +1 -1
- package/build-types/queried-data/index.d.ts +3 -3
- package/build-types/queried-data/index.d.ts.map +1 -1
- package/build-types/queried-data/reducer.d.ts +7 -23
- package/build-types/queried-data/reducer.d.ts.map +1 -1
- package/build-types/queried-data/selectors.d.ts +3 -3
- package/build-types/queried-data/selectors.d.ts.map +1 -1
- package/build-types/reducer.d.ts +40 -32
- package/build-types/reducer.d.ts.map +1 -1
- package/build-types/resolvers.d.ts +130 -47
- package/build-types/resolvers.d.ts.map +1 -1
- package/build-types/selectors.d.ts +1 -1
- package/build-types/selectors.d.ts.map +1 -1
- package/build-types/types.d.ts +61 -6
- package/build-types/types.d.ts.map +1 -1
- package/build-types/utils/block-selection-history.d.ts.map +1 -1
- package/build-types/utils/conservative-map-item.d.ts.map +1 -1
- package/build-types/utils/crdt-blocks.d.ts +19 -9
- package/build-types/utils/crdt-blocks.d.ts.map +1 -1
- package/build-types/utils/crdt-selection.d.ts.map +1 -1
- package/build-types/utils/crdt-user-selections.d.ts.map +1 -1
- package/build-types/utils/crdt-utils.d.ts +35 -2
- package/build-types/utils/crdt-utils.d.ts.map +1 -1
- package/build-types/utils/crdt.d.ts.map +1 -1
- package/build-types/utils/forward-resolver.d.ts +2 -2
- package/build-types/utils/forward-resolver.d.ts.map +1 -1
- package/build-types/utils/get-nested-value.d.ts.map +1 -1
- package/build-types/utils/get-normalized-comma-separable.d.ts +1 -1
- package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -1
- package/build-types/utils/if-matching-action.d.ts +3 -3
- package/build-types/utils/if-matching-action.d.ts.map +1 -1
- package/build-types/utils/index.d.ts +12 -12
- package/build-types/utils/index.d.ts.map +1 -1
- package/build-types/utils/is-numeric-id.d.ts.map +1 -1
- package/build-types/utils/log-entity-deprecation.d.ts +1 -1
- package/build-types/utils/log-entity-deprecation.d.ts.map +1 -1
- package/build-types/utils/normalize-query-for-resolution.d.ts.map +1 -1
- package/build-types/utils/receive-intermediate-results.d.ts +1 -1
- package/build-types/utils/receive-intermediate-results.d.ts.map +1 -1
- package/build-types/utils/replace-action.d.ts +3 -3
- package/build-types/utils/replace-action.d.ts.map +1 -1
- package/build-types/utils/set-nested-value.d.ts.map +1 -1
- package/build-types/utils/user-permissions.d.ts +3 -3
- package/build-types/utils/user-permissions.d.ts.map +1 -1
- package/build-types/utils/with-weak-map-cache.d.ts +1 -1
- package/build-types/utils/with-weak-map-cache.d.ts.map +1 -1
- package/package.json +20 -20
- package/src/actions.js +7 -9
- package/src/awareness/post-editor-awareness.ts +5 -2
- package/src/resolvers.js +2 -1
- package/src/test/actions.js +58 -0
- package/src/test/resolvers.js +115 -2
- package/src/test/rtc-rich-text-offset-space.test.js +204 -0
- package/src/types.ts +63 -6
- package/src/utils/block-selection-history.ts +5 -1
- package/src/utils/crdt-blocks.ts +316 -116
- package/src/utils/crdt-selection.ts +2 -1
- package/src/utils/crdt-user-selections.ts +9 -2
- package/src/utils/crdt-utils.ts +53 -10
- package/src/utils/crdt.ts +30 -4
- package/src/utils/test/crdt-blocks.ts +74 -18
- package/src/utils/test/crdt-utils.ts +18 -2
- package/src/utils/test/rtc-rich-text-cursor-scope.test.js +267 -0
- package/src/utils/test/rtc-rich-text-offset-space.test.js +469 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/get-nested-value.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,
|
|
1
|
+
{"version":3,"file":"get-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/get-nested-value.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAE,MAAM,KAAA,EAAE,IAAI,EAJzC,MAAM,QAImC,EAAE,YAAY,EAHvD,GAGuD,GAFtD,GAAC,CAgBZ"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export default getNormalizedCommaSeparable;
|
|
2
1
|
/**
|
|
3
2
|
* Given a value which can be specified as one or the other of a comma-separated
|
|
4
3
|
* string or an array, returns a value normalized to an array of strings, or
|
|
@@ -9,4 +8,5 @@ export default getNormalizedCommaSeparable;
|
|
|
9
8
|
* @return {?(string[])} Normalized field value.
|
|
10
9
|
*/
|
|
11
10
|
declare function getNormalizedCommaSeparable(value: string | string[] | any): (string[]) | null;
|
|
11
|
+
export default getNormalizedCommaSeparable;
|
|
12
12
|
//# sourceMappingURL=get-normalized-comma-separable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-normalized-comma-separable.d.ts","sourceRoot":"","sources":["../../src/utils/get-normalized-comma-separable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-normalized-comma-separable.d.ts","sourceRoot":"","sources":["../../src/utils/get-normalized-comma-separable.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,iBAAS,2BAA2B,CAAE,KAAK,EAJhC,MAAM,GAAC,MAAM,EAAE,GAAC,GAIgB,GAF9B,CAAC,MAAM,EAAE,CAAC,OAAA,CAUtB;eAEc,2BAA2B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export default ifMatchingAction;
|
|
2
|
-
export type AnyFunction = import("../types").AnyFunction;
|
|
3
1
|
/** @typedef {import('../types').AnyFunction} AnyFunction */
|
|
2
|
+
export type AnyFunction = import('../types').AnyFunction;
|
|
4
3
|
/**
|
|
5
4
|
* A higher-order reducer creator which invokes the original reducer only if
|
|
6
5
|
* the dispatching action matches the given predicate, **OR** if state is
|
|
@@ -10,5 +9,6 @@ export type AnyFunction = import("../types").AnyFunction;
|
|
|
10
9
|
*
|
|
11
10
|
* @return {AnyFunction} Higher-order reducer.
|
|
12
11
|
*/
|
|
13
|
-
declare
|
|
12
|
+
declare const ifMatchingAction: (isMatch: AnyFunction) => AnyFunction;
|
|
13
|
+
export default ifMatchingAction;
|
|
14
14
|
//# sourceMappingURL=if-matching-action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"if-matching-action.d.ts","sourceRoot":"","sources":["../../src/utils/if-matching-action.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"if-matching-action.d.ts","sourceRoot":"","sources":["../../src/utils/if-matching-action.js"],"names":[],"mappings":"AAAA,4DAA4D;AAAxD,YAA0C,WAAW,GAA3C,OAAO,UAAU,EAAE,WAAW,CAAa;AAEzD;;;;;;;;GAQG;AACH,QAAA,MAAM,gBAAgB,YAJX,WAAW,KAEV,WAQX,CAAC;eAEa,gBAAgB"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { default as conservativeMapItem } from
|
|
2
|
-
export { default as getNormalizedCommaSeparable } from
|
|
3
|
-
export { default as ifMatchingAction } from
|
|
4
|
-
export { default as forwardResolver } from
|
|
5
|
-
export { default as replaceAction } from
|
|
6
|
-
export { default as withWeakMapCache } from
|
|
7
|
-
export { default as setNestedValue } from
|
|
8
|
-
export { default as getNestedValue } from
|
|
9
|
-
export { default as isNumericID } from
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
1
|
+
export { default as conservativeMapItem } from './conservative-map-item';
|
|
2
|
+
export { default as getNormalizedCommaSeparable } from './get-normalized-comma-separable';
|
|
3
|
+
export { default as ifMatchingAction } from './if-matching-action';
|
|
4
|
+
export { default as forwardResolver } from './forward-resolver';
|
|
5
|
+
export { default as replaceAction } from './replace-action';
|
|
6
|
+
export { default as withWeakMapCache } from './with-weak-map-cache';
|
|
7
|
+
export { default as setNestedValue } from './set-nested-value';
|
|
8
|
+
export { default as getNestedValue } from './get-nested-value';
|
|
9
|
+
export { default as isNumericID } from './is-numeric-id';
|
|
10
|
+
export { getUserPermissionCacheKey, getUserPermissionsFromAllowHeader, ALLOWED_RESOURCE_ACTIONS, } from './user-permissions';
|
|
11
|
+
export { RECEIVE_INTERMEDIATE_RESULTS } from './receive-intermediate-results';
|
|
12
|
+
export { default as normalizeQueryForResolution } from './normalize-query-for-resolution';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACN,yBAAyB,EACzB,iCAAiC,EACjC,wBAAwB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-numeric-id.d.ts","sourceRoot":"","sources":["../../src/utils/is-numeric-id.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"is-numeric-id.d.ts","sourceRoot":"","sources":["../../src/utils/is-numeric-id.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,EAAE,EAH5B,GAG4B,GAF3B,OAAO,CAIlB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @param options.alternativeFunctionName The name of the alternative function that should be used instead.
|
|
9
9
|
* @param options.isShorthandSelector Whether the function is a shorthand selector.
|
|
10
10
|
*/
|
|
11
|
-
export default function logEntityDeprecation(kind: string, name: string, functionName: string, { alternativeFunctionName, isShorthandSelector
|
|
11
|
+
export default function logEntityDeprecation(kind: string, name: string, functionName: string, { alternativeFunctionName, isShorthandSelector }?: {
|
|
12
12
|
alternativeFunctionName?: string;
|
|
13
13
|
isShorthandSelector?: boolean;
|
|
14
14
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-entity-deprecation.d.ts","sourceRoot":"","sources":["../../src/utils/log-entity-deprecation.ts"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,EACC,uBAAuB,EACvB,mBAA2B,
|
|
1
|
+
{"version":3,"file":"log-entity-deprecation.d.ts","sourceRoot":"","sources":["../../src/utils/log-entity-deprecation.ts"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,EACC,uBAAuB,EACvB,mBAA2B,EAC3B,GAAE;IACF,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACzB,QAkCN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-query-for-resolution.d.ts","sourceRoot":"","sources":["../../src/utils/normalize-query-for-resolution.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,
|
|
1
|
+
{"version":3,"file":"normalize-query-for-resolution.d.ts","sourceRoot":"","sources":["../../src/utils/normalize-query-for-resolution.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAE,KAAK,KAAA,GAF9C,MAAO,SAAS,CAc3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const RECEIVE_INTERMEDIATE_RESULTS: unique symbol;
|
|
1
|
+
export declare const RECEIVE_INTERMEDIATE_RESULTS: unique symbol;
|
|
2
2
|
//# sourceMappingURL=receive-intermediate-results.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"receive-intermediate-results.d.ts","sourceRoot":"","sources":["../../src/utils/receive-intermediate-results.js"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"receive-intermediate-results.d.ts","sourceRoot":"","sources":["../../src/utils/receive-intermediate-results.js"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,eAExC,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export default replaceAction;
|
|
2
|
-
export type AnyFunction = import("../types").AnyFunction;
|
|
3
1
|
/** @typedef {import('../types').AnyFunction} AnyFunction */
|
|
2
|
+
export type AnyFunction = import('../types').AnyFunction;
|
|
4
3
|
/**
|
|
5
4
|
* Higher-order reducer creator which substitutes the action object before
|
|
6
5
|
* passing to the original reducer.
|
|
@@ -9,5 +8,6 @@ export type AnyFunction = import("../types").AnyFunction;
|
|
|
9
8
|
*
|
|
10
9
|
* @return {AnyFunction} Higher-order reducer.
|
|
11
10
|
*/
|
|
12
|
-
declare
|
|
11
|
+
declare const replaceAction: (replacer: AnyFunction) => AnyFunction;
|
|
12
|
+
export default replaceAction;
|
|
13
13
|
//# sourceMappingURL=replace-action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-action.d.ts","sourceRoot":"","sources":["../../src/utils/replace-action.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"replace-action.d.ts","sourceRoot":"","sources":["../../src/utils/replace-action.js"],"names":[],"mappings":"AAAA,4DAA4D;AAAxD,YAA0C,WAAW,GAA3C,OAAO,UAAU,EAAE,WAAW,CAAa;AAEzD;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,aAJR,WAAW,KAEV,WAIX,CAAC;eAEa,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/set-nested-value.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,
|
|
1
|
+
{"version":3,"file":"set-nested-value.d.ts","sourceRoot":"","sources":["../../src/utils/set-nested-value.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAE,MAAM,KAAA,EAAE,IAAI,EAHzC,QAAM,MAGmC,EAAE,KAAK,EAFhD,GAEgD,OAsB1D"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export function
|
|
3
|
-
export
|
|
1
|
+
export declare const ALLOWED_RESOURCE_ACTIONS: string[];
|
|
2
|
+
export declare function getUserPermissionsFromAllowHeader(allowedMethods: any): {};
|
|
3
|
+
export declare function getUserPermissionCacheKey(action: any, resource: any, id: any): string;
|
|
4
4
|
//# sourceMappingURL=user-permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-permissions.d.ts","sourceRoot":"","sources":["../../src/utils/user-permissions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user-permissions.d.ts","sourceRoot":"","sources":["../../src/utils/user-permissions.js"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,UAKpC,CAAC;AAEF,wBAAgB,iCAAiC,CAAE,cAAc,KAAA,MAgBhE;AAED,wBAAgB,yBAAyB,CAAE,MAAM,KAAA,EAAE,QAAQ,KAAA,EAAE,EAAE,KAAA,UAU9D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export default withWeakMapCache;
|
|
2
1
|
/**
|
|
3
2
|
* Given a function, returns an enhanced function which caches the result and
|
|
4
3
|
* tracks in WeakMap. The result is only cached if the original function is
|
|
@@ -9,4 +8,5 @@ export default withWeakMapCache;
|
|
|
9
8
|
* @return {Function} Enhanced caching function.
|
|
10
9
|
*/
|
|
11
10
|
declare function withWeakMapCache(fn: Function): Function;
|
|
11
|
+
export default withWeakMapCache;
|
|
12
12
|
//# sourceMappingURL=with-weak-map-cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-weak-map-cache.d.ts","sourceRoot":"","sources":["../../src/utils/with-weak-map-cache.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"with-weak-map-cache.d.ts","sourceRoot":"","sources":["../../src/utils/with-weak-map-cache.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,iBAAS,gBAAgB,CAAE,EAAE,UAAA,YAoB5B;eAEc,gBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/core-data",
|
|
3
|
-
"version": "7.45.0",
|
|
3
|
+
"version": "7.45.1-next.v.202605131032.0+f6d6e7149",
|
|
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",
|
|
@@ -49,32 +49,32 @@
|
|
|
49
49
|
"build-module/index.mjs"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@wordpress/api-fetch": "^7.45.0",
|
|
53
|
-
"@wordpress/block-editor": "^15.
|
|
54
|
-
"@wordpress/blocks": "^15.18.0",
|
|
55
|
-
"@wordpress/compose": "^7.45.0",
|
|
56
|
-
"@wordpress/data": "^10.45.0",
|
|
57
|
-
"@wordpress/deprecated": "^4.45.0",
|
|
58
|
-
"@wordpress/element": "^6.45.0",
|
|
59
|
-
"@wordpress/html-entities": "^4.45.0",
|
|
60
|
-
"@wordpress/i18n": "^6.18.0",
|
|
61
|
-
"@wordpress/is-shallow-equal": "^5.45.0",
|
|
62
|
-
"@wordpress/private-apis": "^1.45.0",
|
|
63
|
-
"@wordpress/rich-text": "^7.45.0",
|
|
64
|
-
"@wordpress/sync": "^1.45.0",
|
|
65
|
-
"@wordpress/undo-manager": "^1.45.0",
|
|
66
|
-
"@wordpress/url": "^4.45.0",
|
|
67
|
-
"@wordpress/warning": "^3.45.0",
|
|
52
|
+
"@wordpress/api-fetch": "^7.45.1-next.v.202605131032.0+f6d6e7149",
|
|
53
|
+
"@wordpress/block-editor": "^15.19.1-next.v.202605131032.0+f6d6e7149",
|
|
54
|
+
"@wordpress/blocks": "^15.18.1-next.v.202605131032.0+f6d6e7149",
|
|
55
|
+
"@wordpress/compose": "^7.45.1-next.v.202605131032.0+f6d6e7149",
|
|
56
|
+
"@wordpress/data": "^10.45.1-next.v.202605131032.0+f6d6e7149",
|
|
57
|
+
"@wordpress/deprecated": "^4.45.1-next.v.202605131032.0+f6d6e7149",
|
|
58
|
+
"@wordpress/element": "^6.45.1-next.v.202605131032.0+f6d6e7149",
|
|
59
|
+
"@wordpress/html-entities": "^4.45.1-next.v.202605131032.0+f6d6e7149",
|
|
60
|
+
"@wordpress/i18n": "^6.18.1-next.v.202605131032.0+f6d6e7149",
|
|
61
|
+
"@wordpress/is-shallow-equal": "^5.45.1-next.v.202605131032.0+f6d6e7149",
|
|
62
|
+
"@wordpress/private-apis": "^1.45.1-next.v.202605131032.0+f6d6e7149",
|
|
63
|
+
"@wordpress/rich-text": "^7.45.1-next.v.202605131032.0+f6d6e7149",
|
|
64
|
+
"@wordpress/sync": "^1.45.1-next.v.202605131032.0+f6d6e7149",
|
|
65
|
+
"@wordpress/undo-manager": "^1.45.1-next.v.202605131032.0+f6d6e7149",
|
|
66
|
+
"@wordpress/url": "^4.45.1-next.v.202605131032.0+f6d6e7149",
|
|
67
|
+
"@wordpress/warning": "^3.45.1-next.v.202605131032.0+f6d6e7149",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"equivalent-key-map": "^0.2.2",
|
|
70
70
|
"fast-deep-equal": "^3.1.3",
|
|
71
71
|
"memize": "^2.1.0",
|
|
72
|
-
"uuid": "^
|
|
72
|
+
"uuid": "^14.0.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@jest/globals": "^30.2.0",
|
|
76
76
|
"@types/jest": "^29.5.14",
|
|
77
|
-
"@types/node": "^20.19.
|
|
77
|
+
"@types/node": "^20.19.39",
|
|
78
78
|
"deep-freeze": "0.0.1"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "0e198c7ac7ca634e73ded9220ce048c0302174dd"
|
|
88
88
|
}
|
package/src/actions.js
CHANGED
|
@@ -597,17 +597,15 @@ export const __unstableCreateUndoLevel =
|
|
|
597
597
|
* the exceptions. Defaults to false.
|
|
598
598
|
*/
|
|
599
599
|
export const saveEntityRecord =
|
|
600
|
-
(
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
record,
|
|
604
|
-
{
|
|
600
|
+
( kind, name, record, options = {} ) =>
|
|
601
|
+
async ( { select, resolveSelect, dispatch } ) => {
|
|
602
|
+
const {
|
|
605
603
|
isAutosave = false,
|
|
606
604
|
__unstableFetch = apiFetch,
|
|
605
|
+
__unstableSkipSyncUpdate = false,
|
|
607
606
|
throwOnError = false,
|
|
608
|
-
} =
|
|
609
|
-
|
|
610
|
-
async ( { select, resolveSelect, dispatch } ) => {
|
|
607
|
+
} = options;
|
|
608
|
+
|
|
611
609
|
logEntityDeprecation( kind, name, 'saveEntityRecord' );
|
|
612
610
|
const configs = await resolveSelect.getEntitiesConfig( kind );
|
|
613
611
|
const entityConfig = configs.find(
|
|
@@ -798,7 +796,7 @@ export const saveEntityRecord =
|
|
|
798
796
|
getSyncManager()?.update(
|
|
799
797
|
`${ kind }/${ name }`,
|
|
800
798
|
recordId,
|
|
801
|
-
updatedRecord,
|
|
799
|
+
__unstableSkipSyncUpdate ? {} : updatedRecord,
|
|
802
800
|
LOCAL_UNDO_IGNORED_ORIGIN,
|
|
803
801
|
{ isSave: true }
|
|
804
802
|
);
|
|
@@ -16,7 +16,10 @@ import {
|
|
|
16
16
|
LOCAL_CURSOR_UPDATE_DEBOUNCE_IN_MS,
|
|
17
17
|
} from './config';
|
|
18
18
|
import { STORE_NAME as coreStore } from '../name';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
asHtmlStringIndex,
|
|
21
|
+
htmlIndexToRichTextOffset,
|
|
22
|
+
} from '../utils/crdt-utils';
|
|
20
23
|
import {
|
|
21
24
|
areSelectionsStatesEqual,
|
|
22
25
|
getSelectionState,
|
|
@@ -291,7 +294,7 @@ export class PostEditorAwareness extends BaseAwarenessState< PostEditorState > {
|
|
|
291
294
|
return {
|
|
292
295
|
richTextOffset: htmlIndexToRichTextOffset(
|
|
293
296
|
absolutePosition.type.toString(),
|
|
294
|
-
absolutePosition.index
|
|
297
|
+
asHtmlStringIndex( absolutePosition.index )
|
|
295
298
|
),
|
|
296
299
|
localClientId,
|
|
297
300
|
};
|
package/src/resolvers.js
CHANGED
package/src/test/actions.js
CHANGED
|
@@ -33,6 +33,7 @@ jest.mock( '../batch', () => {
|
|
|
33
33
|
jest.mock( '../sync', () => ( {
|
|
34
34
|
getSyncManager: jest.fn(),
|
|
35
35
|
LOCAL_EDITOR_ORIGIN: 'local-editor',
|
|
36
|
+
LOCAL_UNDO_IGNORED_ORIGIN: 'local-undo-ignored',
|
|
36
37
|
} ) );
|
|
37
38
|
|
|
38
39
|
describe( 'editEntityRecord', () => {
|
|
@@ -922,6 +923,63 @@ describe( 'saveEntityRecord', () => {
|
|
|
922
923
|
expect( result ).toBe( updatedRecord );
|
|
923
924
|
} );
|
|
924
925
|
|
|
926
|
+
it( 'preserves the live sync title when a CRDT persistence save returns stale post fields', async () => {
|
|
927
|
+
const liveSyncState = {
|
|
928
|
+
isSaved: false,
|
|
929
|
+
title: 'synced title',
|
|
930
|
+
};
|
|
931
|
+
const post = { id: 10, title: 'synced title' };
|
|
932
|
+
const configs = [
|
|
933
|
+
{
|
|
934
|
+
name: 'post',
|
|
935
|
+
kind: 'postType',
|
|
936
|
+
baseURL: '/wp/v2/posts',
|
|
937
|
+
syncConfig: {},
|
|
938
|
+
},
|
|
939
|
+
];
|
|
940
|
+
const syncManager = {
|
|
941
|
+
update: jest.fn(
|
|
942
|
+
( _objectType, _objectId, changes, _origin, options ) => {
|
|
943
|
+
if (
|
|
944
|
+
Object.prototype.hasOwnProperty.call( changes, 'title' )
|
|
945
|
+
) {
|
|
946
|
+
liveSyncState.title = changes.title;
|
|
947
|
+
}
|
|
948
|
+
if ( options?.isSave ) {
|
|
949
|
+
liveSyncState.isSaved = true;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
),
|
|
953
|
+
};
|
|
954
|
+
const select = {
|
|
955
|
+
getRawEntityRecord: () => post,
|
|
956
|
+
};
|
|
957
|
+
const resolveSelect = { getEntitiesConfig: jest.fn( () => configs ) };
|
|
958
|
+
|
|
959
|
+
const staleSaveResponse = { ...post, title: 'initial title' };
|
|
960
|
+
apiFetch.mockImplementation( () => {
|
|
961
|
+
return staleSaveResponse;
|
|
962
|
+
} );
|
|
963
|
+
getSyncManager.mockReturnValue( syncManager );
|
|
964
|
+
|
|
965
|
+
const result = await saveEntityRecord( 'postType', 'post', post, {
|
|
966
|
+
__unstableSkipSyncUpdate: true,
|
|
967
|
+
} )( { select, dispatch, resolveSelect } );
|
|
968
|
+
|
|
969
|
+
expect( syncManager.update ).toHaveBeenCalledWith(
|
|
970
|
+
'postType/post',
|
|
971
|
+
10,
|
|
972
|
+
{},
|
|
973
|
+
'local-undo-ignored',
|
|
974
|
+
{ isSave: true }
|
|
975
|
+
);
|
|
976
|
+
expect( liveSyncState ).toEqual( {
|
|
977
|
+
isSaved: true,
|
|
978
|
+
title: 'synced title',
|
|
979
|
+
} );
|
|
980
|
+
expect( result ).toBe( staleSaveResponse );
|
|
981
|
+
} );
|
|
982
|
+
|
|
925
983
|
it( 'triggers a PUT request for an existing record with a custom key', async () => {
|
|
926
984
|
const postType = { slug: 'page', title: 'Pages' };
|
|
927
985
|
const configs = [
|
package/src/test/resolvers.js
CHANGED
|
@@ -11,6 +11,7 @@ import { getSyncManager } from '../sync';
|
|
|
11
11
|
jest.mock( '@wordpress/api-fetch' );
|
|
12
12
|
jest.mock( '../sync', () => ( {
|
|
13
13
|
getSyncManager: jest.fn(),
|
|
14
|
+
LOCAL_UNDO_IGNORED_ORIGIN: 'local-undo-ignored',
|
|
14
15
|
} ) );
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
24
25
|
getAutosaves,
|
|
25
26
|
getCurrentUser,
|
|
26
27
|
} from '../resolvers';
|
|
28
|
+
import { saveEntityRecord } from '../actions';
|
|
27
29
|
import { RECEIVE_INTERMEDIATE_RESULTS } from '../utils';
|
|
28
30
|
|
|
29
31
|
describe( 'getEntityRecord', () => {
|
|
@@ -285,7 +287,8 @@ describe( 'getEntityRecord', () => {
|
|
|
285
287
|
expect( dispatch.saveEntityRecord ).toHaveBeenCalledWith(
|
|
286
288
|
'postType',
|
|
287
289
|
'post',
|
|
288
|
-
EDITED_RECORD
|
|
290
|
+
EDITED_RECORD,
|
|
291
|
+
{ __unstableSkipSyncUpdate: true }
|
|
289
292
|
);
|
|
290
293
|
} );
|
|
291
294
|
|
|
@@ -336,8 +339,118 @@ describe( 'getEntityRecord', () => {
|
|
|
336
339
|
expect( dispatch.saveEntityRecord ).toHaveBeenCalledWith(
|
|
337
340
|
'postType',
|
|
338
341
|
'post',
|
|
339
|
-
POST_RECORD
|
|
342
|
+
POST_RECORD,
|
|
343
|
+
{ __unstableSkipSyncUpdate: true }
|
|
344
|
+
);
|
|
345
|
+
} );
|
|
346
|
+
|
|
347
|
+
it( 'persistCRDTDoc does not replay a stale save response into the sync document', async () => {
|
|
348
|
+
const INITIAL_TITLE = 'Initial Title';
|
|
349
|
+
const SYNCED_TITLE = 'Synced Title';
|
|
350
|
+
const POST_RECORD = { id: 1, title: INITIAL_TITLE, meta: {} };
|
|
351
|
+
const EDITED_RECORD = { id: 1, title: SYNCED_TITLE, meta: {} };
|
|
352
|
+
const STALE_SAVE_RESPONSE = {
|
|
353
|
+
id: 1,
|
|
354
|
+
title: INITIAL_TITLE,
|
|
355
|
+
meta: { _crdt_document: 'serialized-crdt-doc' },
|
|
356
|
+
};
|
|
357
|
+
const liveSyncState = {
|
|
358
|
+
isSaved: false,
|
|
359
|
+
title: SYNCED_TITLE,
|
|
360
|
+
};
|
|
361
|
+
const POST_RESPONSE = {
|
|
362
|
+
json: () => Promise.resolve( POST_RECORD ),
|
|
363
|
+
};
|
|
364
|
+
const ENTITIES_WITH_SYNC = [
|
|
365
|
+
{
|
|
366
|
+
name: 'post',
|
|
367
|
+
kind: 'postType',
|
|
368
|
+
baseURL: '/wp/v2/posts',
|
|
369
|
+
baseURLParams: { context: 'edit' },
|
|
370
|
+
syncConfig: {},
|
|
371
|
+
__unstablePrePersist: jest.fn( async () => ( {
|
|
372
|
+
meta: { _crdt_document: 'serialized-crdt-doc' },
|
|
373
|
+
} ) ),
|
|
374
|
+
},
|
|
375
|
+
];
|
|
376
|
+
|
|
377
|
+
const select = {
|
|
378
|
+
getEditedEntityRecord: jest.fn( () => EDITED_RECORD ),
|
|
379
|
+
getRawEntityRecord: jest.fn( () => POST_RECORD ),
|
|
380
|
+
};
|
|
381
|
+
const resolveSelectWithSync = {
|
|
382
|
+
getEntitiesConfig: jest.fn( () => ENTITIES_WITH_SYNC ),
|
|
383
|
+
getEditedEntityRecord: jest.fn( () =>
|
|
384
|
+
Promise.resolve( EDITED_RECORD )
|
|
385
|
+
),
|
|
386
|
+
};
|
|
387
|
+
let savePromise;
|
|
388
|
+
|
|
389
|
+
syncManager.update = jest.fn(
|
|
390
|
+
( _objectType, _objectId, changes, _origin, options ) => {
|
|
391
|
+
if (
|
|
392
|
+
Object.prototype.hasOwnProperty.call( changes, 'title' )
|
|
393
|
+
) {
|
|
394
|
+
liveSyncState.title = changes.title;
|
|
395
|
+
}
|
|
396
|
+
if ( options?.isSave ) {
|
|
397
|
+
liveSyncState.isSaved = true;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
340
400
|
);
|
|
401
|
+
dispatch.saveEntityRecord = jest.fn(
|
|
402
|
+
( kind, name, record, options ) => {
|
|
403
|
+
savePromise = saveEntityRecord(
|
|
404
|
+
kind,
|
|
405
|
+
name,
|
|
406
|
+
record,
|
|
407
|
+
options
|
|
408
|
+
)( {
|
|
409
|
+
select,
|
|
410
|
+
dispatch,
|
|
411
|
+
resolveSelect: resolveSelectWithSync,
|
|
412
|
+
} );
|
|
413
|
+
return savePromise;
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
triggerFetch
|
|
418
|
+
.mockImplementationOnce( () => POST_RESPONSE )
|
|
419
|
+
.mockImplementationOnce( () => STALE_SAVE_RESPONSE );
|
|
420
|
+
|
|
421
|
+
await getEntityRecord(
|
|
422
|
+
'postType',
|
|
423
|
+
'post',
|
|
424
|
+
1
|
|
425
|
+
)( {
|
|
426
|
+
dispatch,
|
|
427
|
+
registry,
|
|
428
|
+
resolveSelect: resolveSelectWithSync,
|
|
429
|
+
} );
|
|
430
|
+
|
|
431
|
+
const handlers = syncManager.load.mock.calls[ 0 ][ 4 ];
|
|
432
|
+
|
|
433
|
+
handlers.persistCRDTDoc();
|
|
434
|
+
await Promise.resolve();
|
|
435
|
+
await savePromise;
|
|
436
|
+
|
|
437
|
+
expect( dispatch.saveEntityRecord ).toHaveBeenCalledWith(
|
|
438
|
+
'postType',
|
|
439
|
+
'post',
|
|
440
|
+
EDITED_RECORD,
|
|
441
|
+
{ __unstableSkipSyncUpdate: true }
|
|
442
|
+
);
|
|
443
|
+
expect( syncManager.update ).toHaveBeenCalledWith(
|
|
444
|
+
'postType/post',
|
|
445
|
+
1,
|
|
446
|
+
{},
|
|
447
|
+
'local-undo-ignored',
|
|
448
|
+
{ isSave: true }
|
|
449
|
+
);
|
|
450
|
+
expect( liveSyncState ).toEqual( {
|
|
451
|
+
isSaved: true,
|
|
452
|
+
title: SYNCED_TITLE,
|
|
453
|
+
} );
|
|
341
454
|
} );
|
|
342
455
|
|
|
343
456
|
it( 'provides transient properties when read/write config is supplied', async () => {
|