@rozenite/storage-plugin 1.8.1 → 1.10.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/CHANGELOG.md +34 -0
- package/README.md +23 -0
- package/dist/devtools/assets/panel-Bm-SWF7d.js +33 -0
- package/dist/devtools/assets/panel-DIqI4WSp.css +1 -0
- package/dist/devtools/panel.html +2 -2
- package/dist/react-native/chunks/index.require.cjs +1 -1
- package/dist/react-native/chunks/index.require.js +43 -57
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.cjs +1 -1
- package/dist/react-native/chunks/useRozeniteStoragePlugin.require.js +253 -191
- package/dist/react-native/index.d.ts +29 -6
- package/dist/rozenite.json +1 -1
- package/dist/sdk/index.d.ts +1 -0
- package/package.json +9 -6
- package/src/react-native/__tests__/import.test.ts +182 -0
- package/src/react-native/adapters/__tests__/mmkv.test.ts +436 -0
- package/src/react-native/adapters/mmkv.ts +65 -39
- package/src/react-native/import.ts +67 -0
- package/src/react-native/storage-view.ts +16 -8
- package/src/react-native/useRozeniteStoragePlugin.ts +61 -36
- package/src/shared/__tests__/snapshot.test.ts +361 -0
- package/src/shared/messaging.ts +25 -1
- package/src/shared/snapshot.ts +276 -0
- package/src/shared/types.ts +1 -0
- package/src/ui/__tests__/binary-value-editor-state.test.ts +199 -0
- package/src/ui/__tests__/binary.test.ts +251 -0
- package/src/ui/__tests__/type-conversion.test.ts +123 -0
- package/src/ui/add-entry-dialog.tsx +83 -173
- package/src/ui/binary-value-editor-state.ts +125 -0
- package/src/ui/binary-value-editor.tsx +168 -0
- package/src/ui/binary.ts +123 -0
- package/src/ui/edit-entry-dialog.tsx +64 -161
- package/src/ui/editable-table.tsx +12 -10
- package/src/ui/editor-switcher.tsx +62 -0
- package/src/ui/entry-detail-dialog.tsx +14 -6
- package/src/ui/import-dialog.tsx +261 -0
- package/src/ui/panel.tsx +257 -57
- package/src/ui/type-conversion.ts +105 -0
- package/src/ui/typed-value-editor.tsx +96 -0
- package/src/ui/utils.ts +30 -0
- package/dist/devtools/assets/panel-DMhXYHH4.css +0 -1
- package/dist/devtools/assets/panel-eGOuOVos.js +0 -22
- package/src/react-native/is-garbled.ts +0 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 0 0% 3.9%;--card: 0 0% 100%;--card-foreground: 0 0% 3.9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 3.9%;--primary: 0 0% 9%;--primary-foreground: 0 0% 98%;--secondary: 0 0% 96.1%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96.1%;--muted-foreground: 0 0% 45.1%;--accent: 0 0% 96.1%;--accent-foreground: 0 0% 9%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 0 0% 89.8%;--input: 0 0% 89.8%;--ring: 0 0% 3.9%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8%}.dark{--background: 0 0% 3.9%;--foreground: 0 0% 98%;--card: 0 0% 3.9%;--card-foreground: 0 0% 98%;--popover: 0 0% 3.9%;--popover-foreground: 0 0% 98%;--primary: 0 0% 98%;--primary-foreground: 0 0% 9%;--secondary: 0 0% 14.9%;--secondary-foreground: 0 0% 98%;--muted: 0 0% 14.9%;--muted-foreground: 0 0% 63.9%;--accent: 0 0% 14.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--border: 0 0% 14.9%;--input: 0 0% 14.9%;--ring: 0 0% 83.1%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%;--sidebar-background: 240 5.9% 10%;--sidebar-foreground: 240 4.8% 95.9%;--sidebar-primary: 224.3 76.3% 48%;--sidebar-primary-foreground: 0 0% 100%;--sidebar-accent: 240 3.7% 15.9%;--sidebar-accent-foreground: 240 4.8% 95.9%;--sidebar-border: 240 3.7% 15.9%;--sidebar-ring: 217.2 91.2% 59.8%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.left-2{left:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-20{max-height:5rem}.max-h-24{max-height:6rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0px}.min-h-\[120px\]{min-height:120px}.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-96{width:24rem}.w-\[28rem\]{width:28rem}.w-\[32rem\]{width:32rem}.w-\[90vw\]{width:90vw}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius)}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.border-red-700{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity, 1))}.border-yellow-700{--tw-border-opacity: 1;border-color:rgb(161 98 7 / var(--tw-border-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-600{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-purple-600{--tw-bg-opacity: 1;background-color:rgb(147 51 234 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/30{background-color:#7f1d1d4d}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.bg-yellow-900\/30{background-color:#713f124d}.bg-opacity-50{--tw-bg-opacity: .5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pl-8{padding-left:2rem}.pr-3{padding-right:.75rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-cyan-500{--tw-text-opacity: 1;color:rgb(6 182 212 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-pink-500{--tw-text-opacity: 1;color:rgb(236 72 153 / var(--tw-text-opacity, 1))}.text-purple-200{--tw-text-opacity: 1;color:rgb(233 213 255 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-purple-500{--tw-text-opacity: 1;color:rgb(168 85 247 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-200{--tw-text-opacity: 1;color:rgb(254 240 138 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:#1f2937;border-radius:4px}::-webkit-scrollbar-thumb{background:#374151;border-radius:4px;border:1px solid #1f2937}::-webkit-scrollbar-thumb:hover{background:#4b5563}::-webkit-scrollbar-thumb:active{background:#6b7280}::-webkit-scrollbar-corner{background:#1f2937}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-blue-400:hover{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.hover\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-600:disabled{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.disabled\:bg-gray-800:disabled{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}
|
package/dist/devtools/panel.html
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
<script>
|
|
23
23
|
var __ROZENITE_PANEL__ = true;
|
|
24
24
|
</script>
|
|
25
|
-
<script type="module" crossorigin src="../devtools/assets/panel-
|
|
26
|
-
<link rel="stylesheet" crossorigin href="../devtools/assets/panel-
|
|
25
|
+
<script type="module" crossorigin src="../devtools/assets/panel-Bm-SWF7d.js"></script>
|
|
26
|
+
<link rel="stylesheet" crossorigin href="../devtools/assets/panel-DIqI4WSp.css">
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<div id="root"></div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./types.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./types.cjs"),g=require("./async-storage.require.cjs"),f=require("./secure-storage.require.cjs"),l=t=>"remove"in t,S=t=>{if(Array.isArray(t)){if(t.some(l))throw new Error("[Rozenite] Storage Plugin: MMKV arrays are not supported for v4 storages. Pass a record of storage IDs and MMKV instances.");return Object.fromEntries(t.map(r=>[r.id,r]))}return t},p=t=>l(t)?{set:(e,r)=>t.set(e,r),getBoolean:e=>t.getBoolean(e),getString:e=>t.getString(e),getNumber:e=>t.getNumber(e),getBuffer:e=>t.getBuffer(e),delete:e=>t.remove(e),getAllKeys:()=>t.getAllKeys(),addOnValueChangedListener:e=>t.addOnValueChangedListener(e)}:{set:(e,r)=>t.set(e,r),getBoolean:e=>t.getBoolean(e),getString:e=>t.getString(e),getNumber:e=>t.getNumber(e),getBuffer:e=>t.getBuffer(e),delete:e=>t.delete(e),getAllKeys:()=>t.getAllKeys(),addOnValueChangedListener:e=>t.addOnValueChangedListener(e)},A=(t,e)=>{const r=t.getString(e);if(r!==void 0&&r.length>0)return{key:e,type:"string",value:r};const a=t.getBuffer(e);if(a!==void 0&&a.byteLength>0)return{key:e,type:"buffer",value:Array.from(new Uint8Array(a))};const s=t.getNumber(e);if(s!==void 0)return{key:e,type:"number",value:s};const u=t.getBoolean(e);if(u!==void 0)return{key:e,type:"boolean",value:u};if(r!==void 0)return{key:e,type:"string",value:r}},y=(t,e)=>{e.type==="buffer"?t.set(e.key,new Uint8Array(e.value).buffer):t.set(e.key,e.value)},b=(t,e)=>{if(t)return t instanceof RegExp?t:t[e]},V=(t,e)=>{if(t instanceof RegExp)return r=>(t.lastIndex=0,t.test(`${e}:${r}`))},M=({adapterId:t="mmkv",adapterName:e="MMKV",storages:r,blacklist:a})=>{const s=S(r),u=Object.entries(s).map(([i,c])=>{const o=p(c);return{id:i,name:i,blacklist:b(a,i),shouldFilterKey:V(a,i),capabilities:{supportedTypes:d.DEFAULT_SUPPORTED_TYPES},storage:{kind:"sync",getAllKeys:()=>o.getAllKeys(),get:n=>A(o,n),set:n=>y(o,n),delete:n=>o.delete(n),subscribe:n=>o.addOnValueChangedListener(n)}}});return{id:t,name:e,storages:u}};exports.createAsyncStorageAdapter=g.createAsyncStorageAdapter;exports.createExpoAsyncStorageAdapter=g.createExpoAsyncStorageAdapter;exports.createExpoSecureStorageAdapter=f.createExpoSecureStorageAdapter;exports.createMMKVStorageAdapter=M;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { createAsyncStorageAdapter as
|
|
3
|
-
import { createExpoSecureStorageAdapter as
|
|
4
|
-
const
|
|
1
|
+
import { D as d } from "./types.js";
|
|
2
|
+
import { createAsyncStorageAdapter as B, createExpoAsyncStorageAdapter as E } from "./async-storage.require.js";
|
|
3
|
+
import { createExpoSecureStorageAdapter as x } from "./secure-storage.require.js";
|
|
4
|
+
const l = (t) => "remove" in t, f = (t) => {
|
|
5
5
|
if (Array.isArray(t)) {
|
|
6
6
|
if (t.some(l))
|
|
7
7
|
throw new Error(
|
|
@@ -12,7 +12,7 @@ const d = (t) => !!(t.includes("�") || /[\u0000-\u001F\u007F-\u009F]/.test(t)
|
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
|
-
},
|
|
15
|
+
}, c = (t) => l(t) ? {
|
|
16
16
|
set: (e, r) => t.set(e, r),
|
|
17
17
|
getBoolean: (e) => t.getBoolean(e),
|
|
18
18
|
getString: (e) => t.getString(e),
|
|
@@ -30,71 +30,57 @@ const d = (t) => !!(t.includes("�") || /[\u0000-\u001F\u007F-\u009F]/.test(t)
|
|
|
30
30
|
delete: (e) => t.delete(e),
|
|
31
31
|
getAllKeys: () => t.getAllKeys(),
|
|
32
32
|
addOnValueChangedListener: (e) => t.addOnValueChangedListener(e)
|
|
33
|
-
},
|
|
33
|
+
}, p = (t, e) => {
|
|
34
34
|
const r = t.getString(e);
|
|
35
35
|
if (r !== void 0 && r.length > 0)
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
value: Array.from(new TextEncoder().encode(r))
|
|
40
|
-
} : {
|
|
41
|
-
key: e,
|
|
42
|
-
type: "string",
|
|
43
|
-
value: r
|
|
44
|
-
};
|
|
45
|
-
const n = t.getNumber(e);
|
|
46
|
-
if (n !== void 0)
|
|
47
|
-
return {
|
|
48
|
-
key: e,
|
|
49
|
-
type: "number",
|
|
50
|
-
value: n
|
|
51
|
-
};
|
|
52
|
-
const s = t.getBoolean(e);
|
|
53
|
-
if (s !== void 0)
|
|
54
|
-
return {
|
|
55
|
-
key: e,
|
|
56
|
-
type: "boolean",
|
|
57
|
-
value: s
|
|
58
|
-
};
|
|
59
|
-
const u = t.getBuffer(e);
|
|
60
|
-
if (u !== void 0)
|
|
36
|
+
return { key: e, type: "string", value: r };
|
|
37
|
+
const a = t.getBuffer(e);
|
|
38
|
+
if (a !== void 0 && a.byteLength > 0)
|
|
61
39
|
return {
|
|
62
40
|
key: e,
|
|
63
41
|
type: "buffer",
|
|
64
|
-
value: Array.from(new Uint8Array(
|
|
42
|
+
value: Array.from(new Uint8Array(a))
|
|
65
43
|
};
|
|
44
|
+
const s = t.getNumber(e);
|
|
45
|
+
if (s !== void 0)
|
|
46
|
+
return { key: e, type: "number", value: s };
|
|
47
|
+
const i = t.getBoolean(e);
|
|
48
|
+
if (i !== void 0)
|
|
49
|
+
return { key: e, type: "boolean", value: i };
|
|
50
|
+
if (r !== void 0)
|
|
51
|
+
return { key: e, type: "string", value: r };
|
|
66
52
|
}, A = (t, e) => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
t.set(e.key, e.value);
|
|
72
|
-
}, S = (t, e) => {
|
|
53
|
+
e.type === "buffer" ? t.set(e.key, new Uint8Array(e.value).buffer) : t.set(e.key, e.value);
|
|
54
|
+
}, b = (t, e) => {
|
|
73
55
|
if (t)
|
|
74
56
|
return t instanceof RegExp ? t : t[e];
|
|
75
|
-
},
|
|
57
|
+
}, S = (t, e) => {
|
|
58
|
+
if (t instanceof RegExp)
|
|
59
|
+
return (r) => (t.lastIndex = 0, t.test(`${e}:${r}`));
|
|
60
|
+
}, V = ({
|
|
76
61
|
adapterId: t = "mmkv",
|
|
77
62
|
adapterName: e = "MMKV",
|
|
78
63
|
storages: r,
|
|
79
|
-
blacklist:
|
|
64
|
+
blacklist: a
|
|
80
65
|
}) => {
|
|
81
|
-
const s =
|
|
82
|
-
([
|
|
83
|
-
const
|
|
66
|
+
const s = f(r), i = Object.entries(s).map(
|
|
67
|
+
([u, g]) => {
|
|
68
|
+
const o = c(g);
|
|
84
69
|
return {
|
|
85
|
-
id:
|
|
86
|
-
name:
|
|
87
|
-
blacklist:
|
|
70
|
+
id: u,
|
|
71
|
+
name: u,
|
|
72
|
+
blacklist: b(a, u),
|
|
73
|
+
shouldFilterKey: S(a, u),
|
|
88
74
|
capabilities: {
|
|
89
|
-
supportedTypes:
|
|
75
|
+
supportedTypes: d
|
|
90
76
|
},
|
|
91
77
|
storage: {
|
|
92
78
|
kind: "sync",
|
|
93
|
-
getAllKeys: () =>
|
|
94
|
-
get: (
|
|
95
|
-
set: (
|
|
96
|
-
delete: (
|
|
97
|
-
subscribe: (
|
|
79
|
+
getAllKeys: () => o.getAllKeys(),
|
|
80
|
+
get: (n) => p(o, n),
|
|
81
|
+
set: (n) => A(o, n),
|
|
82
|
+
delete: (n) => o.delete(n),
|
|
83
|
+
subscribe: (n) => o.addOnValueChangedListener(n)
|
|
98
84
|
}
|
|
99
85
|
};
|
|
100
86
|
}
|
|
@@ -102,12 +88,12 @@ const d = (t) => !!(t.includes("�") || /[\u0000-\u001F\u007F-\u009F]/.test(t)
|
|
|
102
88
|
return {
|
|
103
89
|
id: t,
|
|
104
90
|
name: e,
|
|
105
|
-
storages:
|
|
91
|
+
storages: i
|
|
106
92
|
};
|
|
107
93
|
};
|
|
108
94
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
95
|
+
B as createAsyncStorageAdapter,
|
|
96
|
+
E as createExpoAsyncStorageAdapter,
|
|
97
|
+
x as createExpoSecureStorageAdapter,
|
|
98
|
+
V as createMMKVStorageAdapter
|
|
113
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("@rozenite/plugin-bridge"),w=require("react"),P=require("./types.cjs"),g=require("@rozenite/agent-bridge"),p=require("@rozenite/agent-shared"),v=async(t,e,r)=>{const s=t.find(n=>n.target.adapterId===e.target.adapterId&&n.target.storageId===e.target.storageId);if(!s){r({type:"import-result",target:e.target,ok:!1,written:0,total:e.entries.length,error:"Target storage not found"});return}for(let n=0;n<e.entries.length;n++){const o=e.entries[n];try{await s.set(o)}catch(i){r({type:"import-result",target:e.target,ok:!1,written:n,total:e.entries.length,failedKey:o.key,error:i instanceof Error?i.message:String(i)});return}r({type:"set-entry",target:e.target,entry:o})}r({type:"import-result",target:e.target,ok:!0,written:e.entries.length,total:e.entries.length})},R=1500,I=t=>t.kind==="async",b=t=>t.type==="buffer"?`${t.type}:${t.value.join(",")}`:`${t.type}:${String(t.value)}`,z=t=>new Map(t.map(e=>[e.key,e])),m=(t,e)=>t.shouldFilterKey?.(e)?!0:t.blacklist?(t.blacklist.lastIndex=0,t.blacklist.test(e)):!1,M=(t,e,r)=>{if(!P.supportsType(t,e))throw new Error(`Type "${e}" is not supported by storage "${r.storageId}" in adapter "${r.adapterId}".`)},E=async t=>(I(t),t.getAllKeys()),S=async(t,e)=>(I(t),t.get(e)),x=async(t,e)=>{if(I(t)){await t.set(e);return}t.set(e)},N=async(t,e)=>{if(I(t)){await t.delete(e);return}t.delete(e)},$=async t=>{const e=await t();return z(e)},K=(t,e,r)=>{e.forEach((s,n)=>{const o=t.get(n);if(!o){r.onSet(s);return}b(o)!==b(s)&&r.onSet(s)}),t.forEach((s,n)=>{e.has(n)||r.onDelete(n)})},q=async(t,e)=>{let r=await $(t);const s=setInterval(async()=>{try{const n=await $(t);K(r,n,e),r=n}catch{}},R);return{remove:()=>{clearInterval(s)}}},j=(t,e)=>{const r=e.storage,s={adapterId:t.id,storageId:e.id},n=async i=>{if(!m(e,i))return S(r,i)},o=async()=>{const i=await E(r);return(await Promise.all(i.filter(d=>!m(e,d)).map(d=>S(r,d)))).filter(d=>!!d)};return{id:P.getStorageViewId(s),target:s,adapterName:t.name,storageName:e.name,capabilities:e.capabilities,blacklist:e.blacklist,get:n,set:async i=>{M(e.capabilities,i.type,s),await x(r,i)},delete:async i=>{await N(r,i)},getAllKeys:async()=>(await E(r)).filter(a=>!m(e,a)),getAllEntries:o,watch:async({onSet:i,onDelete:a})=>r.subscribe?r.subscribe(async d=>{try{const l=await n(d);if(!l){a(d);return}i(l)}catch{}}):q(o,{onSet:i,onDelete:a})}},C=t=>t.flatMap(e=>e.storages.map(r=>j(e,r))),f={adapterId:{type:"string",description:"Storage adapter ID. Required when multiple adapters are configured."},storageId:{type:"string",description:"Storage node ID within the adapter. Required when multiple storages are configured."}},u="@rozenite/storage-plugin",T=["string","number","boolean","buffer"],y={listStorages:p.defineAgentToolContract({name:"list-storages",description:"List all storage adapters and their storage nodes currently available on the device, including supported entry types and entry counts.",inputSchema:{type:"object",properties:{}}}),listEntries:p.defineAgentToolContract({name:"list-entries",description:"List keys in a storage. This call intentionally does not return entry values to keep responses token-efficient.",inputSchema:{type:"object",properties:{...f,offset:{type:"number",description:"Pagination offset. Defaults to 0."},limit:{type:"number",description:"Pagination size. Defaults to 100."}}}}),readEntry:p.defineAgentToolContract({name:"read-entry",description:"Read a single storage entry value by key.",inputSchema:{type:"object",properties:{...f,key:{type:"string",description:"Entry key."}},required:["key"]}}),createEntry:p.defineAgentToolContract({name:"create-entry",description:"Create a new storage entry. Fails if the key already exists.",inputSchema:{type:"object",properties:{...f,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...T],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),editEntry:p.defineAgentToolContract({name:"edit-entry",description:"Edit an existing storage entry. Fails if the key does not exist.",inputSchema:{type:"object",properties:{...f,key:{type:"string",description:"Entry key."},type:{type:"string",enum:[...T],description:"Entry value type. Must be one of the supported types for the target storage (see list-storages)."},value:{description:"Entry value matching the provided type."}},required:["key","type","value"]}}),removeEntry:p.defineAgentToolContract({name:"remove-entry",description:"Remove a storage entry by key.",inputSchema:{type:"object",properties:{...f,key:{type:"string",description:"Entry key."}},required:["key"]}})},A=(t,e)=>{if(t==="string"){if(typeof e!="string")throw new Error("Expected string value for type=string");return e}if(t==="number"){if(typeof e!="number"||Number.isNaN(e))throw new Error("Expected number value for type=number");return e}if(t==="boolean"){if(typeof e!="boolean")throw new Error("Expected boolean value for type=boolean");return e}if(!Array.isArray(e)||!e.every(r=>Number.isInteger(r)))throw new Error("Expected number[] value for type=buffer");return e},h=t=>`${t.target.adapterId}/${t.target.storageId}`,F=t=>{const e=w.useCallback((r,s)=>{if(t.length===0)throw new Error("No storages are registered.");if(r!==void 0||s!==void 0){const n=t.find(o=>(r===void 0||o.target.adapterId===r)&&(s===void 0||o.target.storageId===s));if(!n){const o=[r&&`adapterId="${r}"`,s&&`storageId="${s}"`].filter(Boolean).join(", ");throw new Error(`No storage matched ${o}. Available: ${t.map(h).join(", ")}`)}return n}if(t.length>1)throw new Error(`Multiple storages detected. Provide adapterId and/or storageId. Available: ${t.map(h).join(", ")}`);return t[0]},[t]);g.useRozenitePluginAgentTool({pluginId:u,tool:y.listStorages,handler:async()=>({storages:await Promise.all(t.map(async r=>({adapterId:r.target.adapterId,storageId:r.target.storageId,adapterName:r.adapterName,storageName:r.storageName,supportedTypes:r.capabilities.supportedTypes,entryCount:(await r.getAllKeys()).length})))})}),g.useRozenitePluginAgentTool({pluginId:u,tool:y.listEntries,handler:async({adapterId:r,storageId:s,offset:n=0,limit:o=100})=>{const i=e(r,s),a=await i.getAllKeys(),d=Math.max(0,Math.floor(n)),l=Math.max(1,Math.floor(o)),c=a.slice(d,d+l);return{adapterId:i.target.adapterId,storageId:i.target.storageId,total:a.length,offset:d,limit:l,keys:c}}}),g.useRozenitePluginAgentTool({pluginId:u,tool:y.readEntry,handler:async({adapterId:r,storageId:s,key:n})=>{const o=e(r,s),i=await o.get(n);if(!i)throw new Error(`Key "${n}" not found in storage "${h(o)}".`);return{adapterId:o.target.adapterId,storageId:o.target.storageId,entry:i}}}),g.useRozenitePluginAgentTool({pluginId:u,tool:y.createEntry,handler:async({adapterId:r,storageId:s,key:n,type:o,value:i})=>{const a=e(r,s);if(await a.get(n))throw new Error(`Key "${n}" already exists in storage "${h(a)}". Use edit-entry instead.`);const l=A(o,i);return await a.set({key:n,type:o,value:l}),{adapterId:a.target.adapterId,storageId:a.target.storageId,created:!0,key:n}}}),g.useRozenitePluginAgentTool({pluginId:u,tool:y.editEntry,handler:async({adapterId:r,storageId:s,key:n,type:o,value:i})=>{const a=e(r,s);if(!await a.get(n))throw new Error(`Key "${n}" not found in storage "${h(a)}". Use create-entry instead.`);const l=A(o,i);return await a.set({key:n,type:o,value:l}),{adapterId:a.target.adapterId,storageId:a.target.storageId,edited:!0,key:n}}}),g.useRozenitePluginAgentTool({pluginId:u,tool:y.removeEntry,handler:async({adapterId:r,storageId:s,key:n})=>{const o=e(r,s),i=!!await o.get(n);return await o.delete(n),{adapterId:o.target.adapterId,storageId:o.target.storageId,removed:i,key:n}}})},V=({storages:t})=>{const e=w.useMemo(()=>C(t),[t]);F(e);const r=k.useRozeniteDevToolsClient({pluginId:"@rozenite/storage-plugin"});return w.useEffect(()=>{if(!r)return;const s=async a=>{const d=a?e.filter(l=>l.id===a):e;for(const l of d)try{const c=await l.getAllEntries();r.send("snapshot",{type:"snapshot",target:l.target,adapterName:l.adapterName,storageName:l.storageName,capabilities:l.capabilities,blacklist:l.blacklist?{source:l.blacklist.source,flags:l.blacklist.flags}:void 0,entries:c})}catch(c){console.warn(`[Rozenite] Storage Plugin: Failed to snapshot ${l.target.adapterId}/${l.target.storageId}.`,c)}};s();const n=[];let o=!1;Promise.all(e.map(async a=>{try{const d=await a.watch({onSet:l=>{r.send("set-entry",{type:"set-entry",target:a.target,entry:l})},onDelete:l=>{r.send("delete-entry",{type:"delete-entry",target:a.target,key:l})}});if(o){d.remove();return}n.push(d)}catch(d){console.warn(`[Rozenite] Storage Plugin: Failed to attach watcher for ${a.target.adapterId}/${a.target.storageId}.`,d)}}));const i=[r.onMessage("set-entry",async({target:a,entry:d})=>{const l=e.find(c=>c.target.adapterId===a.adapterId&&c.target.storageId===a.storageId);if(!l){console.warn(`[Rozenite] Storage Plugin: Storage target not found for ${a.adapterId}/${a.storageId}`);return}try{await l.set(d)}catch(c){console.warn(`[Rozenite] Storage Plugin: Failed to set entry in ${a.adapterId}/${a.storageId}.`,c)}}),r.onMessage("delete-entry",async({target:a,key:d})=>{const l=e.find(c=>c.target.adapterId===a.adapterId&&c.target.storageId===a.storageId);if(!l){console.warn(`[Rozenite] Storage Plugin: Storage target not found for ${a.adapterId}/${a.storageId}`);return}try{await l.delete(d)}catch(c){console.warn(`[Rozenite] Storage Plugin: Failed to delete entry in ${a.adapterId}/${a.storageId}.`,c)}}),r.onMessage("get-snapshot",async({target:a})=>{if(a==="all"){await s();return}await s(`${a.adapterId}:${a.storageId}`)}),r.onMessage("import-entries",async a=>{await v(e,a,d=>{d.type==="set-entry"?r.send("set-entry",d):r.send("import-result",d)})})];return()=>{o=!0,n.forEach(a=>a.remove()),i.forEach(a=>a.remove())}},[r,e]),r};exports.useRozeniteStoragePlugin=V;
|