create-middag-ui 0.15.4 → 0.15.6

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.
Files changed (2) hide show
  1. package/lib/scaffold.js +2 -2
  2. package/package.json +1 -1
package/lib/scaffold.js CHANGED
@@ -1100,7 +1100,7 @@ export function PageProvider({ value, children }: {
1100
1100
  return React.createElement(PageContext.Provider, { value }, children);
1101
1101
  }
1102
1102
 
1103
- export function usePage<T = Record<string, unknown>>(): { props: T; url: string } {
1103
+ export function usePage<T extends Record<string, unknown> = Record<string, unknown>>(): { props: T; url: string } {
1104
1104
  return React.useContext(PageContext) as { props: T; url: string };
1105
1105
  }
1106
1106
 
@@ -1892,7 +1892,7 @@ const mockSharedProps = {
1892
1892
  scope: { extension: null, context: "global" },
1893
1893
  };
1894
1894
 
1895
- export function usePage<T = Record<string, unknown>>(): { props: T; url: string } {
1895
+ export function usePage<T extends Record<string, unknown> = Record<string, unknown>>(): { props: T; url: string } {
1896
1896
  const contract = typeof window !== "undefined" ? (window as any).__MIDDAG_MOCK_CONTRACT__ : undefined;
1897
1897
  return {
1898
1898
  props: { ...mockSharedProps, navigation: buildNavigation(), contract } as T,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-middag-ui",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
4
4
  "type": "module",
5
5
  "description": "Bootstrap a MIDDAG React UI layer in your Moodle or WordPress plugin",
6
6
  "bin": {