@multiplatform.one/core 7.7.3 → 7.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/core",
3
- "version": "7.7.3",
3
+ "version": "7.7.4",
4
4
  "description": "Core framework shell, provider composition, and layout factories for multiplatform.one",
5
5
  "keywords": [
6
6
  "app",
@@ -47,11 +47,11 @@
47
47
  "@tanstack/react-devtools": "^0.10.2",
48
48
  "@tanstack/react-form-devtools": "0.2.22",
49
49
  "react-cookie": "^8.1.2",
50
- "@multiplatform.one/i18n": "7.7.3",
51
- "@multiplatform.one/logger": "7.7.3",
52
- "@multiplatform.one/platform": "7.7.3",
53
- "@multiplatform.one/store": "7.7.3",
54
- "@multiplatform.one/theme": "7.7.3"
50
+ "@multiplatform.one/i18n": "7.7.4",
51
+ "@multiplatform.one/logger": "7.7.4",
52
+ "@multiplatform.one/platform": "7.7.4",
53
+ "@multiplatform.one/store": "7.7.4",
54
+ "@multiplatform.one/theme": "7.7.4"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@sentry/react": "^10.51.0",
@@ -68,8 +68,8 @@
68
68
  "tamagui": "2.7.6",
69
69
  "typescript": "~5.9.3",
70
70
  "vitest": "^4.1.5",
71
- "@multiplatform.one/frappe": "7.7.3",
72
- "@multiplatform.one/web3": "7.7.3"
71
+ "@multiplatform.one/frappe": "7.7.4",
72
+ "@multiplatform.one/web3": "7.7.4"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@sentry/react": "^9.0.0",
@@ -85,10 +85,10 @@
85
85
  "react-native-gesture-handler": ">=2.0.0",
86
86
  "react-native-safe-area-context": ">=4.0.0",
87
87
  "tamagui": "^2.0.0-rc",
88
- "@multiplatform.one/frappe": "^7.7.3",
89
- "@multiplatform.one/frappe-ui": "^7.7.3",
90
- "@multiplatform.one/keycloak": "^7.7.3",
91
- "@multiplatform.one/web3": "^7.7.3"
88
+ "@multiplatform.one/frappe": "^7.7.4",
89
+ "@multiplatform.one/frappe-ui": "^7.7.4",
90
+ "@multiplatform.one/keycloak": "^7.7.4",
91
+ "@multiplatform.one/web3": "^7.7.4"
92
92
  },
93
93
  "peerDependenciesMeta": {
94
94
  "@multiplatform.one/web3": {
@@ -0,0 +1,53 @@
1
+ import { renderToStaticMarkup } from "react-dom/server";
2
+ import { describe, expect, it, vi } from "vitest";
3
+ import type { ReactNode } from "react";
4
+ import { createRootLayout } from "./CreateRootLayout.web";
5
+
6
+ vi.mock("one", () => ({ LoadProgressBar: () => null, Slot: () => null, useMatches: () => [] }));
7
+ vi.mock("@vxrn/color-scheme", () => ({
8
+ SchemeProvider: ({ children }: { children: ReactNode }) => children,
9
+ setUserScheme: vi.fn(),
10
+ useUserScheme: () => ({ value: "light" }),
11
+ }));
12
+ vi.mock("i18next", () => ({
13
+ default: {
14
+ use: () => ({ init: () => Promise.resolve() }),
15
+ changeLanguage: vi.fn(),
16
+ language: "en",
17
+ },
18
+ }));
19
+ vi.mock("react-i18next", () => ({ initReactI18next: {} }));
20
+ vi.mock("@multiplatform.one/platform", () => ({
21
+ config: { get: (_key: string, fallback?: string) => fallback },
22
+ isDev: false,
23
+ platform: { isServer: true },
24
+ }));
25
+ vi.mock("@multiplatform.one/i18n", () => ({ createI18nConfig: () => ({}) }));
26
+ vi.mock("@multiplatform.one/logger", () => ({ logger: { error: vi.fn() } }));
27
+ vi.mock("@multiplatform.one/store", () => ({ storage: {} }));
28
+ vi.mock("./RuntimePublicConfigScript", () => ({ RuntimePublicConfigScript: () => null }));
29
+
30
+ function renderRoot(head?: { favicon?: string; interFonts?: boolean }) {
31
+ const Wrapper = ({ children }: { children?: ReactNode }) => children;
32
+ const Layout = createRootLayout({
33
+ AppProvider: Wrapper,
34
+ RootLayout: Wrapper,
35
+ i18n: { defaultLanguage: "en" },
36
+ head,
37
+ } as Parameters<typeof createRootLayout>[0]);
38
+ return renderToStaticMarkup(<Layout />);
39
+ }
40
+
41
+ describe("web root viewport (MPO-257)", () => {
42
+ it("renders exactly one device-width viewport without optional head config", () => {
43
+ const html = renderRoot();
44
+ expect(html.match(/name="viewport"/g)).toHaveLength(1);
45
+ expect(html).toContain('content="width=device-width, initial-scale=1, maximum-scale=5"');
46
+ });
47
+ it("preserves custom favicon and font settings with exactly one viewport", () => {
48
+ const html = renderRoot({ favicon: "/custom.svg", interFonts: false });
49
+ expect(html.match(/name="viewport"/g)).toHaveLength(1);
50
+ expect(html).toContain('rel="icon" href="/custom.svg"');
51
+ expect(html).not.toContain("/fonts/inter-400.woff2");
52
+ });
53
+ });
@@ -187,13 +187,10 @@ export function createRootLayout(cfg: CreateRootLayoutConfig): ComponentType {
187
187
  "@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:0.4}100%{opacity:1}}",
188
188
  ].join("")}
189
189
  </style>
190
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
190
191
  {cfg.head && (
191
192
  <>
192
193
  <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
193
- <meta
194
- name="viewport"
195
- content="width=device-width, initial-scale=1, maximum-scale=5"
196
- />
197
194
  {cfg.head.favicon && <link rel="icon" href={cfg.head.favicon} />}
198
195
  </>
199
196
  )}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateRootLayout.web.d.ts","sourceRoot":"","sources":["../../src/app/CreateRootLayout.web.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAQtD,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,oBAAoB,CAAC;AAEjF,YAAY,EACV,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,sBAAsB,GAAG,aAAa,CA4L3E"}
1
+ {"version":3,"file":"CreateRootLayout.web.d.ts","sourceRoot":"","sources":["../../src/app/CreateRootLayout.web.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAQtD,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,oBAAoB,CAAC;AAEjF,YAAY,EACV,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,sBAAsB,GAAG,aAAa,CAyL3E"}