@wordpress/views 2.0.0 → 3.1.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.
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/use-view.ts"],
4
- "sourcesContent": ["import { dequal } from 'dequal';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport type { View } from '@wordpress/dataviews';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { generatePreferenceKey } from './preference-keys';\nimport {\n\tgetApplicablePersistedView,\n\tgetUserModifications,\n\tresolveView,\n} from './resolve-view';\nimport type { ViewConfig, ViewOverrides } from './types';\n\ninterface UseViewReturn {\n\tview: View;\n\tisModified: boolean;\n\tupdateView: ( newView: View ) => void;\n\tresetToDefault: () => void;\n}\n\n/**\n * Hook for managing DataViews view state with local persistence.\n *\n * Only the properties the user actually modified are persisted: every other\n * property keeps resolving out of the layers below, so a change to the default\n * view, to the layout defaults or to the active view overrides keeps showing\n * through.\n *\n * @param config Configuration object for loading the view.\n *\n * @return Object with current view, modification state, and update functions.\n */\nexport function useView( config: ViewConfig ): UseViewReturn {\n\tconst {\n\t\tkind,\n\t\tname,\n\t\tslug,\n\t\tdefaultView,\n\t\tdefaultLayouts,\n\t\tactiveViewOverrides,\n\t\tqueryParams,\n\t\tonChangeQueryParams,\n\t} = config;\n\n\tconst preferenceKey = generatePreferenceKey( kind, name, slug );\n\tconst persistedView: ViewOverrides | undefined = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( preferencesStore ).get(\n\t\t\t\t'core/views',\n\t\t\t\tpreferenceKey\n\t\t\t) as ViewOverrides | undefined;\n\t\t},\n\t\t[ preferenceKey ]\n\t);\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst page = Number( queryParams?.page ?? 1 );\n\tconst search = queryParams?.search ?? '';\n\n\tconst view = useMemo(\n\t\t() =>\n\t\t\tresolveView( {\n\t\t\t\tdefaultView,\n\t\t\t\tdefaultLayouts,\n\t\t\t\tactiveViewOverrides,\n\t\t\t\tpersistedView,\n\t\t\t\tpage,\n\t\t\t\tsearch,\n\t\t\t} ),\n\t\t[\n\t\t\tdefaultView,\n\t\t\tdefaultLayouts,\n\t\t\tactiveViewOverrides,\n\t\t\tpersistedView,\n\t\t\tpage,\n\t\t\tsearch,\n\t\t]\n\t);\n\n\t// A persisted `type` the layouts do not offer is ignored on read, so it\n\t// does not count as a modification either: there is nothing to reset.\n\tconst applicablePersistedView = getApplicablePersistedView(\n\t\tpersistedView,\n\t\tdefaultLayouts\n\t);\n\tconst isModified =\n\t\t!! applicablePersistedView &&\n\t\tObject.keys( applicablePersistedView ).length > 0;\n\n\tconst updateView = useCallback(\n\t\t( newView: View ) => {\n\t\t\t// `page` and `search` live in the URL, not in the preference: they\n\t\t\t// are reported back to the consumer instead of being persisted.\n\t\t\tconst newQueryParams = {\n\t\t\t\tpage: Number( newView?.page ?? 1 ),\n\t\t\t\tsearch: newView?.search ?? '',\n\t\t\t};\n\t\t\tif (\n\t\t\t\tonChangeQueryParams &&\n\t\t\t\t! dequal( newQueryParams, { page, search } )\n\t\t\t) {\n\t\t\t\tonChangeQueryParams( newQueryParams );\n\t\t\t}\n\n\t\t\tconst modifications = getUserModifications( newView, {\n\t\t\t\tdefaultView,\n\t\t\t\tdefaultLayouts,\n\t\t\t\tactiveViewOverrides,\n\t\t\t\tpersistedView,\n\t\t\t} );\n\t\t\t// Compared against the preference as stored, so a persisted `type`\n\t\t\t// the layouts do not offer is written out on the first update.\n\t\t\tif ( ! dequal( modifications, persistedView ) ) {\n\t\t\t\t// `undefined` clears the preference: the user reverted every\n\t\t\t\t// property they had modified.\n\t\t\t\tset( 'core/views', preferenceKey, modifications );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tonChangeQueryParams,\n\t\t\tpage,\n\t\t\tsearch,\n\t\t\tdefaultView,\n\t\t\tdefaultLayouts,\n\t\t\tactiveViewOverrides,\n\t\t\tpersistedView,\n\t\t\tset,\n\t\t\tpreferenceKey,\n\t\t]\n\t);\n\n\tconst resetToDefault = useCallback( () => {\n\t\tset( 'core/views', preferenceKey, undefined );\n\t}, [ preferenceKey, set ] );\n\n\treturn {\n\t\tview,\n\t\tisModified,\n\t\tupdateView,\n\t\tresetToDefault,\n\t};\n}\n"],
5
- "mappings": ";AAAA,SAAS,cAAc;AACvB,SAAS,aAAa,eAAe;AACrC,SAAS,aAAa,iBAAiB;AAEvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,6BAA6B;AACtC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAsBA,SAAS,QAAS,QAAoC;AAC5D,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAEJ,QAAM,gBAAgB,sBAAuB,MAAM,MAAM,IAAK;AAC9D,QAAM,gBAA2C;AAAA,IAChD,CAAE,WAAY;AACb,aAAO,OAAQ,gBAAiB,EAAE;AAAA,QACjC;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,aAAc;AAAA,EACjB;AACA,QAAM,EAAE,IAAI,IAAI,YAAa,gBAAiB;AAE9C,QAAM,OAAO,OAAQ,aAAa,QAAQ,CAAE;AAC5C,QAAM,SAAS,aAAa,UAAU;AAEtC,QAAM,OAAO;AAAA,IACZ,MACC,YAAa;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AAAA,IACH;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAIA,QAAM,0BAA0B;AAAA,IAC/B;AAAA,IACA;AAAA,EACD;AACA,QAAM,aACL,CAAC,CAAE,2BACH,OAAO,KAAM,uBAAwB,EAAE,SAAS;AAEjD,QAAM,aAAa;AAAA,IAClB,CAAE,YAAmB;AAGpB,YAAM,iBAAiB;AAAA,QACtB,MAAM,OAAQ,SAAS,QAAQ,CAAE;AAAA,QACjC,QAAQ,SAAS,UAAU;AAAA,MAC5B;AACA,UACC,uBACA,CAAE,OAAQ,gBAAgB,EAAE,MAAM,OAAO,CAAE,GAC1C;AACD,4BAAqB,cAAe;AAAA,MACrC;AAEA,YAAM,gBAAgB,qBAAsB,SAAS;AAAA,QACpD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAGF,UAAK,CAAE,OAAQ,eAAe,aAAc,GAAI;AAG/C,YAAK,cAAc,eAAe,aAAc;AAAA,MACjD;AAAA,IACD;AAAA,IACA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,EACD;AAEA,QAAM,iBAAiB,YAAa,MAAM;AACzC,QAAK,cAAc,eAAe,MAAU;AAAA,EAC7C,GAAG,CAAE,eAAe,GAAI,CAAE;AAE1B,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"use-view.mjs","names":["preferencesStore"],"sources":["../src/use-view.ts"],"sourcesContent":["import { dequal } from 'dequal';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport type { View } from '@wordpress/dataviews';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { generatePreferenceKey } from './preference-keys';\nimport {\n\tgetApplicablePersistedView,\n\tgetUserModifications,\n\tresolveView,\n} from './resolve-view';\nimport type { ViewConfig, ViewOverrides } from './types';\n\ninterface UseViewReturn {\n\tview: View;\n\tisModified: boolean;\n\tupdateView: ( newView: View ) => void;\n\tresetToDefault: () => void;\n}\n\n/**\n * Hook for managing DataViews view state with local persistence.\n *\n * Only the properties the user actually modified are persisted: every other\n * property keeps resolving out of the layers below, so a change to the default\n * view, to the layout defaults or to the active view overrides keeps showing\n * through.\n *\n * @param config Configuration object for loading the view.\n *\n * @return Object with current view, modification state, and update functions.\n */\nexport function useView( config: ViewConfig ): UseViewReturn {\n\tconst {\n\t\tkind,\n\t\tname,\n\t\tslug,\n\t\tdefaultView,\n\t\tdefaultLayouts,\n\t\tactiveViewOverrides,\n\t\tqueryParams,\n\t\tonChangeQueryParams,\n\t} = config;\n\n\tconst preferenceKey = generatePreferenceKey( kind, name, slug );\n\tconst persistedView: ViewOverrides | undefined = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( preferencesStore ).get(\n\t\t\t\t'core/views',\n\t\t\t\tpreferenceKey\n\t\t\t) as ViewOverrides | undefined;\n\t\t},\n\t\t[ preferenceKey ]\n\t);\n\tconst { set } = useDispatch( preferencesStore );\n\n\tconst page = Number( queryParams?.page ?? 1 );\n\tconst search = queryParams?.search ?? '';\n\n\tconst view = useMemo(\n\t\t() =>\n\t\t\tresolveView( {\n\t\t\t\tdefaultView,\n\t\t\t\tdefaultLayouts,\n\t\t\t\tactiveViewOverrides,\n\t\t\t\tpersistedView,\n\t\t\t\tpage,\n\t\t\t\tsearch,\n\t\t\t} ),\n\t\t[\n\t\t\tdefaultView,\n\t\t\tdefaultLayouts,\n\t\t\tactiveViewOverrides,\n\t\t\tpersistedView,\n\t\t\tpage,\n\t\t\tsearch,\n\t\t]\n\t);\n\n\t// A persisted `type` the layouts do not offer is ignored on read, so it\n\t// does not count as a modification either: there is nothing to reset.\n\tconst applicablePersistedView = getApplicablePersistedView(\n\t\tpersistedView,\n\t\tdefaultLayouts\n\t);\n\tconst isModified =\n\t\t!! applicablePersistedView &&\n\t\tObject.keys( applicablePersistedView ).length > 0;\n\n\tconst updateView = useCallback(\n\t\t( newView: View ) => {\n\t\t\t// `page` and `search` live in the URL, not in the preference: they\n\t\t\t// are reported back to the consumer instead of being persisted.\n\t\t\tconst newQueryParams = {\n\t\t\t\tpage: Number( newView?.page ?? 1 ),\n\t\t\t\tsearch: newView?.search ?? '',\n\t\t\t};\n\t\t\tif (\n\t\t\t\tonChangeQueryParams &&\n\t\t\t\t! dequal( newQueryParams, { page, search } )\n\t\t\t) {\n\t\t\t\tonChangeQueryParams( newQueryParams );\n\t\t\t}\n\n\t\t\tconst modifications = getUserModifications( newView, {\n\t\t\t\tdefaultView,\n\t\t\t\tdefaultLayouts,\n\t\t\t\tactiveViewOverrides,\n\t\t\t\tpersistedView,\n\t\t\t} );\n\t\t\t// Compared against the preference as stored, so a persisted `type`\n\t\t\t// the layouts do not offer is written out on the first update.\n\t\t\tif ( ! dequal( modifications, persistedView ) ) {\n\t\t\t\t// `undefined` clears the preference: the user reverted every\n\t\t\t\t// property they had modified.\n\t\t\t\tset( 'core/views', preferenceKey, modifications );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tonChangeQueryParams,\n\t\t\tpage,\n\t\t\tsearch,\n\t\t\tdefaultView,\n\t\t\tdefaultLayouts,\n\t\t\tactiveViewOverrides,\n\t\t\tpersistedView,\n\t\t\tset,\n\t\t\tpreferenceKey,\n\t\t]\n\t);\n\n\tconst resetToDefault = useCallback( () => {\n\t\tset( 'core/views', preferenceKey, undefined );\n\t}, [ preferenceKey, set ] );\n\n\treturn {\n\t\tview,\n\t\tisModified,\n\t\tupdateView,\n\t\tresetToDefault,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,QAAS,QAAoC;CAC5D,MAAM,EACL,MACA,MACA,MACA,aACA,gBACA,qBACA,aACA,wBACG;CAEJ,MAAM,gBAAgB,sBAAuB,MAAM,MAAM,IAAK;CAC9D,MAAM,gBAA2C,WAC9C,WAAY;EACb,OAAO,OAAQA,KAAiB,CAAC,CAAC,IACjC,cACA,aACD;CACD,GACA,CAAE,aAAc,CACjB;CACA,MAAM,EAAE,QAAQ,YAAaA,KAAiB;CAE9C,MAAM,OAAO,OAAQ,aAAa,QAAQ,CAAE;CAC5C,MAAM,SAAS,aAAa,UAAU;CAEtC,MAAM,OAAO,cAEX,YAAa;EACZ;EACA;EACA;EACA;EACA;EACA;CACD,CAAE,GACH;EACC;EACA;EACA;EACA;EACA;EACA;CACD,CACD;CAIA,MAAM,0BAA0B,2BAC/B,eACA,cACD;CAmDA,OAAO;EACN;EACA,YAnDA,CAAC,CAAE,2BACH,OAAO,KAAM,uBAAwB,CAAC,CAAC,SAAS;EAmDhD,YAjDkB,aAChB,YAAmB;GAGpB,MAAM,iBAAiB;IACtB,MAAM,OAAQ,SAAS,QAAQ,CAAE;IACjC,QAAQ,SAAS,UAAU;GAC5B;GACA,IACC,uBACA,CAAE,OAAQ,gBAAgB;IAAE;IAAM;GAAO,CAAE,GAE3C,oBAAqB,cAAe;GAGrC,MAAM,gBAAgB,qBAAsB,SAAS;IACpD;IACA;IACA;IACA;GACD,CAAE;GAGF,IAAK,CAAE,OAAQ,eAAe,aAAc,GAG3C,IAAK,cAAc,eAAe,aAAc;EAElD,GACA;GACC;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,CAUS;EACT,gBARsB,kBAAmB;GACzC,IAAK,cAAc,eAAe,KAAA,CAAU;EAC7C,GAAG,CAAE,eAAe,GAAI,CAMV;CACd;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-view-config.d.ts","sourceRoot":"","sources":["../src/use-view-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAE,EAC9B,IAAI,EACJ,IAAI,EACJ,MAAM,GACN,EAAE;IACF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B,GAAI;IACJ,YAAY,EAAE,IAAI,GAAG,SAAS,CAAC;IAC/B,eAAe,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,SAAS,EAAE,KAAK,CAAE,GAAG,CAAE,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;CACvB,CAqBA"}
1
+ {"version":3,"file":"use-view-config.d.ts","sourceRoot":"","sources":["../src/use-view-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGzE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAE,EAC9B,IAAI,EACJ,IAAI,EACJ,MAAM,GACN,EAAE;IACF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B,GAAI;IACJ,YAAY,EAAE,IAAI,GAAG,SAAS,CAAC;IAC/B,eAAe,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC9C,SAAS,EAAE,KAAK,CAAE,GAAG,CAAE,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;CACvB,CAmBA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/views",
3
- "version": "2.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "View persistence and management for WordPress DataViews.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -19,14 +19,13 @@
19
19
  "url": "https://github.com/WordPress/gutenberg/issues"
20
20
  },
21
21
  "engines": {
22
- "node": ">=18.12.0"
22
+ "node": ">=22.13.0"
23
23
  },
24
24
  "files": [
25
25
  "src",
26
26
  "build",
27
27
  "build-module",
28
- "build-types",
29
- "*.md"
28
+ "build-types"
30
29
  ],
31
30
  "main": "build/index.cjs",
32
31
  "module": "build-module/index.mjs",
@@ -40,19 +39,19 @@
40
39
  },
