@microsoft/power-apps-native-host 0.3.3 → 0.5.1

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 (111) hide show
  1. package/README.md +60 -0
  2. package/compatibility/current.json +1 -1
  3. package/lib/NOTICE.txt +2957 -371
  4. package/lib/commonjs/auth/AuthContext.js +49 -22
  5. package/lib/commonjs/auth/targetAuthorization.js +53 -0
  6. package/lib/commonjs/bridge/NativePowerAppsBridge.js +33 -2
  7. package/lib/commonjs/bridge/PowerPagesBridge.js +1 -3
  8. package/lib/commonjs/bridge/setupNativeHost.js +6 -0
  9. package/lib/commonjs/config/expoConfig.js +14 -0
  10. package/lib/commonjs/config/runtimeTenantMode.js +16 -0
  11. package/lib/commonjs/config/runtimeTenantMode.web.js +9 -0
  12. package/lib/commonjs/config/tenantMode.js +68 -0
  13. package/lib/commonjs/connections/PowerPlatformConnectionApi.js +24 -27
  14. package/lib/commonjs/connections/connectionMetadata.js +2 -2
  15. package/lib/commonjs/connections/resolveConnections.js +8 -3
  16. package/lib/commonjs/connections/types.js +9 -2
  17. package/lib/commonjs/connections/useConnectionRefs.js +19 -10
  18. package/lib/commonjs/index.js +41 -2
  19. package/lib/commonjs/platform/CanvasAppResolution.js +33 -0
  20. package/lib/commonjs/platform/CanvasAppResolutionApi.js +69 -0
  21. package/lib/commonjs/platform/DataverseGlobalDiscoveryApi.js +50 -13
  22. package/lib/commonjs/platform/GlobalDiscovery.js +40 -1
  23. package/lib/commonjs/provider/PowerAppsHostProvider.js +47 -8
  24. package/lib/commonjs/provider/PowerAppsProvider.js +175 -9
  25. package/lib/commonjs/target/DefaultPowerAppsExperience.js +564 -0
  26. package/lib/commonjs/target/PowerAppsExperience.js +41 -0
  27. package/lib/commonjs/target/PowerAppsTargetBootstrap.js +534 -0
  28. package/lib/commonjs/target/errors.js +24 -0
  29. package/lib/commonjs/target/types.js +1 -0
  30. package/lib/commonjs/telemetry/index.js +2 -2
  31. package/lib/module/auth/AuthContext.js +49 -22
  32. package/lib/module/auth/targetAuthorization.js +48 -0
  33. package/lib/module/bridge/NativePowerAppsBridge.js +33 -2
  34. package/lib/module/bridge/PowerPagesBridge.js +1 -3
  35. package/lib/module/bridge/setupNativeHost.js +5 -0
  36. package/lib/module/config/expoConfig.js +14 -0
  37. package/lib/module/config/runtimeTenantMode.js +12 -0
  38. package/lib/module/config/runtimeTenantMode.web.js +5 -0
  39. package/lib/module/config/tenantMode.js +61 -0
  40. package/lib/module/connections/PowerPlatformConnectionApi.js +24 -27
  41. package/lib/module/connections/connectionMetadata.js +2 -2
  42. package/lib/module/connections/resolveConnections.js +9 -4
  43. package/lib/module/connections/types.js +9 -2
  44. package/lib/module/connections/useConnectionRefs.js +20 -11
  45. package/lib/module/index.js +5 -2
  46. package/lib/module/platform/CanvasAppResolution.js +27 -0
  47. package/lib/module/platform/CanvasAppResolutionApi.js +65 -0
  48. package/lib/module/platform/DataverseGlobalDiscoveryApi.js +49 -14
  49. package/lib/module/platform/GlobalDiscovery.js +37 -1
  50. package/lib/module/provider/PowerAppsHostProvider.js +47 -8
  51. package/lib/module/provider/PowerAppsProvider.js +179 -13
  52. package/lib/module/target/DefaultPowerAppsExperience.js +559 -0
  53. package/lib/module/target/PowerAppsExperience.js +34 -0
  54. package/lib/module/target/PowerAppsTargetBootstrap.js +529 -0
  55. package/lib/module/target/errors.js +19 -0
  56. package/lib/module/target/types.js +1 -0
  57. package/lib/module/telemetry/index.js +1 -1
  58. package/lib/typescript/commonjs/auth/AuthContext.d.ts +11 -2
  59. package/lib/typescript/commonjs/auth/targetAuthorization.d.ts +15 -0
  60. package/lib/typescript/commonjs/bridge/NativePowerAppsBridge.d.ts +6 -0
  61. package/lib/typescript/commonjs/bridge/setupNativeHost.d.ts +2 -0
  62. package/lib/typescript/commonjs/config/runtimeTenantMode.d.ts +3 -0
  63. package/lib/typescript/commonjs/config/runtimeTenantMode.web.d.ts +3 -0
  64. package/lib/typescript/commonjs/config/tenantMode.d.ts +14 -0
  65. package/lib/typescript/commonjs/connections/PowerPlatformConnectionApi.d.ts +5 -2
  66. package/lib/typescript/commonjs/connections/connectionMetadata.d.ts +1 -1
  67. package/lib/typescript/commonjs/connections/types.d.ts +7 -1
  68. package/lib/typescript/commonjs/connections/useConnectionRefs.d.ts +11 -2
  69. package/lib/typescript/commonjs/index.d.ts +7 -3
  70. package/lib/typescript/commonjs/platform/CanvasAppResolution.d.ts +4 -0
  71. package/lib/typescript/commonjs/platform/CanvasAppResolutionApi.d.ts +6 -0
  72. package/lib/typescript/commonjs/platform/DataverseGlobalDiscoveryApi.d.ts +12 -2
  73. package/lib/typescript/commonjs/platform/GlobalDiscovery.d.ts +12 -0
  74. package/lib/typescript/commonjs/provider/PowerAppsHostProvider.d.ts +9 -1
  75. package/lib/typescript/commonjs/provider/PowerAppsProvider.d.ts +14 -16
  76. package/lib/typescript/commonjs/target/DefaultPowerAppsExperience.d.ts +6 -0
  77. package/lib/typescript/commonjs/target/PowerAppsExperience.d.ts +61 -0
  78. package/lib/typescript/commonjs/target/PowerAppsTargetBootstrap.d.ts +15 -0
  79. package/lib/typescript/commonjs/target/errors.d.ts +13 -0
  80. package/lib/typescript/commonjs/target/types.d.ts +34 -0
  81. package/lib/typescript/commonjs/telemetry/index.d.ts +2 -2
  82. package/lib/typescript/module/auth/AuthContext.d.ts +11 -2
  83. package/lib/typescript/module/auth/targetAuthorization.d.ts +15 -0
  84. package/lib/typescript/module/bridge/NativePowerAppsBridge.d.ts +6 -0
  85. package/lib/typescript/module/bridge/setupNativeHost.d.ts +2 -0
  86. package/lib/typescript/module/config/runtimeTenantMode.d.ts +3 -0
  87. package/lib/typescript/module/config/runtimeTenantMode.web.d.ts +3 -0
  88. package/lib/typescript/module/config/tenantMode.d.ts +14 -0
  89. package/lib/typescript/module/connections/PowerPlatformConnectionApi.d.ts +5 -2
  90. package/lib/typescript/module/connections/connectionMetadata.d.ts +1 -1
  91. package/lib/typescript/module/connections/types.d.ts +7 -1
  92. package/lib/typescript/module/connections/useConnectionRefs.d.ts +11 -2
  93. package/lib/typescript/module/index.d.ts +7 -3
  94. package/lib/typescript/module/platform/CanvasAppResolution.d.ts +4 -0
  95. package/lib/typescript/module/platform/CanvasAppResolutionApi.d.ts +6 -0
  96. package/lib/typescript/module/platform/DataverseGlobalDiscoveryApi.d.ts +12 -2
  97. package/lib/typescript/module/platform/GlobalDiscovery.d.ts +12 -0
  98. package/lib/typescript/module/provider/PowerAppsHostProvider.d.ts +9 -1
  99. package/lib/typescript/module/provider/PowerAppsProvider.d.ts +14 -16
  100. package/lib/typescript/module/target/DefaultPowerAppsExperience.d.ts +6 -0
  101. package/lib/typescript/module/target/PowerAppsExperience.d.ts +61 -0
  102. package/lib/typescript/module/target/PowerAppsTargetBootstrap.d.ts +15 -0
  103. package/lib/typescript/module/target/errors.d.ts +13 -0
  104. package/lib/typescript/module/target/types.d.ts +34 -0
  105. package/lib/typescript/module/telemetry/index.d.ts +2 -2
  106. package/package.json +12 -5
  107. package/scripts/build-codegen-package.js +34 -3
  108. package/scripts/dev.js +405 -0
  109. package/scripts/upgrade-authoring.js +85 -28
  110. package/scripts/wrap.js +42 -5
  111. package/src/config/generated-config.d.ts +21 -0
