react-dockable-desktop 7.11.0 → 7.12.0-next.0

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/dist/index.d.ts CHANGED
@@ -295,7 +295,33 @@ interface PanelInfo {
295
295
  * the owner panel saves its widgets itself. (7.11.0)
296
296
  */
297
297
  owner?: PanelOwner;
298
+ /**
299
+ * Set while the panel is shown in its own browser window (`workspace.popOutPanel`). Such a
300
+ * panel is `state: 'floating'` and keeps its floating window entry, which the workspace does not
301
+ * draw. Runtime only: `saveLayout()` writes the panel where it would come back to (docked in its
302
+ * place, or floating at its rect), without it, and a loaded layout never has it. (7.12.0)
303
+ */
304
+ poppedOut?: true;
298
305
  }
306
+ /**
307
+ * What `workspace.popOutPanel(id)` did (7.12.0): `{ ok: true }` when the panel is in its own
308
+ * window (or already was), otherwise why not, checked in this order:
309
+ * - `'disabled'`: the workspace was created without `popOut: true`;
310
+ * - `'not-open'`: no open panel has this id;
311
+ * - `'not-allowed'`: the panel's type has no `canPopOut` (or it shows a widget out of its panel);
312
+ * - `'no-gesture'`: the call did not come from a user's click or key press, so no window may open;
313
+ * - `'blocked'`: the browser's pop-up blocker refused the window;
314
+ * - `'no-window'`: no `<DockableDesktopProvider>` is mounted to show it, or the window closed or
315
+ * could not be used before the panel moved in.
316
+ *
317
+ * The panel stays where it was on every refusal.
318
+ */
319
+ type PopOutResult = {
320
+ ok: true;
321
+ } | {
322
+ ok: false;
323
+ reason: 'disabled' | 'not-open' | 'not-allowed' | 'no-gesture' | 'blocked' | 'no-window';
324
+ };
299
325
  /** Who a hosted panel belongs to: see {@link PanelInfo.owner}. (7.11.0) */
