Skip to content
This repository was archived by the owner on Jun 3, 2022. It is now read-only.

Commit 7bda1aa

Browse files
committed
Merge branch 'release/v1.0.0' into stable
2 parents 663c13f + 1036c66 commit 7bda1aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+945
-608
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.0
2+
3+
Remixer v1.0.0 Release.
4+
15
## 0.7.0
26

37
### New Features

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,21 @@ remixer.addBooleanVariable("show", true, function(variable) {
5959
});
6060
```
6161

62-
## Is material-foundation affiliated with Google?
62+
## API Documentation
6363

64-
Yes, the [material-foundation](https://github.com/material-foundation) organization is one of Google's new homes for tools and frameworks related to our [Material Design](https://material.io) system. Please check out our blog post [Design is Never Done](https://design.google.com/articles/design-is-never-done/) for more information regarding Material Design and how Remixer integrates with the system.
64+
- Use these [common static methods](https://github.com/material-foundation/material-remixer-js/blob/develop/docs/remixer-api.md) to enable Remixer in your app.
65+
- Or refer to the full [API documentation](https://material-foundation.github.io/material-remixer-js/docs) for more information.
66+
67+
## Contributing to Remixer
68+
69+
We're excited you want to contribute to the project! Please read these docs so we can get your contributions submitted quickly.
6570
66-
## Contributing
71+
- [Contribution policy and guidelines](https://github.com/material-foundation/material-remixer-js/blob/develop/CONTRIBUTING.md)
72+
- [Developing Remixer](https://github.com/material-foundation/material-remixer-js/blob/develop/docs/developing.md)
6773
68-
We gladly welcome contributions! If you have found a bug, have questions, or wish to contribute, please follow our [Contributing Guidelines](https://github.com/material-foundation/material-remixer-js/blob/develop/CONTRIBUTING.md).
74+
## Is material-foundation affiliated with Google?
75+
76+
Yes, the [material-foundation](https://github.com/material-foundation) organization is one of Google's new homes for tools and frameworks related to our [Material Design](https://material.io) system. Please check out our blog post [Design is Never Done](https://design.google.com/articles/design-is-never-done/) for more information regarding Material Design and how Remixer integrates with the system.
6977

7078
## License
7179

docs/developing.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Developing Remixer
2+
3+
### Setting up your development environment
4+
5+
First you'll need a recent version of [Node.js](https://nodejs.org) to work
6+
with Remixer-js.
7+
8+
Once node is installed, simply clone our repo (or your fork of it) and
9+
run `npm install`.
10+
11+
```bash
12+
git clone git@github.com:material-foundation/material-remixer-js.git
13+
cd material-remixer-js && npm install
14+
```
15+
16+
### Typescript
17+
18+
The source code for Remixer-js is written in
19+
[Typescript](https://www.typescriptlang.org), and compiled to es5 javascript for
20+
distribution.
21+
22+
### Building Remixer
23+
24+
Use any of the following npm scripts to build dev or prod versions of Remixer-js.
25+
26+
```bash
27+
# Builds an unminified version of Remixer-js within the build folder.
28+
npm run build:dev
29+
30+
# Builds a minified version.
31+
npm run build:prod
32+
33+
# Builds both unminified and minified versions.
34+
npm run build
35+
```
36+
37+
### Running the development server
38+
39+
We use [weback dev server](https://webpack.js.org/configuration/dev-server) for
40+
hosting and live-reloading of any code changes.
41+
42+
```bash
43+
npm run dev
44+
open http://localhost:8080
45+
```
46+
47+
### Linting
48+
49+
```bash
50+
# Lint both CSS/LESS using lesshint.
51+
npm run lint:css
52+
53+
# Lint typescript using tslint.
54+
npm run lint:ts
55+
56+
# Lints both css and ts.
57+
npm run lint
58+
```
59+
60+
### Testing and Code Coverage
61+
62+
Testing uses the [karma](https://karma-runner.github.io) test runner with
63+
[mocha](https://mochajs.org/) flavored testing framework. Code coverage
64+
is reported by [istanbul](https://www.npmjs.com/package/istanbul-instrumenter-loader).
65+
66+
```bash
67+
# Run tests and code coverage once.
68+
npm run test
69+
70+
# Run with auto-watch indefinitely.
71+
npm run test:watch
72+
```

docs/remixer-api.md

Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
# Remixer API
2+
The Remixer class is a singleton class that keeps track of all the Variables and deals with saving/syncing its values.
3+
4+
The following methods are the most commonly used to enable Remixer in your app.
5+
6+
- [remixer.start()](#start-static)
7+
- [remixer.stop()](#stop-static)
8+
- [remixer.addBooleanVariable()](#addbooleanvariable-static)
9+
- [remixer.addColorVariable()](#addcolorvariable-static)
10+
- [remixer.addNumberVariable()](#addnumbervariable-static)
11+
- [remixer.addRangeVariable()](#addrangevariable-static)
12+
- [remixer.addStringVariable()](#addstringvariable-static)
13+
14+
---
15+
16+
### start <sub><sup>`STATIC`</sup></sub>
17+
18+
Appends the HTML iFrame to body of client app. Attaches key listener to toggle Overlay visibility.
19+
20+
#### Syntax
21+
22+
```javascript
23+
remixer.start();
24+
remixer.start(remoteConfig);
25+
```
26+
27+
#### Parameters
28+
29+
- **remoteConfig:** *object*
30+
31+
The optional firebase configuration. Provide this configuration if you wish to use the remote controller.
32+
33+
```javascript
34+
var remoteConfig = {
35+
apiKey: "<API_KEY>",
36+
authDomain: "<PROJECT_ID>.firebaseapp.com",
37+
databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
38+
...
39+
};
40+
```
41+
42+
#### Returns void
43+
44+
---
45+
46+
### stop <sub><sup>`STATIC`</sup></sub>
47+
48+
Removes iFrame and attached key listener.
49+
50+
#### Syntax
51+
52+
```javascript
53+
remixer.stop();
54+
```
55+
56+
#### Returns void
57+
58+
---
59+
60+
### addBooleanVariable <sub><sup>`STATIC`</sup></sub>
61+
62+
Adds a boolean Variable to array of Variables with optional callback.
63+
64+
#### Syntax
65+
66+
```javascript
67+
remixer.addBooleanVariable(key, defaultValue);
68+
remixer.addBooleanVariable(key, defaultValue, callback(variable) { ... } );
69+
```
70+
71+
#### Parameters
72+
73+
- **key:** *string*
74+
75+
The key of the Variable.
76+
77+
- **defaultValue:** *boolean*
78+
79+
The initial default value of the variable.
80+
81+
- `OPTIONAL` **callback:** *function*
82+
83+
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
84+
85+
#### Returns [BooleanVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_booleanvariable_.booleanvariable.html)
86+
87+
---
88+
89+
### addColorVariable <sub><sup>`STATIC`</sup></sub>
90+
91+
Adds a color variable to array of variables with optional callback.
92+
93+
#### Syntax
94+
95+
```javascript
96+
remixer.addColorVariable(key, defaultValue);
97+
remixer.addColorVariable(key, defaultValue, limitedToValues);
98+
remixer.addColorVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
99+
```
100+
101+
#### Parameters
102+
103+
- **key:** *string*
104+
105+
The key of the Variable.
106+
107+
- **defaultValue:** *string*
108+
109+
The initial default value of the variable.
110+
111+
- `OPTIONAL` **limitedToValues:** *string[]*
112+
113+
The optional array of allowed values.
114+
115+
- `OPTIONAL` **callback:** *function*
116+
117+
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
118+
119+
#### Returns [ColorVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_colorvariable_.colorvariable.html)
120+
121+
---
122+
123+
### addNumberVariable <sub><sup>`STATIC`</sup></sub>
124+
125+
Adds a number variable to array of variables with optional callback.
126+
127+
#### Syntax
128+
129+
```javascript
130+
remixer.addNumberVariable(key, defaultValue);
131+
remixer.addNumberVariable(key, defaultValue, limitedToValues);
132+
remixer.addNumberVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
133+
```
134+
135+
#### Parameters
136+
137+
- **key:** *string*
138+
139+
The key of the Variable.
140+
141+
- **defaultValue:** *number*
142+
143+
The initial default value of the variable.
144+
145+
- `OPTIONAL` **limitedToValues:** *number[]*
146+
147+
The optional array of allowed values.
148+
149+
- `OPTIONAL` **callback:** *function*
150+
151+
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
152+
153+
#### Returns [NumberVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_numbervariable_.numbervariable.html)
154+
155+
---
156+
157+
### addRangeVariable <sub><sup>`STATIC`</sup></sub>
158+
159+
Adds a range Variable to array of Variables with optional callback.
160+
161+
#### Syntax
162+
163+
```javascript
164+
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment);
165+
remixer.addRangeVariable(key, defaultValue, minValue, maxValue, increment, callback(variable) { ... } );
166+
```
167+
168+
#### Parameters
169+
170+
- **key:** *string*
171+
172+
The key of the Variable.
173+
174+
- **defaultValue:** *number*
175+
176+
The initial default value of the variable.
177+
178+
- **minValue:** *number*
179+
180+
The allowed minimum value of the variable.
181+
182+
- **maxValue:** *number*
183+
184+
The allowed maximum value of the variable.
185+
186+
- **increment:** *number*
187+
188+
The amount to increment the value.
189+
190+
- `OPTIONAL` **callback:** *function*
191+
192+
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
193+
194+
#### Returns [RangeVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_rangevariable_.rangevariable.html)
195+
196+
---
197+
198+
### addStringVariable <sub><sup>`STATIC`</sup></sub>
199+
200+
Adds a string variable to array of variables with optional callback.
201+
202+
#### Syntax
203+
204+
```javascript
205+
remixer.addStringVariable(key, defaultValue);
206+
remixer.addStringVariable(key, defaultValue, limitedToValues);
207+
remixer.addStringVariable(key, defaultValue, limitedToValues, callback(variable) { ... } );
208+
```
209+
210+
#### Parameters
211+
212+
- **key:** *string*
213+
214+
The key of the Variable.
215+
216+
- **defaultValue:** *string*
217+
218+
The initial default value of the variable.
219+
220+
- `OPTIONAL` **limitedToValues:** *string[]*
221+
222+
The optional array of allowed values.
223+
224+
- `OPTIONAL` **callback:** *function*
225+
226+
The callback method to be invoked when the Variable is updated. The function is passed with the updated variable argument.
227+
228+
#### Returns [StringVariable](https://material-foundation.github.io/material-remixer-js/docs/classes/_core_variables_stringvariable_.stringvariable.html)

examples/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "material-remixer-examples",
3-
"version": "0.0.1",
3+
"version": "1.0.0",
44
"description": "Example app demonstrating usage of Remixer.",
55
"author": "The Material Remixer Authors (see AUTHORS)",
66
"license": "Apache-2.0",
@@ -16,6 +16,6 @@
1616
"handlebars": "^4.0.6",
1717
"jquery": "^3.1.1",
1818
"material-design-lite": "^1.2.1",
19-
"material-remixer": "^0.6.4"
19+
"material-remixer": "^1.0.0"
2020
}
2121
}

0 commit comments

Comments
 (0)