@microsoft/power-apps-native-host 0.2.22 → 0.2.25

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 (47) hide show
  1. package/README.md +143 -26
  2. package/compatibility/current.json +88 -0
  3. package/lib/NOTICE.txt +146 -1226
  4. package/lib/commonjs/auth/AuthContext.web.js +32 -0
  5. package/lib/commonjs/auth/completePowerAppsAuthSession.js +16 -0
  6. package/lib/commonjs/bridge/NativePowerAppsBridge.js +11 -1
  7. package/lib/commonjs/bridge/PowerPagesBridge.js +138 -0
  8. package/lib/commonjs/index.js +22 -2
  9. package/lib/commonjs/offline/useOfflineIntegration.js +12 -0
  10. package/lib/commonjs/offline/useOfflineIntegration.web.js +11 -0
  11. package/lib/commonjs/provider/PowerAppsHostProvider.web.js +41 -0
  12. package/lib/commonjs/provider/PowerAppsProvider.js +67 -10
  13. package/lib/module/auth/AuthContext.web.js +26 -0
  14. package/lib/module/auth/completePowerAppsAuthSession.js +11 -0
  15. package/lib/module/bridge/NativePowerAppsBridge.js +11 -1
  16. package/lib/module/bridge/PowerPagesBridge.js +132 -0
  17. package/lib/module/index.js +4 -2
  18. package/lib/module/offline/useOfflineIntegration.js +3 -0
  19. package/lib/module/offline/useOfflineIntegration.web.js +7 -0
  20. package/lib/module/provider/PowerAppsHostProvider.web.js +36 -0
  21. package/lib/module/provider/PowerAppsProvider.js +66 -9
  22. package/lib/typescript/commonjs/auth/AuthContext.web.d.ts +20 -0
  23. package/lib/typescript/commonjs/auth/completePowerAppsAuthSession.d.ts +8 -0
  24. package/lib/typescript/commonjs/bridge/PowerPagesBridge.d.ts +18 -0
  25. package/lib/typescript/commonjs/index.d.ts +3 -0
  26. package/lib/typescript/commonjs/offline/useOfflineIntegration.d.ts +2 -0
  27. package/lib/typescript/commonjs/offline/useOfflineIntegration.web.d.ts +4 -0
  28. package/lib/typescript/commonjs/provider/PowerAppsHostProvider.web.d.ts +5 -0
  29. package/lib/typescript/commonjs/provider/PowerAppsProvider.d.ts +2 -2
  30. package/lib/typescript/module/auth/AuthContext.web.d.ts +20 -0
  31. package/lib/typescript/module/auth/completePowerAppsAuthSession.d.ts +8 -0
  32. package/lib/typescript/module/bridge/PowerPagesBridge.d.ts +18 -0
  33. package/lib/typescript/module/index.d.ts +7 -4
  34. package/lib/typescript/module/offline/useOfflineIntegration.d.ts +2 -0
  35. package/lib/typescript/module/offline/useOfflineIntegration.web.d.ts +4 -0
  36. package/lib/typescript/module/provider/PowerAppsHostProvider.web.d.ts +5 -0
  37. package/lib/typescript/module/provider/PowerAppsProvider.d.ts +4 -4
  38. package/package.json +36 -16
  39. package/scripts/build-ios-base.js +66 -27
  40. package/scripts/bundle.js +212 -5
  41. package/scripts/generate-connector-schemas.js +8 -6
  42. package/scripts/start-web.mjs +137 -0
  43. package/scripts/upgrade/runtime.js +457 -0
  44. package/scripts/upgrade/system.js +244 -0
  45. package/scripts/upgrade-authoring.js +535 -0
  46. package/scripts/upgrade.js +188 -0
  47. package/scripts/wrap.js +536 -0
@@ -7,10 +7,12 @@
7
7
  */
8
8
 
9
9
  export { NativePowerAppsBridge } from "./bridge/NativePowerAppsBridge.js";
10
+ export { PowerPagesBridge, setupPowerPagesHost } from "./bridge/PowerPagesBridge.js";
10
11
  export { buildConnectionReferences } from "./bridge/NativePowerAppsBridge.js";
