ember-freestyle 0.12.9 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +5 -0
- package/CHANGELOG.md +54 -0
- package/README.md +69 -49
- package/addon/components/freestyle/usage/argument/index.hbs +1 -1
- package/addon/components/freestyle/usage/argument/index.js +5 -0
- package/addon/components/freestyle/usage/array/index.hbs +1 -0
- package/addon/components/freestyle/usage/bool/{control.hbs → control/index.hbs} +1 -1
- package/addon/components/freestyle/usage/bool/control/index.js +9 -0
- package/addon/components/freestyle/usage/bool/index.hbs +1 -0
- package/addon/components/freestyle/usage/number/{control.hbs → control/index.hbs} +2 -1
- package/addon/components/freestyle/usage/number/{control.js → control/index.js} +5 -0
- package/addon/components/freestyle/usage/number/index.hbs +1 -0
- package/addon/components/freestyle/usage/object/control/index.hbs +5 -0
- package/addon/components/freestyle/usage/object/control/index.js +18 -0
- package/addon/components/freestyle/usage/object/index.hbs +1 -0
- package/addon/components/freestyle/usage/string/{control.hbs → control/index.hbs} +4 -2
- package/addon/components/freestyle/usage/string/{control.js → control/index.js} +6 -0
- package/addon/components/freestyle/usage/string/index.hbs +1 -0
- package/addon/components/freestyle-collection/index.js +1 -2
- package/addon/components/freestyle-dynamic/index.js +1 -2
- package/addon/components/freestyle-dynamic-input/index.hbs +34 -6
- package/addon/components/freestyle-dynamic-input/index.js +6 -6
- package/addon/components/freestyle-palette/index.hbs +3 -3
- package/addon/components/freestyle-palette/index.js +1 -0
- package/addon/components/freestyle-palette-item/index.js +1 -1
- package/addon/components/freestyle-section/index.js +0 -2
- package/addon/components/freestyle-showdown-content/index.js +14 -0
- package/addon/components/freestyle-source/index.js +1 -2
- package/addon/components/freestyle-subsection/index.js +0 -1
- package/addon/components/freestyle-typeface/index.js +1 -1
- package/addon/components/freestyle-usage/index.js +3 -4
- package/addon/components/freestyle-usage-controls/index.hbs +2 -2
- package/addon/components/freestyle-variant-list/index.hbs +1 -1
- package/addon/services/ember-freestyle.js +2 -2
- package/app/components/freestyle/usage/{bool/index.js → bool.js} +0 -0
- package/app/components/freestyle/usage/{number/index.js → number.js} +0 -0
- package/app/components/freestyle/usage/{object/index.js → object.js} +0 -0
- package/app/components/freestyle/usage/{string/index.js → string.js} +0 -0
- package/{addon → app}/styles/components/freestyle/usage.scss +14 -14
- package/{addon → app}/styles/components/freestyle-annotation.scss +1 -1
- package/{addon → app}/styles/components/freestyle-collection.scss +5 -4
- package/{addon → app}/styles/components/freestyle-dynamic.scss +2 -1
- package/{addon → app}/styles/components/freestyle-guide.scss +7 -6
- package/{addon → app}/styles/components/freestyle-menu.scss +1 -1
- package/{addon → app}/styles/components/freestyle-palette-item.scss +0 -1
- package/{addon → app}/styles/components/freestyle-palette.scss +1 -1
- package/{addon → app}/styles/components/freestyle-section.scss +1 -1
- package/{addon → app}/styles/components/freestyle-source.scss +2 -2
- package/{addon → app}/styles/components/freestyle-subsection.scss +2 -2
- package/{addon → app}/styles/components/freestyle-typeface.scss +0 -0
- package/{addon → app}/styles/components/freestyle-usage-controls.scss +12 -11
- package/{addon → app}/styles/components/freestyle-usage.scss +2 -6
- package/{addon → app}/styles/components/freestyle-variant.scss +0 -0
- package/{addon/styles/addon.scss → app/styles/ember-freestyle.scss} +3 -3
- package/blueprints/ember-freestyle/files/__root__/app/controllers/freestyle.js +16 -47
- package/blueprints/ember-freestyle/files/__root__/app/templates/freestyle.hbs +14 -20
- package/blueprints/ember-freestyle/index.js +0 -1
- package/index.js +15 -1
- package/lib/ast-transform.js +26 -33
- package/package.json +50 -44
- package/vendor/ember-freestyle.css +523 -0
- package/addon/components/freestyle/usage/object/control.hbs +0 -7
- package/addon/components/freestyle-note/index.hbs +0 -3
- package/addon/components/freestyle-note/index.js +0 -11
- package/addon/helpers/equal.js +0 -3
- package/addon/helpers/is-present.js +0 -10
- package/addon/helpers/pick.js +0 -14
- package/app/components/freestyle-note.js +0 -9
- package/app/helpers/is-present.js +0 -1
- package/app/helpers/pick.js +0 -1
- package/app/helpers/variant-eq.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.13.2](https://github.com/chrislopresto/ember-freestyle/compare/v0.13.1...v0.13.2) (2021-11-21)
|
|
6
|
+
|
|
7
|
+
### [0.13.1](https://github.com/chrislopresto/ember-freestyle/compare/v0.13.0...v0.13.1) (2021-11-21)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* remove dependency on `ember-cli-sass` and `sass` ([5482db1](https://github.com/chrislopresto/ember-freestyle/commit/5482db1b11332526e6916f2147e59216120b5fd2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* pass down [@hide](https://github.com/hide)Controls argument ([c8eac40](https://github.com/chrislopresto/ember-freestyle/commit/c8eac406cc1e59b99f659b68fed7af5b4722d5d4))
|
|
18
|
+
|
|
19
|
+
## [0.13.0](https://github.com/chrislopresto/ember-freestyle/compare/v0.12.11...v0.13.0) (2021-10-29)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* remove the use of `ember-json-viewer`
|
|
25
|
+
* drop support for Node v10
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* deprecate `<FreestyleShowdownContent />` component ([78f2568](https://github.com/chrislopresto/ember-freestyle/commit/78f25681c40d33d56c1789601503f3d5ccca88da))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* fix generated id for `freestyle-dynamic-input` component ([942c901](https://github.com/chrislopresto/ember-freestyle/commit/942c901293827e51f35a976623ccdeb0139181e9))
|
|
35
|
+
* import computed.or directly ([ecb6811](https://github.com/chrislopresto/ember-freestyle/commit/ecb6811368e41c10466bf859e3bb9118f5683bfc))
|
|
36
|
+
* import htmlSafe from @ember/template ([57ea33f](https://github.com/chrislopresto/ember-freestyle/commit/57ea33f6651342488e6cc6209a041dbc15ce977f))
|
|
37
|
+
* make AST plugin functional ([87f521c](https://github.com/chrislopresto/ember-freestyle/commit/87f521ce1371a31f0f1fad9530a973f595819723))
|
|
38
|
+
* resolve deprecations related to built-in component events ([a4d07c6](https://github.com/chrislopresto/ember-freestyle/commit/a4d07c6661299e9ab161a75a35a50ead5e755707))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
* drop support for Node v10 ([2add9c7](https://github.com/chrislopresto/ember-freestyle/commit/2add9c7152a5b58b9de45b4e188b836b656d5fb5))
|
|
42
|
+
* remove the use of `ember-json-viewer` ([023f559](https://github.com/chrislopresto/ember-freestyle/commit/023f5591f5531d61188c20d4107447e26172d2b0))
|
|
43
|
+
|
|
44
|
+
### [0.12.11](https://github.com/chrislopresto/ember-freestyle/compare/v0.12.10...v0.12.11) (2021-03-23)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* Move glimmer/tracker to the deps list since ([3a39dc6](https://github.com/chrislopresto/ember-freestyle/commit/3a39dc6daa2d6a69f6b1e090c19e216edf3fef8d))
|
|
50
|
+
* rendering a color palette ([336af81](https://github.com/chrislopresto/ember-freestyle/commit/336af817a43553a3662ebb0cc4b0d174fcf0b23b))
|
|
51
|
+
|
|
52
|
+
### [0.12.10](https://github.com/chrislopresto/ember-freestyle/compare/v0.12.9...v0.12.10) (2021-03-17)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Bug Fixes
|
|
56
|
+
|
|
57
|
+
* blueprint subsection invocation ([#515](https://github.com/chrislopresto/ember-freestyle/issues/515)) ([ad7f63a](https://github.com/chrislopresto/ember-freestyle/commit/ad7f63abf60f2b7013b91881ea2aa0484835226b))
|
|
58
|
+
|
|
5
59
|
### [0.12.9](https://github.com/chrislopresto/ember-freestyle/compare/v0.12.8...v0.12.9) (2021-03-12)
|
|
6
60
|
|
|
7
61
|
|
package/README.md
CHANGED
|
@@ -2,36 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/chrislopresto/ember-freestyle/actions)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-

|
|
6
|
+

|
|
7
7
|
[](http://emberobserver.com/addons/ember-freestyle)
|
|
8
8
|
[](https://conventionalcommits.org)
|
|
9
9
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
10
|
-
[](#contributors-)
|
|
11
11
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
12
12
|
|
|
13
|
-
Ember Freestyle is an Ember addon that allows you to quickly create a component
|
|
13
|
+
Ember Freestyle is an Ember addon that allows you to quickly create a component
|
|
14
|
+
explorer for your Ember app.
|
|
14
15
|
|
|
15
16
|
## Documentation
|
|
16
17
|
|
|
17
|
-
This README provides a lightweight overview of Ember Freestyle to get you going.
|
|
18
|
+
This README provides a lightweight overview of Ember Freestyle to get you going.
|
|
19
|
+
More complete documentation can be found at [https://chrislopresto.github.io/ember-freestyle](https://chrislopresto.github.io/ember-freestyle).
|
|
18
20
|
|
|
19
21
|
## Live Demo
|
|
20
22
|
|
|
21
|
-
To see Ember Freestyle in action, visit [https://chrislopresto.github.io/ember-freestyle/#/acceptance](https://chrislopresto.github.io/ember-freestyle/#/acceptance)
|
|
23
|
+
To see Ember Freestyle in action, visit [https://chrislopresto.github.io/ember-freestyle/#/acceptance](https://chrislopresto.github.io/ember-freestyle/#/acceptance).
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
## Compatibility
|
|
24
26
|
|
|
25
27
|
* Ember.js v3.16 or above
|
|
26
|
-
* Ember CLI
|
|
27
|
-
* Node.js
|
|
28
|
+
* Ember CLI v3.16 or above
|
|
29
|
+
* Node.js v12 or above
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Ember Freestyle support is only provided for the 2 latest Ember versions
|
|
32
|
-
|
|
33
|
-
Installation
|
|
34
|
-
------------------------------------------------------------------------------
|
|
31
|
+
## Installation
|
|
35
32
|
|
|
36
33
|
This installation process is opinionated in order to get you going quickly.
|
|
37
34
|
|
|
@@ -43,63 +40,80 @@ This installation process is opinionated in order to get you going quickly.
|
|
|
43
40
|
- Add a `freestyle` template in your app
|
|
44
41
|
- Add a `freestyle` controller in your app
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
1. Add `this.route('freestyle');` to your `router.js` file
|
|
49
|
-
1. Navigate to `/freestyle`. You should now see something like:
|
|
43
|
+
2. Add `this.route('freestyle');` to your `app/router.js` file
|
|
44
|
+
3. Navigate to `/freestyle`. You should now see something like:
|
|
50
45
|
|
|
51
46
|

|
|
52
47
|
|
|
53
|
-
All of the generated output is optional. If you don't want a `freestyle` route,
|
|
48
|
+
All of the generated output is optional. If you don't want a `freestyle` route,
|
|
49
|
+
for example, feel free to get rid of it and add a `freestyle-guide` somewhere
|
|
50
|
+
else in your app.
|
|
54
51
|
|
|
55
|
-
You can use the `freestyle-guide` component anywhere you'd like in your app.
|
|
52
|
+
You can use the `freestyle-guide` component anywhere you'd like in your app.
|
|
53
|
+
You can organize your components into multiple Freestyle guides if you want to.
|
|
54
|
+
You can even use the constituent components like `freestyle-usage` on their own.
|
|
56
55
|
|
|
57
56
|
## Problems? No problem.
|
|
58
57
|
|
|
59
|
-
Hopefully the installation instructions got you off to a smooth, seamless start.
|
|
58
|
+
Hopefully the installation instructions got you off to a smooth, seamless start.
|
|
59
|
+
If you have any problems, feel free to chat with us in the [Ember Community Discord](https://discord.gg/emberjs) or [open an issue](https://github.com/chrislopresto/ember-freestyle/issues/new). As always, PRs are welcome!
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Excluding Ember Freestyle's Styles
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
If you want to exclude Ember Freestyle's styles, you can set the `includeStyles`
|
|
64
|
+
option to `false` in your `ember-cli-build.js` file:
|
|
64
65
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
var pluginsToBlacklist = environment === 'production' ? ['ember-freestyle'] : [];
|
|
66
|
+
```js
|
|
67
|
+
// ember-cli-build.js
|
|
68
68
|
|
|
69
|
-
module.exports = function(defaults) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
69
|
+
module.exports = function (defaults) {
|
|
70
|
+
const app = new EmberApp(defaults, {
|
|
71
|
+
'ember-freestyle': {
|
|
72
|
+
includeStyles: false,
|
|
73
|
+
},
|
|
74
74
|
};
|
|
75
|
-
}
|
|
75
|
+
};
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
This might be useful in case you want to define your own styles _or_ if you are
|
|
79
|
+
using `ember-cli-sass` and want to import Ember Freestyle's styles explicitly:
|
|
79
80
|
|
|
80
|
-
|
|
81
|
+
```scss
|
|
82
|
+
$FreestyleGuide-color--primary: #C70039;
|
|
83
|
+
$FreestyleGuide-color--accent: #DAF7A6;
|
|
81
84
|
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
@import 'ember-freestyle';
|
|
86
|
+
```
|
|
84
87
|
|
|
85
|
-
##
|
|
88
|
+
## Excluding Ember Freestyle from Your Production Build
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
We recommend excluding Ember Freestyle from production builds using Ember CLI's
|
|
91
|
+
`addons.blacklist` option.
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
```js
|
|
94
|
+
// ember-cli-build.js
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
* `ember try:each` – Runs the test suite against multiple Ember versions
|
|
96
|
+
const environment = process.env.EMBER_ENV;
|
|
97
|
+
const addonsToExclude = environment === 'production' ? ['ember-freestyle'] : [];
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
module.exports = function (defaults) {
|
|
100
|
+
const app = new EmberAddon(defaults, {
|
|
101
|
+
addons: {
|
|
102
|
+
blacklist: addonsToExclude,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Using Ember Freestyle Within an Addon
|
|
97
109
|
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
You should include `ember-freestyle` in your `devDependencies` so that apps
|
|
111
|
+
using your addon will not include Ember Freestyle CSS and JavaScript in their
|
|
112
|
+
production builds.
|
|
100
113
|
|
|
101
|
-
|
|
114
|
+
## Contributing
|
|
102
115
|
|
|
116
|
+
See the [Contributing](CONTRIBUTING.md) guide for details.
|
|
103
117
|
|
|
104
118
|
## Contributors ✨
|
|
105
119
|
|
|
@@ -157,6 +171,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
157
171
|
<tr>
|
|
158
172
|
<td align="center"><a href="https://github.com/lucasmerat"><img src="https://avatars.githubusercontent.com/u/32575355?v=4?s=100" width="100px;" alt=""/><br /><sub><b>lucasmerat</b></sub></a><br /><a href="https://github.com/chrislopresto/ember-freestyle/commits?author=lucasmerat" title="Code">💻</a></td>
|
|
159
173
|
<td align="center"><a href="https://github.com/skwongr"><img src="https://avatars.githubusercontent.com/u/19978361?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Kit</b></sub></a><br /><a href="https://github.com/chrislopresto/ember-freestyle/commits?author=skwongr" title="Code">💻</a></td>
|
|
174
|
+
<td align="center"><a href="https://lolma.us/"><img src="https://avatars.githubusercontent.com/u/200884?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Andrey Mikhaylov (lolmaus)</b></sub></a><br /><a href="https://github.com/chrislopresto/ember-freestyle/issues?q=author%3Alolmaus" title="Bug reports">🐛</a> <a href="https://github.com/chrislopresto/ember-freestyle/commits?author=lolmaus" title="Code">💻</a></td>
|
|
175
|
+
<td align="center"><a href="https://github.com/bertdeblock"><img src="https://avatars.githubusercontent.com/u/7403183?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Bert De Block</b></sub></a><br /><a href="https://github.com/chrislopresto/ember-freestyle/commits?author=bertdeblock" title="Code">💻</a> <a href="#ideas-bertdeblock" title="Ideas, Planning, & Feedback">🤔</a></td>
|
|
160
176
|
</tr>
|
|
161
177
|
</table>
|
|
162
178
|
|
|
@@ -165,4 +181,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
165
181
|
|
|
166
182
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
167
183
|
|
|
168
|
-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
184
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind are welcome!
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
This project is licensed under the [MIT License](LICENSE.md).
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
{{#if @required}}
|
|
16
16
|
<span class="FreestyleUsageArgument-required">Required</span>
|
|
17
17
|
{{/if}}
|
|
18
|
-
{{#if
|
|
18
|
+
{{#if this.shouldRenderDefaultValue}}
|
|
19
19
|
<span class="FreestyleUsageArgument-default u-codePill">
|
|
20
20
|
{{@defaultValue}}
|
|
21
21
|
</span>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { isPresent } from '@ember/utils';
|
|
1
2
|
import Component from '@glimmer/component';
|
|
2
3
|
|
|
3
4
|
export default class FreestyleUsageArgumentComponent extends Component {
|
|
5
|
+
get shouldRenderDefaultValue() {
|
|
6
|
+
return isPresent(this.args.defaultValue);
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
get typeLabel() {
|
|
5
10
|
return this.args.typeLabel || this.args.type;
|
|
6
11
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
+
import { isPresent } from '@ember/utils';
|
|
3
4
|
|
|
4
5
|
export default class FreestyleUsageNumberComponent extends Component {
|
|
6
|
+
get shouldRenderRangeInput() {
|
|
7
|
+
return isPresent(this.args.min) && isPresent(this.args.max);
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
@action onInput(event) {
|
|
6
11
|
let { value } = event.target;
|
|
7
12
|
this.args.onInput(value ? parseFloat(value) : null);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import JsonFormatter from 'json-formatter-js';
|
|
3
|
+
|
|
4
|
+
const OPTIONS = {
|
|
5
|
+
animateClose: false,
|
|
6
|
+
animateOpen: false,
|
|
7
|
+
theme: 'dark',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default class FreestyleUsageObjectControlComponent extends Component {
|
|
11
|
+
get jsonTree() {
|
|
12
|
+
const json = this.args.value;
|
|
13
|
+
const openDepth = this.args.jsonCollapseDepth;
|
|
14
|
+
const jsonFormatter = new JsonFormatter(json, openDepth, OPTIONS);
|
|
15
|
+
|
|
16
|
+
return jsonFormatter.render();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
{{! template-lint-disable require-input-label }}
|
|
2
|
+
|
|
1
3
|
{{#if @options}}
|
|
2
|
-
<select {{on 'change'
|
|
4
|
+
<select {{on 'change' this.callOnInput}}>
|
|
3
5
|
{{#each @options as |optionValue|}}
|
|
4
6
|
<option value={{optionValue}} selected={{eq optionValue @value}}>{{optionValue}}</option>
|
|
5
7
|
{{/each}}
|
|
@@ -8,6 +10,6 @@
|
|
|
8
10
|
<input
|
|
9
11
|
type="text"
|
|
10
12
|
value={{@value}}
|
|
11
|
-
{{on this.inputEvent
|
|
13
|
+
{{on this.inputEvent this.callOnInput}}
|
|
12
14
|
/>
|
|
13
15
|
{{/if}}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import { action } from '@ember/object';
|
|
1
2
|
import Component from '@glimmer/component';
|
|
2
3
|
|
|
3
4
|
export default class FreestyleUsageStringControlComponent extends Component {
|
|
4
5
|
get inputEvent() {
|
|
5
6
|
return this.args.inputEvent || 'input';
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
@action
|
|
10
|
+
callOnInput(event) {
|
|
11
|
+
this.args.onInput(event.target.value);
|
|
12
|
+
}
|
|
7
13
|
}
|
|
@@ -3,8 +3,7 @@ import { and, not } from '@ember/object/computed';
|
|
|
3
3
|
import { A } from '@ember/array';
|
|
4
4
|
import { next } from '@ember/runloop';
|
|
5
5
|
import Component from '@ember/component';
|
|
6
|
-
import { computed } from '@ember/object';
|
|
7
|
-
import { action } from '@ember/object';
|
|
6
|
+
import { action, computed } from '@ember/object';
|
|
8
7
|
|
|
9
8
|
export default Component.extend({
|
|
10
9
|
tagName: '',
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { assign } from '@ember/polyfills';
|
|
2
2
|
import Component from '@ember/component';
|
|
3
|
-
import { set, get, computed } from '@ember/object';
|
|
3
|
+
import { action, set, get, computed } from '@ember/object';
|
|
4
4
|
import { assert } from '@ember/debug';
|
|
5
|
-
import { action } from '@ember/object';
|
|
6
5
|
|
|
7
6
|
export default Component.extend({
|
|
8
7
|
tagName: '',
|
|
@@ -3,22 +3,50 @@
|
|
|
3
3
|
{{@propertyName}}:
|
|
4
4
|
</label>
|
|
5
5
|
{{#if this.isCheckbox}}
|
|
6
|
-
<
|
|
6
|
+
<input
|
|
7
|
+
checked={{@value}}
|
|
8
|
+
id={{this.inputId}}
|
|
9
|
+
type="checkbox"
|
|
10
|
+
{{on "input" this.toggleCheckbox}}
|
|
11
|
+
>
|
|
7
12
|
{{else if this.isTextarea}}
|
|
8
|
-
<
|
|
13
|
+
<textarea
|
|
14
|
+
cols="40"
|
|
15
|
+
id={{this.inputId}}
|
|
16
|
+
rows="5"
|
|
17
|
+
value={{@value}}
|
|
18
|
+
{{on "input" this.sendChangedText}}
|
|
19
|
+
/>
|
|
9
20
|
{{else if this.isSelect}}
|
|
10
|
-
<select {{on
|
|
21
|
+
<select id={{this.inputId}} {{on "change" this.onChange}}>
|
|
11
22
|
{{#each @options as |option|}}
|
|
12
23
|
<FreestyleDynamicInputSelectOption @selectedValue={{@value}} @optionValue={{option}} />
|
|
13
24
|
{{/each}}
|
|
14
25
|
</select>
|
|
15
26
|
{{else if this.isNumber}}
|
|
16
|
-
<
|
|
27
|
+
<input
|
|
28
|
+
id={{this.inputId}}
|
|
29
|
+
type="number"
|
|
30
|
+
value={{@value}}
|
|
31
|
+
{{on "input" this.onChangeWithNumericCoercion}}
|
|
32
|
+
>
|
|
17
33
|
{{else if this.isRange}}
|
|
18
|
-
<
|
|
34
|
+
<input
|
|
35
|
+
id={{this.inputId}}
|
|
36
|
+
max={{@max}}
|
|
37
|
+
min={{@min}}
|
|
38
|
+
type="range"
|
|
39
|
+
value={{@value}}
|
|
40
|
+
{{on "input" this.onChangeWithNumericCoercion}}
|
|
41
|
+
>
|
|
19
42
|
{{@value}}
|
|
20
43
|
{{else}}
|
|
21
|
-
<
|
|
44
|
+
<input
|
|
45
|
+
id={{this.inputId}}
|
|
46
|
+
type="text"
|
|
47
|
+
value={{@value}}
|
|
48
|
+
{{on "input" this.onChange}}
|
|
49
|
+
>
|
|
22
50
|
{{/if}}
|
|
23
51
|
{{#if @description}}
|
|
24
52
|
<small class="FreestyleDynamic-inputDescription">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@ember/component';
|
|
2
|
-
import { computed } from '@ember/object';
|
|
2
|
+
import { action, computed } from '@ember/object';
|
|
3
3
|
import { equal } from '@ember/object/computed';
|
|
4
|
-
import {
|
|
4
|
+
import { guidFor } from '@ember/object/internals';
|
|
5
5
|
|
|
6
6
|
export default Component.extend({
|
|
7
7
|
tagName: '',
|
|
@@ -12,8 +12,8 @@ export default Component.extend({
|
|
|
12
12
|
isNumber: equal('inputType', 'number'),
|
|
13
13
|
isRange: equal('inputType', 'range'),
|
|
14
14
|
|
|
15
|
-
inputId: computed('
|
|
16
|
-
return `${this
|
|
15
|
+
inputId: computed('propertyName', function () {
|
|
16
|
+
return `${guidFor(this)}_${this.propertyName}`;
|
|
17
17
|
}),
|
|
18
18
|
|
|
19
19
|
@action
|
|
@@ -27,8 +27,8 @@ export default Component.extend({
|
|
|
27
27
|
this.changeValueTo(ev.target.value);
|
|
28
28
|
},
|
|
29
29
|
@action
|
|
30
|
-
sendChangedText(
|
|
31
|
-
this.changeValueTo(
|
|
30
|
+
sendChangedText(ev) {
|
|
31
|
+
this.changeValueTo(ev.target.value);
|
|
32
32
|
},
|
|
33
33
|
@action
|
|
34
34
|
onChangeWithNumericCoercion(ev) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div class='FreestylePalette'>
|
|
2
|
-
<div class='FreestylePalette-title'>{{
|
|
3
|
-
<div class='FreestylePalette-description'>{{
|
|
4
|
-
{{#each
|
|
2
|
+
<div class='FreestylePalette-title'>{{this.title}}</div>
|
|
3
|
+
<div class='FreestylePalette-description'>{{this.description}}</div>
|
|
4
|
+
{{#each this.colors as |color|}}
|
|
5
5
|
<FreestylePaletteItem @color={{color}} />
|
|
6
6
|
{{/each}}
|
|
7
7
|
{{yield}}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable ember/no-component-lifecycle-hooks */
|
|
2
2
|
/* eslint-disable ember/require-tagless-components */
|
|
3
|
+
import { deprecate } from '@ember/debug';
|
|
3
4
|
import { inject as service } from '@ember/service';
|
|
4
5
|
import Component from '@ember/component';
|
|
5
6
|
|
|
@@ -8,7 +9,20 @@ export default Component.extend({
|
|
|
8
9
|
|
|
9
10
|
didInsertElement() {
|
|
10
11
|
this._super(...arguments);
|
|
12
|
+
|
|
13
|
+
deprecate(
|
|
14
|
+
'The `<FreestyleShowdownContent />` component is deprecated. Please use `ember-cli-showdown` directly if you need Markdown support.',
|
|
15
|
+
false,
|
|
16
|
+
{
|
|
17
|
+
for: 'ember-freestyle',
|
|
18
|
+
id: 'freestyle-showdown-content-component',
|
|
19
|
+
since: '0.13.0',
|
|
20
|
+
until: '0.14.0',
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
11
24
|
let pre = this.element.getElementsByTagName('pre');
|
|
25
|
+
|
|
12
26
|
if (pre[0]) {
|
|
13
27
|
this.emberFreestyle.highlight(pre[0]);
|
|
14
28
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* eslint-disable ember/no-component-lifecycle-hooks */
|
|
2
2
|
/* eslint-disable ember/require-tagless-components */
|
|
3
|
-
import { set } from '@ember/object';
|
|
4
3
|
import { inject as service } from '@ember/service';
|
|
5
4
|
import Component from '@ember/component';
|
|
6
|
-
import { computed, get } from '@ember/object';
|
|
5
|
+
import { computed, get, set } from '@ember/object';
|
|
7
6
|
|
|
8
7
|
export default Component.extend({
|
|
9
8
|
initialHighlightComplete: false,
|