@polkadot/ui-settings
Advanced tools
Comparing version 2.9.12 to 2.9.13
@@ -1235,3 +1235,3 @@ (function (global, factory) { | ||
type: 'esm', | ||
version: '2.9.12' | ||
version: '2.9.13' | ||
}; | ||
@@ -1238,0 +1238,0 @@ |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { Settings, settings } from "./Settings.js"; | ||
@@ -4,0 +5,0 @@ export { ENDPOINT_DEFAULT, ICON_DEFAULT, ICON_DEFAULT_HOST, LANGUAGE_DEFAULT, LOCKING_DEFAULT, PREFIX_DEFAULT, UIMODE_DEFAULT, UITHEME_DEFAULT } from "./defaults/index.js"; |
@@ -78,9 +78,5 @@ "use strict"; | ||
}); | ||
var _Settings = require("./Settings"); | ||
var _defaults = require("./defaults"); | ||
var _chains = require("./defaults/chains"); | ||
var _packageInfo = require("./packageInfo"); |
@@ -7,9 +7,7 @@ "use strict"; | ||
exports.chains = void 0; | ||
var _networks = require("@polkadot/networks"); | ||
var _util = require("@polkadot/util"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const chains = _networks.selectableNetworks.filter(n => n.genesisHash.length).reduce((chains, _ref) => { | ||
@@ -24,3 +22,2 @@ let { | ||
}, {}); | ||
exports.chains = chains; |
@@ -9,2 +9,3 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const CRYPTOS = [{ | ||
@@ -11,0 +12,0 @@ info: 'sr25519', |
@@ -9,2 +9,3 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const ENDPOINTS = [{ | ||
@@ -11,0 +12,0 @@ info: 'local', |
@@ -111,15 +111,10 @@ "use strict"; | ||
}); | ||
var _crypto = require("./crypto"); | ||
var _endpoints = require("./endpoints"); | ||
var _ledger = require("./ledger"); | ||
var _ss = require("./ss58"); | ||
var _ui = require("./ui"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const CAMERA_DEFAULT = 'off'; | ||
@@ -126,0 +121,0 @@ exports.CAMERA_DEFAULT = CAMERA_DEFAULT; |
@@ -9,2 +9,3 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const LEDGER_CONN_DEFAULT = 'none'; | ||
@@ -16,3 +17,4 @@ exports.LEDGER_CONN_DEFAULT = LEDGER_CONN_DEFAULT; | ||
value: 'none' | ||
}, // Deprecated | ||
}, | ||
// Deprecated | ||
// { | ||
@@ -19,0 +21,0 @@ // info: 'u2f', |
@@ -7,7 +7,6 @@ "use strict"; | ||
exports.PREFIX_DEFAULT = exports.PREFIXES = void 0; | ||
var _networks = require("@polkadot/networks"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const PREFIX_DEFAULT = -1; | ||
@@ -20,3 +19,2 @@ exports.PREFIX_DEFAULT = PREFIX_DEFAULT; | ||
}; | ||
const networks = _networks.availableNetworks.map(_ref => { | ||
@@ -34,4 +32,3 @@ let { | ||
}); | ||
const PREFIXES = [defaultNetwork, ...networks]; | ||
exports.PREFIXES = PREFIXES; |
@@ -9,4 +9,5 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// matches https://polkadot.js.org & https://*.polkadot.io | ||
const isPolkadot = typeof window !== 'undefined' && window.location.host.includes('polkadot'); | ||
exports.isPolkadot = isPolkadot; |
@@ -7,7 +7,6 @@ "use strict"; | ||
exports.UITHEME_DEFAULT = exports.UITHEMES = exports.UIMODE_DEFAULT = exports.UIMODES = exports.NOTIFICATION_DEFAULT = exports.LANGUAGE_DEFAULT = exports.ICON_DEFAULT_HOST = exports.ICON_DEFAULT = exports.ICONS = void 0; | ||
var _type = require("./type"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
const LANGUAGE_DEFAULT = 'default'; | ||
@@ -14,0 +13,0 @@ exports.LANGUAGE_DEFAULT = LANGUAGE_DEFAULT; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _util = require("@polkadot/util"); | ||
var _detectOther = _interopRequireDefault(require("./detectOther")); | ||
var _packageInfo = require("./packageInfo"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
(0, _util.detectPackage)(_packageInfo.packageInfo, null, _detectOther.default); |
@@ -8,5 +8,3 @@ "use strict"; | ||
exports.default = void 0; | ||
var _bundle = require("./bundle"); | ||
Object.keys(_bundle).forEach(function (key) { | ||
@@ -13,0 +11,0 @@ if (key === "default" || key === "__esModule") return; |
@@ -9,3 +9,5 @@ "use strict"; | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
const packageInfo = { | ||
@@ -15,4 +17,4 @@ name: '@polkadot/ui-settings', | ||
type: 'cjs', | ||
version: '2.9.12' | ||
version: '2.9.13' | ||
}; | ||
exports.packageInfo = packageInfo; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,16 +8,11 @@ value: true | ||
exports.settings = exports.Settings = void 0; | ||
var _eventemitter = _interopRequireDefault(require("eventemitter3")); | ||
var _store = _interopRequireDefault(require("store")); | ||
var _util = require("@polkadot/util"); | ||
var _defaults = require("./defaults"); | ||
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
function withDefault(options, option, fallback) { | ||
const _option = option || fallback; | ||
return options.some(_ref => { | ||
@@ -31,7 +25,7 @@ let { | ||
} | ||
class Settings { | ||
#emitter; | ||
#apiType; // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
#apiType; | ||
// will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
#apiUrl; | ||
@@ -47,7 +41,7 @@ #camera; | ||
#notification; | ||
constructor() { | ||
const settings = _store.default.get('settings') || {}; | ||
this.#emitter = new _eventemitter.default(); // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
this.#emitter = new _eventemitter.default(); | ||
// will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
this.#apiUrl = typeof settings.apiUrl === 'string' && settings.apiUrl || _util.hasProcess && process.env && process.env.WS_URL || _defaults.ENDPOINT_DEFAULT.value; | ||
@@ -68,91 +62,68 @@ this.#apiType = { | ||
} | ||
get camera() { | ||
return this.#camera; | ||
} | ||
get apiType() { | ||
return this.#apiType; | ||
} | ||
get apiUrl() { | ||
return this.#apiUrl; | ||
} | ||
get i18nLang() { | ||
return this.#i18nLang; | ||
} | ||
get icon() { | ||
return this.#icon; | ||
} | ||
get notification() { | ||
return this.#notification; | ||
} | ||
get ledgerConn() { | ||
return this.#ledgerConn; | ||
} | ||
get locking() { | ||
return this.#locking; | ||
} | ||
get prefix() { | ||
return this.#prefix; | ||
} | ||
get uiMode() { | ||
return this.#uiMode; | ||
} | ||
get uiTheme() { | ||
return this.#uiTheme; | ||
} | ||
get availableCamera() { | ||
return _defaults.CAMERA; | ||
} | ||
get availableCryptos() { | ||
return _defaults.CRYPTOS; | ||
} | ||
get availableCryptosEth() { | ||
return _defaults.CRYPTOS_ETH; | ||
} | ||
get availableCryptosLedger() { | ||
return _defaults.CRYPTOS_LEDGER; | ||
} | ||
get availableIcons() { | ||
return _defaults.ICONS; | ||
} | ||
get availableLedgerConn() { | ||
return _defaults.LEDGER_CONN; | ||
} | ||
get availableLocking() { | ||
return _defaults.LOCKING; | ||
} | ||
get availableNodes() { | ||
return _defaults.ENDPOINTS; | ||
} | ||
get availablePrefixes() { | ||
return _defaults.PREFIXES; | ||
} | ||
get availableUIModes() { | ||
return _defaults.UIMODES; | ||
} | ||
get availableUIThemes() { | ||
return _defaults.UITHEMES; | ||
} | ||
get() { | ||
@@ -173,3 +144,2 @@ return { | ||
} | ||
set(settings) { | ||
@@ -188,16 +158,11 @@ this.#apiType = settings.apiType || this.#apiType; | ||
const newValues = this.get(); | ||
_store.default.set('settings', newValues); | ||
this.#emitter.emit('change', newValues); | ||
} | ||
on(type, cb) { | ||
this.#emitter.on(type, cb); | ||
} | ||
} | ||
exports.Settings = Settings; | ||
const settings = new Settings(); | ||
exports.settings = settings; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { selectableNetworks } from '@polkadot/networks'; | ||
@@ -4,0 +5,0 @@ import { objectSpread } from '@polkadot/util'; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export const CRYPTOS = [{ | ||
@@ -4,0 +5,0 @@ info: 'sr25519', |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export const ENDPOINTS = [{ | ||
@@ -4,0 +5,0 @@ info: 'local', |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { CRYPTOS, CRYPTOS_ETH, CRYPTOS_LEDGER } from "./crypto.js"; | ||
@@ -4,0 +5,0 @@ import { ENDPOINT_DEFAULT, ENDPOINTS } from "./endpoints.js"; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
export const LEDGER_CONN_DEFAULT = 'none'; | ||
@@ -8,3 +9,4 @@ export const LEDGER_CONN = [{ | ||
value: 'none' | ||
}, // Deprecated | ||
}, | ||
// Deprecated | ||
// { | ||
@@ -11,0 +13,0 @@ // info: 'u2f', |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { availableNetworks } from '@polkadot/networks'; | ||
@@ -4,0 +5,0 @@ export const PREFIX_DEFAULT = -1; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// matches https://polkadot.js.org & https://*.polkadot.io | ||
export const isPolkadot = typeof window !== 'undefined' && window.location.host.includes('polkadot'); |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { isPolkadot } from "./type.js"; | ||
@@ -4,0 +5,0 @@ const LANGUAGE_DEFAULT = 'default'; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Empty template, auto-generated by @polkadot/dev | ||
export default []; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
import { detectPackage } from '@polkadot/util'; | ||
@@ -5,0 +7,0 @@ import others from "./detectOther.js"; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { settings } from "./bundle.js"; | ||
export * from "./bundle.js"; | ||
export default settings; |
@@ -20,3 +20,3 @@ { | ||
"type": "module", | ||
"version": "2.9.12", | ||
"version": "2.9.13", | ||
"main": "./cjs/index.js", | ||
@@ -111,5 +111,5 @@ "module": "./index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.19.4", | ||
"@polkadot/networks": "^10.1.11", | ||
"@polkadot/util": "^10.1.11", | ||
"@babel/runtime": "^7.20.1", | ||
"@polkadot/networks": "^10.1.12", | ||
"@polkadot/util": "^10.1.12", | ||
"eventemitter3": "^4.0.7", | ||
@@ -116,0 +116,0 @@ "store": "^2.0.12" |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Do not edit, auto-generated by @polkadot/dev | ||
export const packageInfo = { | ||
@@ -8,3 +10,3 @@ name: '@polkadot/ui-settings', | ||
type: 'esm', | ||
version: '2.9.12' | ||
version: '2.9.13' | ||
}; |
// Copyright 2017-2022 @polkadot/ui-settings authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import EventEmitter from 'eventemitter3'; | ||
@@ -7,6 +8,4 @@ import store from 'store'; | ||
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"; | ||
function withDefault(options, option, fallback) { | ||
const _option = option || fallback; | ||
return options.some(({ | ||
@@ -16,7 +15,7 @@ value | ||
} | ||
export class Settings { | ||
#emitter; | ||
#apiType; // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
#apiType; | ||
// will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
#apiUrl; | ||
@@ -32,7 +31,7 @@ #camera; | ||
#notification; | ||
constructor() { | ||
const settings = store.get('settings') || {}; | ||
this.#emitter = new EventEmitter(); // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
this.#emitter = new EventEmitter(); | ||
// will become deprecated for supporting substrate connect light clients. apiType structure should be used instead | ||
this.#apiUrl = typeof settings.apiUrl === 'string' && settings.apiUrl || hasProcess && process.env && process.env.WS_URL || ENDPOINT_DEFAULT.value; | ||
@@ -53,91 +52,68 @@ this.#apiType = { | ||
} | ||
get camera() { | ||
return this.#camera; | ||
} | ||
get apiType() { | ||
return this.#apiType; | ||
} | ||
get apiUrl() { | ||
return this.#apiUrl; | ||
} | ||
get i18nLang() { | ||
return this.#i18nLang; | ||
} | ||
get icon() { | ||
return this.#icon; | ||
} | ||
get notification() { | ||
return this.#notification; | ||
} | ||
get ledgerConn() { | ||
return this.#ledgerConn; | ||
} | ||
get locking() { | ||
return this.#locking; | ||
} | ||
get prefix() { | ||
return this.#prefix; | ||
} | ||
get uiMode() { | ||
return this.#uiMode; | ||
} | ||
get uiTheme() { | ||
return this.#uiTheme; | ||
} | ||
get availableCamera() { | ||
return CAMERA; | ||
} | ||
get availableCryptos() { | ||
return CRYPTOS; | ||
} | ||
get availableCryptosEth() { | ||
return CRYPTOS_ETH; | ||
} | ||
get availableCryptosLedger() { | ||
return CRYPTOS_LEDGER; | ||
} | ||
get availableIcons() { | ||
return ICONS; | ||
} | ||
get availableLedgerConn() { | ||
return LEDGER_CONN; | ||
} | ||
get availableLocking() { | ||
return LOCKING; | ||
} | ||
get availableNodes() { | ||
return ENDPOINTS; | ||
} | ||
get availablePrefixes() { | ||
return PREFIXES; | ||
} | ||
get availableUIModes() { | ||
return UIMODES; | ||
} | ||
get availableUIThemes() { | ||
return UITHEMES; | ||
} | ||
get() { | ||
@@ -158,3 +134,2 @@ return { | ||
} | ||
set(settings) { | ||
@@ -176,8 +151,6 @@ this.#apiType = settings.apiType || this.#apiType; | ||
} | ||
on(type, cb) { | ||
this.#emitter.on(type, cb); | ||
} | ||
} | ||
export const settings = new Settings(); |
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
2296
86213
Updated@babel/runtime@^7.20.1
Updated@polkadot/networks@^10.1.12
Updated@polkadot/util@^10.1.12