electrum-store
Advanced tools
Comparing version 0.1.1 to 0.2.1
{ | ||
"name": "electrum-store", | ||
"version": "0.1.1", | ||
"version": "0.2.1", | ||
"description": "Electrum store provides a store implementation tailored for Electrum.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
'use strict'; | ||
import {Colors, Spacing, Timing} from './themes/default'; | ||
import { | ||
paletteBuilder, | ||
shapesBuilder, | ||
transitionsBuilder, | ||
typoBuilder | ||
} from './themes/default'; | ||
/******************************************************************************/ | ||
@@ -10,13 +19,17 @@ | ||
class Theme { | ||
constructor (name, key, typo, palette, colors, transitions, spacing, shapes) { | ||
constructor (name, key, colors, palette, shapes, spacing, timing, transitions, typo) { | ||
if (key !== secretKey) { | ||
throw new Error ('Do not call Theme constructor directly; use Theme.create instead'); | ||
} | ||
if (!typo.font) { | ||
throw new Error ('Typo has no default font'); | ||
} | ||
this._name = name; | ||
this._typo = typo; | ||
this._colors = colors; | ||
this._palette = palette; | ||
this._colors = colors; | ||
this._shapes = shapes; | ||
this._spacing = spacing; | ||
this._timing = timing; | ||
this._transitions = transitions; | ||
this._spacing = spacing; | ||
this._shapes = shapes; | ||
this._typo = typo; | ||
} | ||
@@ -28,4 +41,4 @@ | ||
get typo () { | ||
return this._typo; | ||
get colors () { | ||
return this._colors; | ||
} | ||
@@ -37,6 +50,14 @@ | ||
get colors () { | ||
return this._colors; | ||
get shapes () { | ||
return this._shapes; | ||
} | ||
get spacing () { | ||
return this._spacing; | ||
} | ||
get timing () { | ||
return this._timing; | ||
} | ||
get transitions () { | ||
@@ -46,12 +67,24 @@ return this._transitions; | ||
get spacing () { | ||
return this._spacing; | ||
get typo () { | ||
return this._typo; | ||
} | ||
get shapes () { | ||
return this._shapes; | ||
} | ||
static create (name) { | ||
if ((typeof name !== 'string') || | ||
(name.length === 0)) { | ||
throw new Error ('name must be a valid string'); | ||
} | ||
const Palette = paletteBuilder (Colors); | ||
const Shapes = shapesBuilder (Spacing); | ||
const Transitions = transitionsBuilder (Timing); | ||
const Typo = typoBuilder (Spacing); | ||
static create (name) { | ||
return new Theme (name, secretKey, {}, {}, {}, {}, {}, {}); | ||
return new Theme (name, secretKey, | ||
Colors, | ||
Palette, | ||
Shapes, | ||
Spacing, | ||
Timing, | ||
Transitions, | ||
Typo); | ||
} | ||
@@ -58,0 +91,0 @@ } |
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
38923
27
1062