eruda-storage 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026
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 ADDED
@@ -0,0 +1,37 @@
1
+ # eruda-storage
2
+
3
+ Editable storage panel plugin for Eruda 3.x.
4
+
5
+ It adds a `Storage` tab with:
6
+
7
+ - Local Storage
8
+ - Session Storage
9
+ - Cookie
10
+ - IndexedDB database / object store browsing
11
+ - Add, edit, delete, and clear actions
12
+ - Object preview tree with expandable nested values
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install eruda eruda-storage
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import eruda from "eruda";
24
+ import erudaStorage from "eruda-storage";
25
+
26
+ eruda.init();
27
+ eruda.add(erudaStorage);
28
+ ```
29
+
30
+ ## Notes
31
+
32
+ - IndexedDB database listing uses `indexedDB.databases()`, so very old browsers may only show a not-supported message.
33
+ - The plugin patches `Storage.prototype.setItem`, `removeItem`, and `clear` to refresh the panel when storage changes on the current page.
34
+
35
+ ## License
36
+
37
+ MIT
@@ -0,0 +1,91 @@
1
+ import type { Eruda, Tool } from "eruda";
2
+ declare class ErudaStorageTool implements Tool {
3
+ private readonly eruda;
4
+ name: string;
5
+ private activeKind;
6
+ private dbs;
7
+ private editor;
8
+ private filter;
9
+ private selectedDb;
10
+ private selectedIndex;
11
+ private selectedStore;
12
+ private stores;
13
+ private rows;
14
+ private detailTouchX;
15
+ private detailTouchY;
16
+ private detailExpandedPaths;
17
+ private detailSelectedKey;
18
+ private isVisible;
19
+ private lastSnapshot;
20
+ private refreshTimer?;
21
+ private styleEl?;
22
+ private root?;
23
+ constructor(eruda: Eruda);
24
+ init($el: unknown): void;
25
+ show(): this;
26
+ hide(): this;
27
+ destroy(): void;
28
+ private resolveElement;
29
+ private bindEvents;
30
+ private startAutoRefresh;
31
+ private stopAutoRefresh;
32
+ private handleExternalStorageChange;
33
+ private handleVisibilityChange;
34
+ private keepDetailScroll;
35
+ private handleDetailTouchStart;
36
+ private handleClick;
37
+ private handleDoubleClick;
38
+ private handleInput;
39
+ private handleAction;
40
+ private refresh;
41
+ private refreshIfChanged;
42
+ private readRows;
43
+ private readWebStorage;
44
+ private readCookies;
45
+ private refreshIndexedDb;
46
+ private refreshStores;
47
+ private refreshIndexedDbRows;
48
+ private refreshIndexedDbIfChanged;
49
+ private openDb;
50
+ private filteredRows;
51
+ private selectedRow;
52
+ private selectRow;
53
+ private toggleDetailPath;
54
+ private createSnapshot;
55
+ private restoreSelection;
56
+ private renderSelection;
57
+ private updateToolbarState;
58
+ private openEditor;
59
+ private saveEditor;
60
+ private saveWebStorage;
61
+ private setCookie;
62
+ private saveIndexedDbValue;
63
+ private deleteSelected;
64
+ private deleteIndexedDbRow;
65
+ private clearActive;
66
+ private clearIndexedDbStore;
67
+ private deleteSelectedDatabase;
68
+ private renderLoading;
69
+ private render;
70
+ private renderRowsPanel;
71
+ private syncScrollLayout;
72
+ private renderToolbar;
73
+ private renderSidebar;
74
+ private renderNav;
75
+ private renderIndexedDbTree;
76
+ private renderTable;
77
+ private renderDatabaseOverview;
78
+ private renderDatabaseMetaRow;
79
+ private renderDetail;
80
+ private toDetailValue;
81
+ private renderTreeNode;
82
+ private renderKey;
83
+ private isRecord;
84
+ private renderPrimitive;
85
+ private renderEditor;
86
+ private currentTitle;
87
+ private isIndexedDbDatabaseOverview;
88
+ }
89
+ export declare const createErudaStoragePlugin: (eruda: Eruda) => ErudaStorageTool;
90
+ export default createErudaStoragePlugin;
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AA6czC,cAAM,gBAAiB,YAAW,IAAI;IAsBxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IArBlC,IAAI,SAAa;IAEjB,OAAO,CAAC,UAAU,CAAwB;IAC1C,OAAO,CAAC,GAAG,CAAuB;IAClC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,UAAU,CAAM;IACxB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9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