Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Jan 13, 2024
1 parent 284cdca commit 479979f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions plugins/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export function serializePath(
}

export function resolvedChildren(els: ASTv1.Node[]) {
if (els.length === 1 && els[0].type === 'BlockStatement') {
// hack for 'else if' // @todo write proper nesting
return resolvedChildren((els[0] as ASTv1.BlockStatement).program.body);
}
return els.filter((el) => {
if (
el.type === 'CommentStatement' ||
Expand Down
5 changes: 4 additions & 1 deletion src/components/Application.gts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ export class Application extends Component {
@stack={{this.router.stack}}
/>
<EuiAvatar
@color='#BD10E0'
@size='l'
@type='user'
@name='John Doe'
@imgUrl='https://plus.unsplash.com/premium_photo-1669324357471-e33e71e3f3d8?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8dXJsfGVufDB8fDB8fHww'
@imageUrl='https://plus.unsplash.com/premium_photo-1669324357471-e33e71e3f3d8?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8dXJsfGVufDB8fDB8fHww'
@iconClasses={{array '1'}}
/>
</template>
Expand Down
8 changes: 5 additions & 3 deletions src/ember-compat/ember__helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export { $__hash as hash } from '@/utils/helpers/index';
export function get() {
debugger;
}
export function get(obj: Record<string, any>, key: string) {
return key.split('.').reduce((acc, key) => {
return acc[key];
}, obj);
}
1 change: 1 addition & 0 deletions src/ember-compat/ember__template-compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function precompileTemplate(tpl: string, args: {
const keys = Object.keys(args.scope());
const transformResult = transform(`export function t() {
this['args'] = arguments[0];
this['$fw'] = arguments[1] || this['$fw'];
let {${keys.join(', ')}} = globalThis.scopes.get('${scopeId}')();
return hbs\`${tpl}\`;
}`, 'name.js', 'development', false);
Expand Down
4 changes: 2 additions & 2 deletions src/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
setBounds,
} from './shared';
import { modifierManagers } from '../ember-compat/ember__modifier';
import Helper from '../ember-compat/ember__component__helper';

// EMPTY DOM PROPS
export const $_edp = [[], [], []] as Props;
Expand Down Expand Up @@ -132,6 +131,7 @@ export function $_maybeHelper(value: any) {
if (value.prototype && value.prototype.compute) {
const helper = new value();
return (...args: any[]) => {
// debugger;
return helper.compute.call(helper, args, {});
}
}
Expand Down Expand Up @@ -430,7 +430,7 @@ function component(
if ($template in instance) {
const result = (
instance[$template] as unknown as () => ComponentReturnType
)();
)(args, fw);
if (IS_DEV_MODE) {
// @ts-expect-error new
instance.debugName = comp.name;
Expand Down

0 comments on commit 479979f

Please sign in to comment.