@@ -0,0 +1,559 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { ActivityIndicator, Pressable, ScrollView, StyleSheet, Text, useColorScheme, View } from 'react-native';
5
+ import { Feather } from '@expo/vector-icons';
6
+ import { darkTheme, lightTheme } from "../theme/tokens.js";
7
+ import { PowerAppsRuntimeGate, usePowerAppsExperience } from "./PowerAppsExperience.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ function Action({
10
+ label,
11
+ icon,
12
+ onPress,
13
+ theme,
14
+ secondary = false
15
+ }) {
16
+ return /*#__PURE__*/_jsxs(Pressable, {
17
+ accessibilityRole: "button",
18
+ onPress: onPress,
19
+ style: ({
20
+ pressed
21
+ }) => [styles.action, {
22
+ backgroundColor: secondary ? theme.surface0 : theme.accentBase
23
+ }, secondary && {
24
+ borderColor: theme.surface4
25
+ }, pressed && styles.pressed],
26
+ children: [/*#__PURE__*/_jsx(Feather, {
27
+ name: icon,
28
+ size: 18,
29
+ color: secondary ? theme.text1 : theme.accentOnAccent
30
+ }), /*#__PURE__*/_jsx(Text, {
31
+ style: [styles.actionLabel, {
32
+ color: secondary ? theme.text0 : theme.accentOnAccent
33
+ }],
34
+ children: label
35
+ })]
36
+ });
37
+ }
38
+ function Frame({
39
+ appDisplayName,
40
+ eyebrow,
41
+ title,
42
+ children
43
+ }) {
44
+ const theme = useColorScheme() === 'dark' ? darkTheme : lightTheme;
45
+ return /*#__PURE__*/_jsxs(View, {
46
+ style: [styles.background, {
47
+ backgroundColor: theme.surface1
48
+ }],
49
+ children: [/*#__PURE__*/_jsx(View, {
50
+ style: [styles.topBand, {
51
+ backgroundColor: theme.accentDeep
52
+ }]
53
+ }), /*#__PURE__*/_jsx(View, {
54
+ style: [styles.sideBand, {
55
+ backgroundColor: theme.accentSoft
56
+ }]
57
+ }), /*#__PURE__*/_jsxs(View, {
58
+ style: styles.frame,
59
+ children: [/*#__PURE__*/_jsxs(View, {
60
+ style: styles.brandRow,
61
+ children: [/*#__PURE__*/_jsx(View, {
62
+ style: [styles.brandMark, {
63
+ backgroundColor: theme.accentBase
64
+ }],
65
+ children: /*#__PURE__*/_jsx(Feather, {
66
+ name: "grid",
67
+ size: 22,
68
+ color: theme.accentOnAccent
69
+ })
70
+ }), /*#__PURE__*/_jsx(Text, {
71
+ numberOfLines: 2,
72
+ style: [styles.brandName, {
73
+ color: theme.text0
74
+ }],
75
+ children: appDisplayName
76
+ })]
77
+ }), /*#__PURE__*/_jsxs(View, {
78
+ style: styles.content,
79
+ children: [/*#__PURE__*/_jsx(Text, {
80
+ style: [styles.eyebrow, {
81
+ color: theme.accentDeep
82
+ }],
83
+ children: eyebrow
84
+ }), /*#__PURE__*/_jsx(Text, {
85
+ accessibilityRole: "header",
86
+ style: [styles.title, {
87
+ color: theme.text0
88
+ }],
89
+ children: title
90
+ }), children]
91
+ }), /*#__PURE__*/_jsx(Text, {
92
+ style: [styles.footer, {
93
+ color: theme.text2
94
+ }],
95
+ children: "Powered by Microsoft Power Apps"
96
+ })]
97
+ })]
98
+ });
99
+ }
100
+ function Status({
101
+ appDisplayName,
102
+ title,
103
+ message
104
+ }) {
105
+ const theme = useColorScheme() === 'dark' ? darkTheme : lightTheme;
106
+ return /*#__PURE__*/_jsx(Frame, {
107
+ appDisplayName: appDisplayName,
108
+ eyebrow: "Getting things ready",
109
+ title: title,
110
+ children: /*#__PURE__*/_jsxs(View, {
111
+ style: styles.statusRow,
112
+ accessibilityRole: "progressbar",
113
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
114
+ color: theme.accentBase,
115
+ size: "small"
116
+ }), /*#__PURE__*/_jsx(Text, {
117
+ style: [styles.body, {
118
+ color: theme.text1
119
+ }],
120
+ children: message
121
+ })]
122
+ })
123
+ });
124
+ }
125
+ function Message({
126
+ children,
127
+ theme
128
+ }) {
129
+ return /*#__PURE__*/_jsx(Text, {
130
+ style: [styles.body, {
131
+ color: theme.text1
132
+ }],
133
+ children: children
134
+ });
135
+ }
136
+ export function DefaultPowerAppsExperience({
137
+ appDisplayName,
138
+ children
139
+ }) {
140
+ const experience = usePowerAppsExperience();
141
+ const theme = useColorScheme() === 'dark' ? darkTheme : lightTheme;
142
+ switch (experience.status) {
143
+ case 'preparing':
144
+ return /*#__PURE__*/_jsx(Status, {
145
+ appDisplayName: appDisplayName,
146
+ title: "Welcome",
147
+ message: "Preparing secure sign-in..."
148
+ });
149
+ case 'discovering':
150
+ return /*#__PURE__*/_jsx(Status, {
151
+ appDisplayName: appDisplayName,
152
+ title: "Finding your workspace",
153
+ message: "Checking the environments available to your account..."
154
+ });
155
+ case 'connecting':
156
+ return /*#__PURE__*/_jsx(Status, {
157
+ appDisplayName: appDisplayName,
158
+ title: `Opening ${experience.environment.label}`,
159
+ message: "Establishing a secure connection..."
160
+ });
161
+ case 'resolvingApp':
162
+ return /*#__PURE__*/_jsx(Status, {
163
+ appDisplayName: appDisplayName,
164
+ title: "Almost there",
165
+ message: "Loading the app configuration..."
166
+ });
167
+ case 'signIn':
168
+ return /*#__PURE__*/_jsxs(Frame, {
169
+ appDisplayName: appDisplayName,
170
+ eyebrow: "Secure access",
171
+ title: "Sign in to continue",
172
+ children: [/*#__PURE__*/_jsx(Message, {
173
+ theme: theme,
174
+ children: "Use your work or school account to find the environments available to you."
175
+ }), experience.error ? /*#__PURE__*/_jsxs(View, {
176
+ style: [styles.notice, {
177
+ backgroundColor: theme.surface2,
178
+ borderColor: theme.surface4
179
+ }],
180
+ children: [/*#__PURE__*/_jsx(Feather, {
181
+ name: "alert-circle",
182
+ size: 18,
183
+ color: "#A4262C"
184
+ }), /*#__PURE__*/_jsx(Text, {
185
+ style: [styles.noticeText, {
186
+ color: theme.text0
187
+ }],
188
+ children: experience.error
189
+ })]
190
+ }) : null, /*#__PURE__*/_jsxs(View, {
191
+ style: styles.actions,
192
+ children: [/*#__PURE__*/_jsx(Action, {
193
+ label: "Sign in with Microsoft",
194
+ icon: "log-in",
195
+ onPress: () => {
196
+ void experience.signIn();
197
+ },
198
+ theme: theme
199
+ }), experience.goBack ? /*#__PURE__*/_jsx(Action, {
200
+ label: "Choose another environment",
201
+ icon: "arrow-left",
202
+ onPress: experience.goBack,
203
+ theme: theme,
204
+ secondary: true
205
+ }) : null]
206
+ })]
207
+ });
208
+ case 'selectEnvironment':
209
+ return /*#__PURE__*/_jsxs(View, {
210
+ style: [styles.background, {
211
+ backgroundColor: theme.surface1
212
+ }],
213
+ children: [/*#__PURE__*/_jsx(View, {
214
+ style: [styles.topBand, {
215
+ backgroundColor: theme.accentDeep
216
+ }]
217
+ }), /*#__PURE__*/_jsxs(ScrollView, {
218
+ contentContainerStyle: styles.scrollFrame,
219
+ children: [/*#__PURE__*/_jsxs(View, {
220
+ style: styles.brandRow,
221
+ children: [/*#__PURE__*/_jsx(View, {
222
+ style: [styles.brandMark, {
223
+ backgroundColor: theme.accentBase
224
+ }],
225
+ children: /*#__PURE__*/_jsx(Feather, {
226
+ name: "grid",
227
+ size: 22,
228
+ color: theme.accentOnAccent
229
+ })
230
+ }), /*#__PURE__*/_jsx(Text, {
231
+ numberOfLines: 2,
232
+ style: [styles.brandName, {
233
+ color: theme.text0
234
+ }],
235
+ children: appDisplayName
236
+ })]
237
+ }), /*#__PURE__*/_jsxs(View, {
238
+ style: styles.content,
239
+ children: [/*#__PURE__*/_jsx(Text, {
240
+ style: [styles.eyebrow, {
241
+ color: theme.accentDeep
242
+ }],
243
+ children: "Your workspace"
244
+ }), /*#__PURE__*/_jsx(Text, {
245
+ accessibilityRole: "header",
246
+ style: [styles.title, {
247
+ color: theme.text0
248
+ }],
249
+ children: "Choose an environment"
250
+ }), /*#__PURE__*/_jsx(Message, {
251
+ theme: theme,
252
+ children: "Select where you want to open this app."
253
+ }), /*#__PURE__*/_jsx(View, {
254
+ style: styles.environmentList,
255
+ children: experience.environments.map(environment => /*#__PURE__*/_jsxs(Pressable, {
256
+ accessibilityRole: "button",
257
+ accessibilityLabel: `Open ${environment.label}`,
258
+ onPress: () => experience.selectEnvironment(environment.id),
259
+ style: ({
260
+ pressed
261
+ }) => [styles.environment, {
262
+ backgroundColor: theme.surface0,
263
+ borderColor: theme.surface3
264
+ }, pressed && {
265
+ backgroundColor: theme.surface2
266
+ }],
267
+ children: [/*#__PURE__*/_jsx(View, {
268
+ style: [styles.environmentIcon, {
269
+ backgroundColor: theme.accentSoft
270
+ }],
271
+ children: /*#__PURE__*/_jsx(Feather, {
272
+ name: "briefcase",
273
+ size: 19,
274
+ color: theme.accentDeep
275
+ })
276
+ }), /*#__PURE__*/_jsx(Text, {
277
+ numberOfLines: 2,
278
+ style: [styles.environmentLabel, {
279
+ color: theme.text0
280
+ }],
281
+ children: environment.label
282
+ }), /*#__PURE__*/_jsx(Feather, {
283
+ name: "chevron-right",
284
+ size: 20,
285
+ color: theme.text2
286
+ })]
287
+ }, environment.id))
288
+ }), /*#__PURE__*/_jsx(Action, {
289
+ label: "Sign out",
290
+ icon: "log-out",
291
+ onPress: () => {
292
+ void experience.signOut();
293
+ },
294
+ theme: theme,
295
+ secondary: true
296
+ })]
297
+ }), /*#__PURE__*/_jsx(Text, {
298
+ style: [styles.footer, {
299
+ color: theme.text2
300
+ }],
301
+ children: "Powered by Microsoft Power Apps"
302
+ })]
303
+ })]
304
+ });
305
+ case 'empty':
306
+ return /*#__PURE__*/_jsxs(Frame, {
307
+ appDisplayName: appDisplayName,
308
+ eyebrow: "No environments",
309
+ title: "Nothing available yet",
310
+ children: [/*#__PURE__*/_jsx(View, {
311
+ style: [styles.stateIcon, {
312
+ backgroundColor: theme.accentSoft
313
+ }],
314
+ children: /*#__PURE__*/_jsx(Feather, {
315
+ name: "inbox",
316
+ size: 26,
317
+ color: theme.accentDeep
318
+ })
319
+ }), /*#__PURE__*/_jsx(Message, {
320
+ theme: theme,
321
+ children: "We could not find a Dataverse environment that contains this app."
322
+ }), /*#__PURE__*/_jsxs(View, {
323
+ style: styles.actions,
324
+ children: [/*#__PURE__*/_jsx(Action, {
325
+ label: "Try again",
326
+ icon: "refresh-cw",
327
+ onPress: experience.retry,
328
+ theme: theme
329
+ }), /*#__PURE__*/_jsx(Action, {
330
+ label: "Use another account",
331
+ icon: "user",
332
+ onPress: () => {
333
+ void experience.signOut();
334
+ },
335
+ theme: theme,
336
+ secondary: true
337
+ })]
338
+ })]
339
+ });
340
+ case 'error':
341
+ return /*#__PURE__*/_jsxs(Frame, {
342
+ appDisplayName: appDisplayName,
343
+ eyebrow: "We hit a problem",
344
+ title: "Unable to continue",
345
+ children: [/*#__PURE__*/_jsx(View, {
346
+ style: [styles.stateIcon, {
347
+ backgroundColor: theme.surface2
348
+ }],
349
+ children: /*#__PURE__*/_jsx(Feather, {
350
+ name: "alert-triangle",
351
+ size: 26,
352
+ color: "#A4262C"
353
+ })
354
+ }), /*#__PURE__*/_jsx(Message, {
355
+ theme: theme,
356
+ children: experience.error.message
357
+ }), /*#__PURE__*/_jsxs(View, {
358
+ style: styles.actions,
359
+ children: [experience.retry ? /*#__PURE__*/_jsx(Action, {
360
+ label: "Try again",
361
+ icon: "refresh-cw",
362
+ onPress: experience.retry,
363
+ theme: theme
364
+ }) : null, experience.goBack ? /*#__PURE__*/_jsx(Action, {
365
+ label: "Choose another environment",
366
+ icon: "arrow-left",
367
+ onPress: experience.goBack,
368
+ theme: theme,
369
+ secondary: true
370
+ }) : null, experience.signOut ? /*#__PURE__*/_jsx(Action, {
371
+ label: "Use another account",
372
+ icon: "user",
373
+ onPress: () => {
374
+ void experience.signOut?.();
375
+ },
376
+ theme: theme,
377
+ secondary: true
378
+ }) : null]
379
+ })]
380
+ });
381
+ case 'ready':
382
+ return /*#__PURE__*/_jsx(PowerAppsRuntimeGate, {
383
+ children: children
384
+ });
385
+ }
386
+ }
387
+ const styles = StyleSheet.create({
388
+ background: {
389
+ flex: 1,
390
+ overflow: 'hidden'
391
+ },
392
+ topBand: {
393
+ position: 'absolute',
394
+ top: 0,
395
+ right: 0,
396
+ left: 0,
397
+ height: 8
398
+ },
399
+ sideBand: {
400
+ position: 'absolute',
401
+ top: 80,
402
+ right: -24,
403
+ width: 72,
404
+ height: 220,
405
+ transform: [{
406
+ rotate: '8deg'
407
+ }]
408
+ },
409
+ frame: {
410
+ flex: 1,
411
+ width: '100%',
412
+ maxWidth: 560,
413
+ alignSelf: 'center',
414
+ justifyContent: 'space-between',
415
+ paddingTop: 54,
416
+ paddingRight: 28,
417
+ paddingBottom: 28,
418
+ paddingLeft: 28
419
+ },
420
+ scrollFrame: {
421
+ flexGrow: 1,
422
+ width: '100%',
423
+ maxWidth: 560,
424
+ alignSelf: 'center',
425
+ justifyContent: 'space-between',
426
+ paddingTop: 54,
427
+ paddingRight: 28,
428
+ paddingBottom: 28,
429
+ paddingLeft: 28
430
+ },
431
+ brandRow: {
432
+ minHeight: 48,
433
+ flexDirection: 'row',
434
+ alignItems: 'center',
435
+ gap: 12
436
+ },
437
+ brandMark: {
438
+ width: 44,
439
+ height: 44,
440
+ borderRadius: 8,
441
+ alignItems: 'center',
442
+ justifyContent: 'center'
443
+ },
444
+ brandName: {
445
+ flex: 1,
446
+ fontSize: 17,
447
+ lineHeight: 22,
448
+ fontWeight: '700'
449
+ },
450
+ content: {
451
+ width: '100%',
452
+ gap: 18,
453
+ paddingVertical: 40
454
+ },
455
+ eyebrow: {
456
+ fontSize: 13,
457
+ lineHeight: 18,
458
+ fontWeight: '700',
459
+ textTransform: 'uppercase'
460
+ },
461
+ title: {
462
+ maxWidth: 470,
463
+ fontSize: 30,
464
+ lineHeight: 38,
465
+ fontWeight: '700'
466
+ },
467
+ body: {
468
+ maxWidth: 460,
469
+ fontSize: 16,
470
+ lineHeight: 24
471
+ },
472
+ statusRow: {
473
+ minHeight: 48,
474
+ flexDirection: 'row',
475
+ alignItems: 'center',
476
+ gap: 14
477
+ },
478
+ actions: {
479
+ width: '100%',
480
+ maxWidth: 380,
481
+ gap: 10,
482
+ paddingTop: 4
483
+ },
484
+ action: {
485
+ minHeight: 52,
486
+ width: '100%',
487
+ borderWidth: 1,
488
+ borderColor: 'transparent',
489
+ borderRadius: 6,
490
+ flexDirection: 'row',
491
+ alignItems: 'center',
492
+ justifyContent: 'center',
493
+ gap: 10,
494
+ paddingHorizontal: 18
495
+ },
496
+ actionLabel: {
497
+ flexShrink: 1,
498
+ fontSize: 16,
499
+ lineHeight: 21,
500
+ fontWeight: '600',
501
+ textAlign: 'center'
502
+ },
503
+ pressed: {
504
+ opacity: 0.78
505
+ },
506
+ notice: {
507
+ maxWidth: 460,
508
+ borderWidth: 1,
509
+ borderRadius: 6,
510
+ flexDirection: 'row',
511
+ alignItems: 'flex-start',
512
+ gap: 10,
513
+ padding: 14
514
+ },
515
+ noticeText: {
516
+ flex: 1,
517
+ fontSize: 14,
518
+ lineHeight: 20
519
+ },
520
+ environmentList: {
521
+ width: '100%',
522
+ gap: 10,
523
+ paddingTop: 4
524
+ },
525
+ environment: {
526
+ minHeight: 64,
527
+ borderWidth: 1,
528
+ borderRadius: 6,
529
+ flexDirection: 'row',
530
+ alignItems: 'center',
531
+ gap: 12,
532
+ paddingHorizontal: 14,
533
+ paddingVertical: 10
534
+ },
535
+ environmentIcon: {
536
+ width: 38,
537
+ height: 38,
538
+ borderRadius: 6,
539
+ alignItems: 'center',
540
+ justifyContent: 'center'
541
+ },
542
+ environmentLabel: {
543
+ flex: 1,
544
+ fontSize: 16,
545
+ lineHeight: 22,
546
+ fontWeight: '600'
547
+ },
548
+ stateIcon: {
549
+ width: 52,
550
+ height: 52,
551
+ borderRadius: 8,
552
+ alignItems: 'center',
553
+ justifyContent: 'center'
554
+ },
555
+ footer: {
556
+ fontSize: 12,
557
+ lineHeight: 18
558
+ }
559
+ });
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import React, { createContext, useContext } from 'react';
4
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
5
+ const PowerAppsExperienceContext = /*#__PURE__*/createContext(undefined);
6
+ export function usePowerAppsExperience() {
7
+ const experience = useContext(PowerAppsExperienceContext);
8
+ if (!experience) {
9
+ throw new Error('usePowerAppsExperience must be used by a multi-tenant experience component.');
10
+ }
11
+ return experience;
12
+ }
13
+ export function PowerAppsRuntimeGate({
14
+ children
15
+ }) {
16
+ return usePowerAppsExperience().status === 'ready' ? /*#__PURE__*/_jsx(_Fragment, {
17
+ children: children
18
+ }) : null;
19
+ }
20
+ export function PowerAppsExperienceBoundary({
21
+ experience,
22
+ appDisplayName,
23
+ component: Component,
24
+ children,
25
+ fallback
26
+ }) {
27
+ return /*#__PURE__*/_jsx(PowerAppsExperienceContext.Provider, {
28
+ value: experience,
29
+ children: Component ? /*#__PURE__*/_jsx(Component, {
30
+ appDisplayName: appDisplayName,
31
+ children: children
32
+ }) : fallback
33
+ });
34
+ }