@shellui/core 0.5.3 → 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",
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.3"
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,30 +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.
329
- // Also nudge the settings handshake once the companion document has loaded —
330
- // early shell→iframe posts are skipped while the frame is still about:blank.
308
+ // Handshake is request-driven: the companion posts SETTINGS_REQUESTED when ready;
309
+ // we do not nudge or send anything on load.
331
310
  useEffect(() => {
332
311
  const iframe = iframeRef.current;
333
312
  if (!iframe) return;
@@ -340,15 +319,6 @@ export const ContentView = ({
340
319
  } catch {
341
320
  if (loads > 1) iframe.setAttribute(IFRAME_FOREIGN_ATTR, 'true');
342
321
  }
343
-
344
- // Same-window SETTINGS_REQUESTED → SettingsProvider pushes to registered frames.
345
- // Harmless if settings already arrived; unblocks companions that raced about:blank.
346
- if (typeof window !== 'undefined' && window.parent === window) {
347
- window.postMessage(
348
- { type: 'SHELLUI_SETTINGS_REQUESTED', payload: {} },
349
- window.location.origin,
350
- );
351
- }
352
322
  };
353
323
  iframe.addEventListener('load', onLoad);
354
324
  return () => iframe.removeEventListener('load', onLoad);
@@ -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
- for (const [uuid, iframe] of shellui.frameRegistry.getAllIframes()) {
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.getAllIframes();
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;