This repository has been archived by the owner on Jun 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v1.0.0' into stable
- Loading branch information
Showing
47 changed files
with
945 additions
and
608 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 1.0.0 | ||
|
||
Remixer v1.0.0 Release. | ||
|
||
## 0.7.0 | ||
|
||
### New Features | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Developing Remixer | ||
|
||
### Setting up your development environment | ||
|
||
First you'll need a recent version of [Node.js](https://nodejs.org) to work | ||
with Remixer-js. | ||
|
||
Once node is installed, simply clone our repo (or your fork of it) and | ||
run `npm install`. | ||
|
||
```bash | ||
git clone [email protected]:material-foundation/material-remixer-js.git | ||
cd material-remixer-js && npm install | ||
``` | ||
|
||
### Typescript | ||
|
||
The source code for Remixer-js is written in | ||
[Typescript](https://www.typescriptlang.org), and compiled to es5 javascript for | ||
distribution. | ||
|
||
### Building Remixer | ||
|
||
Use any of the following npm scripts to build dev or prod versions of Remixer-js. | ||
|
||
```bash | ||
# Builds an unminified version of Remixer-js within the build folder. | ||
npm run build:dev | ||
|
||
# Builds a minified version. | ||
npm run build:prod | ||
|
||
# Builds both unminified and minified versions. | ||
npm run build | ||
``` | ||
|
||
### Running the development server | ||
|
||
We use [weback dev server](https://webpack.js.org/configuration/dev-server) for | ||
hosting and live-reloading of any code changes. | ||
|
||
```bash | ||
npm run dev | ||
open http://localhost:8080 | ||
``` | ||
|
||
### Linting | ||
|
||
```bash | ||
# Lint both CSS/LESS using lesshint. | ||
npm run lint:css | ||
|
||
# Lint typescript using tslint. | ||
npm run lint:ts | ||
|
||
# Lints both css and ts. | ||
npm run lint | ||
``` | ||
|
||
### Testing and Code Coverage | ||
|
||
Testing uses the [karma](https://karma-runner.github.io) test runner with | ||
[mocha](https://mochajs.org/) flavored testing framework. Code coverage | ||
is reported by [istanbul](https://www.npmjs.com/package/istanbul-instrumenter-loader). | ||
|
||
```bash | ||
# Run tests and code coverage once. | ||
npm run test | ||
|
||
# Run with auto-watch indefinitely. | ||
npm run test:watch | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
# Remixer API | ||
The Remixer class is a singleton class that keeps track of all the Variables and deals with saving/syncing its values. | ||
|
||
The following methods are the most commonly used to enable Remixer in your app. | ||
|
||
- [remixer.start()](#start-static) | ||
- [remixer.stop()](#stop-static) | ||
- [remixer.addBooleanVariable()](#addbooleanvariable-static) | ||
- [remixer.addColorVariable()](#addcolorvariable-static) | ||
- [remixer.addNumberVariable()](#addnumbervariable-static) | ||
- [remixer.addRangeVariable()](#addrangevariable-static) | ||
- [remixer.addStringVariable()](#addstringvariable-static) | ||
|
||
--- | ||
|
||
### start <sub><sup>`STATIC`</sup></sub> | ||
|
||
Appends the HTML iFrame to body of client app. Attaches key listener to toggle Overlay visibility. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.start(); | ||
remixer.start(remoteConfig); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **remoteConfig:** *object* | ||
|
||
The optional firebase configuration. Provide this configuration if you wish to use the remote controller. | ||
|
||
```javascript | ||
var remoteConfig = { | ||
apiKey: "<API_KEY>", | ||
authDomain: "<PROJECT_ID>.firebaseapp.com", | ||
databaseURL: "https://<DATABASE_NAME>.firebaseio.com" | ||
... | ||
}; | ||
``` | ||
|
||
#### Returns void | ||
|
||
--- | ||
|
||
### stop <sub><sup>`STATIC`</sup></sub> | ||
|
||
Removes iFrame and attached key listener. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.stop(); | ||
``` | ||
|
||
#### Returns void | ||
|
||
--- | ||
|
||
### addBooleanVariable <sub><sup>`STATIC`</sup></sub> | ||
|
||
Adds a boolean Variable to array of Variables with optional callback. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.addBooleanVariable(key, defaultValue); | ||
remixer.addBooleanVariable(key, defaultValue, callback(variable) { ... } ); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **key:** *string* | ||
|
||
The key of the Variable. | ||
|
||
- **defaultValue:** *boolean* | ||
|
||
The initial default value of the variable. | ||
|
||
- `OPTIONAL` **callback:** *function* | ||
|
||
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument. | ||
|
||
#### Returns [BooleanVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_booleanvariable_.booleanvariable.html) | ||
|
||
--- | ||
|
||
### addColorVariable <sub><sup>`STATIC`</sup></sub> | ||
|
||
Adds a color variable to array of variables with optional callback. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.addColorVariable(key, defaultValue); | ||
remixer.addColorVariable(key, defaultValue, limitedToValues); | ||
remixer.addColorVariable(key, defaultValue, limitedToValues, callback(variable) { ... } ); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **key:** *string* | ||
|
||
The key of the Variable. | ||
|
||
- **defaultValue:** *string* | ||
|
||
The initial default value of the variable. | ||
|
||
- `OPTIONAL` **limitedToValues:** *string[]* | ||
|
||
The optional array of allowed values. | ||
|
||
- `OPTIONAL` **callback:** *function* | ||
|
||
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument. | ||
|
||
#### Returns [ColorVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_colorvariable_.colorvariable.html) | ||
|
||
--- | ||
|
||
### addNumberVariable <sub><sup>`STATIC`</sup></sub> | ||
|
||
Adds a number variable to array of variables with optional callback. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.addNumberVariable(key, defaultValue); | ||
remixer.addNumberVariable(key, defaultValue, limitedToValues); | ||
remixer.addNumberVariable(key, defaultValue, limitedToValues, callback(variable) { ... } ); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **key:** *string* | ||
|
||
The key of the Variable. | ||
|
||
- **defaultValue:** *number* | ||
|
||
The initial default value of the variable. | ||
|
||
- `OPTIONAL` **limitedToValues:** *number[]* | ||
|
||
The optional array of allowed values. | ||
|
||
- `OPTIONAL` **callback:** *function* | ||
|
||
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument. | ||
|
||
#### Returns [NumberVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_numbervariable_.numbervariable.html) | ||
|
||
--- | ||
|
||
### addRangeVariable <sub><sup>`STATIC`</sup></sub> | ||
|
||
Adds a range Variable to array of Variables with optional callback. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment); | ||
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment, callback(variable) { ... } ); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **key:** *string* | ||
|
||
The key of the Variable. | ||
|
||
- **defaultValue:** *number* | ||
|
||
The initial default value of the variable. | ||
|
||
- **minValue:** *number* | ||
|
||
The allowed minimum value of the variable. | ||
|
||
- **maxValue:** *number* | ||
|
||
The allowed maximum value of the variable. | ||
|
||
- **increment:** *number* | ||
|
||
The amount to increment the value. | ||
|
||
- `OPTIONAL` **callback:** *function* | ||
|
||
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument. | ||
|
||
#### Returns [RangeVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_rangevariable_.rangevariable.html) | ||
|
||
--- | ||
|
||
### addStringVariable <sub><sup>`STATIC`</sup></sub> | ||
|
||
Adds a string variable to array of variables with optional callback. | ||
|
||
#### Syntax | ||
|
||
```javascript | ||
remixer.addStringVariable(key, defaultValue); | ||
remixer.addStringVariable(key, defaultValue, limitedToValues); | ||
remixer.addStringVariable(key, defaultValue, limitedToValues, callback(variable) { ... } ); | ||
``` | ||
|
||
#### Parameters | ||
|
||
- **key:** *string* | ||
|
||
The key of the Variable. | ||
|
||
- **defaultValue:** *string* | ||
|
||
The initial default value of the variable. | ||
|
||
- `OPTIONAL` **limitedToValues:** *string[]* | ||
|
||
The optional array of allowed values. | ||
|
||
- `OPTIONAL` **callback:** *function* | ||
|
||
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument. | ||
|
||
#### Returns [StringVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_stringvariable_.stringvariable.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.