create-middag-ui 0.7.1 → 0.8.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.
Files changed (2) hide show
  1. package/lib/scaffold.js +8 -3
  2. package/package.json +1 -1
package/lib/scaffold.js CHANGED
@@ -827,7 +827,7 @@ createRoot(document.getElementById("root")!).render(
827
827
  writeFile(
828
828
  appPath,
829
829
  `import { useState, useEffect } from "react";
830
- import { ContractPage } from "@middag-io/react";
830
+ import { ContractPage, I18nProvider } from "@middag-io/react";
831
831
  import type { PageContract } from "@middag-io/react";
832
832
  import { dashboardContract } from "./pages/dashboard";
833
833
  import { connectorsContract } from "./pages/connectors";
@@ -864,7 +864,11 @@ export function App() {
864
864
  // Expose contract for usePage() mock adapter
865
865
  (window as any).__MIDDAG_MOCK_CONTRACT__ = contract;
866
866
 
867
- return <ContractPage contract={contract} />;
867
+ return (
868
+ <I18nProvider>
869
+ <ContractPage contract={contract} />
870
+ </I18nProvider>
871
+ );
868
872
  }
869
873
  `,
870
874
  "src/app.tsx",
@@ -935,10 +939,11 @@ function buildNavigation() {
935
939
 
936
940
  const mockSharedProps = {
937
941
  auth: { id: 1, name: "Dev User", email: "dev@localhost", capabilities: [] },
938
- theme: { appearance: "light" as const },
942
+ theme: { appearance: "light" as const, strings: {} as Record<string, string> },
939
943
  flash: {},
940
944
  locale: "en",
941
945
  version: "0.0.0-mock",
946
+ scope: { extension: null, context: "global" },
942
947
  };
943
948
 
944
949
  export function usePage<T = Record<string, unknown>>(): { props: T; url: string } {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-middag-ui",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "description": "Bootstrap a MIDDAG React UI layer in your Moodle or WordPress plugin",
6
6
  "bin": {