300
326
  interface PanelOwner {
301
327
  /** The panel whose overlay opened the widget. */
@@ -461,6 +487,9 @@ interface WorkspaceActions {
461
487
  * @param id - Panel instance ID.
462
488
  * @param rect - Optional initial position and size. Omit to use the last known position or a cascaded default.
463
489
  * @param anchor - Optional corner to pin the new floating window to. Omit (or pass `null`) for free-float.
490
+ *
491
+ * Ignored while the panel is in its own browser window (`popOutPanel`, 7.12.0): it has no window
492
+ * on the page to place until it returns.
464
493
  */
465
494
  floatPanel: (id: string, rect?: {
466
495
  x: number;
@@ -477,6 +506,8 @@ interface WorkspaceActions {
477
506
  /**
478
507
  * Maximizes a floating window to cover the entire workspace viewport.
479
508
  * @param id - Panel instance ID.
509
+ *
510
+ * Ignored while the panel is in its own browser window (`popOutPanel`, 7.12.0).
480
511
  */
481
512
  maximizePanel: (id: string) => void;
482
513
  /**
@@ -734,6 +765,19 @@ interface InternalWindowActions extends WorkspaceActions {
734
765
  * closes. `onDrop`, just before a `loadLayout` drops it: the widget is about to go home. (7.11.0)
735
766
  */
736
767
  registerHostedCloseHandler: (id: string, onClose: () => void, onDrop?: () => void) => () => void;
768
+ /**
769
+ * @internal Marks an open panel as shown in its own window (7.12.0): a docked or minimized panel
770
+ * becomes floating first, remembering its group. Returns `false`, changing nothing, when the
771
+ * workspace has no `popOut` or there is no such panel.
772
+ */
773
+ setPoppedOut: (id: string) => boolean;
774
+ /**
775
+ * @internal Clears a panel's pop-out flag (7.12.0). With `restorePlace`, a panel that was docked
776
+ * goes back where it was: its tab-mates' group, its own kept empty group, beside the panels it was
777
+ * next to, the grid when no panel is docked, else floating (or the first group for a type that
778
+ * can't float). See `WorkspaceClient.returnPanel`.
779
+ */
780
+ clearPoppedOut: (id: string, restorePlace: boolean) => void;
737
781
  }
738
782
  /** @internal Where a hosted panel opens. (7.11.0) */
739
783
  type HostedPanelPlacement = {
@@ -873,6 +917,13 @@ interface PanelRegistryEntry {
873
917
  * reloads. Off by default. @default false
874
918
  */
875
919
  preserveEmbeds?: boolean;
920
+ /**
921
+ * `true`: a panel of this type can move into its own browser window (7.12.0), from its "Open
922
+ * in new window" menu item or `workspace.popOutPanel(id)`. Needs a workspace created with
923
+ * `popOut: true`. It gates the menu item and new calls only: a window already open stays open
924
+ * when this changes. @default false
925
+ */
926
+ canPopOut?: boolean;
876
927
  };
877
928
  }
878
929
  /**
@@ -1064,6 +1115,26 @@ declare const defaultPredefinedMessages: {
1064
1115
  readonly id: "dockable-desktop-untitledPanel";
1065
1116
  readonly defaultMessage: "Panel";
1066
1117
  };
1118
+ readonly popOutWindow: {
1119
+ readonly id: "dockable-desktop-popOutWindow";
1120
+ readonly defaultMessage: "Open in new window";
1121
+ };
1122
+ readonly returnToDesktop: {
1123
+ readonly id: "dockable-desktop-returnToDesktop";
1124
+ readonly defaultMessage: "Return to desktop";
1125
+ };
1126
+ readonly inOwnWindow: {
1127
+ readonly id: "dockable-desktop-inOwnWindow";
1128
+ readonly defaultMessage: "in its own window";
1129
+ };
1130
+ readonly backIntoPanel: {
1131
+ readonly id: "dockable-desktop-backIntoPanel";
1132
+ readonly defaultMessage: "Back into the panel";
1133
+ };
1134
+ readonly popOutBlocked: {
1135
+ readonly id: "dockable-desktop-popOutBlocked";
1136
+ readonly defaultMessage: "The browser blocked the new window. Allow pop-ups for this site and try again.";
1137
+ };
1067
1138
  };
1068
1139
  /**
1069
1140
  * Union of every key in `defaultMessages`.
@@ -1144,6 +1215,95 @@ declare const usePredefinedMessages: () => Record<MessageKey, MessageDescriptor>
1144
1215
  */
1145
1216
  declare function usePanelContextMenu(items: ContextMenuItem[]): void;
1146
1217
 
1218
+ /**
1219
+ * @file popOutWindows.ts
1220
+ * @description A workspace's pop-out windows (7.12.0): a panel shown in its own browser window.
1221
+ * Internal: the public face is `workspace.popOutPanel` / `workspace.returnPanel`.
1222
+ *
1223
+ * The workspace client owns the windows, because `window.open` must run synchronously inside the
1224
+ * user's click, outside React. The store marks the panel (`PanelInfo.poppedOut`, a floating panel
1225
+ * whose frame the workspace doesn't draw); the provider subscribes here and renders, per window,
1226
+ * the library's frame and a slot into the child's `<body>`, which the panel's preserved element
1227
+ * moves into. Nothing remounts.
1228
+ *
1229
+ * Every way back ends in one function, {@link PopOutWindows.returnPanel}'s core: the frame's
1230
+ * button, the app's call, the child's `pagehide` (the element is moved back to the main document
1231
+ * inside the handler, before the child's document goes), a `closed` poll as a backstop, and the
1232
+ * main page's own `pagehide`. A panel that stops being a popped-out floating panel some other way
1233
+ * (closed, docked or minimized by the app, dropped by `loadLayout`) closes its window too: the
1234
+ * windows follow the store, never the other way round.
1235
+ */
1236
+
1237
+ /** @internal What the provider lends the windows: the panel's element, where it is and how to take it back. */
1238
+ interface PopOutHost {
1239
+ /** Moves the panel's element back into the main document, now. */
1240
+ park(id: string): void;
1241
+ /** The panel's box on the main page, or null when it isn't shown. */
1242
+ rectOf(id: string): {
1243
+ left: number;
1244
+ top: number;
1245
+ width: number;
1246
+ height: number;
1247
+ } | null;
1248
+ }
1249
+ /** @internal One open window, as the provider renders it. `doc` is null until its page has loaded. */
1250
+ interface PopOutEntry {
1251
+ /** This window's own name: unique per window opened, so a re-opened panel renders afresh. */
1252
+ readonly key: string;
1253
+ readonly id: string;
1254
+ readonly win: Window;
1255
+ readonly doc: Document | null;
1256
+ }
1257
+ /**
1258
+ * @internal What a managed widget's overlay lends for its hosted panel (7.12.0, S5): the panel is
1259
+ * popped out through the widget (it may have to leave its panel first), and comes back into the
1260
+ * panel when its window closes (D17).
1261
+ */
1262
+ interface HostedPopOut {
1263
+ /** `popOutPanel(hostedId)`: the widget's own `popOut()`. */
1264
+ popOut(): PopOutResult;
1265
+ /** Its window is closing to bring it back (not a move from code): before the element moves. */
1266
+ returning(): void;
1267
+ /** ...and it is out of the window: the widget goes back into its panel. */
1268
+ returned(): void;
1269
+ }
1270
+ /** @internal How a hosted panel is popped out: the widget has checked its own rules. */
1271
+ interface HostedPopOutOptions {
1272
+ /** Called once the window is open, before the panel moves in: takes the widget out of its panel if needed. */
1273
+ prepare: () => boolean;
1274
+ /** Where the widget is on the main page (client pixels), for the window's place and size. */
1275
+ rect?: {
1276
+ left: number;
1277
+ top: number;
1278
+ width: number;
1279
+ height: number;
1280
+ } | null;
1281
+ }
1282
+ /** @internal A workspace's pop-out windows: what `WorkspaceClient` and the provider use. */
1283
+ interface PopOutWindows {
1284
+ /** See `WorkspaceClient.popOutPanel`. With `hosted`, a managed widget's own pop-out (S5). */
1285
+ popOut(id: string, hosted?: HostedPopOutOptions): PopOutResult;
1286
+ /** Brings a panel's window forward, best effort (7.12.0, S6); false when it has none. */
1287
+ focusWindow(id: string): boolean;
1288
+ /** Lends a hosted panel's widget rules; returns the function that takes them back. */
1289
+ registerHosted(panelId: string, hosted: HostedPopOut): () => void;
1290
+ /** See `WorkspaceClient.returnPanel`. */
1291
+ returnPanel(id: string): {
1292
+ ok: boolean;
1293
+ };
1294
+ /** Whether the user may pop this panel out now (the menu item's rule). */
1295
+ canPopOut(id: string): boolean;
1296
+ /** Whether the workspace was created with `popOut: true`. */
1297
+ readonly enabled: boolean;
1298
+ /** The app's page for a pop-out (`<DockableDesktopProvider popoutUrl>`); a blank window without one. */
1299
+ setUrl(url: string | undefined): void;
1300
+ /** The provider lends its panel host; returns the function that takes it back. */
1301
+ bindHost(host: PopOutHost): () => void;
1302
+ /** For `useSyncExternalStore`: the open windows, a new array whenever they change. */
1303
+ subscribe(cb: () => void): () => void;
1304
+ getSnapshot(): readonly PopOutEntry[];
1305
+ }
1306
+
1147
1307
  /** Built-in lifecycle events always available on the workspace event bus. */
1148
1308
  interface BuiltInEvents {
1149
1309
  'panel:opened': {
@@ -1159,6 +1319,24 @@ interface BuiltInEvents {
1159
1319
  'panel:restored': {
1160
1320
  id: string;
1161
1321
  };
1322
+ /**
1323
+ * A panel moved into its own browser window (`popOutPanel`, 7.12.0), once that window's page is
1324
+ * ready: `window` is it, the one `usePanelWindow()` now gives the panel. Sent for a managed
1325
+ * widget's own panel too (`useFloatingWidgets().popOut`), with that panel's id.
1326
+ */
1327
+ 'panel:popped-out': {
1328
+ id: string;
1329
+ window: Window;
1330
+ };
1331
+ /**
1332
+ * A panel that was in its own window is back in the page (7.12.0), whatever brought it back: the
1333
+ * app, the frame's button, the window closing, the provider unmounting. Not sent for a panel
1334
+ * closed while out (`panel:closed` is). Sent for a managed widget's own panel too, as it goes back
1335
+ * into its owner panel.
1336
+ */
1337
+ 'panel:returned': {
1338
+ id: string;
1339
+ };
1162
1340
  /**
1163
1341
  * Fires whenever something `saveLayout()` would capture changes — open/close/minimize/restore,
1164
1342
  * float/dock/re-order/dock-to-edge, closing a group, maximizing a minimized panel, and an
@@ -1247,6 +1425,21 @@ interface WorkspaceClientConfig {
1247
1425
  * ```
1248
1426
  */
1249
1427
  canDrop?: (drop: PanelDrop) => boolean;
1428
+ /**
1429
+ * Lets panels move into their own browser window, for a second monitor (7.12.0): a panel type
1430
+ * opts in with `defaultOptions.canPopOut`, and the user opens it with "Open in new window" or
1431
+ * the app with `workspace.popOutPanel(id)`. Set once, here. With `false`, nothing of it runs: no menu item, and `popOutPanel` returns
1432
+ * `{ ok: false, reason: 'disabled' }`. @default false
1433
+ *
1434
+ * @example
1435
+ * ```ts
1436
+ * const workspace = createWorkspace({
1437
+ * popOut: true,
1438
+ * panels: { chart: { component: ChartPanel, defaultOptions: { canPopOut: true } } },
1439
+ * });
1440
+ * ```
1441
+ */
1442
+ popOut?: boolean;
1250
1443
  }
1251
1444
  /**
1252
1445
  * A workspace: the layout, every action on it, the panel registry and the event bus. Create one
@@ -1287,6 +1480,8 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
1287
1480
  readonly config: Pick<WorkspaceClientConfig, 'formatMessage' | 'predefinedMessages' | 'dir' | 'defaultSplitRatio' | 'defaultEdgeSplitRatio' | 'zIndexBase'>;
1288
1481
  /** @internal The workspace store. Live from construction; a provider only subscribes to it. */
1289
1482
  readonly _core: WorkspaceCore;
1483
+ /** @internal The workspace's pop-out windows (7.12.0); the provider renders them. */
1484
+ readonly _popOut: PopOutWindows;
1290
1485
  /** The store's actions, to which every method below forwards. */
1291
1486
  private get _actions();
1292
1487
  constructor(config?: WorkspaceClientConfig);
@@ -1304,6 +1499,7 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
1304
1499
  * For floating panels: raises z-index so the window appears on top.
1305
1500
  * For docked panels: selects the tab within its leaf group.
1306
1501
  * For minimized panels: makes it the active one, but leaves it minimized.
1502
+ * For a panel in its own window (7.12.0): also brings that window forward, best effort.
1307
1503
  */
1308
1504
  focusPanel(id: string): void;
1309
1505
  /**
@@ -1317,6 +1513,61 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
1317
1513
  focusPanel(id: string, options: {
1318
1514
  restore?: boolean;
1319
1515
  }): void;
1516
+ /**
1517
+ * Brings forward the window that holds a panel, and makes it the active panel (7.12.0): its
1518
+ * pop-out for a panel in its own window (a widget's panel too), the main window for one in the
1519
+ * page. Best effort: a browser may keep another window in front. `ok` is false for an id that
1520
+ * isn't open.
1521
+ * @example
1522
+ * ```tsx
1523
+ * // From a widget in its own window: bring its owner panel's window forward.
1524
+ * workspace.focusPanelWindow(useWidget()!.ownerPanelId!);
1525
+ * ```
1526
+ */
1527
+ focusPanelWindow(id: string): {
1528
+ ok: boolean;
1529
+ };
1530
+ /**
1531
+ * Moves a panel into its own browser window (7.12.0), for a second monitor. Nothing remounts:
1532
+ * the panel's state, scroll offsets and a canvas's WebGL context go with it. A docked panel
1533
+ * remembers its group and goes back into it on return.
1534
+ *
1535
+ * Call it inside the user's click or key press: browsers only open a window then. It is
1536
+ * synchronous, and says what happened (see {@link PopOutResult}); on a refusal the panel stays
1537
+ * where it is and nothing is shown to the user, so the app decides what to say. Calling it for a
1538
+ * panel that is already out brings its window forward.
1539
+ *
1540
+ * Needs `createWorkspace({ popOut: true })` and the panel type's `defaultOptions.canPopOut`.
1541
+ * The window opens `<DockableDesktopProvider popoutUrl>`, or a blank window. When that page can't
1542
+ * be used after all (another origin, or it doesn't load within 10 s), the panel comes back and the
1543
+ * window closes, after this has returned `{ ok: true }`.
1544
+ *
1545
+ * @example
1546
+ * ```tsx
1547
+ * <button onClick={() => {
1548
+ * const result = workspace.popOutPanel('chart-1');
1549
+ * if (!result.ok && result.reason === 'blocked') alert('Allow pop-ups for this site.');
1550
+ * }}>Pop out</button>
1551
+ * ```
1552
+ */
1553
+ popOutPanel(id: string): PopOutResult;
1554
+ /**
1555
+ * Brings a panel back from its own window (7.12.0), where it was. A panel that was floating
1556
+ * floats at its rect. One that was docked goes, in this order:
1557
+ * - into the group of its tab-mates, among their tabs, when one of them is docked;
1558
+ * - into its own group, when that group was kept and waits empty;
1559
+ * - beside the panels it was next to, on the same side at the same size (the nearest part of its
1560
+ * old layout still docked);
1561
+ * - into the grid, when no panel is docked there;
1562
+ * - otherwise floating, or into the first group for a type that can't float.
1563
+ *
1564
+ * Panels out at the same time come back, in any order, to the layout they left. The window
1565
+ * closes. Closing the window, or its "Return to desktop" button, does the same. `ok` is false
1566
+ * when the panel wasn't in a window.
1567
+ */
1568
+ returnPanel(id: string): {
1569
+ ok: boolean;
1570
+ };
1320
1571
  /** Returns `true` if a panel with this ID is currently open. */
1321
1572
  isOpen(id: string): boolean;
1322
1573
  /** Returns the IDs of all currently open panels. */
@@ -1669,7 +1920,7 @@ type PanelState = PanelInfo['state'];
1669
1920
  *
1670
1921
  * **Identity.** `id` and the five functions (`close`, `minimize`, `setDirty`, `setTitle`,
1671
1922
  * `setIcon`) never change identity for the panel's lifetime. The handle object itself changes
1672
- * when `containerType`, `isActive`, `isMinimized` or `isFloating` does. So don't list the handle
1923
+ * when `containerType`, `isActive`, `isMinimized`, `isFloating` or `isPoppedOut` does. So don't list the handle
1673
1924
  * in a dependency array: depend on the function you call, or on the values you write.
1674
1925
  */
1675
1926
  interface PanelHandle {
@@ -1681,8 +1932,13 @@ interface PanelHandle {
1681
1932
  isActive: boolean;
1682
1933
  /** A workspace panel that is minimized to the taskbar. */
1683
1934
  isMinimized: boolean;
1684
- /** A workspace panel shown as a floating window. */
1935
+ /** A workspace panel shown as a floating window. True too while it is in its own browser window. */
1685
1936
  isFloating: boolean;
1937
+ /**
1938
+ * A workspace panel shown in its own browser window (`workspace.popOutPanel`, 7.12.0). Its
1939
+ * window and document are {@link usePanelWindow}'s.
1940
+ */
1941
+ isPoppedOut: boolean;
1686
1942
  /** Asks the container to close, honouring close guards and the dirty flag. */
1687
1943
  close: (options?: CloseOptions) => void;
1688
1944
  /** Minimizes a workspace panel. No effect in a modal or drawer. */
@@ -1822,6 +2078,42 @@ type RddContextMenuProps = ContextMenuProps & {
1822
2078
  */
1823
2079
  declare const RddContextMenu: React$1.ForwardRefExoticComponent<RddContextMenuProps & React$1.RefAttributes<ContextMenuHandle>>;
1824
2080
 
2081
+ /**
2082
+ * @file panelWindow.tsx
2083
+ * @description The window a panel is in (7.12.0, S4): the main one, or its pop-out's. Panel code
2084
+ * reads it with `usePanelWindow()`; the app's `popoutWrapper` gets it as props, so a CSS-in-JS
2085
+ * cache can follow the panel into the pop-out's document.
2086
+ */
2087
+
2088
+ /** The window and document a panel is shown in. See {@link usePanelWindow}. (7.12.0) */
2089
+ interface PanelWindow {
2090
+ window: Window;
2091
+ document: Document;
2092
+ }
2093
+ /** The props of `<DockableDesktopProvider popoutWrapper>`. (7.12.0) */
2094
+ interface PopoutWrapperProps extends PanelWindow {
2095
+ children: ReactNode;
2096
+ }
2097
+ /**
2098
+ * The window and document the panel is shown in (7.12.0): the pop-out's while the panel is in its
2099
+ * own window, the main ones otherwise (and outside a workspace panel, or with `popOut` off). It
2100
+ * changes when the panel pops out and when it returns, so code that listens on the window, uses
2101
+ * its `requestAnimationFrame`, `devicePixelRatio` or `matchMedia`, or creates elements, can follow.
2102
+ *
2103
+ * @example
2104
+ * ```tsx
2105
+ * function Chart() {
2106
+ * const { window: win } = usePanelWindow();
2107
+ * useEffect(() => {
2108
+ * const onResize = () => redraw(win.devicePixelRatio);
2109
+ * win.addEventListener('resize', onResize);
2110
+ * return () => win.removeEventListener('resize', onResize);
2111
+ * }, [win]);
2112
+ * }
2113
+ * ```
2114
+ */
2115
+ declare function usePanelWindow(): PanelWindow;
2116
+
1825
2117
  /** Props for `<DockableDesktopProvider>`. */
1826
2118
  interface DockableDesktopProviderProps {
1827
2119
  children: React$1.ReactNode;
@@ -1855,6 +2147,40 @@ interface DockableDesktopProviderProps {
1855
2147
  zIndexBase?: number;
1856
2148
  /** Context menu implementation. Defaults to the built-in menu. */
1857
2149
  contextMenuAdapter?: ContextMenuAdapter;
2150
+ /**
2151
+ * The page a pop-out window opens (7.12.0): a same-origin page of the app, such as
2152
+ * `/popout.html`, with an empty `<body>`. The library waits for it to load, then moves the panel
2153
+ * in. Without it, the window opens blank. A page that can't be read (another origin, or a redirect
2154
+ * off this one) or doesn't load within 10 s sends the panel back. Only used with
2155
+ * `createWorkspace({ popOut: true })`.
2156
+ */
2157
+ popoutUrl?: string;
2158
+ /**
2159
+ * A component around every panel's content, given the window and document the panel is in (7.12.0):
2160
+ * the main ones, then the pop-out's while it is in its own window. For CSS-in-JS: a cache per
2161
+ * document, so the panel's styles are inserted where it is shown (a pop-out doesn't get rules
2162
+ * inserted with `insertRule` from the page). Rendered for every panel, for its whole life, while
2163
+ * the workspace has `popOut: true` (none otherwise), so nothing remounts when a panel moves. Pass
2164
+ * a stable component (defined outside a render), not an inline function.
2165
+ *
2166
+ * @example
2167
+ * ```tsx
2168
+ * import createCache from '@emotion/cache';
2169
+ * import { CacheProvider } from '@emotion/react';
2170
+ *
2171
+ * const caches = new WeakMap<Document, ReturnType<typeof createCache>>();
2172
+ * const cacheFor = (doc: Document) => {
2173
+ * let c = caches.get(doc);
2174
+ * if (!c) { c = createCache({ key: 'app', container: doc.head }); caches.set(doc, c); }
2175
+ * return c;
2176
+ * };
2177
+ * const PopoutWrapper = ({ document, children }: PopoutWrapperProps) =>
2178
+ * <CacheProvider value={cacheFor(document)}>{children}</CacheProvider>;
2179
+ *
2180
+ * <DockableDesktopProvider workspace={workspace} popoutWrapper={PopoutWrapper}>…</DockableDesktopProvider>
2181
+ * ```
2182
+ */
2183
+ popoutWrapper?: React$1.ComponentType<PopoutWrapperProps>;
1858
2184
  }
1859
2185
  /**
1860
2186
  * The one provider. Place it above everything from this library: `<RddDesktop>`, `<RddSidebar>`,
@@ -2600,6 +2926,13 @@ interface ManagedWidget {
2600
2926
  * an iframe reloads as before. As `preserveEmbeds` on a panel type's `defaultOptions`. @default false
2601
2927
  */
2602
2928
  preserveEmbeds?: boolean;
2929
+ /**
2930
+ * It may move into its own browser window (7.12.0): `useFloatingWidgets().popOut(id)`, or an item
2931
+ * the app offers in its {@link ManagedWidget.titleMenu} (`w.popOut()`). Needs a workspace created
2932
+ * with `popOut: true`. Changeable while open: call `open()` again; a window already open stays
2933
+ * open. @default false
2934
+ */
2935
+ canPopOut?: boolean;
2603
2936
  }
2604
2937
  /**
2605
2938
  * Where a managed widget is, as plain JSON (7.11.0): from `useFloatingWidgets().placement(id)`,
@@ -2620,6 +2953,12 @@ interface WidgetMenuContext {
2620
2953
  canDock: boolean;
2621
2954
  /** Its config's `canFloat`. */
2622
2955
  canFloat: boolean;
2956
+ /** Its config's `canPopOut`, on a workspace with `popOut` (7.12.0). */
2957
+ canPopOut: boolean;
2958
+ /** It is in its own browser window now (`location` is then `'floating'`). (7.12.0) */
2959
+ isPoppedOut: boolean;
2960
+ /** `useFloatingWidgets().popOut()` for this widget (7.12.0). */
2961
+ popOut(): PopOutResult;
2623
2962
  /** `useFloatingWidgets().move()` for this widget. */
2624
2963
  move(to: WidgetTarget): MoveResult;
2625
2964
  /** Closes the widget, wherever it is. */
@@ -2949,6 +3288,21 @@ interface FloatingWidgetsApi {
2949
3288
  * widgets.open('table', { ...config, placement: saved ?? undefined }); // later: it opens where it was
2950
3289
  */
2951
3290
  placement(id: string): WidgetPlacement | null;
3291
+ /**
3292
+ * Moves a widget into its own browser window (7.12.0), for a second monitor, without remounting
3293
+ * its content. Synchronous: call it inside the user's click. From inside its panel it leaves the
3294
+ * panel and goes into the window as one move; from docked, tabbed, floating or minimised, its
3295
+ * panel moves. The same result and reasons as `workspace.popOutPanel` (`'not-allowed'` without
3296
+ * {@link ManagedWidget.canPopOut}, or when its owner panel can't hold it out); a refusal changes
3297
+ * nothing. While out, `location()` is `'floating'` and `useWidget().isPoppedOut` is true.
3298
+ *
3299
+ * Back: `move()` to any place returns it first, as one move; closing the window, or its "Back into
3300
+ * the panel" button, puts it back into its panel where it was (D17). `onWillMove` / `onMoved` run
3301
+ * around each, and the `panel:popped-out` / `panel:returned` events are sent for its panel.
3302
+ * @example
3303
+ * <button onClick={() => widgets.popOut('table')}>Open in new window</button>
3304
+ */
3305
+ popOut(id: string): PopOutResult;
2952
3306
  }
2953
3307
  /**
2954
3308
  * Imperative hook for spawning N named floating windows at runtime from data or event handlers.
@@ -2990,6 +3344,11 @@ interface WidgetHandle {
2990
3344
  panelId: string | null;
2991
3345
  /** Where it is shown now. A component that calls `useWidget()` re-renders when it changes. */
2992
3346
  location: WidgetLocation;
3347
+ /**
3348
+ * It is in its own browser window (`useFloatingWidgets().popOut`, 7.12.0); `location` is then
3349
+ * `'floating'`. Its content's `usePanelWindow()` gives that window.
3350
+ */
3351
+ isPoppedOut: boolean;
2993
3352
  /**
2994
3353
  * Called just before the widget's content element moves to another container: into or out of
2995
3354
  * its panel, between docked, tabbed and floating, minimised or restored. Save what a move would
@@ -3197,4 +3556,4 @@ declare function isElementRtl(el: HTMLElement | null): boolean;
3197
3556
  */
3198
3557
  declare function isComputedRtl(el: Element | null | undefined): boolean;
3199
3558
 
3200
- export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type MoveResult, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, type PanelMap, type PanelOwner, type PanelPropsOf, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PointerDragConfig, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TabContentProps, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type TypedWorkspace, type WidgetHandle, type WidgetLocation, type WidgetMenuContext, type WidgetPlacement, type WidgetTarget, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, definePanels, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWidget, useWorkspace, useWindowManagerState as useWorkspaceState };
3559
+ export { type AlertOptions, type BuiltInEvents, type ButtonVariant, type CloseOptions, type ConfirmOptions, type ContainerType, type ContextMenuAdapter, type ContextMenuCheckbox, type ContextMenuHandle, type ContextMenuItem, type ContextMenuLabel, type ContextMenuSeparator, type ContextMenuSimpleItem, type ContextMenuSubMenu, type DirtyStateOptions, DockableDesktopProvider, type DockableDesktopProviderProps, type DropPosition, type DropTarget, type FloatAnchor, type FloatingWidgetsApi, type FloatingWindow, type HostClasses, type LayoutGridNode, type LayoutLeafNode, type LayoutNode, type ManagedWidget, type MenuItemAction, type MessageDescriptor, type MessageFormatter, type MessageKey, type ModalOptions, type ModalsApi, type MoveResult, type OpenPanelOptions, type OverlayId, type OverlayInstance, type OverlayState, type PanelContribution, type PanelDefinition, type PanelDrop, type PanelDropTarget, type PanelEvents, type PanelFloatPlacement, type PanelHandle, type PanelInfo, type PanelMap, type PanelOwner, type PanelPropsOf, PanelRegistry, type PanelRegistryEntry, type PanelSidebarSection, type PanelState, type PanelTitle, type PanelTitleDescriptor, type PanelWindow, type PointerDragConfig, type PopOutResult, type PopoutWrapperProps, AlertForm as RddAlert, type RddAlertProps, ConfirmationForm as RddConfirm, type RddConfirmProps, RddContextMenu, type RddContextMenuProps, WindowManager as RddDesktop, type RddDesktopProps, PanelFloatingWindow as RddFloatingWidget, type RddFloatingWidgetProps, ModalStackRenderer as RddModals, PanelOverlayRoot as RddPanelOverlay, type RddPanelOverlayProps, PanelToolbar as RddPanelToolbar, type RddPanelToolbarProps, SecondarySidebar as RddSecondarySidebar, type RddSecondarySidebarProps, RddSidePanels, type RddSidePanelsProps, Sidebar as RddSidebar, type RddSidebarProps, ToastContainer as RddToasts, type RddToastsProps, Toolbar as RddToolbar, ToolbarButton as RddToolbarButton, type RddToolbarButtonProps, ToolbarCenter as RddToolbarCenter, ToolbarItem as RddToolbarItem, type RddToolbarProps, ToolbarSearchInput as RddToolbarSearch, type RddToolbarSearchProps, ToolbarSeparator as RddToolbarSeparator, ToolbarSpacer as RddToolbarSpacer, ToolbarToggle as RddToolbarToggle, type RddToolbarToggleProps, type ResizeConstraints, type ResizeDir, type ResizeRect, type ResolvedToastOptions, type SearchResult, type SerializedLayout, type ShowContextMenuOptions, type SidePanelOptions, type SidePanelsApi, type SidebarActionButton, type SidebarContextValue as SidebarContext, type SidebarCustomEntry, type SidebarHandle, type SidebarHeaderAction, type SidebarRailEntry, type SidebarTab, type SidebarTabContextValue as SidebarTabContext, type SplitDirection, type SplitOrientation, type Stretch, type TabContentProps, type TaskbarVisibility, type ToastAdapter, type ToastFunction, type ToastOptions, type ToastPosition, type ToastPromiseMessages, type ToastType, type ToolbarActionItem, type ToolbarContextValue, type ToolbarGroupEntry, type ToolbarGroupItem, type ToolbarGroupSubItem, type ToolbarHandle, type ToolbarItem$1 as ToolbarItem, type ToolbarPosition, type ToolbarRadioItem, type ToolbarSeparator$1 as ToolbarSeparator, type ToolbarToggleItem, type ToolbarVariant, type TypedWorkspace, type WidgetHandle, type WidgetLocation, type WidgetMenuContext, type WidgetPlacement, type WidgetTarget, type Workspace, type WorkspaceActions, type WorkspaceConfig, type WorkspaceState, computeResizedRect, createWorkspace, defaultPredefinedMessages as defaultMessages, definePanels, formatLabel, isComputedRtl, isElementRtl, isSerializable, sidebarSectionToTab as sectionToTab, startPointerDrag, toast, useActivePanelContribution as useActiveContribution, useBeforeClose, useColorScheme, useShowContextMenu as useContextMenu, usePanelFloatingWindowManager as useFloatingWidgets, useFormatMessage, useStyleClasses as useHostClasses, useMergedSidebarTabs, useMergedToolbarItems, usePredefinedMessages as useMessages, useModals, usePanel, usePanelContextMenu, usePanelContribution, usePanelEvents, usePanelSize, usePanelWindow, useSaveState, useSidePanels, useSidebar, useSidebarTab, useToolbar, useWidget, useWorkspace, useWindowManagerState as useWorkspaceState };