11
12
  export { setupNativeHost } from "./bridge/setupNativeHost.js";
12
- export { AuthProvider, useAuth } from "./auth/AuthContext.js";
13
- export { PowerAppsHostProvider } from "./provider/PowerAppsHostProvider.js";
13
+ export { AuthProvider, useAuth } from './auth/AuthContext';
14
+ export { completePowerAppsAuthSession } from "./auth/completePowerAppsAuthSession.js";
15
+ export { PowerAppsHostProvider } from './provider/PowerAppsHostProvider';
14
16
  export { PowerAppsProvider } from "./provider/PowerAppsProvider.js";
15
17
  export { fetchInstanceUrl, buildCdsDataSources, buildEnvironmentEndpoint, POWER_PLATFORM_API_SCOPE } from "./platform/PowerPlatformEnvironmentApi.js";
16
18
  export { useConnectionRefs } from "./platform/useConnectionRefs.js";
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ export { useOfflineIntegration } from '@microsoft/power-apps-native-offline';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ export function useOfflineIntegration(_options) {
4
+ return {
5
+ StatusOverlay: null
6
+ };
7
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { SafeAreaProvider } from 'react-native-safe-area-context';
5
+ import { buildConnectionReferences } from "../bridge/NativePowerAppsBridge.js";
6
+ import { setupPowerPagesHost } from "../bridge/PowerPagesBridge.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ export function PowerAppsHostProvider({
9
+ connectionReferences,
10
+ databaseReferences,
11
+ children
12
+ }) {
13
+ const isPowerPages = typeof window !== 'undefined' && Boolean(window.Microsoft?.Dynamic365?.Portal?.version);
14
+ if (isPowerPages) {
15
+ const connectorRuntimeUrl = window.location.origin;
16
+ const dataverseRuntimeUrl = `${window.location.origin}/api/data/v9.0/`;
17
+ const connections = buildConnectionReferences(connectionReferences);
18
+ for (const connection of Object.values(connections)) {
19
+ connection.runtimeUrl = connectorRuntimeUrl;
20
+ connection.datasetName = window.location.origin;
21
+ }
22
+ const dataSources = Object.values(databaseReferences ?? {}).flatMap(databaseReference => Object.values(databaseReference.dataSources ?? {}).map(dataSource => ({
23
+ runtimeUrl: dataverseRuntimeUrl,
24
+ entitySetName: dataSource.entitySetName ?? '',
25
+ logicalName: dataSource.logicalName ?? '',
26
+ version: '9.2'
27
+ })));
28
+ setupPowerPagesHost({
29
+ connections,
30
+ dataSources
31
+ });
32
+ }
33
+ return /*#__PURE__*/_jsx(SafeAreaProvider, {
34
+ children: children
35
+ });
36
+ }
@@ -7,7 +7,7 @@
7
7
  * Power Apps canvas app inside an Expo shell:
8
8
  *
9
9
  * GestureHandlerRootView
10
- * └── TamaguiProvider (defaults to @tamagui/config/v3)
10
+ * └── TamaguiProvider (defaults to @tamagui/config/v5)
11
11
  * └── PortalProvider (required by ToastViewport)
12
12
  * └── ToastProvider + ToastViewport
13
13
  * └── QueryClientProvider (own QueryClient, wired to NetInfo + AppState)
@@ -28,23 +28,24 @@
28
28
  */
29
29
 
30
30
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
31
- import { AppState, Platform } from 'react-native';
31
+ import { AppState, Platform, ScrollView, StyleSheet, Text } from 'react-native';
32
32
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
33
33
  import { createTamagui, TamaguiProvider } from '@tamagui/core';
34
34
  import { PortalProvider } from '@tamagui/portal';
35
- import { config as tamaguiDefaultConfig } from '@tamagui/config/v3';
35
+ import { defaultConfig as tamaguiDefaultConfig } from '@tamagui/config/v5';
36
36
  import { ToastProvider, ToastViewport } from '@tamagui/toast';
