goby-database 2.1.15 → 2.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -942,16 +942,19 @@ export default class Project {
|
|
|
942
942
|
let blocks = blocks_sql.map(a => (Object.assign(Object.assign({}, a), { metadata: JSON.parse(a.metadata) })));
|
|
943
943
|
// for(let block of blocks) block.metadata=JSON.parse(block.metadata);
|
|
944
944
|
// get any relevant root items
|
|
945
|
-
|
|
945
|
+
const items = this.db.prepare(`SELECT system_root.*
|
|
946
946
|
FROM system_root
|
|
947
947
|
LEFT JOIN workspace_${id}
|
|
948
948
|
ON system_root.id = workspace_${id}.thing_id
|
|
949
949
|
WHERE workspace_${id}.type = 'item';
|
|
950
950
|
`).all();
|
|
951
|
-
// get any relevant classes
|
|
951
|
+
// get any relevant classes
|
|
952
|
+
const classes = this.class_cache.filter((cls) => blocks.find((block) => { block.thing_type == 'class' && block.thing_id == cls.id; }));
|
|
953
|
+
// NOTE: could possibly add class items as well in the future
|
|
952
954
|
return {
|
|
953
955
|
blocks,
|
|
954
|
-
items
|
|
956
|
+
items,
|
|
957
|
+
classes
|
|
955
958
|
};
|
|
956
959
|
}
|
|
957
960
|
action_config_window({ type, open, metadata = { pos: [null, null], size: [1000, 700] }, id }) {
|