// form/nc/nc-define/nc-layout-editor/nc-layout-toolbar/nc-layout-toolbar.js

import { isContainer, cleanLayoutJson, restCallback } from '/plugin/nc-layout-editor/nc-layout-editor-util.js'
// import NcLayoutElement from '/plugin/nc-layout-editor/nc-layout-element.js'
// import NcElementProperty from '/plugin/nc-layout-editor/nc-element-property.js'
// import NcContainerProperty from '/plugin/nc-layout-editor/nc-container-property.js'

console.debug('* nc-layout-toolbar lazy-loaded')

// eslint-disable-next-line no-unused-vars
function isContainerNode(node) {
	return isContainer(node)
}

// eslint-disable-next-line no-unused-vars
function save() {
	const saveData = cleanLayoutJson(rec.layout_json, true) // true == strip id
	nc.callServer(state, 'dynamic-form', { path: rec.layout_name, save: saveData }, restCallback(state))
}

// eslint-disable-next-line no-unused-vars
function toolWidth() {
	return rec.element_column_width * rec.tool_column_count + rec.toolbar_extra_width - 1.1 + 'em'
}
