@rinova/devtools 0.10.0 → 0.11.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 jove
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jove
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,25 @@
1
- # @rinova/devtools
2
-
3
- 框架无关的前端调试面板内核。提供悬浮球、停靠面板、配置、网络、存储、日志、快捷操作与插件系统。
4
-
5
- ```bash
6
- pnpm add @rinova/devtools
7
- ```
8
-
9
- ```ts
10
- import { createDevtools } from '@rinova/devtools'
11
-
12
- createDevtools({
13
- appName: 'My App',
14
- enabled: import.meta.env.DEV,
15
- config: [{ key: 'apiBase', type: 'text', label: 'API 地址' }]
16
- }).mount()
17
- ```
18
-
19
- - 只依赖 DOM 与 Shadow DOM,可接入 Vue / React / Svelte / 原生页面
20
- - 无 UI 组件库、无遥测、无远程资源
21
- - 网络面板支持复制 cURL、重放请求;配置 schema 驱动、即时生效
22
-
23
- 完整文档见仓库 `docs/`:架构、配置、插件开发、框架接入、内置面板、路线图。
24
-
25
- MIT
1
+ # @rinova/devtools
2
+
3
+ 框架无关的前端调试面板内核。提供悬浮球、停靠面板、配置、网络、存储、日志、快捷操作与插件系统。
4
+
5
+ ```bash
6
+ pnpm add @rinova/devtools
7
+ ```
8
+
9
+ ```ts
10
+ import { createDevtools } from '@rinova/devtools'
11
+
12
+ createDevtools({
13
+ appName: 'My App',
14
+ enabled: import.meta.env.DEV,
15
+ config: [{ key: 'apiBase', type: 'text', label: 'API 地址' }]
16
+ }).mount()
17
+ ```
18
+
19
+ - 只依赖 DOM 与 Shadow DOM,可接入 Vue / React / Svelte / 原生页面
20
+ - 无 UI 组件库、无遥测、无远程资源
21
+ - 网络面板支持复制 cURL、重放请求;配置 schema 驱动、即时生效
22
+
23
+ 完整文档见仓库 `docs/`:架构、配置、插件开发、框架接入、内置面板、路线图。
24
+
25
+ MIT
@@ -15,6 +15,9 @@ export declare class NetworkCapture {
15
15
  private originalFetch?;
16
16
  private originalXhrOpen?;
17
17
  private originalXhrSend?;
18
+ private originalXhrSetRequestHeader?;
19
+ private originalWebSocket?;
20
+ private resourceObserver?;
18
21
  private enabled;
19
22
  private changeScheduled;
20
23
  constructor(options?: NetworkCaptureOptions);
@@ -27,6 +30,8 @@ export declare class NetworkCapture {
27
30
  subscribe(listener: EntryListener): () => void;
28
31
  subscribeChange(listener: () => void): () => void;
29
32
  private shouldIgnore;
33
+ /** replay 在调用 fetch 的同步阶段挂上,本次请求入列时交回条目(避免把并发请求误当重放结果) */
34
+ private replayHook;
30
35
  private push;
31
36
  private update;
32
37
  /**
@@ -37,6 +42,8 @@ export declare class NetworkCapture {
37
42
  private notifyChange;
38
43
  private patchFetch;
39
44
  private patchXhr;
45
+ private patchWebSocket;
46
+ private observeImages;
40
47
  replay(entryId: string): Promise<NetworkEntry | undefined>;
41
48
  }
42
49
  export {};
@@ -10,25 +10,24 @@ export interface ResolvedOptions extends DevtoolsOptions {
10
10
  version: string;
11
11
  theme: DevtoolsTheme;
12
12
  size: PanelSize;
13
- shortcut: string | false;
14
13
  storagePrefix: string;
15
14
  }
15
+ export type SplitPlugin = 'network' | 'storage';
16
16
  export interface RuntimeUi {
17
17
  getTheme(): DevtoolsTheme;
18
18
  getThemes(): DevtoolsThemeDefinition[];
19
19
  getSize(): PanelSize;
20
- getCollapsed(): boolean;
20
+ getMaximized(): boolean;
21
21
  getAutoTuck(): boolean;
22
22
  getPanelPos(): PanelPosition | null;
23
- /** 生效中的快捷键(已合并用户覆盖与 options 默认值) */
24
- getShortcut(): string | false;
25
23
  setTheme(theme: DevtoolsTheme): void;
26
24
  setSize(size: PanelSize): void;
27
- setCollapsed(collapsed: boolean): void;
25
+ setMaximized(maximized: boolean): void;
28
26
  setAutoTuck(autoTuck: boolean): void;
29
27
  setPanelPos(pos: PanelPosition | null): void;
30
- /** null 表示恢复 options.shortcut */
31
- setShortcut(shortcut: string | false | null): void;
28
+ /** 网络 / 存储列表栏占比(百分比);未记住时返回 null */
29
+ getSplit(plugin: SplitPlugin): number | null;
30
+ setSplit(plugin: SplitPlugin, size: number | null): void;
32
31
  resetLauncher(): void;
33
32
  resetAll(): void;
34
33
  activePlugin(): string;
package/dist/index.d.ts CHANGED
@@ -3,9 +3,42 @@ import type { ConfigField, DevtoolsPlugin } from './types.js';
3
3
  export { createDevtools };
4
4
  export { VERSION } from './version.js';
5
5
  export { h, icon, button, field, empty, tag, segmented } from './ui/dom.js';
6
+ export type { ButtonOptions } from './ui/dom.js';
7
+ export type { EmptyOptions, FieldOptions } from './ui/dom.js';
8
+ export { Empty, Field, ScrollArea, Section, StatusBar, Toolbar, scrollArea, section, statusBar, toolbar } from './ui/layout.js';
9
+ export type { EmptyProps, FieldProps, ScrollAreaProps, SectionProps, StatusBarProps, ToolbarProps } from './ui/layout.js';
10
+ export { Splitter } from './ui/splitter.js';
11
+ export type { SplitterProps } from './ui/splitter.js';
12
+ export { Dialog } from './ui/dialog.js';
13
+ export type { DialogProps, DialogResult } from './ui/dialog.js';
14
+ export { TitleBar, WindowControls, SideNav } from './ui/shell-chrome.js';
15
+ export type { TitleBarProps, WindowControlsProps, SideNavProps } from './ui/shell-chrome.js';
16
+ export { DatePicker } from './ui/date-picker.js';
17
+ export type { DatePickerProps, DatePickerValue, DateRange } from './ui/date-picker.js';
18
+ export { CodeEditor, CODE_EDITOR_HIGHLIGHT_MAX_LINES } from './ui/code-editor.js';
19
+ export type { CodeEditorProps } from './ui/code-editor.js';
20
+ export { defineComponent, mount } from './ui/component.js';
21
+ export type { ComponentDef, ComponentHandle, ComponentView } from './ui/component.js';
22
+ export { Button, BUTTON_CONFIRM_MS, Input, Textarea, Tag, Segmented, input, textarea, switchControl, checkbox, radio, Switch, Checkbox, Radio } from './ui/form-controls.js';
23
+ export type { ButtonProps, InputProps, TextareaProps, TagProps, SegmentedItem, SegmentedProps, SwitchProps, CheckboxProps, RadioProps } from './ui/form-controls.js';
24
+ export { CheckboxGroup, RadioGroup, checkboxGroup, radioGroup } from './ui/choice-groups.js';
25
+ export type { CheckboxGroupProps, RadioGroupProps, ChoiceGroupOption } from './ui/choice-groups.js';
26
+ export { createPopup } from './ui/popup.js';
27
+ export { PANEL_MOVE_EVENT, watchLayout } from './ui/layout-watch.js';
28
+ export type { PopupCloseReason, PopupHandle, PopupOptions, PopupPlacement, PopupPoint } from './ui/popup.js';
29
+ export { ContextMenu, Popover, Tooltip } from './ui/overlays.js';
30
+ export type { ContextMenuItem, ContextMenuProps, PopoverProps, TooltipProps } from './ui/overlays.js';
31
+ export { MultiSelect, Select } from './ui/select.js';
32
+ export type { MultiSelectProps, SelectOption, SelectProps } from './ui/select.js';
33
+ export { defineTable, Table } from './ui/table.js';
34
+ export type { TableColumn, TableProps, TableRowKey, TableSort } from './ui/table.js';
35
+ export { JsonView, KeyValue, JSON_VIEW_PAGE_SIZE } from './ui/inspectors.js';
36
+ export type { CopyResult, JsonViewProps, KeyValueItem, KeyValueProps } from './ui/inspectors.js';
37
+ export { Tabs } from './ui/tabs.js';
38
+ export type { TabItem, TabsProps } from './ui/tabs.js';
6
39
  export { formatBytes, formatDuration, formatClock, previewValue, prettyJSON } from './utils/format.js';
7
40
  export { toCurl } from './utils/curl.js';
8
- export type { ActionTone, BuiltinPluginId, ConfigChangePayload, ConfigField, ConfigGroup, ConfigOption, ConfigValue, DevtoolsAction, DevtoolsActionContext, DevtoolsBuiltinTheme, DevtoolsDensity, DevtoolsInstance, DevtoolsOptions, DevtoolsPlugin, DevtoolsTheme, DevtoolsThemeDefinition, DockSide, FloatRect, IconName, LauncherOptions, LogEntry, LogLevel, NetworkApi, NetworkCaptureOptions, NetworkEntry, PanelPosition, PanelSize, PluginContext, ToastTone, ValueMap } from './types.js';
41
+ export type { ActionTone, BuiltinPluginId, ConfigChangePayload, ConfigField, ConfigGroup, ConfigOption, ConfigValue, DevtoolsAction, DevtoolsActionContext, DevtoolsBuiltinTheme, DevtoolsDensity, DevtoolsInstance, DevtoolsOptions, DevtoolsPlugin, DevtoolsTheme, DevtoolsThemeDefinition, DefaultCorner, DockSide, FloatRect, IconName, LauncherOptions, LogEntry, LogLevel, NetworkApi, NetworkCaptureOptions, NetworkEntry, PanelPosition, PanelSize, PluginContext, ToastTone, ValueMap } from './types.js';
9
42
  /** 仅用于获得类型推断,运行时原样返回 */
10
43
  export declare function definePlugin(plugin: DevtoolsPlugin): DevtoolsPlugin;
11
44
  /** 仅用于获得类型推断,运行时原样返回 */