modify kiri ui to use updated dependency management
This commit is contained in:
parent
47903526b6
commit
d7be37478d
38 changed files with 300 additions and 230 deletions
283
app.js
283
app.js
|
|
@ -39,6 +39,12 @@ const EventEmitter = require('events');
|
||||||
class AppEmitter extends EventEmitter {}
|
class AppEmitter extends EventEmitter {}
|
||||||
const events = new AppEmitter();
|
const events = new AppEmitter();
|
||||||
|
|
||||||
|
function addonce(array, v) {
|
||||||
|
if (array.indexOf(v) < 0) {
|
||||||
|
array.push(v);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
function init(mod) {
|
function init(mod) {
|
||||||
startTime = time();
|
startTime = time();
|
||||||
lastmod = mod.util.lastmod;
|
lastmod = mod.util.lastmod;
|
||||||
|
|
@ -52,54 +58,120 @@ function init(mod) {
|
||||||
dversion = debug ? `_${version}` : version;
|
dversion = debug ? `_${version}` : version;
|
||||||
cacheDir = mod.util.datadir("cache");
|
cacheDir = mod.util.datadir("cache");
|
||||||
|
|
||||||
let depcache = {};
|
const approot = "main/gapp";
|
||||||
|
const refcache = {};
|
||||||
|
const callstack = [];
|
||||||
|
let xxxx = false;
|
||||||
|
|
||||||
function find_deps(path, seen = [], uses = []) {
|
function find_refs(cache, path) {
|
||||||
let cached = depcache[path];
|
let rec = refcache[path];
|
||||||
if (cached) {
|
if (rec) {
|
||||||
return cached;
|
let crec = cache[path];
|
||||||
}
|
if (!crec) {
|
||||||
if (seen.indexOf(path) >= 0) {
|
cache[path] = rec;
|
||||||
if (debug > 1) {
|
for (let d of rec.deps) find_refs(cache, d);
|
||||||
console.log(`circular dependency at ${path}`, seen);
|
for (let u of rec.deps) find_refs(cache, u);
|
||||||
}
|
}
|
||||||
return [];
|
return;
|
||||||
}
|
}
|
||||||
seen.push(path);
|
callstack.push(path);
|
||||||
let deps = [ "main/gapp" ];
|
rec = cache[path] = refcache[path] = {
|
||||||
let lines = fs.readFileSync(`${dir}/src/${path}.js`)
|
uses: [],
|
||||||
|
deps: [ approot ]
|
||||||
|
};
|
||||||
|
let full = `${dir}/src/${path}.js`;
|
||||||
|
try {
|
||||||
|
fs.lstatSync(full);
|
||||||
|
} catch (e) {
|
||||||
|
console.log({missing: full, callstack});
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
let lines = fs.readFileSync(full)
|
||||||
.toString()
|
.toString()
|
||||||
.split('\n');
|
.split('\n');
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
|
let arr, pos;
|
||||||
let upos = line.indexOf('// use:');
|
let upos = line.indexOf('// use:');
|
||||||
if (upos >= 0) {
|
if (upos >= 0) {
|
||||||
let use = line.substring(upos + 7).trim().replace('.','/');
|
arr = rec.uses;
|
||||||
if (uses.indexOf(use) < 0) {
|
pos = upos + 7;
|
||||||
uses.push(use);
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
let dpos = line.indexOf('// dep:');
|
let dpos = line.indexOf('// dep:');
|
||||||
if (dpos >= 0) {
|
if (dpos >= 0) {
|
||||||
let dep = line.substring(dpos + 7).trim().replace('.','/');
|
arr = rec.deps;
|
||||||
if (deps.indexOf(dep) < 0) {
|
pos = dpos + 7;
|
||||||
deps.push(dep);
|
}
|
||||||
}
|
if (upos >= 0 && dpos >= 0) {
|
||||||
let deep = find_deps(dep, seen, uses);
|
console.log(`invalid line: ${line}`);
|
||||||
deps = deps.filter(p => deep.indexOf(p) < 0);
|
process.exit();
|
||||||
// deeper dependencies go first
|
}
|
||||||
deps = [...deep, ...deps];
|
if (arr && pos >= 0) {
|
||||||
|
let path = line.substring(pos).trim().replace(/\./g,'/').trim();
|
||||||
|
addonce(arr, path);
|
||||||
|
find_refs(cache, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
depcache[path] = deps;
|
// if (xxxx) console.log({path, ...rec});
|
||||||
return deps;
|
callstack.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
// return record position indicated by path
|
||||||
|
function pos(path, list) {
|
||||||
|
for (let i=0; i<list.length; i++) {
|
||||||
|
if (list[i].path === path) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(`not found: ${path}`);
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function order_refs(cache) {
|
||||||
|
const recs = Object.entries(cache).map(entry => {
|
||||||
|
return { path: entry[0], deps: entry[1].deps }
|
||||||
|
}).sort((a,b) => {
|
||||||
|
return a.path === b.path ? 0 : a.path < b.path ? -1 : 1;
|
||||||
|
});
|
||||||
|
if (xxxx) console.log({ordering: recs});
|
||||||
|
|
||||||
|
// for each rec, ensure that dependencies are inserted before it
|
||||||
|
let lrec = recs.slice();
|
||||||
|
for (let rec of lrec) {
|
||||||
|
let { path, deps } = rec;
|
||||||
|
for (let dep of deps) {
|
||||||
|
let rpos = pos(path, recs);
|
||||||
|
let dpos = pos(dep, recs);
|
||||||
|
if (dpos > rpos) {
|
||||||
|
let drec = recs[dpos];
|
||||||
|
// remove old dep record
|
||||||
|
recs.splice(dpos, 1);
|
||||||
|
// insert dep before
|
||||||
|
recs.splice(rpos, 0, drec);
|
||||||
|
let nrpos = pos(path, recs);
|
||||||
|
let ndpos = pos(dep, recs);
|
||||||
|
let fail = nrpos != ndpos + 1;
|
||||||
|
// if (xxxx) { console.log({move: dep, dpos, before: path, rpos}); }
|
||||||
|
if (fail) {
|
||||||
|
console.log({move: dep, dpos, before: path, rpos, ndpos, nrpos, recs: recs.slice(0,10)});
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (xxxx) console.log({recs});
|
||||||
|
return recs.map(rec => rec.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// process script dependencies, expand paths
|
// process script dependencies, expand paths
|
||||||
for (let [key,val] of Object.entries(script)) {
|
for (let [ key, val ] of Object.entries(script)) {
|
||||||
let nval = val.map(p => p.charAt(0) === '&' ? p.substring(1) : p);
|
if (val.indexOf(approot) < 0) {
|
||||||
let modd = false;
|
val = [ approot, ...val ];
|
||||||
let uses = [];
|
}
|
||||||
|
const list = val.map(p => p.charAt(0) === '&' ? p.substring(1) : p);
|
||||||
|
const cache = {};
|
||||||
|
const roots = [];
|
||||||
|
// xxxx = key === "kiri_work";
|
||||||
|
// for each path in the list, find deps and add to list
|
||||||
for (let path of val) {
|
for (let path of val) {
|
||||||
let fc = path.charAt(0);
|
let fc = path.charAt(0);
|
||||||
if (fc === '@') {
|
if (fc === '@') {
|
||||||
|
|
@ -107,38 +179,25 @@ function init(mod) {
|
||||||
}
|
}
|
||||||
if (fc === '&') {
|
if (fc === '&') {
|
||||||
path = path.substring(1);
|
path = path.substring(1);
|
||||||
} else {
|
addonce(roots, path);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let uses = [];
|
|
||||||
let deps = find_deps(path, [], uses);
|
|
||||||
if (uses.length) {
|
|
||||||
let miss = uses.filter(u => deps.indexOf(u) < 0);
|
|
||||||
if (miss.length) {
|
|
||||||
val.appendAll(miss);
|
|
||||||
}
|
|
||||||
// console.log({key, uses, miss, deps});
|
|
||||||
deps.appendAll(miss);
|
|
||||||
}
|
|
||||||
if (deps) {
|
|
||||||
// remove deps already in list
|
|
||||||
deps = deps.filter(p => nval.indexOf(p) < 0);
|
|
||||||
let ppos = nval.indexOf(path);
|
|
||||||
if (ppos < 0) {
|
|
||||||
throw `missing ${path} in nval`;
|
|
||||||
}
|
|
||||||
// inject deps
|
|
||||||
nval.splice(ppos, 0, ...deps);
|
|
||||||
modd = true;
|
|
||||||
}
|
|
||||||
// if list is modified, substitute
|
|
||||||
if (modd) {
|
|
||||||
if (debug > 1) {
|
|
||||||
console.log({path, val, nval});
|
|
||||||
}
|
|
||||||
val = nval;
|
|
||||||
}
|
}
|
||||||
|
find_refs(cache, path);
|
||||||
}
|
}
|
||||||
|
if (xxxx) console.log({processing: key, val});
|
||||||
|
let refs = order_refs(cache).filter(p => roots.indexOf(p) < 0);
|
||||||
|
// remove paths that are in refs
|
||||||
|
let paths = list.filter(p => {
|
||||||
|
if (p.charAt(0) === '&') {
|
||||||
|
p = p.substring(1);
|
||||||
|
}
|
||||||
|
return refs.indexOf(p) < 0 && roots.indexOf(p) < 0;
|
||||||
|
});
|
||||||
|
// when dependency roots exist, re-write val array
|
||||||
|
if (roots.length) {
|
||||||
|
val = [...refs, ...paths, ...roots];
|
||||||
|
}
|
||||||
|
// val.splice(1, 0, ...roots);
|
||||||
|
if (xxxx) console.log({key, cache, refs, paths, roots, val});
|
||||||
script[key] = val.map(p => p.charAt(0) !== '@' ? `src/${p}.js` : p);
|
script[key] = val.map(p => p.charAt(0) !== '@' ? `src/${p}.js` : p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -270,8 +329,9 @@ function initModule(mod, file, dir) {
|
||||||
if (opt.end) {
|
if (opt.end) {
|
||||||
codelist.push(path);
|
codelist.push(path);
|
||||||
} else {
|
} else {
|
||||||
let io = Math.max(0, codelist.indexOf('@inject'));
|
codelist.push(path);
|
||||||
codelist.splice(io, 0, path);
|
// let io = Math.max(0, codelist.indexOf('@inject'));
|
||||||
|
// codelist.splice(io, 0, path);
|
||||||
}
|
}
|
||||||
if (opt.cachever) {
|
if (opt.cachever) {
|
||||||
cachever[path] = opt.cachever;
|
cachever[path] = opt.cachever;
|
||||||
|
|
@ -322,89 +382,15 @@ function initModule(mod, file, dir) {
|
||||||
|
|
||||||
const script = {
|
const script = {
|
||||||
kiri : [
|
kiri : [
|
||||||
"main/gapp",
|
|
||||||
"moto/license",
|
|
||||||
"main/kiri",
|
|
||||||
"@inject",
|
"@inject",
|
||||||
"ext/three",
|
|
||||||
"ext/three-bgu",
|
|
||||||
"ext/three-svg",
|
|
||||||
"ext/jszip",
|
|
||||||
"ext/clip2",
|
|
||||||
"ext/tween",
|
|
||||||
"ext/fsave",
|
|
||||||
// "ext/earcut",
|
|
||||||
"ext/base64",
|
|
||||||
"add/array",
|
|
||||||
"add/three",
|
|
||||||
"geo/base",
|
|
||||||
"geo/point",
|
|
||||||
"geo/points",
|
|
||||||
"geo/slope",
|
|
||||||
"geo/line",
|
|
||||||
"geo/bounds",
|
|
||||||
"geo/polygons",
|
|
||||||
"geo/polygon",
|
|
||||||
"geo/mesh",
|
|
||||||
"data/local",
|
|
||||||
"data/index",
|
|
||||||
"moto/ajax",
|
|
||||||
"moto/orbit",
|
|
||||||
"moto/space",
|
|
||||||
"load/3mf",
|
|
||||||
"load/obj",
|
|
||||||
"load/stl",
|
|
||||||
"load/svg",
|
|
||||||
"load/url",
|
|
||||||
"load/file",
|
|
||||||
"moto/broker",
|
|
||||||
"moto/webui",
|
|
||||||
"kiri/conf",
|
|
||||||
"kiri/consts",
|
|
||||||
"kiri/utils",
|
|
||||||
"kiri/stats",
|
|
||||||
"kiri/api",
|
|
||||||
"kiri/ui",
|
|
||||||
"kiri/pack",
|
|
||||||
"kiri/lang",
|
|
||||||
"kiri/lang-en",
|
|
||||||
"kiri/files",
|
|
||||||
"kiri/slice",
|
|
||||||
"kiri/layers",
|
|
||||||
"kiri/client",
|
|
||||||
"kiri-mode/fdm/fill",
|
|
||||||
"kiri-mode/fdm/driver",
|
|
||||||
"kiri-mode/fdm/client",
|
|
||||||
"kiri-mode/sla/driver",
|
|
||||||
"kiri-mode/sla/client",
|
|
||||||
"kiri-mode/cam/driver",
|
|
||||||
"kiri-mode/cam/client",
|
|
||||||
"kiri-mode/cam/tool",
|
|
||||||
"kiri-mode/cam/animate",
|
|
||||||
"kiri-mode/laser/driver",
|
|
||||||
"kiri/alerts",
|
|
||||||
"kiri/stack",
|
|
||||||
"kiri/stacks",
|
|
||||||
"kiri/widget",
|
|
||||||
"kiri/widgets",
|
|
||||||
"kiri/function",
|
|
||||||
"kiri/platform",
|
|
||||||
"kiri/selection",
|
|
||||||
"kiri/settings",
|
|
||||||
"kiri/codec",
|
|
||||||
"kiri/main",
|
|
||||||
"kiri/init",
|
|
||||||
"kiri/do",
|
|
||||||
"kiri/export",
|
|
||||||
"kiri/tools",
|
|
||||||
"kiri/frame",
|
|
||||||
"@devices",
|
"@devices",
|
||||||
"@icons",
|
"@icons",
|
||||||
|
"&main/kiri",
|
||||||
|
"&kiri/lang-en"
|
||||||
],
|
],
|
||||||
kiri_work : [
|
kiri_work : [
|
||||||
"main/gapp",
|
// "main/gapp",
|
||||||
"moto/license",
|
"moto/license",
|
||||||
"main/kiri",
|
|
||||||
"@inject",
|
"@inject",
|
||||||
"ext/three",
|
"ext/three",
|
||||||
"ext/pngjs",
|
"ext/pngjs",
|
||||||
|
|
@ -456,12 +442,12 @@ const script = {
|
||||||
"kiri-mode/laser/driver",
|
"kiri-mode/laser/driver",
|
||||||
"kiri/widget",
|
"kiri/widget",
|
||||||
"kiri/codec",
|
"kiri/codec",
|
||||||
"kiri/worker"
|
"kiri/worker",
|
||||||
|
"main/kiri",
|
||||||
],
|
],
|
||||||
kiri_pool : [
|
kiri_pool : [
|
||||||
"main/gapp",
|
// "main/gapp",
|
||||||
"moto/license",
|
"moto/license",
|
||||||
"main/kiri",
|
|
||||||
"@inject",
|
"@inject",
|
||||||
"ext/clip2",
|
"ext/clip2",
|
||||||
"ext/earcut",
|
"ext/earcut",
|
||||||
|
|
@ -486,10 +472,11 @@ const script = {
|
||||||
"kiri/layers",
|
"kiri/layers",
|
||||||
"kiri/widget",
|
"kiri/widget",
|
||||||
"kiri/codec",
|
"kiri/codec",
|
||||||
"kiri/minion"
|
"kiri/minion",
|
||||||
|
"main/kiri",
|
||||||
],
|
],
|
||||||
engine : [
|
engine : [
|
||||||
"main/gapp",
|
// "main/gapp",
|
||||||
"moto/license",
|
"moto/license",
|
||||||
"main/kiri",
|
"main/kiri",
|
||||||
"@inject",
|
"@inject",
|
||||||
|
|
@ -520,11 +507,11 @@ const script = {
|
||||||
"kiri-run/engine"
|
"kiri-run/engine"
|
||||||
],
|
],
|
||||||
frame : [
|
frame : [
|
||||||
"main/gapp",
|
// "main/gapp",
|
||||||
"kiri-run/frame"
|
"kiri-run/frame"
|
||||||
],
|
],
|
||||||
meta : [
|
meta : [
|
||||||
"main/gapp",
|
// "main/gapp",
|
||||||
"moto/license",
|
"moto/license",
|
||||||
"main/meta",
|
"main/meta",
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// use: add.array
|
||||||
gapp.register("add.class", [], (root, exports) => {
|
gapp.register("add.class", [], (root, exports) => {
|
||||||
|
|
||||||
self.ArrayWriter = class ArrayWriter {
|
self.ArrayWriter = class ArrayWriter {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// use: add.array
|
||||||
|
// use: add.class
|
||||||
gapp.register("geo.base", [], (root, exports) => {
|
gapp.register("geo.base", [], (root, exports) => {
|
||||||
|
|
||||||
const base = root.base = {};
|
const base = root.base = {};
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: geo.base
|
||||||
// dep: ext.clip2
|
// dep: ext.clip2
|
||||||
// dep: geo.point
|
// dep: geo.point
|
||||||
// dep: geo.bounds
|
// dep: geo.bounds
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,15 @@
|
||||||
// dep: geo.line
|
// dep: geo.line
|
||||||
// dep: geo.point
|
// dep: geo.point
|
||||||
// dep: geo.polygon
|
// dep: geo.polygon
|
||||||
|
// dep: geo.polygons
|
||||||
gapp.register("geo.slicer", [], (root, exports) => {
|
gapp.register("geo.slicer", [], (root, exports) => {
|
||||||
|
|
||||||
const { base } = root;
|
const { base } = root;
|
||||||
const { config, util, polygons } = base
|
const { config, util, polygons } = base
|
||||||
const { newOrderedLine, newPolygon, newPoint } = base;
|
const { newOrderedLine, newPolygon, newPoint } = base;
|
||||||
|
|
||||||
|
const POLY = base.polygons;
|
||||||
|
|
||||||
function dval(v, dv) {
|
function dval(v, dv) {
|
||||||
return v !== undefined ? v : dv;
|
return v !== undefined ? v : dv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
|
// use: kiri-mode.cam.animate
|
||||||
gapp.register("kiri-mode.cam.client", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.client", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,15 @@
|
||||||
// dep: main.kiri
|
// dep: main.kiri
|
||||||
// use: kiri.api
|
// use: kiri.api
|
||||||
// use: kiri.widgets
|
// use: kiri.widgets
|
||||||
|
// use: kiri-mode.cam.client
|
||||||
|
// use: kiri-mode.cam.slice
|
||||||
|
// use: kiri-mode.cam.prepare
|
||||||
|
// use: kiri-mode.cam.export
|
||||||
|
// use: kiri-mode.cam.tool
|
||||||
gapp.register("kiri-mode.cam.driver", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.driver", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri } = root;
|
const { kiri } = root;
|
||||||
const { driver } = kiri;
|
const { driver } = kiri;
|
||||||
|
|
||||||
const CAM = driver.CAM = {};
|
const CAM = driver.CAM = {};
|
||||||
|
|
||||||
CAM.process = {
|
CAM.process = {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
// dep: geo.polygons
|
// dep: geo.polygons
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
gapp.register("kiri-mode.cam.export", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.export", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
// dep: geo.paths
|
// dep: geo.paths
|
||||||
// dep: geo.point
|
// dep: geo.point
|
||||||
// dep: geo.polygons
|
// dep: geo.polygons
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
|
// use: kiri-mode.cam.ops
|
||||||
gapp.register("kiri-mode.cam.prepare", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.prepare", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
// dep: geo.point
|
// dep: geo.point
|
||||||
// dep: geo.polygons
|
// dep: geo.polygons
|
||||||
// dep: kiri.slice
|
// dep: kiri.slice
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
|
// use: kiri-mode.cam.slicer
|
||||||
|
// use: kiri-mode.cam.ops
|
||||||
gapp.register("kiri-mode.cam.slice", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.slice", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
gapp.register("kiri-mode.cam.tools", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.tools", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri } = root;
|
const { kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,13 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: geo.base
|
||||||
|
// dep: geo.line
|
||||||
|
// dep: geo.point
|
||||||
|
// dep: geo.polygon
|
||||||
|
// dep: geo.polygons
|
||||||
|
// dep: kiri.slice
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
gapp.register("kiri-mode.cam.tools", [], (root, exports) => {
|
gapp.register("kiri-mode.cam.tools", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// use: kiri.api
|
// use: kiri.api
|
||||||
|
// use: kiri-mode.fdm.client
|
||||||
|
// use: kiri-mode.fdm.slice
|
||||||
|
// use: kiri-mode.fdm.prepare
|
||||||
|
// use: kiri-mode.fdm.export
|
||||||
gapp.register("kiri-mode.fdm.driver", [], (root, exports) => {
|
gapp.register("kiri-mode.fdm.driver", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri } = root;
|
const { kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
// dep: kiri.util
|
// dep: kiri.utils
|
||||||
// dep: kiri-mode.fdm.driver
|
// dep: kiri-mode.fdm.driver
|
||||||
gapp.register("kiri-mode.fdm.export", [], (root, exports) => {
|
gapp.register("kiri-mode.fdm.export", [], (root, exports) => {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
// dep: kiri.slice
|
// dep: kiri.slice
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri-mode.fdm.driver
|
// dep: kiri-mode.fdm.driver
|
||||||
// use: kiri.worker
|
// use: kiri.client
|
||||||
gapp.register("kiri-mode.fdm.prepare", [], (root, exports) => {
|
gapp.register("kiri-mode.fdm.prepare", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri, noop } = root;
|
const { base, kiri, noop } = root;
|
||||||
|
|
@ -1403,7 +1403,7 @@ function slicePrintPath(print, slice, startPoint, offset, output, opt = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
FDM.isDark = function() {
|
FDM.isDark = function() {
|
||||||
return current.print.settings.controller.dark ? true : false;
|
return worker.print.settings.controller.dark ? true : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
FDM.rateToColor = function(rate, max) {
|
FDM.rateToColor = function(rate, max) {
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
|
// dep: geo.slicer
|
||||||
// dep: geo.polygons
|
// dep: geo.polygons
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
// dep: kiri.fill
|
|
||||||
// dep: kiri.utils
|
// dep: kiri.utils
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri-mode.fdm.driver
|
// dep: kiri-mode.fdm.driver
|
||||||
// use: add.clip2
|
// use: kiri-mode.fdm.fill
|
||||||
|
// use: ext.clip2
|
||||||
// use: add.three
|
// use: add.three
|
||||||
gapp.register("kiri-mode.fdm.slice", [], (root, exports) => {
|
gapp.register("kiri-mode.fdm.slice", [], (root, exports) => {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: base.polygons
|
// dep: geo.polygons
|
||||||
// dep: base.point
|
// dep: geo.point
|
||||||
// dep: kiri.slice
|
// dep: kiri.slice
|
||||||
gapp.register("kiri-mode.laser.driver", [], (root, exports) => {
|
gapp.register("kiri-mode.laser.driver", [], (root, exports) => {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// use: kiri.print
|
// use: kiri.print
|
||||||
// use: kiri.worker
|
// use: kiri.client
|
||||||
|
// use: kiri-mode.sla.client
|
||||||
|
// use: kiri-mode.sla.slice
|
||||||
|
// use: kiri-mode.sla.export
|
||||||
gapp.register("kiri-mode.sla.driver", [], (root, exports) => {
|
gapp.register("kiri-mode.sla.driver", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri } = root
|
const { kiri } = root
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
// dep: kiri-mode.sla.driver
|
// dep: kiri-mode.sla.driver
|
||||||
// dep: kiri-mode.sla.x_cxdlp
|
// dep: kiri-mode.sla.x_cxdlp
|
||||||
// dep: kiri-mode.sla.x_photons
|
// dep: kiri-mode.sla.x_photon
|
||||||
gapp.register("kiri-mode.sla.export", [], (root, exports) => {
|
gapp.register("kiri-mode.sla.export", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root
|
const { base, kiri } = root
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: main.kiri
|
|
||||||
// dep: data.local
|
// dep: data.local
|
||||||
// dep: kiri.utils
|
// dep: kiri.utils
|
||||||
|
// dep: kiri.consts
|
||||||
// use: kiri.client
|
// use: kiri.client
|
||||||
// use: kiri.settings
|
// use: kiri.settings
|
||||||
gapp.register("kiri.api", [], (root, exports) => {
|
gapp.register("kiri.api", [], (root, exports) => {
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@
|
||||||
|
|
||||||
// dep: main.kiri
|
// dep: main.kiri
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
|
// dep: geo.polygon
|
||||||
|
// dep: kiri.widget
|
||||||
|
// dep: kiri.slice
|
||||||
|
// dep: kiri.layers
|
||||||
gapp.register("kiri.codec", [], (root, exports) => {
|
gapp.register("kiri.codec", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
// dep: data.local
|
// dep: data.local
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
|
// dep: kiri.main
|
||||||
gapp.register("kiri.export", [], (root, exports) => {
|
gapp.register("kiri.export", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, data, kiri } = root;
|
const { base, data, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// use: load.stl
|
// use: load.stl
|
||||||
// use: load.svg
|
// use: load.svg
|
||||||
// use: kiri.api
|
// use: kiri.api
|
||||||
// use: kiri.feature
|
|
||||||
// use: kiri.platform
|
// use: kiri.platform
|
||||||
// use: kiri.settings
|
// use: kiri.settings
|
||||||
// use: kiri.widget
|
// use: kiri.widget
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,12 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
|
// dep: kiri.export
|
||||||
// dep: moto.space
|
// dep: moto.space
|
||||||
|
// dep: kiri-mode.cam.driver
|
||||||
|
// dep: kiri-mode.fdm.driver
|
||||||
|
// dep: kiri-mode.sla.driver
|
||||||
|
// dep: kiri-mode.laser.driver
|
||||||
gapp.register("kiri.function", [], (root, exports) => {
|
gapp.register("kiri.function", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri, noop } = root;
|
const { kiri, noop } = root;
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,13 @@
|
||||||
|
|
||||||
// dep: geo.base
|
// dep: geo.base
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
|
// dep: kiri.main
|
||||||
|
// dep: kiri.lang
|
||||||
// dep: kiri.stats
|
// dep: kiri.stats
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri.platform
|
// dep: kiri.platform
|
||||||
// dep: kiri.selection
|
// dep: kiri.selection
|
||||||
|
// use: kiri.pack
|
||||||
gapp.register("kiri.init", [], (root, exports) => {
|
gapp.register("kiri.init", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
@ -2891,7 +2894,6 @@ gapp.register("kiri.init", [], (root, exports) => {
|
||||||
// if a language needs to load, the script is injected and loaded
|
// if a language needs to load, the script is injected and loaded
|
||||||
// first. once this loads, or doesn't, the initialization begins
|
// first. once this loads, or doesn't, the initialization begins
|
||||||
let lang = SETUP.ln ? SETUP.ln[0] : sdb.getItem('kiri-lang') || kiri.lang.get();
|
let lang = SETUP.ln ? SETUP.ln[0] : sdb.getItem('kiri-lang') || kiri.lang.get();
|
||||||
|
|
||||||
// inject language script if not english
|
// inject language script if not english
|
||||||
if (lang && lang !== 'en' && lang !== 'en-us') {
|
if (lang && lang !== 'en' && lang !== 'en-us') {
|
||||||
let map = kiri.lang.map(lang);
|
let map = kiri.lang.map(lang);
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,29 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: main.kiri
|
||||||
|
// dep: moto.license
|
||||||
|
// dep: geo.base
|
||||||
|
// dep: kiri.ui
|
||||||
|
// dep: kiri.api
|
||||||
|
// dep: kiri.conf
|
||||||
|
// dep: kiri.lang
|
||||||
|
// dep: kiri.utils
|
||||||
|
// dep: kiri.files
|
||||||
|
// dep: kiri.consts
|
||||||
|
// dep: kiri.widget
|
||||||
|
// dep: kiri.stats
|
||||||
|
// dep: kiri.stacks
|
||||||
|
// dep: kiri.function
|
||||||
|
// dep: kiri.platform
|
||||||
|
// dep: kiri.selection
|
||||||
|
// dep: kiri.settings
|
||||||
|
// use: kiri.alerts
|
||||||
|
// use: kiri.files
|
||||||
|
// use: kiri.frame
|
||||||
gapp.register("kiri.main", [], (root, exports) => {
|
gapp.register("kiri.main", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, data, load, kiri, moto, noop } = root;
|
const { base, data, kiri, moto, noop } = root;
|
||||||
const { api, consts, lang, Widget, newWidget, utils, stats } = kiri;
|
const { api, consts, lang, Widget, newWidget, utils, stats } = kiri;
|
||||||
const { areEqual, parseOpt, encodeOpt, ajax, o2js, js2o, ls2o } = utils;
|
const { areEqual, parseOpt, encodeOpt, ajax, o2js, js2o, ls2o } = utils;
|
||||||
const { feature, platform, selection, settings } = api;
|
const { feature, platform, selection, settings } = api;
|
||||||
|
|
@ -939,7 +959,7 @@ gapp.register("kiri.main", [], (root, exports) => {
|
||||||
DOC.onkeydown = function (evt) { if (evt.keyCode == 27) evt.preventDefault() }
|
DOC.onkeydown = function (evt) { if (evt.keyCode == 27) evt.preventDefault() }
|
||||||
|
|
||||||
// complete module loading
|
// complete module loading
|
||||||
kiri.load_exec();
|
// kiri.load_exec();
|
||||||
|
|
||||||
// upon restore, seed presets
|
// upon restore, seed presets
|
||||||
api.event.emit('preset', api.conf.dbo());
|
api.event.emit('preset', api.conf.dbo());
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
gapp.register("kiri.minion", [], (root, exports) => {
|
||||||
|
|
||||||
let BASE = self.base,
|
let BASE = self.base,
|
||||||
KIRI = self.kiri,
|
KIRI = self.kiri,
|
||||||
UTIL = BASE.util,
|
UTIL = BASE.util,
|
||||||
|
|
@ -125,3 +127,5 @@ const funcs = {
|
||||||
reply({ seq, error: "invalid command" });
|
reply({ seq, error: "invalid command" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: moto.space
|
// dep: moto.space
|
||||||
|
// dep: moto.webui
|
||||||
// dep: kiri.api
|
// dep: kiri.api
|
||||||
// dep: kiri.consts
|
// dep: kiri.consts
|
||||||
// dep: kiri.utils
|
// dep: kiri.utils
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,9 @@
|
||||||
|
|
||||||
gapp.register("kiri.ui", [], (root, exports) => {
|
gapp.register("kiri.ui", [], (root, exports) => {
|
||||||
|
|
||||||
if (kiri.ui) return;
|
const { kiri } = root;
|
||||||
|
|
||||||
let SELF = self,
|
let DOC = self.document,
|
||||||
KIRI = self.kiri,
|
|
||||||
DOC = SELF.document,
|
|
||||||
inputAction = null,
|
inputAction = null,
|
||||||
lastGroup = null,
|
lastGroup = null,
|
||||||
lastDiv = null,
|
lastDiv = null,
|
||||||
|
|
@ -36,9 +34,9 @@ gapp.register("kiri.ui", [], (root, exports) => {
|
||||||
lastPop = null,
|
lastPop = null,
|
||||||
savePop = null;
|
savePop = null;
|
||||||
|
|
||||||
SELF.$ = (SELF.$ || function (id) { return DOC.getElementById(id) } );
|
self.$ = (self.$ || function (id) { return DOC.getElementById(id) } );
|
||||||
|
|
||||||
KIRI.ui = {
|
kiri.ui = {
|
||||||
prefix: function(pre) { prefix = pre; return kiri.ui },
|
prefix: function(pre) { prefix = pre; return kiri.ui },
|
||||||
inputAction: function(fn) { inputAction = fn; return kiri.ui },
|
inputAction: function(fn) { inputAction = fn; return kiri.ui },
|
||||||
lastChange: function() { return lastChange },
|
lastChange: function() { return lastChange },
|
||||||
|
|
@ -128,7 +126,7 @@ gapp.register("kiri.ui", [], (root, exports) => {
|
||||||
}
|
}
|
||||||
$('mod-any').innerHTML = html.join('');
|
$('mod-any').innerHTML = html.join('');
|
||||||
function done(value) {
|
function done(value) {
|
||||||
KIRI.api.modal.hide();
|
kiri.api.modal.hide();
|
||||||
setTimeout(() => { resolve(value) }, 150);
|
setTimeout(() => { resolve(value) }, 150);
|
||||||
}
|
}
|
||||||
if (iid) {
|
if (iid) {
|
||||||
|
|
@ -148,7 +146,7 @@ gapp.register("kiri.ui", [], (root, exports) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
KIRI.api.modal.show('any');
|
kiri.api.modal.show('any');
|
||||||
if (iid) {
|
if (iid) {
|
||||||
iid.focus();
|
iid.focus();
|
||||||
iid.selectionStart = iid.value.length;
|
iid.selectionStart = iid.value.length;
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: data.local
|
// dep: data.local
|
||||||
// dep: main.kiri
|
|
||||||
// use: moto.ajax
|
// use: moto.ajax
|
||||||
gapp.register("kiri.utils", [], (root, exports) => {
|
gapp.register("kiri.utils", [], (root, exports) => {
|
||||||
|
|
||||||
const { kiri, moto, data } = root;
|
const { kiri, data } = root;
|
||||||
|
|
||||||
function parseOpt(ov) {
|
function parseOpt(ov) {
|
||||||
let opt = {}, kv, kva;
|
let opt = {}, kv, kva;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,13 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
// dep: geo.base
|
||||||
|
// dep: geo.mesh
|
||||||
|
// dep: geo.point
|
||||||
|
// dep: geo.points
|
||||||
|
// dep: geo.polygons
|
||||||
|
// dep: kiri.utils
|
||||||
|
// use: kiri.codec
|
||||||
gapp.register("kiri.widget", [], (root, exports) => {
|
gapp.register("kiri.widget", [], (root, exports) => {
|
||||||
|
|
||||||
const { base, kiri } = root;
|
const { base, kiri } = root;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const { base, kiri } = self;
|
gapp.register("kiri.worker", [], (root, exports) => {
|
||||||
|
|
||||||
|
const { base, kiri } = root;
|
||||||
const { util, polygons, wasm_ctrl } = base;
|
const { util, polygons, wasm_ctrl } = base;
|
||||||
const { codec } = kiri;
|
const { codec } = kiri;
|
||||||
const { time } = util;
|
const { time } = util;
|
||||||
|
|
@ -874,5 +876,7 @@ dispatch.onmessage = self.onmessage = function(e) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
// load kiri modules
|
// load kiri modules
|
||||||
kiri.load_exec(dispatch);
|
// kiri.load_exec(dispatch);
|
||||||
|
|
|
||||||
|
|
@ -66,26 +66,7 @@ gapp.overlay = Object.assign;
|
||||||
|
|
||||||
// register module without a load function
|
// register module without a load function
|
||||||
gapp.register = (name, deps, fn) => {
|
gapp.register = (name, deps, fn) => {
|
||||||
gapp.load(undefined, name, deps);
|
gapp.load(fn, name, deps);
|
||||||
if (fn) {
|
|
||||||
let toks = name.split('.');
|
|
||||||
let root = self;
|
|
||||||
let map = toks.pop();
|
|
||||||
for (let tok of toks) {
|
|
||||||
if (!root[tok]) {
|
|
||||||
dbug.debug({creating_root: tok, for: name});
|
|
||||||
root = root[tok] = {};
|
|
||||||
} else {
|
|
||||||
root = root[tok];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let tmp = root[map] || {};
|
|
||||||
fn(self, exports => {
|
|
||||||
if (exports) {
|
|
||||||
return root[map] = Object.assign(tmp, exports);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// register module with a load function
|
// register module with a load function
|
||||||
|
|
@ -108,7 +89,10 @@ gapp.check = (name, deps = []) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// perform dependency checks and run module load functions
|
// perform dependency checks and run module load functions
|
||||||
gapp.main = (app, deps, fn) => {
|
gapp.main = (app, deps, post, pre) => {
|
||||||
|
const root = self;
|
||||||
|
// optional fn to run before loading
|
||||||
|
if (pre) pre(root);
|
||||||
// app loader may also pass deps
|
// app loader may also pass deps
|
||||||
gapp.check(app, deps);
|
gapp.check(app, deps);
|
||||||
// load mods after checking if dependency is present
|
// load mods after checking if dependency is present
|
||||||
|
|
@ -123,13 +107,29 @@ gapp.main = (app, deps, fn) => {
|
||||||
}
|
}
|
||||||
// mods with no function are allowed so they can be depended on
|
// mods with no function are allowed so they can be depended on
|
||||||
if (fn) {
|
if (fn) {
|
||||||
mod.fn();
|
let toks = name.split('.');
|
||||||
|
let map = toks.pop();
|
||||||
|
let path = root;
|
||||||
|
for (let tok of toks) {
|
||||||
|
if (!path[tok]) {
|
||||||
|
dbug.debug({creating_root: tok, for: name});
|
||||||
|
path = path[tok] = {};
|
||||||
|
} else {
|
||||||
|
path = path[tok];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let tmp = path[map] || {};
|
||||||
|
fn(root, exports => {
|
||||||
|
if (exports) {
|
||||||
|
return path[map] = Object.assign(tmp, exports);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// force runtime error if gapp.load() called gapp.main()
|
// force runtime error if gapp.load() called gapp.main()
|
||||||
mods = null;
|
mods = null;
|
||||||
// optional if not called inline with startup
|
// optional if not called inline with startup
|
||||||
if (fn) fn(self);
|
if (post) post(root);
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -2,22 +2,32 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
gapp.register("main.kiri", [], (root) => {
|
// use: kiri.init
|
||||||
|
// use: kiri.main
|
||||||
|
gapp.main("main.kiri", [], (root) => {
|
||||||
|
|
||||||
const modfns = root.kirimod = [];
|
const { kiri } = root;
|
||||||
|
const { api } = kiri;
|
||||||
|
|
||||||
const kiri = root.kiri = {
|
// complete module loading
|
||||||
beta: 3303,
|
kiri.load_exec();
|
||||||
driver: {}, // driver modules
|
|
||||||
load(fn) {
|
}, (root) => {
|
||||||
modfns.push(fn);
|
|
||||||
},
|
const modfns = root.kirimod = [];
|
||||||
load_exec(api) {
|
|
||||||
// complete module loading
|
const kiri = root.kiri = {
|
||||||
modfns.forEach(modfn => { modfn(api || kiri.api)} );
|
beta: 3303,
|
||||||
// rewrite load() to be immediate post-finalize
|
driver: {}, // driver modules
|
||||||
kiri.load = (modfn) => { modfn(api || kiri.api) };
|
load(fn) {
|
||||||
}
|
modfns.push(fn);
|
||||||
};
|
},
|
||||||
|
load_exec(api) {
|
||||||
|
// complete module loading
|
||||||
|
modfns.forEach(modfn => { modfn(api || kiri.api)} );
|
||||||
|
// rewrite load() to be immediate post-finalize
|
||||||
|
kiri.load = (modfn) => { modfn(api || kiri.api) };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
// dep: moto.broker
|
// dep: moto.broker
|
||||||
// dep: moto.space
|
// dep: moto.space
|
||||||
// dep: mesh.util
|
// dep: mesh.util
|
||||||
// dep: add.array
|
|
||||||
// dep: ext.three
|
// dep: ext.three
|
||||||
// dep: ext.three-bgu
|
// dep: ext.three-bgu
|
||||||
|
// use: add.array
|
||||||
gapp.register("mesh.api", [], (root, exports) => {
|
gapp.register("mesh.api", [], (root, exports) => {
|
||||||
|
|
||||||
const { Matrix4, Vector3 } = THREE;
|
const { Matrix4, Vector3 } = THREE;
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,9 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
gapp.register("moto.client", [
|
// dep: add.array
|
||||||
|
// dep: moto.broker
|
||||||
"add.array", // dep: add.array
|
gapp.register("moto.client", [], (root, exports) => {
|
||||||
"moto.broker", // dep: moto.broker
|
|
||||||
|
|
||||||
], (root, exports) => {
|
|
||||||
|
|
||||||
let ccvalue = self.navigator ? navigator.hardwareConcurrency || 1 : 1,
|
let ccvalue = self.navigator ? navigator.hardwareConcurrency || 1 : 1,
|
||||||
ccmax = ccvalue > 3 ? ccvalue - 1 : 1,
|
ccmax = ccvalue > 3 ? ccvalue - 1 : 1,
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,10 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// dep: ext.tween
|
// dep: ext.tween
|
||||||
gapp.register("moto.space", [
|
// dep: add.three
|
||||||
|
// dep: add.array
|
||||||
'add.three', // dep: add.three
|
// dep: moto.orbit
|
||||||
'add.array', // dep: add.array
|
gapp.register("moto.space", [], (root, exports) => {
|
||||||
'moto.orbit' // dep: moto.orbit
|
|
||||||
|
|
||||||
], (root, exports) => {
|
|
||||||
|
|
||||||
const { moto } = root;
|
const { moto } = root;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// English language map. Other localization maps will
|
// English language map. Other localization maps will
|
||||||
// defer to English map for any missing key/value pairs
|
// defer to English map for any missing key/value pairs
|
||||||
kiri.lang['en'] =
|
self.kiri.lang['en'] =
|
||||||
kiri.lang['en-us'] = {
|
self.kiri.lang['en-us'] = {
|
||||||
// common keys and menus
|
// common keys and menus
|
||||||
animate: "animate", // CAM animate button
|
animate: "animate", // CAM animate button
|
||||||
arrange: "arrange", // layout workspace objects
|
arrange: "arrange", // layout workspace objects
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue