react-dockable-desktop 7.1.2 → 7.2.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/README.md +52 -18
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +186 -170
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -731,10 +731,13 @@ interface WorkspaceActions {
|
|
|
731
731
|
*/
|
|
732
732
|
setPanelIcon: (id: string, icon: React$1.ReactNode | null) => void;
|
|
733
733
|
/**
|
|
734
|
-
* Closes a panel
|
|
735
|
-
*
|
|
734
|
+
* Closes a panel the way its tab's × does: registered close guards run first, and a dirty panel
|
|
735
|
+
* closes only if `onConfirm` resolves `true` — without `onConfirm`, a dirty panel stays open.
|
|
736
|
+
* (The tab's own ×, which passes an `onConfirm`, is what shows the built-in unsaved-changes
|
|
737
|
+
* dialog.)
|
|
736
738
|
* @param id - Panel instance ID.
|
|
737
|
-
* @param options - `force: true` bypasses guards; `onConfirm`
|
|
739
|
+
* @param options - `force: true` bypasses guards and the dirty check; `onConfirm` is asked
|
|
740
|
+
* whether to discard a dirty panel's changes.
|
|
738
741
|
*/
|
|
739
742
|
requestClosePanel: (id: string, options?: {
|
|
740
743
|
force?: boolean;
|
|
@@ -941,8 +944,8 @@ interface BuiltInEvents {
|
|
|
941
944
|
* `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
|
|
942
945
|
* consumers, so they don't need to subscribe to separate events. Does **not** cover a
|
|
943
946
|
* `registerStateProvider` callback's return value changing on its own — that's a pull, there's
|
|
944
|
-
* no way to observe it changing without the panel separately notifying — nor
|
|
945
|
-
*
|
|
947
|
+
* no way to observe it changing without the panel separately notifying — nor split-ratio drags,
|
|
948
|
+
* floating-window moves and resizes, or toggling a floating window's maximized state.
|
|
946
949
|
*/
|
|
947
950
|
'layout:changed': Record<string, never>;
|
|
948
951
|
/**
|
|
@@ -1109,8 +1112,9 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
|
|
|
1109
1112
|
/** Sets an open panel's tab/window/taskbar icon; `null` restores its registration's icon. Not saved by `saveLayout()`. */
|
|
1110
1113
|
setPanelIcon(id: string, icon: ReactNode | null): void;
|
|
1111
1114
|
/**
|
|
1112
|
-
* Requests that a panel close, honoring
|
|
1113
|
-
*
|
|
1115
|
+
* Requests that a panel close, honoring any registered close guard and its dirty flag: a dirty
|
|
1116
|
+
* panel closes only if `onConfirm` resolves `true` (without `onConfirm` it stays open).
|
|
1117
|
+
* `force: true` skips both. Resolves once the close (or the refusal) has been decided.
|
|
1114
1118
|
*/
|
|
1115
1119
|
requestClosePanel(id: string, options?: {
|
|
1116
1120
|
force?: boolean;
|
|
@@ -2539,9 +2543,9 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
|
|
|
2539
2543
|
|
|
2540
2544
|
type ColorScheme = 'dark' | 'light';
|
|
2541
2545
|
/**
|
|
2542
|
-
* Reactively reads the
|
|
2543
|
-
* (
|
|
2544
|
-
* `'dark'` or `'light'` and re-rendering whenever it changes.
|
|
2546
|
+
* Reactively reads the page's `data-color-scheme` attribute on `<html>` — the one the host
|
|
2547
|
+
* application sets to switch the library's scheme (the library itself never writes it) —
|
|
2548
|
+
* returning `'dark'` or `'light'` and re-rendering whenever it changes.
|
|
2545
2549
|
*
|
|
2546
2550
|
* Useful for panel content that needs to react to the same scheme the
|
|
2547
2551
|
* workspace itself is using — e.g. swapping a map's tile layer or an
|
package/dist/index.d.ts
CHANGED
|
@@ -731,10 +731,13 @@ interface WorkspaceActions {
|
|
|
731
731
|
*/
|
|
732
732
|
setPanelIcon: (id: string, icon: React$1.ReactNode | null) => void;
|
|
733
733
|
/**
|
|
734
|
-
* Closes a panel
|
|
735
|
-
*
|
|
734
|
+
* Closes a panel the way its tab's × does: registered close guards run first, and a dirty panel
|
|
735
|
+
* closes only if `onConfirm` resolves `true` — without `onConfirm`, a dirty panel stays open.
|
|
736
|
+
* (The tab's own ×, which passes an `onConfirm`, is what shows the built-in unsaved-changes
|
|
737
|
+
* dialog.)
|
|
736
738
|
* @param id - Panel instance ID.
|
|
737
|
-
* @param options - `force: true` bypasses guards; `onConfirm`
|
|
739
|
+
* @param options - `force: true` bypasses guards and the dirty check; `onConfirm` is asked
|
|
740
|
+
* whether to discard a dirty panel's changes.
|
|
738
741
|
*/
|
|
739
742
|
requestClosePanel: (id: string, options?: {
|
|
740
743
|
force?: boolean;
|
|
@@ -941,8 +944,8 @@ interface BuiltInEvents {
|
|
|
941
944
|
* `openPanel` `dedupeKey` redirect. Coalesces those into one signal for autosave-style
|
|
942
945
|
* consumers, so they don't need to subscribe to separate events. Does **not** cover a
|
|
943
946
|
* `registerStateProvider` callback's return value changing on its own — that's a pull, there's
|
|
944
|
-
* no way to observe it changing without the panel separately notifying — nor
|
|
945
|
-
*
|
|
947
|
+
* no way to observe it changing without the panel separately notifying — nor split-ratio drags,
|
|
948
|
+
* floating-window moves and resizes, or toggling a floating window's maximized state.
|
|
946
949
|
*/
|
|
947
950
|
'layout:changed': Record<string, never>;
|
|
948
951
|
/**
|
|
@@ -1109,8 +1112,9 @@ declare class WorkspaceClient<TUserEvents extends object = Record<string, unknow
|
|
|
1109
1112
|
/** Sets an open panel's tab/window/taskbar icon; `null` restores its registration's icon. Not saved by `saveLayout()`. */
|
|
1110
1113
|
setPanelIcon(id: string, icon: ReactNode | null): void;
|
|
1111
1114
|
/**
|
|
1112
|
-
* Requests that a panel close, honoring
|
|
1113
|
-
*
|
|
1115
|
+
* Requests that a panel close, honoring any registered close guard and its dirty flag: a dirty
|
|
1116
|
+
* panel closes only if `onConfirm` resolves `true` (without `onConfirm` it stays open).
|
|
1117
|
+
* `force: true` skips both. Resolves once the close (or the refusal) has been decided.
|
|
1114
1118
|
*/
|
|
1115
1119
|
requestClosePanel(id: string, options?: {
|
|
1116
1120
|
force?: boolean;
|
|
@@ -2539,9 +2543,9 @@ declare function computeResizedRect(dir: ResizeDir, dx: number, dy: number, star
|
|
|
2539
2543
|
|
|
2540
2544
|
type ColorScheme = 'dark' | 'light';
|
|
2541
2545
|
/**
|
|
2542
|
-
* Reactively reads the
|
|
2543
|
-
* (
|
|
2544
|
-
* `'dark'` or `'light'` and re-rendering whenever it changes.
|
|
2546
|
+
* Reactively reads the page's `data-color-scheme` attribute on `<html>` — the one the host
|
|
2547
|
+
* application sets to switch the library's scheme (the library itself never writes it) —
|
|
2548
|
+
* returning `'dark'` or `'light'` and re-rendering whenever it changes.
|
|
2545
2549
|
*
|
|
2546
2550
|
* Useful for panel content that needs to react to the same scheme the
|
|
2547
2551
|
* workspace itself is using — e.g. swapping a map's tile layer or an
|