41
40
  "types": "build-types",
42
41
  "dependencies": {
43
- "@wordpress/core-data": "^8.2.0",
44
- "@wordpress/data": "^10.57.0",
45
- "@wordpress/dataviews": "^20.0.0",
46
- "@wordpress/element": "^9.0.0",
47
- "@wordpress/preferences": "^4.57.0",
48
- "@wordpress/private-apis": "^2.0.0",
42
+ "@wordpress/core-data": "^9.1.0",
43
+ "@wordpress/data": "^11.1.0",
44
+ "@wordpress/dataviews": "^22.0.0",
45
+ "@wordpress/element": "^10.1.0",
46
+ "@wordpress/preferences": "^5.1.0",
47
+ "@wordpress/private-apis": "^3.1.0",
49
48
  "dequal": "^2.0.3"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@testing-library/react": "^16.3.3",
53
52
  "react": "^19.3.0",
54
53
  "react-dom": "^19.3.0",
55
- "vitest": "^5.0.3"
54
+ "vitest": "^5.0.5"
56
55
  },
57
56
  "peerDependencies": {
58
57
  "@types/react": "^18 || ^19",
@@ -71,5 +70,5 @@
71
70
  "publishConfig": {
72
71
  "access": "public"
73
72
  },
74
- "gitHead": "12441e2520c78b2254a792a8cba40c34110be060"
73
+ "gitHead": "9b70363b9f93cff0583a1f3153738d383cf5a49e"
75
74
  }
