memorio 2.5.2 → 2.5.3

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/index.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../functions/idb/tools/db.create.ts", "../functions/idb/tools/db.list.ts", "../functions/idb/tools/db.exist.ts", "../functions/idb/tools/db.quota.ts", "../functions/idb/tools/db.delete.ts", "../functions/idb/tools/db.size.ts", "../functions/idb/tools/db.version.ts", "../functions/idb/tools/db.support.ts", "../functions/idb/tools/table.create.ts", "../functions/idb/tools/table.size.ts", "../functions/idb/crud/data.delete.ts", "../functions/idb/crud/data.set.ts", "../functions/idb/crud/data.get.ts", "../package.json", "../config/global.ts", "../config/dispatch.ts", "../config/constructor.ts", "../functions/logger/index.ts", "../functions/state/index.ts", "../functions/store/index.ts", "../functions/session/index.ts", "../functions/cache/index.ts", "../functions/idb/index.ts", "../functions/devtools/index.ts", "../functions/react.ts"],
4
- "sourcesContent": ["/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.create = (dbName, ver = 1) => {\r\n\r\n idb.db.support()\r\n\r\n // let db\r\n const request = indexedDB.open(dbName, ver) as any\r\n\r\n // Event handling\r\n request.onerror = () => {\r\n console.error(`IndexedDB error: ${request.errorCode}`)\r\n }\r\n\r\n request.onsuccess = () => {\r\n console.debug(\"Successful database connection\")\r\n // db = request.result\r\n }\r\n\r\n request.onupgradeneeded = () => {\r\n console.debug(\"Database created\")\r\n }\r\n\r\n idb.db.list()\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.list = () => {\r\n indexedDB\r\n .databases()\r\n .then(result => result)\r\n .then(result => {\r\n if (!result) return\r\n idbases = result\r\n })\r\n .catch(err => {\r\n console.error(err)\r\n })\r\n idb.db.size()\r\n return idbases\r\n}\r\n\r\nsetInterval(() => {\r\n idb.db.list()\r\n}, 1000)\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.exist = (storeName: any) => {\r\n if (idbases?.find((db: any) => db.name === storeName) !== undefined)\r\n return true\r\n return false\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.quota = () => {\r\n return navigator.storage.estimate()\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.delete = (storeName: any) => {\r\n\r\n if ((globalThis as any).memorio?.debug) {\r\n console.debug(`Remove ${storeName}...`)\r\n }\r\n\r\n if (!idb.db.exist(storeName)) return\r\n\r\n if (typeof (globalThis as any).layerpro === \"function\") {\r\n\r\n // USE CONFIRM FROM LAYERPRO\r\n confirm(\r\n `Are you sure to remove \"${storeName}\" database?`,\r\n () => {\r\n setTimeout(() => {\r\n indexedDB.deleteDatabase(storeName)\r\n console.debug(`${storeName} removed`)\r\n idb.db.list()\r\n }, 1000)\r\n },\r\n () => alert(\"Operation cancelled.\")\r\n )\r\n return\r\n\r\n } else {\r\n\r\n if (confirm(`Are you sure to remove \"${storeName}\" database?`)) {\r\n setTimeout(() => {\r\n indexedDB.deleteDatabase(storeName)\r\n console.debug(`${storeName} removed`)\r\n idb.db.list()\r\n }, 1000)\r\n } else {\r\n alert(\"Operation cancelled.\")\r\n }\r\n return\r\n\r\n }\r\n\r\n return\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.size = () => {\r\n\r\n idbases?.map((dbName) => {\r\n\r\n if (!idb.db.exist(dbName)) return null\r\n\r\n const\r\n index = dphelper.array.findindex(idbases, dbName.name),\r\n request = indexedDB?.open(dbName.name, idb.db.version(dbName.name))\r\n\r\n request.onerror = (_event: any) => console.error(\"Error on IndexedDB\")\r\n\r\n request.onsuccess = (event: any) => {\r\n\r\n const\r\n db = event.target.result,\r\n tableNames = [...db.objectStoreNames],\r\n\r\n t = (tableNames, db) => {\r\n const tableSizeGetters = tableNames.reduce(\r\n (acc, tableName) => {\r\n acc.push(idb.table.size(db, tableName))\r\n return acc\r\n }, []\r\n )\r\n\r\n tableSizeGetters.map(\r\n (sizes) => {\r\n const total = sizes.reduce((acc, val) => acc + val, 0)\r\n const sizeBytes = Number.parseInt(dphelper.dev.byteSize(total)) || 0\r\n return sizeBytes\r\n }\r\n )\r\n\r\n idbases[index].size = tableSizeGetters.length > 0 ? tableSizeGetters : 0\r\n }\r\n\r\n t(tableNames, db)\r\n }\r\n\r\n return null\r\n })\r\n}\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.version = (storeName: string) => {\r\n let idbVer = 0\r\n for (const v of idbases) {\r\n if (v.name === storeName) idbVer = v.version\r\n break\r\n }\r\n return idbVer\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.db.support = () => {\r\n if (\"indexedDB\" in window) {\r\n return true\r\n }\r\n console.error(\"Your browser doesn't support IndexedBD\")\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.table.create = (dbName, dbTable) => {\r\n\r\n try {\r\n const v = Number(idb.db.version(dbName)) + 1\r\n let request = indexedDB.open(dbName, v)\r\n\r\n try {\r\n request.onupgradeneeded = e => {\r\n\r\n const\r\n target = e.target as any,\r\n db = target.result\r\n\r\n const store = db.createObjectStore(\r\n dbTable,\r\n {\r\n keyPath: \"id\",\r\n unique: true,\r\n autoincrement: true\r\n }\r\n )\r\n\r\n store.createIndex(\"id\", \"id\")\r\n store.createIndex(\"data\", \"data\")\r\n\r\n db.close()\r\n request?.result?.close()\r\n request = undefined\r\n idb.db.list()\r\n }\r\n\r\n } catch (err) {\r\n\r\n console.error(\">>\", err)\r\n return\r\n\r\n }\r\n\r\n } catch (err) {\r\n\r\n console.error(\">>>\", err)\r\n return\r\n\r\n }\r\n\r\n return false\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.table.size = (db: any, table: any) => {\r\n\r\n idb.db.list()\r\n\r\n return new Promise(\r\n\r\n (resolve, reject) => {\r\n\r\n if (db == null) return reject()\r\n\r\n const e: any = event\r\n let size = 0\r\n db = e.target.result\r\n\r\n const transaction = db.transaction([table]).objectStore(table).openCursor()\r\n\r\n transaction.onsuccess = (\r\n\r\n (event: any) => {\r\n const cursor = event.target.result\r\n\r\n if (cursor) {\r\n const storedObject = cursor.value,\r\n json = JSON.stringify(storedObject)\r\n\r\n size += json.length\r\n cursor.continue()\r\n } else {\r\n resolve(size)\r\n }\r\n\r\n }\r\n\r\n )\r\n\r\n transaction.onerror = (err: any) => reject(`error in ${table}: ${err}`)\r\n }\r\n\r\n )\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.data.delete = (storeName: string, table: string, value: any) => {\r\n\r\n if (!idb.db.exist(storeName)) return\r\n\r\n const request = indexedDB.open(storeName, idb.db.version(storeName))\r\n\r\n request.onsuccess = () => {\r\n\r\n const\r\n db = request.result,\r\n transaction = db.transaction(table, \"readwrite\"),\r\n objectStore = transaction.objectStore(table)\r\n\r\n objectStore.put(value)\r\n\r\n request.onerror = (e: any) => {\r\n console.debug(e, `Database insert error: ${e.target.errorCode}`)\r\n }\r\n\r\n transaction.onerror = (e: any) => {\r\n console.debug(event, `Database insert error: ${e.target.errorCode}`)\r\n }\r\n\r\n db.close()\r\n idb.db.list()\r\n console.debug(\"Store inserted\")\r\n\r\n // Trigger React re-render\r\n if ((globalThis as any).memorioIdbTrigger) (globalThis as any).memorioIdbTrigger()\r\n }\r\n\r\n return\r\n}\r\n\r\nexport { }\r\n\r\n///\r\n\r\nidb.data.delete.all = (storeName: string, table: string) => {\r\n\r\n idb.db.list()\r\n\r\n const request = indexedDB.open(storeName)\r\n\r\n request.onsuccess = (event: any) => {\r\n\r\n const db = event.target.result\r\n const Store = db\r\n .transaction(table)\r\n .objectStore(table)\r\n .set({})\r\n\r\n Store.onsuccess = (event: any) => {\r\n if ((globalThis as any).memorio?.debug) {\r\n console.debug(event)\r\n }\r\n }\r\n\r\n }\r\n\r\n return\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nidb.data.set = (storeName: string, table: string, value: any) => {\r\n\r\n if (!idb.db?.exist(storeName)) return\r\n\r\n const request = indexedDB.open(storeName, idb.version(storeName))\r\n\r\n request.onsuccess = () => {\r\n const db = request.result\r\n const transaction = db.transaction(table, \"readwrite\")\r\n const objectStore = transaction.objectStore(table)\r\n objectStore.put(value)\r\n\r\n request.onerror = (e: any) => {\r\n console.debug(e, `Database insert error: ${e.target.errorCode}`)\r\n }\r\n\r\n transaction.onerror = (e: any) => {\r\n console.debug(event, `Database insert error: ${e.target.errorCode}`)\r\n }\r\n\r\n db.close()\r\n idb.databases()\r\n console.debug(\"IndexDB inserted\")\r\n\r\n // Trigger React re-render\r\n if ((globalThis as any).memorioIdbTrigger) (globalThis as any).memorioIdbTrigger()\r\n }\r\n\r\n}\r\n\r\nexport { }\r\n", "/*!\r\n Memorio\r\n Copyright (c) 2019 Dario Passariello <dariopassariello@gmail.com>\r\n Licensed under PRIVATE License, see\r\n https://dario.passariello.ca\r\n*/\r\n\r\nlet returnValue\r\n\r\nidb.data.get = (storeName: any, table: any, key: any) => {\r\n\r\n idb.db.list()\r\n\r\n const request = indexedDB.open(storeName)\r\n\r\n request.onsuccess = (event: any) => {\r\n\r\n const\r\n db = event.target.result,\r\n Store = db\r\n .transaction(table)\r\n .objectStore(table)\r\n .get(key)\r\n\r\n Store.onsuccess = (_event: any) => {\r\n returnValue = Store.result\r\n return Store.result\r\n }\r\n\r\n }\r\n\r\n return returnValue\r\n\r\n}\r\n\r\nexport { }\r\n", "{\r\n \"name\": \"memorio\",\r\n \"version\": \"3.0.0\",\r\n \"type\": \"module\",\r\n \"main\": \"dist/index.js\",\r\n \"module\": \"dist/index.mjs\",\r\n \"license\": \"MIT\",\r\n \"types\": \"./index.d.ts\",\r\n \"typings\": \"./types/*\",\r\n \"description\": \"Memorio, State + Store for an easy life - Lightweight storage for small projects\",\r\n \"copyright\": \"Copyright (c) 2026 Dario Passariello\",\r\n \"homepage\": \"https://a51.gitbook.io/memorio\",\r\n \"author\": \"Dario Passariello <dariopassariello@gmail.com>\",\r\n \"support\": {\r\n \"name\": \"Dario Passariello\",\r\n \"url\": \"https://github.com/passariello/\",\r\n \"email\": \"dariopassariello@gmail.com\"\r\n },\r\n \"bugs\": {\r\n \"url\": \"https://github.com/passariello/\"\r\n },\r\n \"contributors\": [\r\n {\r\n \"name\": \"Dario Passariello\",\r\n \"email\": \"dariopassarielloa@gmail.com\"\r\n },\r\n {\r\n \"name\": \"Valeria Cala Scaglitta\",\r\n \"email\": \"valeriacalascaglitta@gmail.com\"\r\n }\r\n ],\r\n \"keywords\": [\r\n \"biglogic\",\r\n \"a51\",\r\n \"memorio\",\r\n \"state\",\r\n \"store\"\r\n ],\r\n \"funding\": [\r\n {\r\n \"type\": \"patreon\",\r\n \"url\": \"https://www.patreon.com/passariello\"\r\n }\r\n ],\r\n \"typing\": [\r\n \"types/*\"\r\n ],\r\n \"exports\": {\r\n \".\": {\r\n \"types\": \"./types/index.d.ts\",\r\n \"import\": \"./dist/index.mjs\",\r\n \"default\": \"./dist/index.js\"\r\n },\r\n \"./types/*\": \"./types/*\"\r\n },\r\n \"scripts\": {\r\n \"build\": \"rimraf dist && node esbuild.config.mjs\",\r\n \"dev\": \"node esbuild.config.mjs --watch-and-serve\",\r\n \"npm:pack\": \"npm run build && cd dist && npm pack\",\r\n \"npm:publish\": \"npm run build && npm publish ./dist\",\r\n \"test\": \"cd tests && npm run test\",\r\n \"lint\": \"cd tests && npm run lint\",\r\n \"tsc\": \"cd tests && tsc --noEmit\"\r\n },\r\n \"devDependencies\": {\r\n \"@types/node\": \"25.3.0\",\r\n \"esbuild\": \"0.27.3\",\r\n \"esbuild-node-externals\": \"1.20.1\",\r\n \"esbuild-plugin-alias\": \"0.2.1\",\r\n \"esbuild-plugin-copy\": \"2.1.1\",\r\n \"esbuild-sass-plugin\": \"3.6.0\",\r\n \"esbuild-scss-modules-plugin\": \"1.1.1\",\r\n \"jest-util\": \"30.2.0\",\r\n \"rimraf\": \"6.1.3\",\r\n \"ts-jest\": \"29.4.6\",\r\n \"tsx\": \"^4.21.0\",\r\n \"typescript\": \"5.9.3\"\r\n }\r\n}\r\n", "/**\r\n * MEMORIO GLOBAL CONFIGURATION\r\n *\r\n * This module initializes the global memorio object and its core properties.\r\n * It sets up version information and protected property names.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\nimport p from '../package.json' with { type: \"json\" }\r\n\r\n// Check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n/////////////////////////////////////\r\n\r\n// Sentinel value to represent undefined (since Proxy can't store undefined)\r\nconst UNDEFINED = Symbol('memorio-undefined')\r\n ; (globalThis as any).memorioUNDEFINED = UNDEFINED\r\nexport { UNDEFINED }\r\n\r\n// Only create globals if enabled\r\nif (shouldCreateGlobal('memorio')) {\r\n Object.defineProperty(\r\n globalThis,\r\n 'memorio',\r\n {\r\n value: {},\r\n writable: false,\r\n configurable: true,\r\n enumerable: false\r\n }\r\n )\r\n\r\n Object.defineProperty(\r\n globalThis,\r\n 'events',\r\n {\r\n value: {},\r\n writable: true,\r\n enumerable: false\r\n }\r\n )\r\n\r\n Object.defineProperty(\r\n memorio,\r\n 'version',\r\n {\r\n writable: false,\r\n enumerable: false,\r\n value: p.version\r\n }\r\n )\r\n\r\n Object.defineProperty(\r\n memorio,\r\n 'debug',\r\n {\r\n writable: true,\r\n enumerable: true,\r\n value: false\r\n }\r\n )\r\n}\r\n\r\n/**\r\n * Protected property names that cannot be used as state keys.\r\n * These are reserved for internal memorio functionality.\r\n */\r\nexport const protect = [\r\n 'list',\r\n 'state',\r\n 'store',\r\n 'idb',\r\n 'remove',\r\n 'removeAll'\r\n]\r\n", "Object.defineProperty(\r\n memorio,\r\n 'dispatch',\r\n {\r\n writable: false,\r\n enumerable: false,\r\n value: {\r\n\r\n /**\r\n * Dispatches a custom event with the specified name and value.\r\n * @param name The name of the event.\r\n * @param value The value to pass with the event.\r\n */\r\n set: (name: string, value = {}) => {\r\n dispatchEvent(new CustomEvent(String(name), value))\r\n },\r\n\r\n /////////////////////////////////////////////////////\r\n\r\n /**\r\n * Listens for the specified event names and executes the callback when the event is triggered.\r\n * @param name The name of the event to listen for.\r\n * @param cb The callback function to execute when the event is triggered.\r\n * @param flag A flag to indicate whether to remove existing listeners (default is false).\r\n */\r\n listen: (name: string, cb: ((e: Event) => void) | null = null, _flag = false) => {\r\n const exec = (e: Event) => cb\r\n ? setTimeout(() => cb(e), 1)\r\n : null\r\n globalThis.addEventListener(name, exec as any)\r\n ; (globalThis as any).events = (globalThis as any).events || {}\r\n ; (globalThis as any).events[name] = exec\r\n },\r\n\r\n /////////////////////////////////////////////////////\r\n\r\n /**\r\n * Removes the event listener for the specified event names.\r\n * @param name The name of the event to remove the listener for.\r\n */\r\n remove: (name: string) => {\r\n const events = (globalThis as any).events || {}\r\n globalThis.removeEventListener(name, events[name] as any)\r\n delete events[name]\r\n }\r\n\r\n }\r\n }\r\n)\r\n", "/**\r\n * Extracts the function name from a container object.\r\n * @param container The container object.\r\n * @param object The function or property to extract name from.\r\n * @returns The extracted property name.\r\n */\r\n; (memorio as any).propertyName = function (_container: unknown, _object: unknown) {\r\n\r\n const t = String(_object).replace(\"() => \", \"\")\r\n return t\r\n\r\n return null // Or handle as needed if not found\r\n}\r\n", "/**\r\n * MEMORIO LOGGING MIDDLEWARE\r\n *\r\n * This module provides logging capabilities for Memorio state changes.\r\n * It can log to console and optionally to a custom log handler.\r\n */\r\n\r\ninterface LogEntry {\r\n timestamp: string\r\n module: 'state' | 'store' | 'session' | 'cache' | 'idb'\r\n action: 'get' | 'set' | 'delete' | 'clear'\r\n path: string\r\n value?: any\r\n previousValue?: any\r\n duration?: number\r\n}\r\n\r\ntype LogHandler = (entry: LogEntry) => void\r\n\r\ninterface LoggerConfig {\r\n enabled: boolean\r\n logToConsole: boolean\r\n customHandler?: LogHandler\r\n modules: ('state' | 'store' | 'session' | 'cache' | 'idb')[]\r\n maxEntries: number\r\n}\r\n\r\nconst defaultConfig: LoggerConfig = {\r\n enabled: true,\r\n logToConsole: true,\r\n modules: ['state', 'store', 'session', 'cache', 'idb'],\r\n maxEntries: 1000\r\n}\r\n\r\n// Helper to check if debug mode is enabled\r\nfunction isDebugEnabled(): boolean {\r\n return (globalThis as any).memorio?.debug === true\r\n}\r\n\r\nlet config: LoggerConfig = { ...defaultConfig }\r\nconst logHistory: LogEntry[] = []\r\n\r\n/**\r\n * Configure the logger\r\n */\r\nexport const configure = (options: Partial<LoggerConfig>): void => {\r\n config = { ...config, ...options }\r\n}\r\n\r\n/**\r\n * Enable or disable logging\r\n */\r\nexport const enable = (): void => {\r\n config.enabled = true\r\n}\r\n\r\n/**\r\n * Disable logging\r\n */\r\nexport const disable = (): void => {\r\n config.enabled = false\r\n}\r\n\r\n/**\r\n * Check if logging is enabled for a specific module\r\n */\r\nexport const isEnabled = (module: LoggerConfig['modules'][number]): boolean => {\r\n return config.enabled && config.modules.includes(module)\r\n}\r\n\r\n/**\r\n * Log an entry\r\n */\r\nexport const log = (\r\n module: LoggerConfig['modules'][number],\r\n action: LogEntry['action'],\r\n path: string,\r\n value?: any,\r\n previousValue?: any\r\n): void => {\r\n if (!isEnabled(module)) return\r\n\r\n const entry: LogEntry = {\r\n timestamp: new Date().toISOString(),\r\n module,\r\n action,\r\n path,\r\n value,\r\n previousValue\r\n }\r\n\r\n // Add to history\r\n logHistory.push(entry)\r\n if (logHistory.length > config.maxEntries) {\r\n logHistory.shift()\r\n }\r\n\r\n // Console output (only in debug mode)\r\n if (config.logToConsole && isDebugEnabled()) {\r\n const prefix = `[Memorio:${module.toUpperCase()}]`\r\n const color = getModuleColor(module)\r\n\r\n console.debug(\r\n `%c${prefix}%c ${action} ${path}`,\r\n `color: ${color}; font-weight: bold`,\r\n 'color: inherit'\r\n )\r\n\r\n if (value !== undefined) {\r\n console.debug(' \u2192 value:', value)\r\n }\r\n if (previousValue !== undefined) {\r\n console.debug(' \u2190 previous:', previousValue)\r\n }\r\n }\r\n\r\n // Custom handler\r\n if (config.customHandler) {\r\n config.customHandler(entry)\r\n }\r\n}\r\n\r\n/**\r\n * Get color for module\r\n */\r\nconst getModuleColor = (module: string): string => {\r\n const colors: Record<string, string> = {\r\n state: '#4CAF50',\r\n store: '#2196F3',\r\n session: '#FF9800',\r\n cache: '#9C27B0',\r\n idb: '#F44336'\r\n }\r\n return colors[module] || '#888888'\r\n}\r\n\r\n/**\r\n * Get log history\r\n */\r\nexport const getHistory = (): LogEntry[] => {\r\n return [...logHistory]\r\n}\r\n\r\n/**\r\n * Clear log history\r\n */\r\nexport const clearHistory = (): void => {\r\n logHistory.length = 0\r\n}\r\n\r\n/**\r\n * Get statistics\r\n */\r\nexport const getStats = (): Record<string, number> => {\r\n const stats: Record<string, number> = {\r\n total: logHistory.length,\r\n state: 0,\r\n store: 0,\r\n session: 0,\r\n cache: 0,\r\n idb: 0,\r\n set: 0,\r\n get: 0,\r\n delete: 0,\r\n clear: 0\r\n }\r\n\r\n logHistory.forEach(entry => {\r\n stats[entry.module]++\r\n stats[entry.action]++\r\n })\r\n\r\n return stats\r\n}\r\n\r\n/**\r\n * Export log entries for debugging\r\n */\r\nexport const exportLogs = (): string => {\r\n return JSON.stringify(logHistory, null, 2)\r\n}\r\n\r\n// Add to global memorio object\r\nif (typeof globalThis.memorio !== 'undefined') {\r\n Object.defineProperty(globalThis.memorio, 'logger', {\r\n enumerable: false,\r\n configurable: true,\r\n value: {\r\n configure,\r\n enable,\r\n disable,\r\n isEnabled,\r\n log,\r\n getHistory,\r\n clearHistory,\r\n getStats,\r\n exportLogs\r\n }\r\n })\r\n}\r\n", "/**\r\n * MEMORIO STATE MANAGEMENT\r\n *\r\n * This module provides reactive state management using Proxy.\r\n * It enables nested object tracking and dispatches events on state changes.\r\n * Auto-detects React and triggers useEffect when available.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\nimport { protect } from \"../../config/global.js\"\r\n\r\n// Import logger for automatic logging\r\nimport '../../functions/logger'\r\n\r\n/**\r\n * React integration using useSyncExternalStore\r\n * This provides proper React 18+ integration without requiring hooks in library code\r\n */\r\n\r\n// Subscribe function for external store integration\r\nconst subscribers = new Set<() => void>()\r\n\r\nfunction subscribe(callback: () => void) {\r\n subscribers.add(callback)\r\n return () => subscribers.delete(callback)\r\n}\r\n\r\n// State version for change detection - updated on every state change\r\nlet stateVersion = 0\r\n\r\nfunction getSnapshot() {\r\n return stateVersion\r\n}\r\n\r\n// Call this to bump the version when state changes\r\nexport function bumpStateVersion() {\r\n stateVersion++\r\n}\r\n\r\nfunction getServerSnapshot() {\r\n return 0\r\n}\r\n\r\n// Export subscribe for useSyncExternalStore\r\nexport const memorioSubscribe = subscribe\r\nexport const memorioGetSnapshot = getSnapshot\r\nexport const memorioGetServerSnapshot = getServerSnapshot\r\n\r\n// Trigger all subscribers (call this when state changes)\r\nfunction triggerReact() {\r\n stateVersion++\r\n subscribers.forEach(cb => cb())\r\n}\r\n\r\nObject.defineProperty(\r\n memorio,\r\n 'objPath',\r\n {\r\n // configurable: true,\r\n writable: false,\r\n enumerable: false,\r\n value: (prop: string, object: string[], separator: string = '.'): string => {\r\n return object.concat(prop).join(separator)\r\n }\r\n }\r\n)\r\n\r\n/////////////////////////////////////////////////////\r\n\r\n/**\r\n * Builds a recursive proxy for reactive state management.\r\n * @param obj The target object to proxy.\r\n * @param callback Function called on state changes.\r\n * @param tree Current path in the object tree.\r\n * @returns A proxied object with reactive behavior.\r\n */\r\nexport const buildProxy = (obj: Record<string, any>, callback: (props: any) => void, tree: string[] = []): any => {\r\n\r\n // EVENT FUNCTION FOR OBSERVER\r\n const event = (name: string) => {\r\n const array = name.split('.')\r\n array.forEach(\r\n (x, i) => {\r\n const command = array.slice(0, i + 1).join('.')\r\n globalThis.memorio.dispatch.set(command, { detail: { name: command } })\r\n }\r\n )\r\n return\r\n }\r\n\r\n ///////////////////////////////////////////////\r\n\r\n // CREATE THE PROXY\r\n return new Proxy(\r\n obj,\r\n {\r\n get(target: any, prop: any) {\r\n // Handle special methods first\r\n\r\n if (prop === 'list') {\r\n if ((globalThis as any).memorio?.debug) {\r\n console.debug('Some state could be hidden when you use \"state.list\". Use \"state\" to see the complete list ')\r\n }\r\n return JSON.parse(JSON.stringify(target))\r\n }\r\n\r\n if (prop === 'remove') {\r\n return function (key: string) {\r\n delete target[key]\r\n return true\r\n }\r\n }\r\n\r\n if (prop === 'removeAll') {\r\n return function () {\r\n try {\r\n for (const key in target) {\r\n if (typeof target[key] !== 'function' && !['list', 'remove', 'removeAll'].includes(key)) {\r\n if (!Object.isFrozen(target[key])) delete target[key]\r\n delete target[key]\r\n }\r\n }\r\n } catch (error) {\r\n console.error(error)\r\n }\r\n return\r\n }\r\n }\r\n\r\n if (Object.isFrozen(target[prop])) return target[prop]\r\n\r\n try {\r\n const value = Reflect.get(target, prop)\r\n if (value && typeof value === 'object' && ['Array', 'Object'].includes(value.constructor.name)) {\r\n return buildProxy(value, callback, tree.concat(prop as string))\r\n }\r\n return value\r\n } catch (error) {\r\n console.error('Error: ', error)\r\n return undefined\r\n }\r\n\r\n },\r\n\r\n set(target: any, key: string, value: any): boolean {\r\n\r\n // PROTECTED\r\n if (protect.includes(key)) {\r\n console.error('key ' + key + ' is protected')\r\n return false\r\n }\r\n\r\n // FREEZED\r\n if (target[key] && typeof target[key] === 'object' && Object.isFrozen(target[key])) {\r\n console.error(`Error: state '${key}' is locked`)\r\n return false\r\n }\r\n\r\n // ALLOWED SET\r\n\r\n try {\r\n\r\n const path = globalThis.memorio.objPath(key as string, tree)\r\n\r\n callback(\r\n {\r\n action: 'set',\r\n path,\r\n target,\r\n newValue: value,\r\n previousValue: Reflect.get(target, key)\r\n }\r\n )\r\n\r\n event('state.' + path)\r\n\r\n // Trigger React re-render if available\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the change\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('state', 'set', path, value, Reflect.get(target, key))\r\n }\r\n\r\n // Handle undefined values - use a sentinel to distinguish from missing properties\r\n if (value === undefined) {\r\n // Use a special marker object to represent undefined\r\n ; (target as any)[key] = globalThis.memorio\r\n } else {\r\n Reflect.set(target, key, value)\r\n }\r\n\r\n // DEFINE LOCK PROPERTY FUNCTION\r\n if (target[key] && typeof target[key] === 'object') {\r\n\r\n Reflect.defineProperty(\r\n target[key],\r\n 'lock',\r\n {\r\n value() {\r\n Object.defineProperty(\r\n target,\r\n key,\r\n {\r\n writable: false,\r\n enumerable: false\r\n }\r\n )\r\n\r\n Object.freeze(target[key])\r\n }\r\n }\r\n )\r\n\r\n }\r\n\r\n return true\r\n\r\n } catch (error) {\r\n\r\n console.error('Error in set trap:', error)\r\n return false\r\n\r\n }\r\n\r\n },\r\n\r\n deleteProperty(target: any, prop: string | symbol): boolean {\r\n try {\r\n const path = globalThis.memorio.objPath(prop as string, tree)\r\n callback({ action: 'delete', path, target })\r\n\r\n // Log the delete\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('state', 'delete', path, undefined, Reflect.get(target, prop))\r\n }\r\n\r\n return Reflect.deleteProperty(target, prop)\r\n } catch (error) {\r\n console.error('Error in deleteProperty trap:', error)\r\n return false\r\n }\r\n }\r\n\r\n }\r\n\r\n )\r\n\r\n}\r\n\r\n// Export state for module usage\r\nexport const state = buildProxy({}, () => { })\r\n\r\n// SET STATE AS PROXY (only if global enabled)\r\nif (shouldCreateGlobal('state')) {\r\n globalThis.state = state\r\n\r\n ///////////////////////////////////////////////\r\n\r\n // DEFINE THE STATE IN GLOBAL\r\n Object.defineProperty(\r\n globalThis,\r\n 'state',\r\n {\r\n enumerable: false,\r\n configurable: true\r\n }\r\n )\r\n}\r\n", "/**\r\n * MEMORIO STORE (localStorage)\r\n *\r\n * This module provides localStorage persistence with a simple API.\r\n * It handles JSON serialization/deserialization automatically.\r\n * Auto-detects React and triggers useEffect when available.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n// Import memorio global\r\nimport { state as globalState } from '../state'\r\n\r\n// React integration - reuse state subscribers\r\nconst subscribers = (globalState as any).subscribers || new Set<() => void>()\r\n\r\nfunction triggerReact() {\r\n subscribers.forEach((cb: () => void) => cb())\r\n}\r\n\r\n// Logger import\r\nimport '../../functions/logger'\r\n\r\n// STORE\r\nconst storeProxy: any = new Proxy({}, {})\r\n\r\n// Only create global if enabled\r\nif (shouldCreateGlobal('store')) {\r\n Object.defineProperty(\r\n globalThis,\r\n 'store',\r\n {\r\n value: storeProxy,\r\n enumerable: false,\r\n configurable: true\r\n }\r\n )\r\n}\r\n\r\nObject.defineProperties(\r\n storeProxy,\r\n {\r\n /**\r\n * Gets a value from localStorage.\r\n * @param name The key to retrieve.\r\n * @returns The parsed value or null if not found.\r\n */\r\n get: {\r\n value(name: string) {\r\n if (!name) return\r\n try {\r\n const item = localStorage.getItem(name)\r\n if (item) return JSON.parse(item)\r\n return item\r\n } catch (err) {\r\n console.error(`Error parsing store item '${name}':`, err)\r\n }\r\n return null\r\n }\r\n },\r\n\r\n /**\r\n * Sets a value in localStorage.\r\n * @param name The key to set.\r\n * @param value The value to store (objects, arrays, primitives).\r\n */\r\n set: {\r\n value(name: string, value: any) {\r\n if (!name) return\r\n try {\r\n\r\n if (value === null || value === undefined) localStorage.setItem(name, JSON.stringify(null))\r\n else if (typeof value === 'object' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'string') localStorage.setItem(name, JSON.stringify(value))\r\n else if (typeof value === 'function') console.error('It\\'s not secure to store functions.')\r\n\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the change\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n const previous = localStorage.getItem(name)\r\n globalThis.memorio.logger.log('store', 'set', name, value, previous ? JSON.parse(previous) : undefined)\r\n }\r\n\r\n } catch (err) {\r\n\r\n console.error(`Error setting store item '${name}':`, err)\r\n\r\n }\r\n return null\r\n }\r\n },\r\n\r\n /**\r\n * Removes a value from localStorage.\r\n * @param name The key to remove.\r\n * @returns True if removed, false if not found.\r\n */\r\n remove: {\r\n value(name: string) {\r\n if (!name) return\r\n if (localStorage.getItem(name)) {\r\n const previous = localStorage.getItem(name)\r\n localStorage.removeItem(name)\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the delete\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('store', 'delete', name, undefined, previous ? JSON.parse(previous) : undefined)\r\n }\r\n\r\n return true\r\n }\r\n return false\r\n }\r\n },\r\n\r\n /**\r\n * Alias for remove.\r\n * @param name The key to delete.\r\n */\r\n delete: {\r\n value(name: string) {\r\n storeProxy.remove(name)\r\n return true\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Clears all items from localStorage.\r\n */\r\n removeAll: {\r\n value() {\r\n localStorage.clear()\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the clear\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('store', 'clear', '*')\r\n }\r\n\r\n return true\r\n }\r\n },\r\n\r\n /**\r\n * Alias for removeAll.\r\n */\r\n clearAll: {\r\n value() {\r\n storeProxy.removeAll()\r\n return true\r\n }\r\n },\r\n\r\n /**\r\n * Estimates storage quota usage.\r\n * @returns Promise with [usage, quota] in KB.\r\n */\r\n quota: {\r\n value() {\r\n if ('storage' in navigator && 'estimate' in navigator.storage) {\r\n navigator.storage.estimate()\r\n .then(\r\n ({ usage, quota }) => {\r\n if (usage && quota) {\r\n console.debug(`Using ${usage / 1024} out of ${quota / 1024} Mb.`)\r\n return [usage / 1024, quota / 1024]\r\n }\r\n }\r\n )\r\n .catch(err => { console.error('Error estimating quota:', err) })\r\n }\r\n return\r\n }\r\n },\r\n\r\n /**\r\n * Calculates total size of all localStorage items.\r\n * @returns Total size in characters.\r\n */\r\n size: {\r\n value() {\r\n let totalSize = 0\r\n for (const key in localStorage) {\r\n if (Object.prototype.hasOwnProperty.call(localStorage, key)) {\r\n const item = localStorage.getItem(key)\r\n if (item) totalSize += item.length\r\n }\r\n }\r\n return totalSize\r\n }\r\n },\r\n\r\n /**\r\n * Get a list of all store items.\r\n * @returns Object with all store items.\r\n */\r\n list: {\r\n value() {\r\n const result: Record<string, any> = {}\r\n for (const key in localStorage) {\r\n if (Object.prototype.hasOwnProperty.call(localStorage, key)) {\r\n try {\r\n result[key] = JSON.parse(localStorage.getItem(key) || 'null')\r\n } catch {\r\n result[key] = localStorage.getItem(key)\r\n }\r\n }\r\n }\r\n return result\r\n }\r\n }\r\n\r\n }\r\n)\r\n\r\nObject.freeze(storeProxy)\r\n\r\n// Export store for module usage\r\nexport const store = storeProxy\r\n", "/**\r\n * MEMORIO SESSION (sessionStorage)\r\n *\r\n * This module provides sessionStorage persistence with a simple API.\r\n * Data is cleared when the browser tab is closed.\r\n * Auto-detects React and triggers useEffect when available.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n// Import memorio global\r\nimport { state as globalState } from '../state'\r\n\r\n// React integration - reuse state subscribers\r\nconst subscribers = (globalState as any).subscribers || new Set<() => void>()\r\n\r\nfunction triggerReact() {\r\n subscribers.forEach((cb: () => void) => cb())\r\n}\r\n\r\n// Remove the old reactTrigger code\r\n\r\n// Logger import\r\nimport '../../functions/logger'\r\n\r\n// Session proxy\r\nconst sessionProxy: any = new Proxy({}, {})\r\n\r\n// Only create global if enabled\r\nif (shouldCreateGlobal('session')) {\r\n Object.defineProperty(\r\n globalThis,\r\n 'session',\r\n {\r\n value: sessionProxy,\r\n enumerable: false,\r\n configurable: true\r\n }\r\n )\r\n}\r\n\r\nObject.defineProperties(\r\n sessionProxy,\r\n {\r\n /**\r\n * Gets a value from sessionStorage.\r\n * @param name The key to retrieve.\r\n * @returns The parsed value or null if not found.\r\n */\r\n get: {\r\n value(name: string) {\r\n if (!name) return\r\n try {\r\n const item = sessionStorage.getItem(name)\r\n if (item) return JSON.parse(item)\r\n return item\r\n } catch (err) {\r\n console.error(`Error parsing session item '${name}':`, err)\r\n }\r\n return\r\n }\r\n },\r\n\r\n /**\r\n * Sets a value in sessionStorage.\r\n * @param name The key to set.\r\n * @param value The value to store.\r\n */\r\n set: {\r\n value(name: string, value: any) {\r\n if (!name) return\r\n try {\r\n\r\n if (value === null || value === undefined) sessionStorage.setItem(name, JSON.stringify(null))\r\n else if (typeof value === 'object' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'string') sessionStorage.setItem(name, JSON.stringify(value))\r\n else if (typeof value === 'function') console.error('It\\'s not secure to session functions.')\r\n\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the change\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n const previous = sessionStorage.getItem(name)\r\n globalThis.memorio.logger.log('session', 'set', name, value, previous ? JSON.parse(previous) : undefined)\r\n }\r\n\r\n } catch (err) {\r\n\r\n console.error(`Error setting session item '${name}':`, err)\r\n\r\n }\r\n return\r\n }\r\n },\r\n\r\n /**\r\n * Removes a value from sessionStorage.\r\n * @param name The key to remove.\r\n * @returns True if removed.\r\n */\r\n remove: {\r\n value(name: string) {\r\n if (!name) return\r\n if (sessionStorage.getItem(name)) {\r\n const previous = sessionStorage.getItem(name)\r\n sessionStorage.removeItem(name)\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the delete\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('session', 'delete', name, undefined, previous ? JSON.parse(previous) : undefined)\r\n }\r\n\r\n return true\r\n }\r\n return\r\n }\r\n },\r\n\r\n /**\r\n * Alias for remove.\r\n * @param name The key to delete.\r\n */\r\n delete: {\r\n value(name: string) {\r\n session.remove(name)\r\n return true\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Clears all sessionStorage items.\r\n */\r\n removeAll: {\r\n value() {\r\n sessionStorage.clear()\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the clear\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('session', 'clear', '*')\r\n }\r\n\r\n return true\r\n }\r\n },\r\n\r\n /**\r\n * Alias for removeAll.\r\n */\r\n clearAll: {\r\n value() {\r\n session.removeAll()\r\n return true\r\n }\r\n },\r\n\r\n quota: {\r\n value() {\r\n if ('storage' in navigator && 'estimate' in navigator.storage) {\r\n navigator.storage.estimate()\r\n .then(\r\n ({ usage, quota }) => {\r\n if (usage && quota) console.debug(`Using ${usage / 1024} out of ${quota / 1024} Mb.`)\r\n }\r\n )\r\n .catch(err => { console.error('Error estimating quota:', err) })\r\n }\r\n return\r\n }\r\n },\r\n\r\n /**\r\n * Gets total size of all sessionStorage items.\r\n * @returns Total size in characters.\r\n */\r\n size: {\r\n value() {\r\n let totalSize = 0\r\n for (const key in sessionStorage) {\r\n if (Object.prototype.hasOwnProperty.call(sessionStorage, key)) {\r\n const item = sessionStorage.getItem(key)\r\n if (item) {\r\n totalSize += item.length\r\n }\r\n }\r\n }\r\n return totalSize\r\n }\r\n },\r\n\r\n /**\r\n * Get a list of all session items.\r\n * @returns Object with all session items.\r\n */\r\n list: {\r\n value() {\r\n const result: Record<string, any> = {}\r\n for (const key in sessionStorage) {\r\n if (Object.prototype.hasOwnProperty.call(sessionStorage, key)) {\r\n try {\r\n result[key] = JSON.parse(sessionStorage.getItem(key) || 'null')\r\n } catch {\r\n result[key] = sessionStorage.getItem(key)\r\n }\r\n }\r\n }\r\n return result\r\n }\r\n }\r\n\r\n }\r\n)\r\n\r\nObject.freeze(session)\r\n", "/**\r\n * MEMORIO CACHE (In-Memory)\r\n *\r\n * This module provides in-memory caching using a simple object.\r\n * Data is lost on page refresh.\r\n * Auto-detects React and triggers useEffect when available.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\n\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n// Import memorio global\r\nimport { state as globalState } from '../state'\r\n\r\n// React integration - reuse state subscribers\r\nconst subscribers = (globalState as any).subscribers || new Set<() => void>()\r\n\r\nfunction triggerReact() {\r\n subscribers.forEach((cb: () => void) => cb())\r\n}\r\n\r\n// Logger import\r\nimport '../logger'\r\n\r\n// Define cache on globalThis\r\nconst cacheProxy = new Proxy({}, {\r\n set(target, prop, value) {\r\n const previousValue = (target as any)[prop]\r\n ; (target as any)[prop] = value\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the change\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('cache', 'set', String(prop), value, previousValue)\r\n }\r\n\r\n return true\r\n },\r\n deleteProperty(target, prop) {\r\n const previousValue = (target as any)[prop]\r\n delete (target as any)[prop]\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n\r\n // Log the delete\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('cache', 'delete', String(prop), undefined, previousValue)\r\n }\r\n\r\n return true\r\n },\r\n get(target: any, prop) {\r\n // Add clear method\r\n if (prop === 'clear') {\r\n return () => {\r\n Object.keys(target).forEach(key => {\r\n delete target[key]\r\n })\r\n // Trigger React re-render\r\n if (subscribers.size > 0) triggerReact()\r\n // Log the clear\r\n if (typeof globalThis.memorio?.logger?.log === 'function') {\r\n globalThis.memorio.logger.log('cache', 'clear', '*')\r\n }\r\n }\r\n }\r\n return (target as any)[prop]\r\n }\r\n})\r\n\r\n// Only create global if enabled\r\nif (shouldCreateGlobal('cache')) {\r\n Object.defineProperty(globalThis, 'cache', {\r\n value: cacheProxy,\r\n enumerable: false,\r\n configurable: true\r\n })\r\n}\r\n\r\n// Export cache for module usage\r\nexport const cache = cacheProxy\r\n\r\nexport { }\r\n", "\r\n/**\r\n * MEMORIO INDEXEDDB\r\n *\r\n * This module provides IndexedDB browser database functionality.\r\n * It enables persistent storage for large amounts of structured data.\r\n * Auto-detects React and triggers useEffect when available.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n// React trigger mechanism - accessible to CRUD operations\r\nconst reactTrigger = (() => {\r\n let trigger: any = null\r\n let tick = 0\r\n\r\n if (typeof (globalThis as any).useEffect !== 'undefined') {\r\n try {\r\n const React = (globalThis as any).React\r\n if (React && React.useState) {\r\n const [, setTickState] = React.useState(0)\r\n trigger = () => {\r\n tick++\r\n setTickState(tick)\r\n }\r\n }\r\n } catch (_e) { }\r\n }\r\n\r\n return trigger\r\n})()\r\n\r\n // Export for use in CRUD operations\r\n ; (globalThis as any).memorioIdbTrigger = () => { if (reactTrigger) reactTrigger() }\r\n\r\n(\r\n () => {\r\n\r\n // Only create globals if enabled\r\n if (shouldCreateGlobal('idb')) {\r\n Object.defineProperty(\r\n window,\r\n \"idb\",\r\n {\r\n value: {\r\n db: {},\r\n table: {},\r\n data: {}\r\n },\r\n writable: true,\r\n configurable: true,\r\n enumerable: false\r\n }\r\n )\r\n\r\n Object.defineProperty(\r\n window,\r\n \"idbases\",\r\n {\r\n value: [],\r\n writable: true,\r\n configurable: true,\r\n enumerable: false\r\n }\r\n )\r\n }\r\n\r\n // Export for module usage\r\n const idb = {\r\n db: {},\r\n table: {},\r\n data: {}\r\n }\r\n\r\n // setTimeout(\r\n // () => {\r\n import('./tools/db.create')\r\n import('./tools/db.list')\r\n import('./tools/db.exist')\r\n import('./tools/db.quota')\r\n import('./tools/db.delete')\r\n import('./tools/db.size')\r\n import('./tools/db.version')\r\n import('./tools/db.support')\r\n import('./tools/table.create')\r\n import('./tools/table.size')\r\n\r\n import('./crud/data.delete')\r\n import('./crud/data.set')\r\n import('./crud/data.get')\r\n // }, 0\r\n // )\r\n\r\n if (shouldCreateGlobal('idb')) {\r\n Object.preventExtensions(idb)\r\n Object.seal(idb)\r\n Object.freeze(idb)\r\n }\r\n\r\n }\r\n)()\r\n", "/**\r\n * MEMORIO DEVTOOLS\r\n *\r\n * This module provides browser DevTools integration for Memorio.\r\n * It exposes state, store, session, cache and IDB to the browser console\r\n * for debugging and inspection.\r\n *\r\n * CONFIGURATION:\r\n * Set window.memorio = { globals: false } before importing to disable global pollution\r\n */\r\n\r\n// Helper to check if globals should be created\r\nconst memorioConfig = (globalThis as any).memorio || {}\r\nconst globalsConfig = memorioConfig.globals\r\nfunction shouldCreateGlobal(name: string): boolean {\r\n if (globalsConfig === false) return false\r\n if (globalsConfig && typeof globalsConfig === 'object') {\r\n return globalsConfig[name] !== false\r\n }\r\n return true\r\n}\r\n\r\n// Helper to check if debug mode is enabled\r\nfunction isDebugEnabled(): boolean {\r\n return (globalThis as any).memorio?.debug === true\r\n}\r\n\r\ninterface DevToolsStats {\r\n stateKeys: number\r\n storeKeys: number\r\n sessionKeys: number\r\n cacheKeys: number\r\n idbDatabases: number\r\n lastUpdate: string\r\n}\r\n\r\n/**\r\n * Inspect all Memorio modules\r\n */\r\nexport const inspect = (): void => {\r\n if (!isDebugEnabled()) return\r\n console.debug('%c\uD83E\uDDE0 Memorio State Inspector', 'font-size: 16px; font-weight: bold; color: #4CAF50')\r\n console.debug('')\r\n\r\n // State\r\n if (globalThis.state) {\r\n console.debug('%c\uD83D\uDCE6 STATE', 'color: #4CAF50; font-weight: bold')\r\n console.table(globalThis.state.list ? globalThis.state.list() : globalThis.state)\r\n console.debug('')\r\n }\r\n\r\n // Store\r\n if (globalThis.store) {\r\n console.debug('%c\uD83C\uDFEA STORE', 'color: #2196F3; font-weight: bold')\r\n console.table(globalThis.store.list ? globalThis.store.list() : globalThis.store)\r\n console.debug('')\r\n }\r\n\r\n // Session\r\n if (globalThis.session) {\r\n console.debug('%c\uD83D\uDD10 SESSION', 'color: #FF9800; font-weight: bold')\r\n console.table(globalThis.session.list ? globalThis.session.list() : globalThis.session)\r\n console.debug('')\r\n }\r\n\r\n // Cache\r\n if (globalThis.cache) {\r\n console.debug('%c\u26A1 CACHE', 'color: #9C27B0; font-weight: bold')\r\n console.table(globalThis.cache.list ? globalThis.cache.list() : globalThis.cache)\r\n console.debug('')\r\n }\r\n}\r\n\r\n/**\r\n * Get statistics about all modules\r\n */\r\nexport const stats = (): DevToolsStats => {\r\n const getKeys = (obj: any): number => {\r\n if (!obj) return 0\r\n if (typeof obj.list === 'function') {\r\n const list = obj.list()\r\n return Object.keys(list).length\r\n }\r\n return Object.keys(obj).length\r\n }\r\n\r\n return {\r\n stateKeys: getKeys(globalThis.state),\r\n storeKeys: getKeys(globalThis.store),\r\n sessionKeys: getKeys(globalThis.session),\r\n cacheKeys: getKeys(globalThis.cache),\r\n idbDatabases: 0, // Would require async IDB check\r\n lastUpdate: new Date().toISOString()\r\n }\r\n}\r\n\r\n/**\r\n * Clear all data from a specific module\r\n */\r\nexport const clear = (module: 'state' | 'store' | 'session' | 'cache'): void => {\r\n if (globalThis[module] && typeof (globalThis[module] as any).clear === 'function') {\r\n (globalThis[module] as any).clear()\r\n if (isDebugEnabled()) {\r\n console.debug(`%c\u2713 Cleared ${module}`, 'color: #4CAF50')\r\n }\r\n } else {\r\n console.error(`Module ${module} not found or does not support clear()`)\r\n }\r\n}\r\n\r\n/**\r\n * Clear all modules\r\n */\r\nexport const clearAll = (): void => {\r\n clear('state')\r\n clear('store')\r\n clear('session')\r\n clear('cache')\r\n if (isDebugEnabled()) {\r\n console.debug('%c\u2713 Cleared all Memorio modules', 'color: #4CAF50; font-weight: bold')\r\n }\r\n}\r\n\r\n/**\r\n * Watch a specific path for changes\r\n */\r\nexport const watch = (module: string, path: string): void => {\r\n if (!isDebugEnabled()) return\r\n\r\n console.debug(`%c\uD83D\uDC41 Watching ${module}.${path}`, 'color: #FF9800')\r\n\r\n const target = globalThis[module as keyof typeof globalThis]\r\n if (target) {\r\n // Simple watch implementation - logs access\r\n const original = (target as any)[path]\r\n if (original !== undefined) {\r\n Object.defineProperty(target, path, {\r\n get: function () {\r\n console.debug(`%c\uD83D\uDC41 Access: ${module}.${path}`, 'color: #FF9800')\r\n return original\r\n },\r\n set: function (value) {\r\n console.debug(`%c\uD83D\uDC41 Change: ${module}.${path} =`, 'color: #FF9800', value)\r\n return value\r\n }\r\n })\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Export all data as JSON\r\n */\r\nexport const exportData = (): string => {\r\n const data = {\r\n state: globalThis.state?.list ? globalThis.state.list() : globalThis.state,\r\n store: globalThis.store?.list ? globalThis.store.list() : globalThis.store,\r\n session: globalThis.session?.list ? globalThis.session.list() : globalThis.session,\r\n cache: globalThis.cache?.list ? globalThis.cache.list() : globalThis.cache,\r\n exportedAt: new Date().toISOString()\r\n }\r\n\r\n return JSON.stringify(data, null, 2)\r\n}\r\n\r\n/**\r\n * Import data from JSON\r\n */\r\nexport const importData = (jsonString: string): void => {\r\n try {\r\n const data = JSON.parse(jsonString)\r\n\r\n if (data.state) {\r\n Object.entries(data.state).forEach(([key, value]) => {\r\n if (globalThis.state) (globalThis.state as any)[key] = value\r\n })\r\n }\r\n\r\n if (data.store) {\r\n Object.entries(data.store).forEach(([key, value]) => {\r\n if (globalThis.store) (globalThis.store as any)[key] = value\r\n })\r\n }\r\n\r\n if (data.session) {\r\n Object.entries(data.session).forEach(([key, value]) => {\r\n if (globalThis.session) (globalThis.session as any)[key] = value\r\n })\r\n }\r\n\r\n if (data.cache) {\r\n Object.entries(data.cache).forEach(([key, value]) => {\r\n if (globalThis.cache) (globalThis.cache as any)[key] = value\r\n })\r\n }\r\n\r\n if (isDebugEnabled()) {\r\n console.debug('%c\u2713 Data imported successfully', 'color: #4CAF50')\r\n }\r\n } catch (error) {\r\n console.error('%c\u2717 Import failed:', 'color: #F44336', error)\r\n }\r\n}\r\n\r\n/**\r\n * Show help\r\n */\r\nexport const help = (): void => {\r\n if (!isDebugEnabled()) return\r\n console.debug(`\r\n%c\uD83E\uDDE0 Memorio DevTools Help\r\n\r\nAvailable commands:\r\n memorio.devtools.inspect() - Inspect all state modules\r\n memorio.devtools.stats() - Show statistics\r\n memorio.devtools.clear('module') - Clear specific module\r\n memorio.devtools.clearAll() - Clear all modules\r\n memorio.devtools.watch('module', 'path') - Watch a path\r\n memorio.devtools.exportData() - Export all data as JSON\r\n memorio.devtools.importData(json) - Import data from JSON\r\n memorio.devtools.help() - Show this help\r\n\r\nShortcuts:\r\n state - globalThis.state\r\n store - globalThis.store\r\n session - globalThis.session\r\n cache - globalThis.cache\r\n\r\nShortcuts are also available in console as:\r\n $state, $store, $session, $cache\r\n`, 'font-family: monospace; font-size: 12px')\r\n}\r\n\r\n// Add to global memorio object\r\nif (typeof globalThis.memorio !== 'undefined') {\r\n Object.defineProperty(globalThis.memorio, 'devtools', {\r\n enumerable: false,\r\n configurable: true,\r\n value: {\r\n inspect,\r\n stats,\r\n clear,\r\n clearAll,\r\n watch,\r\n exportData,\r\n importData,\r\n help\r\n }\r\n })\r\n}\r\n\r\n// Also expose as global shortcuts for easy console access (only if enabled)\r\nif (shouldCreateGlobal('devtools')) {\r\n Object.defineProperty(globalThis, '$state', {\r\n get: () => globalThis.state,\r\n configurable: true\r\n })\r\n\r\n Object.defineProperty(globalThis, '$store', {\r\n get: () => globalThis.store,\r\n configurable: true\r\n })\r\n\r\n Object.defineProperty(globalThis, '$session', {\r\n get: () => globalThis.session,\r\n configurable: true\r\n })\r\n\r\n Object.defineProperty(globalThis, '$cache', {\r\n get: () => globalThis.cache,\r\n configurable: true\r\n })\r\n\r\n if ((globalThis as any).memorio?.debug) {\r\n console.debug('%c\uD83E\uDDE0 Memorio DevTools loaded. Type memorio.devtools.help() for info.', 'color: #4CAF50; font-weight: bold')\r\n }\r\n}\r\n", "/**\r\n * Memorio React Integration\r\n *\r\n * AUTOMATIC USAGE - No hooks needed!\r\n *\r\n * Wrap your app with MemorioProvider once:\r\n *\r\n * import { MemorioProvider } from 'memorio'\r\n *\r\n * <MemorioProvider>\r\n * <App />\r\n * </MemorioProvider>\r\n *\r\n * Then use global state anywhere - NO HOOKS NEEDED!\r\n *\r\n * function MyComponent() {\r\n * useEffect(() => {\r\n * console.log(state.test) // \u2705 Automatic!\r\n * }, [state.test])\r\n *\r\n * return <button onClick={() => state.test = 123}>Click</button>\r\n * }\r\n */\r\n\r\n// Get React lazily - will be available when used in React app\r\nfunction getReact() {\r\n const React = (globalThis as any).React\r\n if (!React) {\r\n throw new Error('React not found. Make sure React is installed and memorio is imported in a React app.')\r\n }\r\n return React\r\n}\r\n\r\n// Import subscribe from state module\r\nimport { memorioSubscribe } from './state'\r\n\r\n// Create Context lazily\r\nfunction getContext() {\r\n return getReact().createContext(null)\r\n}\r\n\r\n// Provider component - wrap your app with this ONCE\r\nexport function MemorioProvider({ children }: { children: any }) {\r\n const React = getReact()\r\n\r\n // Force re-render on any state change\r\n const [, setTick] = React.useState(0)\r\n\r\n React.useEffect(() => {\r\n const unsubscribe = memorioSubscribe(() => {\r\n setTick((t: number) => t + 1)\r\n })\r\n return unsubscribe\r\n }, [])\r\n\r\n const MemorioContext = getContext()\r\n return React.createElement(MemorioContext.Provider, { value: true }, children)\r\n}\r\n\r\n// Legacy hook - still available for compatibility\r\nexport function useMemorioState() {\r\n const React = getReact()\r\n const [, setTick] = React.useState(0)\r\n\r\n React.useEffect(() => {\r\n const unsubscribe = memorioSubscribe(() => {\r\n setTick((t: number) => t + 1)\r\n })\r\n return unsubscribe\r\n }, [])\r\n}\r\n\r\nexport function useMemorio() {\r\n return (globalThis as any).state\r\n}\r\n"],
5
- "mappings": "mCAAA,IAAAA,GAAA,OAAAC,EAAAC,EAAA,kBAOA,IAAI,GAAG,OAAS,CAACC,EAAQC,EAAM,IAAM,CAEnC,IAAI,GAAG,QAAQ,EAGf,IAAMC,EAAU,UAAU,KAAKF,EAAQC,CAAG,EAG1CC,EAAQ,QAAU,IAAM,CACtB,QAAQ,MAAM,oBAAoBA,EAAQ,SAAS,EAAE,CACvD,EAEAA,EAAQ,UAAY,IAAM,CACxB,QAAQ,MAAM,gCAAgC,CAEhD,EAEAA,EAAQ,gBAAkB,IAAM,CAC9B,QAAQ,MAAM,kBAAkB,CAClC,EAEA,IAAI,GAAG,KAAK,CACd,IC7BA,IAAAC,GAAA,OAAAC,EAAAC,EAAA,kBAOA,IAAI,GAAG,KAAO,KACZ,UACG,UAAU,EACV,KAAKC,GAAUA,CAAM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AO,eAAe,WAAY,SAAU,CAC1C,IAAK,IAAM,WAAW,MACtB,aAAc,EAChB,CAAC,EAED,OAAO,eAAe,WAAY,SAAU,CAC1C,IAAK,IAAM,WAAW,MACtB,aAAc,EAChB,CAAC,EAED,OAAO,eAAe,WAAY,WAAY,CAC5C,IAAK,IAAM,WAAW,QACtB,aAAc,EAChB,CAAC,EAED,OAAO,eAAe,WAAY,SAAU,CAC1C,IAAK,IAAM,WAAW,MACtB,aAAc,EAChB,CAAC,EAEI,WAAmB,SAAS,OAC/B,QAAQ,MAAM,8EAAwE,mCAAmC,GCzP7H,SAASuB,GAAW,CAClB,IAAMC,EAAS,WAAmB,MAClC,GAAI,CAACA,EACH,MAAM,IAAI,MAAM,uFAAuF,EAEzG,OAAOA,CACT,CAMA,SAASC,IAAa,CACpB,OAAOF,EAAS,EAAE,cAAc,IAAI,CACtC,CAGO,SAASG,GAAgB,CAAE,SAAAC,CAAS,EAAsB,CAC/D,IAAMH,EAAQD,EAAS,EAGjB,CAAC,CAAEK,CAAO,EAAIJ,EAAM,SAAS,CAAC,EAEpCA,EAAM,UAAU,IACMK,EAAiB,IAAM,CACzCD,EAASE,GAAcA,EAAI,CAAC,CAC9B,CAAC,EAEA,CAAC,CAAC,EAEL,IAAMC,EAAiBN,GAAW,EAClC,OAAOD,EAAM,cAAcO,EAAe,SAAU,CAAE,MAAO,EAAK,EAAGJ,CAAQ,CAC/E,CAGO,SAASK,IAAkB,CAChC,IAAMR,EAAQD,EAAS,EACjB,CAAC,CAAEK,CAAO,EAAIJ,EAAM,SAAS,CAAC,EAEpCA,EAAM,UAAU,IACMK,EAAiB,IAAM,CACzCD,EAASE,GAAcA,EAAI,CAAC,CAC9B,CAAC,EAEA,CAAC,CAAC,CACP,CAEO,SAASG,IAAa,CAC3B,OAAQ,WAAmB,KAC7B",
6
- "names": ["db_create_exports", "init_db_create", "__esmMin", "dbName", "ver", "request", "db_list_exports", "init_db_list", "__esmMin", "result", "err", "db_exist_exports", "init_db_exist", "__esmMin", "storeName", "db", "db_quota_exports", "init_db_quota", "__esmMin", "db_delete_exports", "init_db_delete", "__esmMin", "storeName", "db_size_exports", "init_db_size", "__esmMin", "dbName", "index", "request", "_event", "event", "db", "tableNames", "tableSizeGetters", "acc", "tableName", "sizes", "total", "val", "db_version_exports", "init_db_version", "__esmMin", "storeName", "idbVer", "v", "db_support_exports", "init_db_support", "__esmMin", "table_create_exports", "init_table_create", "__esmMin", "dbName", "dbTable", "v", "request", "e", "target", "db", "store", "err", "table_size_exports", "init_table_size", "__esmMin", "db", "table", "resolve", "reject", "e", "size", "transaction", "event", "cursor", "storedObject", "json", "err", "data_delete_exports", "init_data_delete", "__esmMin", "storeName", "table", "value", "request", "db", "transaction", "e", "event", "Store", "data_set_exports", "init_data_set", "__esmMin", "storeName", "table", "value", "request", "db", "transaction", "e", "data_get_exports", "returnValue", "init_data_get", "__esmMin", "storeName", "table", "key", "request", "event", "db", "Store", "_event", "package_default", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "UNDEFINED", "shouldCreateGlobal", "package_default", "protect", "name", "value", "cb", "_flag", "exec", "e", "events", "_container", "_object", "defaultConfig", "isDebugEnabled", "config", "logHistory", "configure", "options", "enable", "disable", "isEnabled", "module", "log", "action", "path", "value", "previousValue", "entry", "prefix", "color", "getModuleColor", "getHistory", "clearHistory", "getStats", "stats", "exportLogs", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "subscribers", "subscribe", "callback", "stateVersion", "memorioSubscribe", "subscribe", "triggerReact", "stateVersion", "subscribers", "cb", "prop", "object", "separator", "buildProxy", "obj", "callback", "tree", "event", "name", "array", "x", "i", "command", "target", "key", "error", "value", "protect", "path", "state", "shouldCreateGlobal", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "subscribers", "state", "triggerReact", "cb", "storeProxy", "item", "err", "value", "previous", "usage", "quota", "totalSize", "key", "result", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "subscribers", "state", "triggerReact", "cb", "sessionProxy", "item", "err", "value", "previous", "usage", "quota", "totalSize", "key", "result", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "subscribers", "state", "triggerReact", "cb", "cacheProxy", "target", "prop", "value", "previousValue", "key", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "reactTrigger", "trigger", "tick", "React", "setTickState", "idb", "memorioConfig", "globalsConfig", "shouldCreateGlobal", "name", "isDebugEnabled", "inspect", "stats", "getKeys", "obj", "list", "clear", "module", "clearAll", "watch", "path", "target", "original", "value", "exportData", "data", "importData", "jsonString", "key", "error", "help", "getReact", "React", "getContext", "MemorioProvider", "children", "setTick", "memorioSubscribe", "t", "MemorioContext", "useMemorioState", "useMemorio"]
7
- }