fix clip2/earcut deps

This commit is contained in:
Stewart Allen 2025-07-05 12:41:00 -04:00
commit 7693b3d9ce
14 changed files with 105 additions and 68 deletions

View file

@ -121,7 +121,7 @@ export const api = {
clone, // <--
color,
conf: settings.conf,
const: { LANG, LOCAL, MODES, SETUP, SECURE, STACKS, VIEWS },
const: { LANG, LISTS: lists, LOCAL, MODES, SETUP, SECURE, STACKS, VIEWS },
devel, // <--
device,
devices,

View file

@ -75,7 +75,6 @@ export const client = {
console.log({ WORKER_MESSAGE_ERROR: error });
error.preventDefault();
};
console.log({ worker });
return worker;
}
},
@ -196,7 +195,6 @@ export const client = {
// called once for each widget
slice(settings, widget, callback) {
console.log('CSLICE', { settings, widget, callback });
send("slice", {
id: widget.id,
anno: widget.annotations(),

View file

@ -1,13 +1,8 @@
/** Copyright Stewart Allen <sa@grid.space> -- All Rights Reserved */
import { kiri } from './kiri.js';
import { moto } from '../moto.js';
import { api } from './api.js';
import { space } from '../moto/space.js';
const { kiri, moto } = root;
const { api } = kiri;
const { space } = moto;
const { event } = api;
let stack = [];
@ -44,7 +39,7 @@ let clear = api.doit.clear = function() {
};
function updateButtons() {
let isArrange = api.view.get() === kiri.consts.VIEWS.ARRANGE;
let isArrange = api.view.get() === api.consts.VIEWS.ARRANGE;
$('doit').style.display = isArrange && stack.length ? 'flex' : 'none';
$('undo').disabled = stpos === 0;
$('redo').disabled = stpos == stack.length;
@ -175,6 +170,3 @@ event.on('mouse.drag.done', () => {
});
moved = {x:0, y:0};
});
// No direct exports; extends api.doit

View file

@ -13,7 +13,7 @@ import { beta, version } from '../moto/license.js';
import { settings as set_ctrl } from './settings.js';
let { CAM, SLA, FDM, LASER, DRAG, WJET, WEDM } = MODES,
{ client, catalog, platform, selection } = api,
{ consts, client, catalog, platform, selection } = api,
LANG = api.language.current,
WIN = self.window,
DOC = self.document,
@ -1850,7 +1850,7 @@ function init_two() {
if (SETUP.s) SETUP.s.forEach(function(lib) {
let scr = DOC.createElement('script');
scr.setAttribute('defer',true);
scr.setAttribute('src',`/code/${lib}.js?${kiri.version}`);
scr.setAttribute('src',`/code/${lib}.js?${version}`);
DOC.body.appendChild(scr);
stats.add('load_'+lib);
api.event.emit('load.lib', lib);
@ -1862,7 +1862,7 @@ function init_two() {
let ss = DOC.createElement('link');
ss.setAttribute("type", "text/css");
ss.setAttribute("rel", "stylesheet");
ss.setAttribute("href", `${style}.css?${kiri.version}`);
ss.setAttribute("href", `${style}.css?${version}`);
DOC.body.appendChild(ss);
});
@ -1901,7 +1901,7 @@ function init_two() {
if (!control.devel) {
// TODO: hide thin type 3 during development
kiri.consts.LISTS.thin.length = 3;
consts.LISTS.thin.length = 3;
}
platform.deselect();
@ -2081,7 +2081,7 @@ function init_two() {
try { if (WIN.self !== WIN.top) $('top-sep').style.display = 'flex' } catch (e) { console.log(e) }
// warn users they are running a beta release
if (beta && beta > 0 && sdb.kiri_beta != kiri.beta) {
if (beta && beta > 0 && sdb.kiri_beta != beta) {
api.show.alert("CAUTION");
api.show.alert("this is a development release");
api.show.alert("and may not function properly");
@ -2152,4 +2152,5 @@ function init_lang() {
export function run() {
init_lang();
return api;
}