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 CHANGED
@@ -99,6 +99,7 @@ export default class Project {
99
99
  retrieve_workspace_contents(id: number): {
100
100
  blocks: WorkspaceBlock[];
101
101
  items: unknown[];
102
+ classes: ClassData[];
102
103
  };
103
104
  action_config_window({ type, open, metadata, id }: {
104
105
  type: ApplicationWindow["type"];
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
- let items = this.db.prepare(`SELECT system_root.*
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 (going to hold off from this for now)
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 }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goby-database",
3
- "version": "2.1.15",
3
+ "version": "2.1.17",
4
4
  "description": "This will hold the core better-sqlite3-powered application for creating and modifying goby databases",
5
5
  "main": "dist/index.js",
6
6
  "files": [