// plugin/vue-renderer/yoga-test.js
// const yoga = require('./yoga-layout/entry-browser.js')
// import yoga, { Node } from './yoga-layout-es/entry-node.js'
// debugger
import yoga from './entry-browser.js'
console.log('🚀 ~ file: yoga-test.js ~ line 4 ~ yoga', yoga)

yoga.then(mod => {
	debugger
	const Node = mod.Node
	const root = Node.create()
	root.setWidth(500)
	root.setHeight(300)
	root.setJustifyContent(yoga.JUSTIFY_CENTER)

	const node1 = Node.create()
	node1.setWidth(100)
	node1.setHeight(100)

	const node2 = Node.create()
	node2.setWidth(100)
	node2.setHeight(100)

	root.insertChild(node1, 0)
	root.insertChild(node2, 1)

	root.calculateLayout(500, 300, yoga.DIRECTION_LTR)
	console.log(root.getComputedLayout())
	// {left: 0, top: 0, width: 500, height: 300}
	console.log(node1.getComputedLayout())
	// {left: 150, top: 0, width: 100, height: 100}
	console.log(node2.getComputedLayout())
	// {left: 250, top: 0, width: 100, height: 100}
})
