@shellui/core 0.5.2 → 0.5.4-alpha.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4-alpha.1",
|
|
4
4
|
"description": "Shellui Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"workbox-routing": "^7.4.0",
|
|
73
73
|
"workbox-strategies": "^7.4.0",
|
|
74
74
|
"workbox-window": "^7.4.0",
|
|
75
|
-
"@shellui/sdk": "0.5.
|
|
75
|
+
"@shellui/sdk": "0.5.4-alpha.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
} from '@shellui/sdk';
|
|
11
11
|
import { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
12
12
|
import { useLocation, useNavigate } from 'react-router';
|
|
13
|
-
import { LOADING_OVERLAY_DURATION_MS } from '../constants/loading';
|
|
14
13
|
import { LoadingOverlay } from './LoadingOverlay';
|
|
15
14
|
import { IFRAME_FOREIGN_ATTR } from '../features/layouts/chrome/constants';
|
|
16
15
|
import { resolveContentIframeSandbox } from './contentIframeSandbox';
|
|
@@ -304,28 +303,10 @@ export const ContentView = ({
|
|
|
304
303
|
};
|
|
305
304
|
}, [ignoreMessages]);
|
|
306
305
|
|
|
307
|
-
// Fallback: hide overlay after LOADING_OVERLAY_DURATION_MS if SHELLUI_INITIALIZED was not received.
|
|
308
|
-
// Also used after location.replace syncs (no full remount / INITIALIZED).
|
|
309
|
-
useEffect(() => {
|
|
310
|
-
if (!isLoading) return;
|
|
311
|
-
const timeoutId = setTimeout(() => {
|
|
312
|
-
logger.info('ContentView: Timeout expired, hiding loading overlay');
|
|
313
|
-
cancelRevealRef.current?.();
|
|
314
|
-
let cancelled = false;
|
|
315
|
-
cancelRevealRef.current = () => {
|
|
316
|
-
cancelled = true;
|
|
317
|
-
cancelRevealRef.current = null;
|
|
318
|
-
};
|
|
319
|
-
scheduleReveal(() => {
|
|
320
|
-
if (!cancelled) setIsLoading(false);
|
|
321
|
-
cancelRevealRef.current = null;
|
|
322
|
-
});
|
|
323
|
-
}, LOADING_OVERLAY_DURATION_MS);
|
|
324
|
-
return () => clearTimeout(timeoutId);
|
|
325
|
-
}, [isLoading]);
|
|
326
|
-
|
|
327
306
|
// After the first load, a cross-origin document (OAuth/login) cannot be inspected.
|
|
328
307
|
// Flag it so desktop Back can restore the iframe to its assigned app URL.
|
|
308
|
+
// Handshake is request-driven: the companion posts SETTINGS_REQUESTED when ready;
|
|
309
|
+
// we do not nudge or send anything on load.
|
|
329
310
|
useEffect(() => {
|
|
330
311
|
const iframe = iframeRef.current;
|
|
331
312
|
if (!iframe) return;
|
|
@@ -180,7 +180,9 @@ export function publishLayoutChrome(chrome: LayoutChrome | null): void {
|
|
|
180
180
|
// Host shell document: vars only (no padding on the outer shell).
|
|
181
181
|
applyLayoutChromeStyles(payload, { autoPadding: false });
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
// Request-driven: only push chrome to frames that have started the handshake.
|
|
184
|
+
// Initial chrome is delivered inside SHELLUI_SETTINGS on SETTINGS_REQUESTED.
|
|
185
|
+
for (const [uuid, iframe] of shellui.frameRegistry.getLiveIframes()) {
|
|
184
186
|
if (isMainLayoutFrame(iframe)) {
|
|
185
187
|
shellui.sendMessage({
|
|
186
188
|
type: 'SHELLUI_LAYOUT_CHROME',
|
|
@@ -175,7 +175,7 @@ export function SettingsProvider({ children }: { children: ReactNode }) {
|
|
|
175
175
|
|
|
176
176
|
const propagateSettingsToIframes = useCallback(
|
|
177
177
|
(baseSettings: Settings) => {
|
|
178
|
-
const iframes = shellui.frameRegistry.
|
|
178
|
+
const iframes = shellui.frameRegistry.getLiveIframes();
|
|
179
179
|
if (iframes.length === 0) return;
|
|
180
180
|
const lang = baseSettings.language?.code || 'en';
|
|
181
181
|
const accessToken = accessTokenRef.current;
|