Skip to content

Commit

Permalink
chore: update components with ui interface
Browse files Browse the repository at this point in the history
  • Loading branch information
agviegas committed Nov 5, 2024
1 parent 56eddd6 commit c5aebe2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components",
"description": "Collection of core functionalities to author BIM apps.",
"version": "2.4.0-alpha.20",
"version": "2.4.0-alpha.21",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/core/Types/src/component-with-ui.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Component } from "./component";
import { Configurator } from "../../ConfigManager";

export type ComponentUIElement = {
name: string;
id: string;
icon: string;
componentID: string;
attributes: { [name: string]: string };
get: () => HTMLElement;
get: () => { element: HTMLElement; config?: Configurator<any, any> };
};

export abstract class ComponentWithUI extends Component {
Expand Down
4 changes: 2 additions & 2 deletions packages/front/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thatopen/components-front",
"description": "Collection of frontend tools to author BIM apps.",
"version": "2.4.0-alpha.22",
"version": "2.4.0-alpha.23",
"author": "That Open Company",
"contributors": [
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
Expand Down Expand Up @@ -47,7 +47,7 @@
"web-ifc": "0.0.61"
},
"dependencies": {
"@thatopen/components": ">=2.4.0-alpha.20",
"@thatopen/components": ">=2.4.0-alpha.21",
"camera-controls": "2.7.3",
"dexie": "^4.0.4",
"earcut": "^2.2.4",
Expand Down
11 changes: 5 additions & 6 deletions resources/mock-cloud-component-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ class PlatformComponent extends OBC.ComponentWithUI {
return [
{
name: "Panel",
id: "panel",
icon: "",
componentID: PlatformComponent.uuid,
attributes: {
label: "Hello"
},
get: () => {
const panel = BUI.Component.create(() => {
return BUI.html`
<bim-panel></bim-panel>
`;
<bim-panel></bim-panel>
`;
});
this._uiElements.add(panel);
return panel;
return { element: panel };
}
}
];
Expand Down
11 changes: 5 additions & 6 deletions resources/mock-cloud-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ class PlatformComponent extends OBC.ComponentWithUI {
return [
{
name: "Panel",
id: "panel",
icon: "",
componentID: PlatformComponent.uuid,
attributes: {
label: "Hello"
},
get: () => {
const panel = BUI.Component.create(() => {
return BUI.html`
<bim-panel></bim-panel>
`;
<bim-panel></bim-panel>
`;
});
this._uiElements.add(panel);
return panel;
return { element: panel };
}
}
];
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@thatopen/components-front@workspace:packages/front"
dependencies:
"@thatopen/components": ">=2.4.0-alpha.19"
"@thatopen/components": ">=2.4.0-alpha.20"
"@thatopen/fragments": ">=2.4.0-alpha.9"
"@thatopen/ui": ~2.3.0
"@thatopen/ui-obc": ~2.3.0
Expand All @@ -709,7 +709,7 @@ __metadata:
languageName: unknown
linkType: soft

"@thatopen/components@>=2.4.0-alpha.19, @thatopen/components@workspace:packages/core":
"@thatopen/components@>=2.4.0-alpha.20, @thatopen/components@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@thatopen/components@workspace:packages/core"
dependencies:
Expand Down

0 comments on commit c5aebe2

Please sign in to comment.