37
37
  import { QueryClient, QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
38
38
  import NetInfo from '@react-native-community/netinfo';
39
- import { AuthProvider, useAuth } from "../auth/AuthContext.js";
40
- import { PowerAppsHostProvider } from "./PowerAppsHostProvider.js";
39
+ import { AuthProvider, useAuth } from '../auth/AuthContext';
40
+ import { PowerAppsHostProvider } from './PowerAppsHostProvider';
41
41
  import { fetchInstanceUrl } from "../platform/PowerPlatformEnvironmentApi.js";
42
42
  import { ThemeProvider } from "../theme/ThemeProvider.js";
43
43
  import { ErrorBoundary } from "../ErrorBoundary.js";
44
+ import { isDevPlayer } from "../utils/isDevPlayer.js";
44
45
  import Constants from 'expo-constants';
45
46
  import { configureAppLogger, getAppLogger, Logger, OneDsTelemetryProvider, resolveDeviceId, resolveTelemetryLocation, regionToClusterCategory, suppressKnownWarnings } from '@microsoft/power-apps-native-common';
46
47
  suppressKnownWarnings();
47
- import { useOfflineIntegration } from '@microsoft/power-apps-native-offline';
48
+ import { useOfflineIntegration } from '../offline/useOfflineIntegration';
48
49
 
49
50
  // ---- React-Query wiring (runs once at module load) ----
50
51
 
@@ -52,6 +53,16 @@ import { useOfflineIntegration } from '@microsoft/power-apps-native-offline';
52
53
  // (the default browser-event-based detection is a no-op in React Native).
53
54
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
54
55
  onlineManager.setEventListener(setOnline => {
56
+ if (Platform.OS === 'web' && typeof window !== 'undefined') {
57
+ const updateOnlineState = () => setOnline(window.navigator.onLine);
58
+ window.addEventListener('online', updateOnlineState);
59
+ window.addEventListener('offline', updateOnlineState);
60
+ updateOnlineState();
61
+ return () => {
62
+ window.removeEventListener('online', updateOnlineState);
63
+ window.removeEventListener('offline', updateOnlineState);
64
+ };
65
+ }
55
66
  return NetInfo.addEventListener(state => setOnline(!!state.isConnected));
56
67
  });
57
68
 
@@ -67,7 +78,7 @@ focusManager.setEventListener(handleFocus => {
67
78
 
68
79
  // The app's tamagui.config.ts (generated by /tamagui-design-system) is always
69
80
  // passed as the `tamaguiConfig` prop and owns all $surface* / $accent* tokens.
70
- // The bare @tamagui/config/v3 preset is only a last-resort fallback for tests
81
+ // The bare @tamagui/config/v5 preset is only a last-resort fallback for tests
71
82
  // and storybook — it will not resolve custom $surface* tokens.
72
83
  const defaultTamaguiConfig = createTamagui(tamaguiDefaultConfig);
73
84
 
@@ -81,6 +92,7 @@ const defaultTamaguiConfig = createTamagui(tamaguiDefaultConfig);
81
92
  // configure the client without a race. Kept deliberately narrow: it only
82
93
  // decides networkMode below.
83
94
  function isOfflineEnabled(offlineProfile) {
95
+ if (Platform.OS === 'web') return false;
84
96
  // Only honour the prop when it carries a profileId — this mirrors the SDK's
85
97
  // useOfflineIntegration, which ignores a profileId-less prop and falls through
86
98
  // to the manifest. Without this guard a truthy-but-invalid prop (no profileId)
@@ -141,6 +153,30 @@ function createQueryClient(offlineEnabled) {
141
153
  }
142
154
  });
143
155
  }
156
+ function hasConfiguredValue(value) {
157
+ return typeof value === 'string' && value.trim().length > 0;
158
+ }
159
+ function hasEntries(value) {
160
+ return Boolean(value && typeof value === 'object' && Object.keys(value).length > 0);
161
+ }
162
+ function requiresPowerPlatformAuth(powerConfig, offlineEnabled) {
163
+ return Boolean(hasConfiguredValue(powerConfig.appId) || hasConfiguredValue(powerConfig.environmentId) || hasEntries(powerConfig.connectionReferences) || hasEntries(powerConfig.databaseReferences) || offlineEnabled);
164
+ }
165
+ function MissingClientIdErrorScreen() {
166
+ return /*#__PURE__*/_jsxs(ScrollView, {
167
+ contentContainerStyle: styles.errorContainer,
168
+ children: [/*#__PURE__*/_jsx(Text, {
169
+ style: styles.errorTitle,
170
+ children: "Missing auth client ID"
171
+ }), /*#__PURE__*/_jsx(Text, {
172
+ style: styles.errorBody,
173
+ children: "This app needs Power Platform authentication, but `auth.config.json` does not include `msal.clientId`."
174
+ }), /*#__PURE__*/_jsx(Text, {
175
+ style: styles.errorBody,
176
+ children: "Add the Entra app registration client ID to `auth.config.json`, rebuild the app bundle, and run it again in Power Apps Dev Player."
177
+ })]
178
+ });
179
+ }
144
180
 
145
181
  // ---- Types ----
146
182
 
@@ -244,6 +280,7 @@ export function PowerAppsProvider({
244
280
  // QueryClient identity stays stable across renders even if the caller passes
245
281
  // fresh offlineProfile literals.
246
282
  const offlineEnabled = useMemo(() => isOfflineEnabled(offlineProfile), [offlineProfile]);
283
+ const missingClientIdInDevPlayer = Platform.OS !== 'web' && isDevPlayer && !hasConfiguredValue(msalConfig.clientId) && requiresPowerPlatformAuth(powerConfig, offlineEnabled);
247
284
  const queryClient = useMemo(() => createQueryClient(offlineEnabled), [offlineEnabled]);
248
285
 
249
286
  // Configure the app logger exactly once per mount inside useEffect so that
@@ -318,7 +355,7 @@ export function PowerAppsProvider({
318
355
  duration: 3000,
319
356
  children: [/*#__PURE__*/_jsx(QueryClientProvider, {
320
357
  client: queryClient,
321
- children: /*#__PURE__*/_jsx(AuthProvider, {
358
+ children: missingClientIdInDevPlayer ? /*#__PURE__*/_jsx(MissingClientIdErrorScreen, {}) : /*#__PURE__*/_jsx(AuthProvider, {
322
359
  msalConfig: msalConfig,
323
360
  intuneConfig: intuneConfig,
324
361
  children: /*#__PURE__*/_jsx(InnerProviders, {
@@ -342,4 +379,24 @@ export function PowerAppsProvider({
342
379
  })
343
380
  })
344
381
  });
345
- }
382
+ }
383
+ const styles = StyleSheet.create({
384
+ errorContainer: {
385
+ flexGrow: 1,
386
+ justifyContent: 'center',
387
+ padding: 24,
388
+ backgroundColor: '#F8F8F8'
389
+ },
390
+ errorTitle: {
391
+ color: '#A4262C',
392
+ fontSize: 22,
393
+ fontWeight: '700',
394
+ marginBottom: 12
395
+ },
396
+ errorBody: {
397
+ color: '#323130',
398
+ fontSize: 15,
399
+ lineHeight: 22,
400
+ marginBottom: 10
401
+ }
402
+ });
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { IntuneConfig, MsalAuthConfig } from '@microsoft/power-apps-native-auth';
3
+ export interface AuthState {
4
+ isLoading: boolean;
5
+ isAuthReady: boolean;
6
+ isSignedIn: boolean;
7
+ hasRealAccount: boolean;
8
+ error: Error | null;
9
+ acquireToken: (scopes: string[]) => Promise<string | null>;
10
+ signIn: () => Promise<void>;
11
+ signOut: () => Promise<void>;
12
+ }
13
+ export interface AuthProviderProps {
14
+ msalConfig: MsalAuthConfig;
15
+ intuneConfig?: IntuneConfig;
16
+ children: React.ReactNode;
17
+ }
18
+ export declare function AuthProvider({ children }: AuthProviderProps): React.JSX.Element;
19
+ export declare function useAuth(): AuthState;
20
+ //# sourceMappingURL=AuthContext.web.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult } from 'expo-web-browser';
2
+ /**
3
+ * Completes an Expo web authentication popup when the current route is its
4
+ * redirect target. Call this at module initialization in the OAuth callback
5
+ * route; navigation after completion remains application-owned.
6
+ */
7
+ export declare function completePowerAppsAuthSession(options?: WebBrowserCompleteAuthSessionOptions): WebBrowserCompleteAuthSessionResult;
8
+ //# sourceMappingURL=completePowerAppsAuthSession.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { AppConnectionReference, CdsDataSourceConfig } from './NativePowerAppsBridge';
2
+ export type PowerPagesBridgeOptions = {
3
+ dataSources: CdsDataSourceConfig[];
4
+ connections: Record<string, AppConnectionReference>;
5
+ };
6
+ export declare class PowerPagesBridge {
7
+ private options;
8
+ constructor(options: PowerPagesBridgeOptions);
9
+ updateOptions(options: PowerPagesBridgeOptions): void;
10
+ initialize(): Promise<void>;
11
+ createRequestBody(config: {
12
+ body?: string | Uint8Array | ArrayBuffer | Blob;
13
+ }): Blob | string | Uint8Array | ArrayBuffer;
14
+ executePluginAsync<T = unknown>(pluginName: string, pluginAction: string, params: unknown[]): Promise<T>;
15
+ private sendHttpAsync;
16
+ }
17
+ export declare function setupPowerPagesHost(options: PowerPagesBridgeOptions): void;
18
+ //# sourceMappingURL=PowerPagesBridge.d.ts.map
@@ -4,11 +4,14 @@
4
4
  *
5
5
  */
6
6
  export { NativePowerAppsBridge } from './bridge/NativePowerAppsBridge';
7
+ export { PowerPagesBridge, setupPowerPagesHost } from './bridge/PowerPagesBridge';
8
+ export type { PowerPagesBridgeOptions } from './bridge/PowerPagesBridge';
7
9
  export type { NativeBridgeOptions, CdsDataSourceConfig, AppConnection, AppConnectionReference } from './bridge/NativePowerAppsBridge';
8
10
  export { buildConnectionReferences } from './bridge/NativePowerAppsBridge';
9
11
  export { setupNativeHost } from './bridge/setupNativeHost';
10
12
  export { AuthProvider, useAuth } from './auth/AuthContext';
11
13
  export type { AuthState, AuthProviderProps } from './auth/AuthContext';
14
+ export { completePowerAppsAuthSession } from './auth/completePowerAppsAuthSession';
12
15
  export type { AuthConfig, MsalAuthConfig, IntuneConfig } from '@microsoft/power-apps-native-auth';
13
16
  export { PowerAppsHostProvider } from './provider/PowerAppsHostProvider';
14
17
  export type { PowerAppsHostProviderProps } from './provider/PowerAppsHostProvider';
@@ -0,0 +1,2 @@
1
+ export { useOfflineIntegration } from '@microsoft/power-apps-native-offline';
2
+ //# sourceMappingURL=useOfflineIntegration.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare function useOfflineIntegration(_options: unknown): {
2
+ StatusOverlay: null;
3
+ };
4
+ //# sourceMappingURL=useOfflineIntegration.web.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
3
+ export type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
4
+ export declare function PowerAppsHostProvider({ connectionReferences, databaseReferences, children, }: PowerAppsHostProviderProps): React.JSX.Element;
5
+ //# sourceMappingURL=PowerAppsHostProvider.web.d.ts.map
@@ -5,7 +5,7 @@
5
5
  * Power Apps canvas app inside an Expo shell:
6
6
  *
7
7
  * GestureHandlerRootView
8
- * └── TamaguiProvider (defaults to @tamagui/config/v3)
8
+ * └── TamaguiProvider (defaults to @tamagui/config/v5)
9
9
  * └── PortalProvider (required by ToastViewport)
10
10
  * └── ToastProvider + ToastViewport
11
11
  * └── QueryClientProvider (own QueryClient, wired to NetInfo + AppState)
@@ -81,7 +81,7 @@ export interface PowerAppsProviderProps {
81
81
  schemaMap: Record<string, ConnectorSchema>;
82
82
  /**
83
83
  * Tamagui design-system config.
84
- * Defaults to the standard @tamagui/config/v3 preset.
84
+ * Defaults to the standard @tamagui/config/v5 preset.
85
85
  */
86
86
  tamaguiConfig?: TamaguiConfig;
87
87
  /** Tamagui default colour theme. @default 'light' */
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import type { IntuneConfig, MsalAuthConfig } from '@microsoft/power-apps-native-auth';
3
+ export interface AuthState {
4
+ isLoading: boolean;
5
+ isAuthReady: boolean;
6
+ isSignedIn: boolean;
7
+ hasRealAccount: boolean;
8
+ error: Error | null;
9
+ acquireToken: (scopes: string[]) => Promise<string | null>;
10
+ signIn: () => Promise<void>;
11
+ signOut: () => Promise<void>;
12
+ }
13
+ export interface AuthProviderProps {
14
+ msalConfig: MsalAuthConfig;
15
+ intuneConfig?: IntuneConfig;
16
+ children: React.ReactNode;
17
+ }
18
+ export declare function AuthProvider({ children }: AuthProviderProps): React.JSX.Element;
19
+ export declare function useAuth(): AuthState;
20
+ //# sourceMappingURL=AuthContext.web.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { WebBrowserCompleteAuthSessionOptions, WebBrowserCompleteAuthSessionResult } from 'expo-web-browser';
2
+ /**
3
+ * Completes an Expo web authentication popup when the current route is its
4
+ * redirect target. Call this at module initialization in the OAuth callback
5
+ * route; navigation after completion remains application-owned.
6
+ */
7
+ export declare function completePowerAppsAuthSession(options?: WebBrowserCompleteAuthSessionOptions): WebBrowserCompleteAuthSessionResult;
8
+ //# sourceMappingURL=completePowerAppsAuthSession.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { AppConnectionReference, CdsDataSourceConfig } from './NativePowerAppsBridge.js';
2
+ export type PowerPagesBridgeOptions = {
3
+ dataSources: CdsDataSourceConfig[];
4
+ connections: Record<string, AppConnectionReference>;
5
+ };
6
+ export declare class PowerPagesBridge {
7
+ private options;
8
+ constructor(options: PowerPagesBridgeOptions);
9
+ updateOptions(options: PowerPagesBridgeOptions): void;
10
+ initialize(): Promise<void>;
11
+ createRequestBody(config: {
12
+ body?: string | Uint8Array | ArrayBuffer | Blob;
13
+ }): Blob | string | Uint8Array | ArrayBuffer;
14
+ executePluginAsync<T = unknown>(pluginName: string, pluginAction: string, params: unknown[]): Promise<T>;
15
+ private sendHttpAsync;
16
+ }
17
+ export declare function setupPowerPagesHost(options: PowerPagesBridgeOptions): void;
18
+ //# sourceMappingURL=PowerPagesBridge.d.ts.map
@@ -4,14 +4,17 @@
4
4
  *
5
5
  */
6
6
  export { NativePowerAppsBridge } from './bridge/NativePowerAppsBridge.js';
7
+ export { PowerPagesBridge, setupPowerPagesHost } from './bridge/PowerPagesBridge.js';
8
+ export type { PowerPagesBridgeOptions } from './bridge/PowerPagesBridge.js';
7
9
  export type { NativeBridgeOptions, CdsDataSourceConfig, AppConnection, AppConnectionReference } from './bridge/NativePowerAppsBridge.js';
8
10
  export { buildConnectionReferences } from './bridge/NativePowerAppsBridge.js';
9
11
  export { setupNativeHost } from './bridge/setupNativeHost.js';
10
- export { AuthProvider, useAuth } from './auth/AuthContext.js';
11
- export type { AuthState, AuthProviderProps } from './auth/AuthContext.js';
12
+ export { AuthProvider, useAuth } from './auth/AuthContext';
13
+ export type { AuthState, AuthProviderProps } from './auth/AuthContext';
14
+ export { completePowerAppsAuthSession } from './auth/completePowerAppsAuthSession.js';
12
15
  export type { AuthConfig, MsalAuthConfig, IntuneConfig } from '@microsoft/power-apps-native-auth';
13
- export { PowerAppsHostProvider } from './provider/PowerAppsHostProvider.js';
14
- export type { PowerAppsHostProviderProps } from './provider/PowerAppsHostProvider.js';
16
+ export { PowerAppsHostProvider } from './provider/PowerAppsHostProvider';
17
+ export type { PowerAppsHostProviderProps } from './provider/PowerAppsHostProvider';
15
18
  export { PowerAppsProvider } from './provider/PowerAppsProvider.js';
16
19
  export type { PowerAppsProviderProps, PowerConfig } from './provider/PowerAppsProvider.js';
17
20
  export { fetchInstanceUrl, buildCdsDataSources, buildEnvironmentEndpoint, POWER_PLATFORM_API_SCOPE } from './platform/PowerPlatformEnvironmentApi.js';
@@ -0,0 +1,2 @@
1
+ export { useOfflineIntegration } from '@microsoft/power-apps-native-offline';
2
+ //# sourceMappingURL=useOfflineIntegration.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare function useOfflineIntegration(_options: unknown): {
2
+ StatusOverlay: null;
3
+ };
4
+ //# sourceMappingURL=useOfflineIntegration.web.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
3
+ export type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
4
+ export declare function PowerAppsHostProvider({ connectionReferences, databaseReferences, children, }: PowerAppsHostProviderProps): React.JSX.Element;
5
+ //# sourceMappingURL=PowerAppsHostProvider.web.d.ts.map
@@ -5,7 +5,7 @@
5
5
  * Power Apps canvas app inside an Expo shell:
6
6
  *
7
7
  * GestureHandlerRootView
8
- * └── TamaguiProvider (defaults to @tamagui/config/v3)
8
+ * └── TamaguiProvider (defaults to @tamagui/config/v5)
9
9
  * └── PortalProvider (required by ToastViewport)
10
10
  * └── ToastProvider + ToastViewport
11
11
  * └── QueryClientProvider (own QueryClient, wired to NetInfo + AppState)
@@ -26,8 +26,8 @@
26
26
  */
27
27
  import React from 'react';
28
28
  import { createTamagui } from '@tamagui/core';
29
- import type { AuthProviderProps } from '../auth/AuthContext.js';
30
- import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider.js';
29
+ import type { AuthProviderProps } from '../auth/AuthContext';
30
+ import type { PowerAppsHostProviderProps } from './PowerAppsHostProvider';
31
31
  import type { ConnectorSchema } from '../platform/useConnectionRefs.js';
32
32
  import type { DatabaseReference } from '../platform/PowerPlatformEnvironmentApi.js';
33
33
  import type { OnDisambiguationNeeded } from '../connections/types.js';
@@ -81,7 +81,7 @@ export interface PowerAppsProviderProps {
81
81
  schemaMap: Record<string, ConnectorSchema>;
82
82
  /**
83
83
  * Tamagui design-system config.
84
- * Defaults to the standard @tamagui/config/v3 preset.
84
+ * Defaults to the standard @tamagui/config/v5 preset.
85
85
  */
86
86
  tamaguiConfig?: TamaguiConfig;
87
87
  /** Tamagui default colour theme. @default 'light' */
package/package.json CHANGED
@@ -1,17 +1,24 @@
1
1
  {
2
2
  "name": "@microsoft/power-apps-native-host",
3
- "version": "0.2.22",
3
+ "version": "0.2.25",
4
4
  "description": "React Native host integration for @microsoft/power-apps",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "bugs": {
8
8
  "email": "pawrap-team@microsoft.com"
9
9
  },
10
+ "engines": {
11
+ "node": "^20.17.0 || >=22.9.0"
12
+ },
10
13
  "main": "./lib/commonjs/index.js",
11
14
  "module": "./lib/module/index.js",
12
15
  "types": "./lib/typescript/commonjs/index.d.ts",
13
16
  "exports": {
14
17
  ".": {
18
+ "browser": {
19
+ "types": "./lib/typescript/commonjs/index.d.ts",
20
+ "default": "./lib/commonjs/index.js"
21
+ },
15
22
  "import": {
16
23
  "types": "./lib/typescript/module/index.d.ts",
17
24
  "default": "./lib/module/index.js"
@@ -27,38 +34,48 @@
27
34
  "bin": {
28
35
  "generate-connector-schemas": "scripts/generate-connector-schemas.js",
29
36
  "js-bundle": "scripts/bundle.js",
30
- "build-ios-base": "scripts/build-ios-base.js"
37
+ "build-ios-base": "scripts/build-ios-base.js",
38
+ "power-apps-web": "scripts/start-web.mjs",
39
+ "wrap": "scripts/wrap.js",
40
+ "upgrade-template": "scripts/upgrade.js"
31
41
  },
32
42
  "files": [
33
43
  "lib/",
34
44
  "!lib/**/*.map",
35
45
  "app.plugin.js",
36
- "scripts/"
46
+ "scripts/",
47
+ "compatibility/"
37
48
  ],
38
49
  "scripts": {
39
- "prepack": "bob build && node ../../scripts/notices.js",
50
+ "prepack": "npm run test:upgrade && bob build && node ../../scripts/notices.js",
40
51
  "build": "bob build && node ../../scripts/notices.js",
41
- "type-check": "tsc --noEmit"
52
+ "type-check": "tsc --noEmit",
53
+ "test:upgrade": "node --test test/upgrade.test.js"
42
54
  },
43
55
  "dependencies": {
44
- "@microsoft/power-apps-native-auth": "^0.3.4",
56
+ "@microsoft/power-apps-native-auth": "^0.3.5",
45
57
  "@microsoft/power-apps-native-common": "^0.1.8",
46
- "@tamagui/config": "1.144.4",
47
- "@tamagui/core": "1.144.4",
48
- "@tamagui/portal": "1.144.4",
49
- "@tamagui/toast": "1.144.4",
50
- "@tanstack/react-query": "5.62.0"
58
+ "@ster5/global-mutex": "3.3.0",
59
+ "@tamagui/config": "2.4.5",
60
+ "@tamagui/core": "2.4.5",
61
+ "@tamagui/portal": "2.4.5",
62
+ "@tamagui/toast": "2.4.5",
63
+ "@tanstack/react-query": "5.62.0",
64
+ "diff": "9.0.0",
65
+ "resolve-workspace-root": "2.0.1",
66
+ "write-file-atomic": "7.0.1"
51
67
  },
52
68
  "peerDependencies": {
53
69
  "@microsoft/power-apps": "*",
54
70
  "@microsoft/power-apps-native-offline": ">=0.1.0",
55
71
  "@react-native-community/netinfo": ">=11.0.0",
56
72
  "burnt": ">=0.12.2",
57
- "expo-constants": ">=55.0.0",
58
- "expo-linking": ">=55.0.14",
59
- "expo-web-browser": ">=55.0.14",
60
- "react": ">=19.2.0",
61
- "react-native": ">=0.83.4",
73
+ "expo-constants": ">=55.0.0 <56",
74
+ "expo-linking": ">=55.0.14 <56",
75
+ "expo-web-browser": ">=55.0.14 <56",
76
+ "react": ">=19.2.0 <20",
77
+ "react-dom": ">=19.2.0 <19.3.0",
78
+ "react-native": ">=0.83.4 <0.84",
62
79
  "react-native-gesture-handler": ">=2.0.0",
63
80
  "react-native-safe-area-context": ">=5.6.2"
64
81
  },
@@ -78,6 +95,9 @@
78
95
  "cross-env": "7.0.3",
79
96
  "expo-constants": "55.0.16",
80
97
  "expo-web-browser": "55.0.15",
98
+ "react": "19.2.0",
99
+ "react-dom": "19.2.0",
100
+ "react-native": "0.83.6",
81
101
  "react-native-safe-area-context": "5.6.2",
82
102
  "typescript": "5.9.3"
83
103
  },