complete api mapping

This commit is contained in:
Stewart Allen 2024-09-17 10:40:42 -04:00
commit 683c117bcd
5 changed files with 25 additions and 26 deletions

View file

@ -18,9 +18,10 @@ gapp.register("kiri-mode.cam.tools", (root, exports) => {
api.show.tools = showTools;
api.tool = {
// extend API
Object.assign(api.tool, {
update: updateTool
};
});
function settings() {
return api.conf.get();

View file

@ -67,10 +67,11 @@ function update(clear) {
}
}
api.alerts = {
// extend API
Object.assign(api.alerts, {
hide,
show,
update
};
});
});

View file

@ -74,6 +74,7 @@ let { data, kiri, moto, noop } = root,
und = undefined,
api = exports({
ajax, // via utils
alerts: {}, // alerts.js
busy: {}, // main.js
catalog: und, // main.js
clip, // <--
@ -81,12 +82,13 @@ let { data, kiri, moto, noop } = root,
color: und, // main.js
conf: {}, // settings.js
const: {}, // main.js
devel, // <--
device: {}, // devices.js
devices: {}, // devices.js
dialog: {}, // main.js
doit, // <--
devel, // <--
event: {}, // main.js
feature, // <--
focus: noop,
function: {}, // function.js
group: {}, // main.js
help: {}, // main.js
@ -94,8 +96,8 @@ let { data, kiri, moto, noop } = root,
image: {}, // main.js
js2o, // via utils
language: und, // main.js
local, // <--
lists, // <--
local, // <--
modal: {}, // main.js
mode: {}, // main.js
o2js, // via utils
@ -107,6 +109,8 @@ let { data, kiri, moto, noop } = root,
settings: {}, // settings.js
show: {}, // main.js
space: {}, // main.js
tool: {}, // kiri-mode/cam/tools.js
tweak, // <--
uc: {}, // main.js
ui: {}, // main.js
util: {}, // main.js
@ -116,7 +120,6 @@ let { data, kiri, moto, noop } = root,
layer_max: 0
},
view: {}, // main.js
tweak,
widgets: {}, // widgets.js
work: und, // main.js
});

View file

@ -9,21 +9,25 @@ gapp.register("kiri.devices", (root, exports) => {
let { kiri } = root,
{ api, conf } = kiri;
api.show.devices = showDevices;
// extend API
Object.assign(api.show, {
showDevices
});
api.device = {
Object.assign(api.device, {
clone: cloneDevice,
code: currentDeviceCode,
get: currentDeviceName,
set: selectDevice,
isBelt
};
});
api.devices = {
Object.assign(api.devices, {
show: showDevices,
select: selectDevice,
refresh: updateDeviceList
};
refresh: updateDeviceList,
update_laser_state: updateLaserState
});
function isBelt() {
return api.conf.get().device.bedBelt;

View file

@ -214,16 +214,6 @@ gapp.register("kiri.init", (root, exports) => {
}, 100);
}
function parentWithClass(el, classname) {
while (el) {
if (el.classList.contains(classname)) {
return el;
}
el = el.parentNode;
}
return el;
}
function onBooleanClick(el) {
// copy some ui elements to target settings
let settings = api.conf.get();
@ -236,7 +226,7 @@ gapp.register("kiri.init", (root, exports) => {
api.conf.update();
DOC.activeElement.blur();
api.event.emit("boolean.click");
updateLaserState();
api.devices.update_laser_state();
if (el === ui.camStockIndexed) {
api.space.set_focus();
}
@ -763,7 +753,7 @@ gapp.register("kiri.init", (root, exports) => {
}
function isBelt() {
return api.device.isBelt;
return api.device.isBelt();
}
function isNotBelt() {