Skip to content

Commit d6d0652

Browse files
committedFeb 6, 2024
add modifiers
1 parent a415e9c commit d6d0652

File tree

10 files changed

+478
-169
lines changed

10 files changed

+478
-169
lines changed
 

‎app/components/component-tree-arg.js

+9
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ export default class ComponentTreeArg extends Component {
1212

1313
get displayValue() {
1414
if (this.isObject) {
15+
if (this.args.value.inspect) {
16+
if (this.args.value.type === 'function') {
17+
return this.args.value.inspect
18+
.replace(/"/g, '\\"')
19+
.replace('bound ', '')
20+
.replace('{ ... }', '');
21+
}
22+
return this.args.value.inspect.replace(/"/g, '\\"');
23+
}
1524
return '...';
1625
} else if (typeof this.args.value === 'string') {
1726
// Escape any interior quotes – we will add the surrounding quotes in the template

‎app/components/component-tree-item.hbs

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@
8787
<span class="component-name">
8888
{{@item.name}}
8989
</span>
90+
{{#each-in @item.args.named as |name value|}}
91+
<div class="arg-token flex ml-2">
92+
<span class="key-token">
93+
{{name}}
94+
</span>
95+
={{if (is-string value) "\""}}
96+
<ComponentTreeArg @value={{value}} />
97+
{{if (is-string value) "\""}}
98+
</div>
99+
{{/each-in}}
90100
{{/if}}
91101
</code>
92102
</div>

‎app/components/object-inspector/property.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default class ObjectInspectorProperty extends Component<ObjectInspectorPr
120120

121121
get cannotEdit() {
122122
if (this.args.model.name === '...' || !this.isCalculated) return true;
123-
return this.isFunction || this.isOverridden || this.readOnly;
123+
return this.args.model?.value?.type !== 'type-string' && this.args.model?.value?.type !== 'type-number';
124124
}
125125

126126
@action

‎app/controllers/component-tree.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,18 @@ class RenderItem {
301301
}
302302

303303
get isComponent() {
304-
return this.renderNode.type === 'component' || this.renderNode.type === 'remote-element';
304+
return (
305+
this.renderNode.type === 'component' ||
306+
this.renderNode.type === 'remote-element'
307+
);
305308
}
306309

307310
get isModifier() {
308311
return this.renderNode.type === 'modifier';
309312
}
310313

311314
get isHtmlTag() {
312-
return this.renderNode.type === 'htmlTag';
315+
return this.renderNode.type === 'html-element';
313316
}
314317

315318
get name() {

‎ember-cli-build.js

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ module.exports = function (defaults) {
5454
if (process.env.EMBER_ENV !== 'test') {
5555
// https://github.com/ef4/ember-auto-import/issues/540
5656
options.autoImport.publicAssetURL = 'assets/';
57+
} else {
58+
options.autoImport.publicAssetURL = 'assets/';
5759
}
5860

5961
// When running ember-try on Ember < 3.13, colocation support is

0 commit comments

Comments
 (0)
Failed to load comments.