@polkadot/ui-settings
Advanced tools
Comparing version 2.9.15 to 2.10.1
@@ -1086,2 +1086,12 @@ (function (global, factory) { | ||
}]; | ||
const STORAGE_DEFAULT = 'off'; | ||
const STORAGE = [{ | ||
info: 'on', | ||
text: 'Allow local in-browser account storage', | ||
value: 'on' | ||
}, { | ||
info: 'off', | ||
text: 'Do not allow local in-browser account storage', | ||
value: 'off' | ||
}]; | ||
@@ -1104,2 +1114,3 @@ function withDefault(options, option, fallback) { | ||
#prefix; | ||
#storage; | ||
#uiMode; | ||
@@ -1121,6 +1132,7 @@ #uiTheme; | ||
this.#locking = settings.locking || LOCKING_DEFAULT; | ||
this.#notification = settings.notification || NOTIFICATION_DEFAULT; | ||
this.#prefix = util$7.isUndefined(settings.prefix) ? PREFIX_DEFAULT : settings.prefix; | ||
this.#storage = withDefault(STORAGE, settings.storage, STORAGE_DEFAULT); | ||
this.#uiMode = settings.uiMode || UIMODE_DEFAULT; | ||
this.#uiTheme = settings.uiTheme || UITHEME_DEFAULT; | ||
this.#notification = settings.notification || NOTIFICATION_DEFAULT; | ||
} | ||
@@ -1154,2 +1166,5 @@ get camera() { | ||
} | ||
get storage() { | ||
return this.#storage; | ||
} | ||
get uiMode() { | ||
@@ -1188,2 +1203,5 @@ return this.#uiMode; | ||
} | ||
get availableStorage() { | ||
return STORAGE; | ||
} | ||
get availableUIModes() { | ||
@@ -1206,2 +1224,3 @@ return UIMODES; | ||
prefix: this.#prefix, | ||
storage: this.#storage, | ||
uiMode: this.#uiMode, | ||
@@ -1221,2 +1240,3 @@ uiTheme: this.#uiTheme | ||
this.#prefix = util$7.isUndefined(settings.prefix) ? this.#prefix : settings.prefix; | ||
this.#storage = settings.storage || this.#storage; | ||
this.#uiMode = settings.uiMode || this.#uiMode; | ||
@@ -1245,3 +1265,3 @@ this.#uiTheme = settings.uiTheme || this.#uiTheme; | ||
type: 'esm', | ||
version: '2.9.15' | ||
version: '2.10.1' | ||
}; | ||
@@ -1248,0 +1268,0 @@ |
@@ -87,2 +87,3 @@ "use strict"; | ||
}); | ||
exports.STORAGE_DEFAULT = exports.STORAGE = void 0; | ||
Object.defineProperty(exports, "UIMODES", { | ||
@@ -145,2 +146,14 @@ enumerable: true, | ||
}]; | ||
exports.LOCKING = LOCKING; | ||
exports.LOCKING = LOCKING; | ||
const STORAGE_DEFAULT = 'off'; | ||
exports.STORAGE_DEFAULT = STORAGE_DEFAULT; | ||
const STORAGE = [{ | ||
info: 'on', | ||
text: 'Allow local in-browser account storage', | ||
value: 'on' | ||
}, { | ||
info: 'off', | ||
text: 'Do not allow local in-browser account storage', | ||
value: 'off' | ||
}]; | ||
exports.STORAGE = STORAGE; |
@@ -16,4 +16,4 @@ "use strict"; | ||
type: 'cjs', | ||
version: '2.9.15' | ||
version: '2.10.1' | ||
}; | ||
exports.packageInfo = packageInfo; |
@@ -36,2 +36,3 @@ "use strict"; | ||
#prefix; | ||
#storage; | ||
#uiMode; | ||
@@ -55,6 +56,7 @@ #uiTheme; | ||
this.#locking = settings.locking || _defaults.LOCKING_DEFAULT; | ||
this.#notification = settings.notification || _defaults.NOTIFICATION_DEFAULT; | ||
this.#prefix = (0, _util.isUndefined)(settings.prefix) ? _defaults.PREFIX_DEFAULT : settings.prefix; | ||
this.#storage = withDefault(_defaults.STORAGE, settings.storage, _defaults.STORAGE_DEFAULT); | ||
this.#uiMode = settings.uiMode || _defaults.UIMODE_DEFAULT; | ||
this.#uiTheme = settings.uiTheme || _defaults.UITHEME_DEFAULT; | ||
this.#notification = settings.notification || _defaults.NOTIFICATION_DEFAULT; | ||
} | ||
@@ -88,2 +90,5 @@ get camera() { | ||
} | ||
get storage() { | ||
return this.#storage; | ||
} | ||
get uiMode() { | ||
@@ -122,2 +127,5 @@ return this.#uiMode; | ||
} | ||
get availableStorage() { | ||
return _defaults.STORAGE; | ||
} | ||
get availableUIModes() { | ||
@@ -140,2 +148,3 @@ return _defaults.UIMODES; | ||
prefix: this.#prefix, | ||
storage: this.#storage, | ||
uiMode: this.#uiMode, | ||
@@ -155,2 +164,3 @@ uiTheme: this.#uiTheme | ||
this.#prefix = (0, _util.isUndefined)(settings.prefix) ? this.#prefix : settings.prefix; | ||
this.#storage = settings.storage || this.#storage; | ||
this.#uiMode = settings.uiMode || this.#uiMode; | ||
@@ -157,0 +167,0 @@ this.#uiTheme = settings.uiTheme || this.#uiTheme; |
@@ -12,2 +12,4 @@ import type { Option } from '../types'; | ||
declare const LOCKING: Option[]; | ||
export { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN_DEFAULT, LEDGER_CONN, LOCKING_DEFAULT, LOCKING, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES }; | ||
declare const STORAGE_DEFAULT = "off"; | ||
declare const STORAGE: Option[]; | ||
export { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN_DEFAULT, LEDGER_CONN, LOCKING_DEFAULT, LOCKING, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, STORAGE, STORAGE_DEFAULT, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES }; |
@@ -30,2 +30,12 @@ // Copyright 2017-2023 @polkadot/ui-settings authors & contributors | ||
}]; | ||
export { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN_DEFAULT, LEDGER_CONN, LOCKING_DEFAULT, LOCKING, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES }; | ||
const STORAGE_DEFAULT = 'off'; | ||
const STORAGE = [{ | ||
info: 'on', | ||
text: 'Allow local in-browser account storage', | ||
value: 'on' | ||
}, { | ||
info: 'off', | ||
text: 'Do not allow local in-browser account storage', | ||
value: 'off' | ||
}]; | ||
export { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN_DEFAULT, LEDGER_CONN, LOCKING_DEFAULT, LOCKING, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, STORAGE, STORAGE_DEFAULT, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES }; |
@@ -20,3 +20,3 @@ { | ||
"type": "module", | ||
"version": "2.9.15", | ||
"version": "2.10.1", | ||
"main": "./cjs/index.js", | ||
@@ -112,4 +112,4 @@ "module": "./index.js", | ||
"@babel/runtime": "^7.20.7", | ||
"@polkadot/networks": "^10.2.3", | ||
"@polkadot/util": "^10.2.3", | ||
"@polkadot/networks": "^10.2.6", | ||
"@polkadot/util": "^10.2.6", | ||
"eventemitter3": "^4.0.7", | ||
@@ -116,0 +116,0 @@ "store": "^2.0.12" |
@@ -10,3 +10,3 @@ // Copyright 2017-2023 @polkadot/ui-settings authors & contributors | ||
type: 'esm', | ||
version: '2.9.15' | ||
version: '2.10.1' | ||
}; |
@@ -16,2 +16,3 @@ import type { Endpoint, Option, SettingsStruct } from './types'; | ||
get prefix(): number; | ||
get storage(): string; | ||
get uiMode(): string; | ||
@@ -28,2 +29,3 @@ get uiTheme(): string; | ||
get availablePrefixes(): Option[]; | ||
get availableStorage(): Option[]; | ||
get availableUIModes(): Option[]; | ||
@@ -30,0 +32,0 @@ get availableUIThemes(): Option[]; |
@@ -7,3 +7,3 @@ // Copyright 2017-2023 @polkadot/ui-settings authors & contributors | ||
import { hasProcess, isUndefined } from '@polkadot/util'; | ||
import { CAMERA, CAMERA_DEFAULT, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING, LOCKING_DEFAULT, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from "./defaults/index.js"; | ||
import { CAMERA, CAMERA_DEFAULT, CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING, LOCKING_DEFAULT, NOTIFICATION_DEFAULT, PREFIX_DEFAULT, PREFIXES, STORAGE, STORAGE_DEFAULT, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from "./defaults/index.js"; | ||
function withDefault(options, option, fallback) { | ||
@@ -27,2 +27,3 @@ const _option = option || fallback; | ||
#prefix; | ||
#storage; | ||
#uiMode; | ||
@@ -46,6 +47,7 @@ #uiTheme; | ||
this.#locking = settings.locking || LOCKING_DEFAULT; | ||
this.#notification = settings.notification || NOTIFICATION_DEFAULT; | ||
this.#prefix = isUndefined(settings.prefix) ? PREFIX_DEFAULT : settings.prefix; | ||
this.#storage = withDefault(STORAGE, settings.storage, STORAGE_DEFAULT); | ||
this.#uiMode = settings.uiMode || UIMODE_DEFAULT; | ||
this.#uiTheme = settings.uiTheme || UITHEME_DEFAULT; | ||
this.#notification = settings.notification || NOTIFICATION_DEFAULT; | ||
} | ||
@@ -79,2 +81,5 @@ get camera() { | ||
} | ||
get storage() { | ||
return this.#storage; | ||
} | ||
get uiMode() { | ||
@@ -113,2 +118,5 @@ return this.#uiMode; | ||
} | ||
get availableStorage() { | ||
return STORAGE; | ||
} | ||
get availableUIModes() { | ||
@@ -131,2 +139,3 @@ return UIMODES; | ||
prefix: this.#prefix, | ||
storage: this.#storage, | ||
uiMode: this.#uiMode, | ||
@@ -146,2 +155,3 @@ uiTheme: this.#uiTheme | ||
this.#prefix = isUndefined(settings.prefix) ? this.#prefix : settings.prefix; | ||
this.#storage = settings.storage || this.#storage; | ||
this.#uiMode = settings.uiMode || this.#uiMode; | ||
@@ -148,0 +158,0 @@ this.#uiTheme = settings.uiTheme || this.#uiTheme; |
@@ -17,2 +17,3 @@ export type Option = { | ||
prefix: number; | ||
storage: string; | ||
uiMode: string; | ||
@@ -19,0 +20,0 @@ uiTheme: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88154
2367
Updated@polkadot/networks@^10.2.6
Updated@polkadot/util@^10.2.6