From c5aebe2f1ea45f12761ce45998da84302ef3bfc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Gonz=C3=A1lez=20Viegas?= Date: Tue, 5 Nov 2024 17:07:40 +0100 Subject: [PATCH] chore: update components with ui interface --- packages/core/package.json | 2 +- packages/core/src/core/Types/src/component-with-ui.ts | 4 ++-- packages/front/package.json | 4 ++-- resources/mock-cloud-component-2.js | 11 +++++------ resources/mock-cloud-component.js | 11 +++++------ yarn.lock | 4 ++-- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 898d1d02e..71658f380 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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)", diff --git a/packages/core/src/core/Types/src/component-with-ui.ts b/packages/core/src/core/Types/src/component-with-ui.ts index 6da64aeae..1a7173799 100644 --- a/packages/core/src/core/Types/src/component-with-ui.ts +++ b/packages/core/src/core/Types/src/component-with-ui.ts @@ -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 }; }; export abstract class ComponentWithUI extends Component { diff --git a/packages/front/package.json b/packages/front/package.json index 1da9c78db..0f935b663 100644 --- a/packages/front/package.json +++ b/packages/front/package.json @@ -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)", @@ -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", diff --git a/resources/mock-cloud-component-2.js b/resources/mock-cloud-component-2.js index f25eb3368..86de87c8f 100644 --- a/resources/mock-cloud-component-2.js +++ b/resources/mock-cloud-component-2.js @@ -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` - - `; + + `; }); this._uiElements.add(panel); - return panel; + return { element: panel }; } } ]; diff --git a/resources/mock-cloud-component.js b/resources/mock-cloud-component.js index a0125f966..7e70a54e3 100644 --- a/resources/mock-cloud-component.js +++ b/resources/mock-cloud-component.js @@ -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` - - `; + + `; }); this._uiElements.add(panel); - return panel; + return { element: panel }; } } ]; diff --git a/yarn.lock b/yarn.lock index f83d8663a..d801eecc3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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 @@ -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: