@multiplatform.one/connectkit 7.90.2 → 7.90.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/connectkit",
3
- "version": "7.90.2",
3
+ "version": "7.90.3",
4
4
  "description": "Signer-agnostic wallet-modal UI kit (modal shell, routing, theming, screen registry) — no wagmi/viem",
5
5
  "keywords": [
6
6
  "connectkit",
@@ -65,7 +65,7 @@
65
65
  "tamagui": "2.7.6"
66
66
  },
67
67
  "devDependencies": {
68
- "@multiplatform.one/config": "7.90.2",
68
+ "@multiplatform.one/config": "7.90.3",
69
69
  "@tamagui/build": "2.7.6",
70
70
  "@tanstack/react-query": "^5.104.3",
71
71
  "@types/qrcode": "^1.4.2",
@@ -1,66 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
- value: mod,
29
- enumerable: true
30
- }) : target, mod));
31
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
- value: true
33
- }), mod);
34
- var useLocalStorage_exports = {};
35
- __export(useLocalStorage_exports, {
36
- useLocalStorage: () => useLocalStorage
37
- });
38
- module.exports = __toCommonJS(useLocalStorage_exports);
39
- var import_react = require("react");
40
- var LocalStorage = __toESM(require("../utils/localstorage.cjs"));
41
- const useLocalStorage = storageKey => {
42
- const [data, setData] = (0, import_react.useState)(LocalStorage.get(storageKey));
43
- const add = item => {
44
- const newItems = LocalStorage.add(storageKey, item);
45
- setData(newItems);
46
- };
47
- const update = items => {
48
- const newItems = LocalStorage.save(storageKey, items);
49
- setData(newItems);
50
- };
51
- const remove = item => {
52
- const newItems = LocalStorage.remove(storageKey, item);
53
- setData(newItems);
54
- };
55
- const clear = () => {
56
- const newItems = LocalStorage.save(storageKey, []);
57
- setData(newItems);
58
- };
59
- return {
60
- data,
61
- add,
62
- remove,
63
- update,
64
- clear
65
- };
66
- };
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __export = (target, all) => {
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
- get: () => from[key],
19
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
- });
21
- }
22
- return to;
23
- };
24
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
- // If the importer is in node compatibility mode or this is not an ESM
26
- // file that has been converted to a CommonJS file using a Babel-
27
- // compatible transform (i.e. "__esModule" has not been set), then set
28
- // "default" to the CommonJS "module.exports" for node compatibility.
29
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
- value: true
35
- }), mod);
36
- var useLocalStorage_exports = {};
37
- __export(useLocalStorage_exports, {
38
- useLocalStorage: () => useLocalStorage
39
- });
40
- module.exports = __toCommonJS(useLocalStorage_exports);
41
- var import_react = require("react");
42
- var LocalStorage = __toESM(require("../utils/localstorage.native.js"));
43
- var useLocalStorage = function useLocalStorage2(storageKey) {
44
- var [data, setData] = (0, import_react.useState)(LocalStorage.get(storageKey));
45
- var add = function add2(item) {
46
- var newItems = LocalStorage.add(storageKey, item);
47
- setData(newItems);
48
- };
49
- var update = function update2(items) {
50
- var newItems = LocalStorage.save(storageKey, items);
51
- setData(newItems);
52
- };
53
- var remove = function remove2(item) {
54
- var newItems = LocalStorage.remove(storageKey, item);
55
- setData(newItems);
56
- };
57
- var clear = function clear2() {
58
- var newItems = LocalStorage.save(storageKey, []);
59
- setData(newItems);
60
- };
61
- return {
62
- data,
63
- add,
64
- remove,
65
- update,
66
- clear
67
- };
68
- };
69
- //# sourceMappingURL=useLocalStorage.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useLocalStorage_exports","__export","useLocalStorage","module","exports","import_react","require","LocalStorage","__toESM","useLocalStorage2","storageKey","data","setData","useState","get","add","add2","item","newItems","update","update2","items","save","remove","remove2","clear","clear2"],"sources":["../../../src/hooks/useLocalStorage.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAyB,CAAAK,uBAAA;AACzB,IAAAK,YAAA,GAA8BC,OAAA;AAEvB,IAAAC,YAAM,GAAAC,OAAmB,CAAAF,OAAA,kCAAuB;AACrD,IAAAJ,eAAa,GAAO,SAAIO,iBAAAC,UAAS;EAEjC,KAAAC,IAAM,EAAAC,OAAO,IAAc,IAAAP,YAAA,CAAAQ,QAAA,EAAAN,YAAA,CAAAO,GAAA,CAAAJ,UAAA;EACzB,IAAAK,GAAA,GAAM,SAAWC,KAAAC,IAAA;IACjB,IAAAC,QAAQ,GAAAX,YAAQ,CAAAQ,GAAA,CAAAL,UAAA,EAAAO,IAAA;IAClBL,OAAA,CAAAM,QAAA;EAEA;EACE,IAAAC,MAAM,YAAWC,QAAAC,KAAa,EAAK;IACnC,IAAAH,QAAQ,GAAAX,YAAQ,CAAAe,IAAA,CAAAZ,UAAA,EAAAW,KAAA;IAClBT,OAAA,CAAAM,QAAA;EAEA;EACE,IAAAK,MAAM,YAAWC,QAAAP,IAAa;IAC9B,IAAAC,QAAQ,GAAAX,YAAQ,CAAAgB,MAAA,CAAAb,UAAA,EAAAO,IAAA;IAClBL,OAAA,CAAAM,QAAA;EAEA;EACE,IAAAO,KAAM,YAAWC,OAAA;IACjB,IAAAR,QAAQ,GAAAX,YAAQ,CAAAe,IAAA,CAAAZ,UAAA;IAClBE,OAAA,CAAAM,QAAA;EAEA;EACF","ignoreList":[]}
@@ -1,73 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
14
- get: () => from[key],
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- return to;
19
- };
20
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
- value: true
22
- }), mod);
23
- var localstorage_exports = {};
24
- __export(localstorage_exports, {
25
- add: () => add,
26
- clear: () => clear,
27
- get: () => get,
28
- remove: () => remove,
29
- save: () => save
30
- });
31
- module.exports = __toCommonJS(localstorage_exports);
32
- const randomID = () => {
33
- return Date.now().toString(36) + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
34
- };
35
- const save = (storageKey, data) => {
36
- try {
37
- localStorage.setItem(storageKey, JSON.stringify(data));
38
- return get(storageKey);
39
- } catch (e) {
40
- return [];
41
- }
42
- };
43
- const get = storageKey => {
44
- try {
45
- const data = localStorage.getItem(storageKey);
46
- if (data) return JSON.parse(data);
47
- return [];
48
- } catch (e) {
49
- save(storageKey, []);
50
- return [];
51
- }
52
- };
53
- const add = (storageKey, item) => {
54
- const data = get(storageKey);
55
- const newData = [{
56
- ...item,
57
- ckStoreKey: randomID(),
58
- // unique key to identify the item so we can remove it later
59
- timestamp: /* @__PURE__ */new Date()
60
- }, ...data];
61
- save(storageKey, newData);
62
- return get(storageKey);
63
- };
64
- const remove = (storageKey, item) => {
65
- const data = get(storageKey);
66
- const newData = data.filter(i => i.ckStoreKey !== item.ckStoreKey);
67
- save(storageKey, newData);
68
- return get(storageKey);
69
- };
70
- const clear = storageKey => {
71
- save(storageKey, []);
72
- return get(storageKey);
73
- };
@@ -1,78 +0,0 @@
1
- "use strict";
2
-
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: () => from[key],
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
21
- };
22
- var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
23
- value: true
24
- }), mod);
25
- var localstorage_exports = {};
26
- __export(localstorage_exports, {
27
- add: () => add,
28
- clear: () => clear,
29
- get: () => get,
30
- remove: () => remove,
31
- save: () => save
32
- });
33
- module.exports = __toCommonJS(localstorage_exports);
34
- var randomID = function randomID2() {
35
- return Date.now().toString(36) + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
36
- };
37
- var save = function save2(storageKey, data) {
38
- try {
39
- localStorage.setItem(storageKey, JSON.stringify(data));
40
- return get(storageKey);
41
- } catch (e) {
42
- return [];
43
- }
44
- };
45
- var get = function get2(storageKey) {
46
- try {
47
- var data = localStorage.getItem(storageKey);
48
- if (data) return JSON.parse(data);
49
- return [];
50
- } catch (e) {
51
- save(storageKey, []);
52
- return [];
53
- }
54
- };
55
- var add = function add2(storageKey, item) {
56
- var data = get(storageKey);
57
- var newData = [{
58
- ...item,
59
- ckStoreKey: randomID(),
60
- // unique key to identify the item so we can remove it later
61
- timestamp: /* @__PURE__ */new Date()
62
- }, ...data];
63
- save(storageKey, newData);
64
- return get(storageKey);
65
- };
66
- var remove = function remove2(storageKey, item) {
67
- var data = get(storageKey);
68
- var newData = data.filter(function (i) {
69
- return i.ckStoreKey !== item.ckStoreKey;
70
- });
71
- save(storageKey, newData);
72
- return get(storageKey);
73
- };
74
- var clear = function clear2(storageKey) {
75
- save(storageKey, []);
76
- return get(storageKey);
77
- };
78
- //# sourceMappingURL=localstorage.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","localstorage_exports","__export","add","clear","get","remove","save","module","exports","randomID","randomID2","Date","now","toString","Math","random","substring","save2","storageKey","data","localStorage","setItem","JSON","stringify","e","get2","getItem","parse","add2","item","newData","ckStoreKey","timestamp","remove2","filter","i","clear2"],"sources":["../../../src/utils/localstorage.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,GAAA,EAAAA,CAAA,KAAAA,GAAA;EAAAC,KAAA,EAAAA,CAAA,KAAAA,KAAA;EAAAC,GAAA,EAAAA,CAAA,KAAAA,GAAA;EAAAC,MAAA,EAAAA,CAAA,KAAAA,MAAA;EAAAC,IAAA,EAAAA,CAAA,KAAAA;AAAA;AAMAC,MAAM,CAAAC,OAAA,GAAWb,YAAM,CAAAK,oBAAA;AAIrB,IAAAS,QACE,GAAK,SAAMC,SAAWA,CAAA,EACtB;EAGJ,OAAAC,IAAA,CAAAC,GAAA,GAAAC,QAAA,OAAAC,IAAA,CAAAC,MAAA,GAAAF,QAAA,KAAAG,SAAA,UAAAF,IAAA,CAAAC,MAAA,GAAAF,QAAA,KAAAG,SAAA;AAEO;AACL,IAAAV,IAAI,YAAAW,MAAAC,UAAA,EAAAC,IAAA;EACF;IACAC,YAAW,CAAAC,OAAA,CAAUH,UAAA,EAAAI,IAAA,CAAAC,SAAA,CAAAJ,IAAA;IACvB,OAASf,GAAG,CAAAc,UAAA;EACV,SAAOM,CAAC;IACV;EACF;AAEO;AACL,IAAApB,GAAI,YAAAqB,KAAAP,UAAA;EACF;IACA,IAAIC,IAAA,GAAMC,YAAY,CAAAM,OAAM,CAAIR,UAAA;IAChC,IAAAC,IAAQ,SAAAG,IAAA,CAAAK,KAAA,CAAAR,IAAA;IACV,OAAS;EAEP,SAAKK,CAAA;IACLlB,IAAA,CAAAY,UAAQ;IACV;EACF;AAEO;AACL,IAAAhB,GAAA,GAAM,SAAW0B,KAAAV,UAAU,EAAAW,IAAA;EAC3B,IAAAV,IAAM,GAAAf,GAAA,CAAAc,UAAU;EAAA,IACdY,OAAA;IAEE,GAAAD,IAAA;IAAqBE,UAAA,EAAAtB,QAAA;IACrB;IACFuB,SAAA,qBAAArB,IAAA;EACA,GACF,GAAAQ,IAAA,CACA;EACAb,IAAA,CAAAY,UAAW,EAAAY,OAAU;EACvB,OAAA1B,GAAA,CAAAc,UAAA;AAEO;AACL,IAAAb,MAAM,YAAW4B,OAAUA,CAAAf,UAAA,EAAAW,IAAA;EAC3B,IAAAV,IAAM,GAAAf,GAAA,CAAAc,UAAe;EACrB,IAAAY,OAAK,GAAAX,IAAY,CAAAe,MAAO,WAAAC,CAAA;IACxB,OAAOA,CAAA,CAAIJ,UAAU,KAAAF,IAAA,CAAAE,UAAA;EACvB;EAEOzB,IAAM,CAAAY,UAAS,EAAAY,OAAA;EACpB,OAAK1B,GAAA,CAAAc,UAAc;AACnB;AACF,IAAAf,KAAA,YAAAiC,OAAAlB,UAAA","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import { useState } from "react";
2
- import * as LocalStorage from "../utils/localstorage.mjs";
3
- const useLocalStorage = storageKey => {
4
- const [data, setData] = useState(LocalStorage.get(storageKey));
5
- const add = item => {
6
- const newItems = LocalStorage.add(storageKey, item);
7
- setData(newItems);
8
- };
9
- const update = items => {
10
- const newItems = LocalStorage.save(storageKey, items);
11
- setData(newItems);
12
- };
13
- const remove = item => {
14
- const newItems = LocalStorage.remove(storageKey, item);
15
- setData(newItems);
16
- };
17
- const clear = () => {
18
- const newItems = LocalStorage.save(storageKey, []);
19
- setData(newItems);
20
- };
21
- return {
22
- data,
23
- add,
24
- remove,
25
- update,
26
- clear
27
- };
28
- };
29
- export { useLocalStorage };
30
- //# sourceMappingURL=useLocalStorage.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useState","LocalStorage","useLocalStorage","storageKey","data","setData","get","add","item","newItems","update","items","save","remove","clear"],"sources":["../../../src/hooks/useLocalStorage.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,YAAYC,YAAA,MAAkB;AAEvB,MAAMC,eAAA,GAAmBC,UAAA,IAAuB;EACrD,MAAM,CAACC,IAAA,EAAMC,OAAO,IAAIL,QAAA,CAASC,YAAA,CAAaK,GAAA,CAAIH,UAAU,CAAC;EAE7D,MAAMI,GAAA,GAAOC,IAAA,IAAc;IACzB,MAAMC,QAAA,GAAWR,YAAA,CAAaM,GAAA,CAAIJ,UAAA,EAAYK,IAAI;IAClDH,OAAA,CAAQI,QAAQ;EAClB;EAEA,MAAMC,MAAA,GAAUC,KAAA,IAAe;IAC7B,MAAMF,QAAA,GAAWR,YAAA,CAAaW,IAAA,CAAKT,UAAA,EAAYQ,KAAK;IACpDN,OAAA,CAAQI,QAAQ;EAClB;EAEA,MAAMI,MAAA,GAAUL,IAAA,IAAc;IAC5B,MAAMC,QAAA,GAAWR,YAAA,CAAaY,MAAA,CAAOV,UAAA,EAAYK,IAAI;IACrDH,OAAA,CAAQI,QAAQ;EAClB;EAEA,MAAMK,KAAA,GAAQA,CAAA,KAAM;IAClB,MAAML,QAAA,GAAWR,YAAA,CAAaW,IAAA,CAAKT,UAAA,EAAY,EAAE;IACjDE,OAAA,CAAQI,QAAQ;EAClB;EAEA,OAAO;IAAEL,IAAA;IAAMG,GAAA;IAAKM,MAAA;IAAQH,MAAA;IAAQI;EAAM;AAC5C","ignoreList":[]}
@@ -1,30 +0,0 @@
1
- import { useState } from "react";
2
- import * as LocalStorage from "../utils/localstorage.native.js";
3
- var useLocalStorage = function useLocalStorage2(storageKey) {
4
- var [data, setData] = useState(LocalStorage.get(storageKey));
5
- var add = function add2(item) {
6
- var newItems = LocalStorage.add(storageKey, item);
7
- setData(newItems);
8
- };
9
- var update = function update2(items) {
10
- var newItems = LocalStorage.save(storageKey, items);
11
- setData(newItems);
12
- };
13
- var remove = function remove2(item) {
14
- var newItems = LocalStorage.remove(storageKey, item);
15
- setData(newItems);
16
- };
17
- var clear = function clear2() {
18
- var newItems = LocalStorage.save(storageKey, []);
19
- setData(newItems);
20
- };
21
- return {
22
- data,
23
- add,
24
- remove,
25
- update,
26
- clear
27
- };
28
- };
29
- export { useLocalStorage };
30
- //# sourceMappingURL=useLocalStorage.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useState","LocalStorage","useLocalStorage","useLocalStorage2","storageKey","data","setData","get","add","add2","item","newItems","update","update2","items","save","remove","remove2","clear","clear2"],"sources":["../../../src/hooks/useLocalStorage.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,QAAA,QAAgB;AACzB,YAAYC,YAAA,MAAkB;AAEvB,IAAAC,eAAM,YAAmBC,gBAAuBA,CAAAC,UAAA;EACrD,KAAAC,IAAO,EAAAC,OAAM,IAAON,QAAI,CAAAC,YAAS,CAAAM,GAAa,CAAAH,UAAI,EAAU;EAE5D,IAAAI,GAAM,YAAOC,IAAcA,CAAAC,IAAA;IACzB,IAAAC,QAAM,GAAAV,YAAW,CAAAO,GAAa,CAAAJ,UAAI,EAAAM,IAAY;IAC9CJ,OAAA,CAAQK,QAAQ;EAClB;EAEA,IAAAC,MAAM,YAAUC,OAAeA,CAAAC,KAAA;IAC7B,IAAAH,QAAM,GAAAV,YAAW,CAAAc,IAAa,CAAAX,UAAK,EAAAU,KAAY;IAC/CR,OAAA,CAAQK,QAAQ;EAClB;EAEA,IAAAK,MAAM,YAAUC,OAAcA,CAAAP,IAAA;IAC5B,IAAAC,QAAM,GAAAV,YAAW,CAAAe,MAAa,CAAAZ,UAAO,EAAAM,IAAY;IACjDJ,OAAA,CAAQK,QAAQ;EAClB;EAEA,IAAAO,KAAM,YAAcC,OAAA;IAClB,IAAAR,QAAM,GAAAV,YAAW,CAAAc,IAAa,CAAAX,UAAK,IAAY,CAAC;IAChDE,OAAA,CAAQK,QAAQ;EAClB;EAEA,OAAO;IACTN,IAAA","ignoreList":[]}
@@ -1,44 +0,0 @@
1
- const randomID = () => {
2
- return Date.now().toString(36) + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
3
- };
4
- const save = (storageKey, data) => {
5
- try {
6
- localStorage.setItem(storageKey, JSON.stringify(data));
7
- return get(storageKey);
8
- } catch (e) {
9
- return [];
10
- }
11
- };
12
- const get = storageKey => {
13
- try {
14
- const data = localStorage.getItem(storageKey);
15
- if (data) return JSON.parse(data);
16
- return [];
17
- } catch (e) {
18
- save(storageKey, []);
19
- return [];
20
- }
21
- };
22
- const add = (storageKey, item) => {
23
- const data = get(storageKey);
24
- const newData = [{
25
- ...item,
26
- ckStoreKey: randomID(),
27
- // unique key to identify the item so we can remove it later
28
- timestamp: /* @__PURE__ */new Date()
29
- }, ...data];
30
- save(storageKey, newData);
31
- return get(storageKey);
32
- };
33
- const remove = (storageKey, item) => {
34
- const data = get(storageKey);
35
- const newData = data.filter(i => i.ckStoreKey !== item.ckStoreKey);
36
- save(storageKey, newData);
37
- return get(storageKey);
38
- };
39
- const clear = storageKey => {
40
- save(storageKey, []);
41
- return get(storageKey);
42
- };
43
- export { add, clear, get, remove, save };
44
- //# sourceMappingURL=localstorage.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["randomID","Date","now","toString","Math","random","substring","save","storageKey","data","localStorage","setItem","JSON","stringify","get","e","getItem","parse","add","item","newData","ckStoreKey","timestamp","remove","filter","i","clear"],"sources":["../../../src/utils/localstorage.ts"],"sourcesContent":[null],"mappings":"AAMA,MAAMA,QAAA,GAAWA,CAAA,KAAM;EAIrB,OACEC,IAAA,CAAKC,GAAA,CAAI,EAAEC,QAAA,CAAS,EAAE,IACtBC,IAAA,CAAKC,MAAA,CAAO,EAAEF,QAAA,CAAS,EAAE,EAAEG,SAAA,C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O;EACxB,OAAON,GAAA,CAAIN,UAAU;AACvB;AAEO,MAAMkB,KAAA,GAASlB,UAAA,IAAuB;EAC3CD,IAAA,CAAKC,UAAA,EAAY,EAAE;EACnB,OAAOM,GAAA,CAAIN,UAAU;AACvB","ignoreList":[]}
@@ -1,46 +0,0 @@
1
- var randomID = function randomID2() {
2
- return Date.now().toString(36) + Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
3
- };
4
- var save = function save2(storageKey, data) {
5
- try {
6
- localStorage.setItem(storageKey, JSON.stringify(data));
7
- return get(storageKey);
8
- } catch (e) {
9
- return [];
10
- }
11
- };
12
- var get = function get2(storageKey) {
13
- try {
14
- var data = localStorage.getItem(storageKey);
15
- if (data) return JSON.parse(data);
16
- return [];
17
- } catch (e) {
18
- save(storageKey, []);
19
- return [];
20
- }
21
- };
22
- var add = function add2(storageKey, item) {
23
- var data = get(storageKey);
24
- var newData = [{
25
- ...item,
26
- ckStoreKey: randomID(),
27
- // unique key to identify the item so we can remove it later
28
- timestamp: /* @__PURE__ */new Date()
29
- }, ...data];
30
- save(storageKey, newData);
31
- return get(storageKey);
32
- };
33
- var remove = function remove2(storageKey, item) {
34
- var data = get(storageKey);
35
- var newData = data.filter(function (i) {
36
- return i.ckStoreKey !== item.ckStoreKey;
37
- });
38
- save(storageKey, newData);
39
- return get(storageKey);
40
- };
41
- var clear = function clear2(storageKey) {
42
- save(storageKey, []);
43
- return get(storageKey);
44
- };
45
- export { add, clear, get, remove, save };
46
- //# sourceMappingURL=localstorage.native.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["randomID","randomID2","Date","now","toString","Math","random","substring","save","save2","storageKey","data","localStorage","setItem","JSON","stringify","get","e","get2","getItem","parse","add","add2","item","newData","ckStoreKey","timestamp","remove","remove2","filter","i","clear","clear2"],"sources":["../../../src/utils/localstorage.ts"],"sourcesContent":[null],"mappings":"AAMA,IAAAA,QAAM,YAAiBC,UAAA;EAIrB,OACEC,IAAA,CAAKC,GAA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AmBC,CAAA,EAAE;IAC1C,OAAKA,CAAA,CAAAL,UAAY,KAAOF,IAAA,CAAAE,UAAA;EACxB;EACFjB,IAAA,CAAAE,UAAA,EAAAc,OAAA;EAEO,OAAMR,GAAA,CAAAN,UAAS;AACpB;AACA,IAAAqB,KAAO,YAAIC,MAAUA,CAAAtB,UAAA;EACvBF,IAAA,CAAAE,UAAA","ignoreList":[]}
@@ -1,28 +0,0 @@
1
- import { useState } from "react";
2
- import * as LocalStorage from "../utils/localstorage";
3
-
4
- export const useLocalStorage = (storageKey: string) => {
5
- const [data, setData] = useState(LocalStorage.get(storageKey));
6
-
7
- const add = (item: any) => {
8
- const newItems = LocalStorage.add(storageKey, item);
9
- setData(newItems);
10
- };
11
-
12
- const update = (items: any) => {
13
- const newItems = LocalStorage.save(storageKey, items);
14
- setData(newItems);
15
- };
16
-
17
- const remove = (item: any) => {
18
- const newItems = LocalStorage.remove(storageKey, item);
19
- setData(newItems);
20
- };
21
-
22
- const clear = () => {
23
- const newItems = LocalStorage.save(storageKey, []);
24
- setData(newItems);
25
- };
26
-
27
- return { data, add, remove, update, clear };
28
- };
@@ -1,63 +0,0 @@
1
- /**
2
- * LocalStorage helper functions to save and retrieve data on a per-app basis
3
- * e.g recently connected wallets, transactions, etc.
4
- */
5
-
6
- //import { randomUUID as randomID } from 'crypto';
7
- const randomID = () => {
8
- // TODO: use randomUUID when it's supported in all browsers
9
- // https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID
10
- // Until then, use this fallback
11
- return (
12
- Date.now().toString(36) +
13
- Math.random().toString(36).substring(2, 15) +
14
- Math.random().toString(36).substring(2, 15)
15
- );
16
- };
17
-
18
- export const save = (storageKey: string, data: any[]) => {
19
- try {
20
- localStorage.setItem(storageKey, JSON.stringify(data));
21
- return get(storageKey);
22
- } catch (e) {
23
- return [];
24
- }
25
- };
26
-
27
- export const get = (storageKey: string) => {
28
- try {
29
- const data = localStorage.getItem(storageKey);
30
- if (data) return JSON.parse(data);
31
- return [];
32
- } catch (e) {
33
- // error parsing data, reset
34
- save(storageKey, []);
35
- return [];
36
- }
37
- };
38
-
39
- export const add = (storageKey: string, item: any) => {
40
- const data = get(storageKey);
41
- const newData = [
42
- {
43
- ...item,
44
- ckStoreKey: randomID(), // unique key to identify the item so we can remove it later
45
- timestamp: new Date(),
46
- },
47
- ...data,
48
- ];
49
- save(storageKey, newData);
50
- return get(storageKey);
51
- };
52
-
53
- export const remove = (storageKey: string, item: any) => {
54
- const data = get(storageKey);
55
- const newData = data.filter((i: any) => i.ckStoreKey !== item.ckStoreKey);
56
- save(storageKey, newData);
57
- return get(storageKey);
58
- };
59
-
60
- export const clear = (storageKey: string) => {
61
- save(storageKey, []);
62
- return get(storageKey);
63
- };
@@ -1,8 +0,0 @@
1
- export declare const useLocalStorage: (storageKey: string) => {
2
- data: any;
3
- add: (item: any) => void;
4
- remove: (item: any) => void;
5
- update: (items: any) => void;
6
- clear: () => void;
7
- };
8
- //# sourceMappingURL=useLocalStorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLocalStorage.d.ts","sourceRoot":"","sources":["../../src/hooks/useLocalStorage.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,GAAI,YAAY,MAAM;;gBAG7B,GAAG;mBAUA,GAAG;oBALF,GAAG;;CAgB3B,CAAC"}
@@ -1,10 +0,0 @@
1
- /**
2
- * LocalStorage helper functions to save and retrieve data on a per-app basis
3
- * e.g recently connected wallets, transactions, etc.
4
- */
5
- export declare const save: (storageKey: string, data: any[]) => any;
6
- export declare const get: (storageKey: string) => any;
7
- export declare const add: (storageKey: string, item: any) => any;
8
- export declare const remove: (storageKey: string, item: any) => any;
9
- export declare const clear: (storageKey: string) => any;
10
- //# sourceMappingURL=localstorage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localstorage.d.ts","sourceRoot":"","sources":["../../src/utils/localstorage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,eAAO,MAAM,IAAI,GAAI,YAAY,MAAM,EAAE,MAAM,GAAG,EAAE,QAOnD,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,YAAY,MAAM,QAUrC,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,YAAY,MAAM,EAAE,MAAM,GAAG,QAYhD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,YAAY,MAAM,EAAE,MAAM,GAAG,QAKnD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,YAAY,MAAM,QAGvC,CAAC"}