@@ -35,9 +35,7 @@ export function useViewConfig( {
35
35
  // Sort fields so the cache key is independent of the order callers list
36
36
  // them; `['title','author']` and `['author','title']` request the same data.
37
37
  const fieldList = Array.isArray( fields ) ? fields : fields?.split( ',' );
38
- const fieldsKey = fieldList
39
- ? [ ...fieldList ].sort().join( ',' )
40
- : undefined;
38
+ const fieldsKey = fieldList ? fieldList.toSorted().join( ',' ) : undefined;
41
39
  return useSelect(
42
40
  ( select ) => {
43
41
  return unlock( select( coreStore ) ).getViewConfig(
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->
2
-
3
- ## Unreleased
4
-
5
- ## 2.0.0 (2026-10-07)
6
-
7
- ### Breaking Changes
8
-
9
- - Upgrade React to v19 ([#83941](https://github.com/WordPress/gutenberg/pull/83941)).
10
-
11
- ### Bug Fixes
12
-
13
- - Declare `react`, `react-dom`, and their types as peer dependencies, forwarding the peers of `@wordpress/element`, so strict package managers such as Yarn PnP can resolve them ([#83765](https://github.com/WordPress/gutenberg/pull/83765)).
14
-
15
- ## 1.23.0 (2026-09-23)
16
-
17
- ## 1.22.0 (2026-09-10)
18
-
19
- ### Bug Fixes
20
-
21
- - `useViewConfig`: request the full configuration under the same cache key as `getViewConfig( kind, name )`, so a route loader that preloads it no longer triggers a second request. ([#82141](https://github.com/WordPress/gutenberg/pull/82141))
22
- - `useView`, `loadView`: ignore a persisted layout `type` that `defaultLayouts` does not offer, resolving the type out of the layers below instead. DataViews renders nothing for a layout it is not given, so a preference saved when a screen still offered that layout used to leave the screen empty, with no way to reset it. Such a type does not count as a modification and is written out of the preference on the next update. ([#82457](https://github.com/WordPress/gutenberg/pull/82457))
23
-
24
- ## 1.21.0 (2026-08-26)
25
-
26
- ### Internal
27
-
28
- - Point tsconfig references at split dependencies' build projects. ([#81515](https://github.com/WordPress/gutenberg/pull/81515))
29
- - Split tsconfig into a build project and a default dev project so dev files are type checked without publishing their declarations. ([#81514](https://github.com/WordPress/gutenberg/pull/81514))
30
-
31
- ## 1.20.0 (2026-08-12)
32
-
33
- ### Bug Fixes
34
-
35
- - `useView`, `loadView`. Resolve the view as a stack of layers — `defaultView`, `defaultLayouts` (for the effective type), `activeViewOverrides`, the user's preference, and the URL query params — and persist only the properties the user actually modified. Previously the whole view was persisted, so a later change to any of the lower layers stopped showing through, an override could bounce back a value the user had picked, and a partial `sort` or `layout` override marked the view as modified forever. `page` and `search` are now sourced from the URL alone, and `layout`, `groupBy` and `sort` merge leaf by leaf, so an override for one field's styles no longer wipes the other fields'. Persisted modifications that happen to coincide with the current view's base are retained on update, so a change made in one view no longer drops a pick made in another view sharing the preference. [#80832](https://github.com/WordPress/gutenberg/pull/80832)
36
-
37
- ### Internal
38
-
39
- - Remove obsolete dependency grouping comments as part of the repository-wide separator-free import migration. ([#81248](https://github.com/WordPress/gutenberg/pull/81248))
40
- - Add `react` and `react-dom` to the package's dev dependencies, so the tests resolve them from the package rather than relying on a hoisted install. [#81139](https://github.com/WordPress/gutenberg/pull/81139)
41
-
42
- ## 1.19.0 (2026-07-29)
43
-
44
- ## 1.18.0 (2026-07-14)
45
-
46
- ## 1.17.0 (2026-07-01)
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { useView } from './use-view';\nexport { loadView } from './load-view';\nexport { useViewConfig } from './use-view-config';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAwB;AACxB,uBAAyB;AACzB,6BAA8B;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/types.ts"],
4
- "sourcesContent": ["import type { View, SupportedLayouts } from '@wordpress/dataviews';\n\n/**\n * A layer merged on top of a view: the active view overrides, and the user's\n * persisted modifications.\n *\n * It is derived from `View` so it stays in sync with it, but every property is\n * optional — including `type`, which `View` requires as the discriminant of its\n * layout union. A layer only ever carries the subset of properties it means to\n * override, and `layout` is loosened to a plain record because a `type`\n * override may change which layout shape applies.\n */\nexport type ViewOverrides = Partial< Omit< View, 'type' | 'layout' > > & {\n\ttype?: View[ 'type' ];\n\tlayout?: Record< string, unknown >;\n};\n\nexport interface ViewConfig {\n\t/**\n\t * Entity kind (e.g. postType, root).\n\t * Similar to core-data entity kinds.\n\t */\n\tkind: string;\n\n\t/**\n\t * Entity name (e.g. post, page, user, site).\n\t * Similar to core-data entity names.\n\t */\n\tname: string;\n\n\t/**\n\t * Identifier for the current view (all, published, mine, etc.)\n\t */\n\tslug: string;\n\n\t/**\n\t * Default view configuration.\n\t */\n\tdefaultView: View;\n\n\t/**\n\t * View overrides applied on top of the default view and the default\n\t * layouts, but never persisted. These represent tab-specific configuration\n\t * (filters, sort) and developer-defined view defaults. The properties the\n\t * user modified take precedence over them; the ones they never touched\n\t * resolve out of them.\n\t */\n\tactiveViewOverrides?: ViewOverrides;\n\n\t/**\n\t * Default layout configurations keyed by layout type.\n\t * Used to apply layout-type-specific defaults (e.g., table column styles)\n\t * that are merged as overrides based on the resolved view type.\n\t */\n\tdefaultLayouts?: SupportedLayouts;\n\n\t/**\n\t * Optional query parameters from URL (page, search).\n\t */\n\tqueryParams?: {\n\t\tpage?: number;\n\t\tsearch?: string;\n\t};\n\n\t/**\n\t * Callback for when URL query parameters should change\n\t */\n\tonChangeQueryParams?: ( params: {\n\t\tpage?: number;\n\t\tsearch?: string;\n\t} ) => void;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { useView } from './use-view';\nexport { loadView } from './load-view';\nexport { useViewConfig } from './use-view-config';\n"],
5
- "mappings": ";AAAA,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }