@roomle/embedding-lib 5.27.0-alpha.1 → 5.27.0-alpha.2

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.
@@ -1,17 +1,18 @@
1
- ## [5.27.0-alpha.1](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.26.0...embedding-lib-v5.27.0-alpha.1) (2025-09-01)
1
+ ## [5.27.0-alpha.2](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.27.0-alpha.1...embedding-lib-v5.27.0-alpha.2) (2025-09-02)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * add open/close icon in the flying menu for construction elements ([a42ba31](https://github.com/roomle-dev/roomle-ui/commit/a42ba319980c42850b3f3d41e65b7d91f29d9712))
7
- * core api - room information ([d82ff87](https://github.com/roomle-dev/roomle-ui/commit/d82ff87b322a1c89953df360ceb70abcfc0aa406))
8
- * hi room information for order data ([3034df5](https://github.com/roomle-dev/roomle-ui/commit/3034df54a39680b5d58a66df06a60ca9a535f752))
9
- * **core:** upgrade to version 2.58.1-alpha.1 ([1f144ee](https://github.com/roomle-dev/roomle-ui/commit/1f144ee761c1604a89abcd7f28b01df28656d288))
10
- * **core:** upgrade to version 2.59.0-alpha.1 ([3021efa](https://github.com/roomle-dev/roomle-ui/commit/3021efabfa5aad20fef86c719b72f37faff5dd25))
11
- * **core:** upgrade to version 2.59.0-alpha.2 ([327b2f2](https://github.com/roomle-dev/roomle-ui/commit/327b2f2f8430f7280b93345709e9e84b68350d61))
12
- * **core:** upgrade to version 2.59.0-alpha.3 ([87d5a75](https://github.com/roomle-dev/roomle-ui/commit/87d5a75d9930face28c442598ed1ed506f52bc47))
6
+ * add recasting for measurement labels to check if the associated line is occluded ([094c80d](https://github.com/roomle-dev/roomle-ui/commit/094c80df3ec9267398f5987943e0cb132d946ff4))
7
+ * move the dimensions label from SDK to UI ([fed29f6](https://github.com/roomle-dev/roomle-ui/commit/fed29f6c3b9e5eec3faab3996bfeace271c5c05a))
8
+ * smart positions of measurements label and add collision detection between labels ([ebf82c6](https://github.com/roomle-dev/roomle-ui/commit/ebf82c63c6b9a52e939c799d6b9b8f1becff3d6b))
9
+ * **core:** upgrade to version 2.59.0-alpha.4 ([d370635](https://github.com/roomle-dev/roomle-ui/commit/d3706359b12d6d258d51d8a8466ef143e7951644))
10
+ * **core:** upgrade to version 2.59.0-alpha.5 ([92227a9](https://github.com/roomle-dev/roomle-ui/commit/92227a93bead21f191cd33711ed936426e5ed4b3))
11
+ * **core:** upgrade to version 2.59.0-alpha.6 ([222e9b0](https://github.com/roomle-dev/roomle-ui/commit/222e9b008715e1de03bed9c3306e4eb32ffe0949))
13
12
 
14
13
 
15
14
  ### Bug Fixes
16
15
 
17
- * update addons on "Add an element" ([a3768bc](https://github.com/roomle-dev/roomle-ui/commit/a3768bcf70d4b26ca11536179ae8642fbb0187f2))
16
+ * dimensioning artifact after zoom in ([7a36d6a](https://github.com/roomle-dev/roomle-ui/commit/7a36d6a18c30ed6cae3a10df9c09485d368e838e))
17
+ * position of dragged in element when in 2d ([e96a5f9](https://github.com/roomle-dev/roomle-ui/commit/e96a5f95d4279ea9908c8b96a1d30a175cedddbf))
18
+ * regenerate lines on camera move 90 degrees ([b089c2e](https://github.com/roomle-dev/roomle-ui/commit/b089c2efe72f3c51d38311d88991bf8e275cdde2))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "5.27.0-alpha.1",
3
+ "version": "5.27.0-alpha.2",
4
4
  "description": "This is a small library which can be used to communicate with the Roomle Configurator",
5
5
  "type": "module",
6
6
  "main": "./roomle-embedding-lib.umd.js",
@@ -711,5 +711,12 @@ export default class RoomleConfigurator<P extends readonly PluginName[] = readon
711
711
  * Resumes all input event listeners on the canvas.
712
712
  */
713
713
  resumeInputListeners(): void;
714
+ /**
715
+ * Directly updates a component parameter.
716
+ * @param runtimeId - The runtime ID of the component to update.
717
+ * @param parameterKey - The key of the parameter to update.
718
+ * @param value - The new value to set for the parameter.
719
+ */
720
+ updateComponentParameter(runtimeId: number, parameterKey: string, value: string): void;
714
721
  }
715
722
  export {};
@@ -9,6 +9,7 @@ import { RoomleComponent } from '../../../common-core/src/webgl/roomle-component
9
9
  import { ConfiguratorDebugCallbacks } from '../configurator-debug-api';
10
10
  import { CancelSelectionReasons } from '../../../typings/planner';
11
11
  import { ExternalConfiguration } from '../../../typings/external-objects';
12
+ import { DimensionLabelsTransferable } from '../../../planner-core/src/utils/measurements';
12
13
 
13
14
  export type ComponentAction = 'edit' | 'add';
14
15
  export type ComponentType = 'preview' | 'component';
@@ -243,6 +244,7 @@ export default class ConfiguratorUiCallbacks extends UiCallback implements Confi
243
244
  * @param rootComponentLabel
244
245
  */
245
246
  onConfigurationLabelChange: (catalogName: string, rapiItemLabel: string, rootComponentLabel: string) => void;
247
+ onDimensionLabelsUpdated: (labels: DimensionLabelsTransferable | null) => void;
246
248
  /**
247
249
  * When kernel failed to load a mesh
248
250
  */
@@ -1,7 +1,17 @@
1
1
  import { RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';
2
2
  import { Context } from '../../../common-core/src/di/context';
3
- import { PerspectiveCamera } from 'three';
3
+ import { OrthographicCamera, Vector3, PerspectiveCamera } from 'three';
4
+ import { Dimensioning, DimensioningAxis } from '../../../typings/kernel';
4
5
 
6
+ export interface DimensionLabelData {
7
+ id: string;
8
+ value: number;
9
+ level: number;
10
+ maxLevel: number;
11
+ dimensioning: Dimensioning;
12
+ axis: DimensioningAxis | undefined;
13
+ interactionKey?: string;
14
+ }
5
15
  export default class ComponentDimensioningHelper implements Context {
6
16
  _creator_: string;
7
17
  private _plannerKernelAccess;
@@ -9,9 +19,28 @@ export default class ComponentDimensioningHelper implements Context {
9
19
  private _camera;
10
20
  private _activeComponents;
11
21
  private _componentDimensioningsExist;
22
+ private _dimensionDataMap;
23
+ private _dimensionObjects;
24
+ private _lastCameraDirection;
25
+ private _regenerationThreshold;
12
26
  constructor(creator: string);
27
+ regenerateDimensions(component: RoomleComponent, updateRenderer?: () => void): Promise<boolean>;
28
+ needsDimensionRegeneration(camera: PerspectiveCamera | OrthographicCamera): boolean;
13
29
  setCamera(camera: PerspectiveCamera): void;
14
- add(component: RoomleComponent, updateRenderer?: () => void): boolean;
30
+ add(component: RoomleComponent, updateRenderer?: () => void): Promise<boolean>;
31
+ /**
32
+ * Get dimension data for a component
33
+ */
34
+ getDimensionData(componentId: number): DimensionLabelData[];
35
+ /**
36
+ * Extract label data from dimension objects
37
+ * This gets the actual calculated positions and values from the Three.js objects
38
+ */
39
+ getLabelData(): DimensionLabelData[];
40
+ /**
41
+ * Get dimension objects to extract their current state
42
+ */
43
+ getDimensionObjects(componentId: number): any[];
15
44
  private _assembleDimensionings;
16
45
  private _findAxis;
17
46
  private _mapDimensioningToAxis;
@@ -22,4 +51,17 @@ export default class ComponentDimensioningHelper implements Context {
22
51
  hasComponentDimensions(): boolean;
23
52
  reset(): Promise<void>;
24
53
  invalidateDimensioningsCache(componentRuntimeId?: number): void;
54
+ /**
55
+ * Get all active components for iteration
56
+ */
57
+ getActiveComponents(): RoomleComponent[];
58
+ updateDimensionVisibility(componentId: number): void;
59
+ /**
60
+ * Get the center of the main dimension line (not extension lines)
61
+ */
62
+ getDimensionLineCenter(componentId: number, dimensionIndex: number): Vector3 | null;
63
+ /**
64
+ * Ensure dimension objects are ready
65
+ */
66
+ ensureDimensionObjectsReady(componentId: number): void;
25
67
  }
@@ -1,7 +1,7 @@
1
1
  import { RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';
2
2
  import { default as ConfiguratorSceneEventHandler } from '../webgl/configurator-scene-event-handler';
3
3
  import { default as ConfiguratorViewModel } from '../../../common-core/src/view-model/configurator-view-model';
4
- import { Object3D, PerspectiveCamera } from 'three';
4
+ import { Object3D, PerspectiveCamera, Vector3 } from 'three';
5
5
 
6
6
  export default class ComponentRaycastHelper {
7
7
  private _object;
@@ -20,4 +20,9 @@ export default class ComponentRaycastHelper {
20
20
  areAllPreviewsVisible(configuratorViewModel: ConfiguratorViewModel): boolean;
21
21
  areAllComponentsInFrustum(previews: RoomleComponent[]): boolean;
22
22
  checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel): void;
23
+ isComponentMeasurementLabelOccluded(labelWorldPos: Vector3, component: RoomleComponent): boolean;
24
+ checkMultipleLabelOcclusion(labelPositions: Array<{
25
+ id: string;
26
+ worldPos: Vector3;
27
+ }>, component: RoomleComponent): Set<string>;
23
28
  }
@@ -39,6 +39,7 @@ export default class DimensioningHelper {
39
39
  removeFromObject(object: Object3D): void;
40
40
  addToUiScene(uiScene: Scene): void;
41
41
  removeFromUiScene(uiScene: Scene): void;
42
+ private _isCameraInsideOrTooClose;
42
43
  private _getWidthEdge;
43
44
  private _getDepthEdge;
44
45
  private _getHeightEdge;
@@ -22,12 +22,14 @@ import { default as CameraBehaviour3d } from '../../../common-core/src/cameracon
22
22
  import { default as GlobalInitData } from '../../../common-core/src/utils/global-init-data';
23
23
  import { CancelSelectionReasons } from '../../../typings/planner';
24
24
  import { ExternalConfiguration } from '../../../typings/external-objects';
25
+ import { default as UnitFormatter } from '../services/unit-formatter';
25
26
 
26
27
  export default class ConfiguratorSceneManager extends SceneManager implements ConfiguratorViewModelCallbackI {
27
28
  _creator_: string;
28
29
  private _configuratorInputManager;
29
30
  private _configuratorMeshGenerator;
30
31
  private _memoryManager;
32
+ protected _unitFormatter: UnitFormatter;
31
33
  protected _configuratorContext: ConfiguratorContext;
32
34
  private _componentDimensioningHelper;
33
35
  private _configuratorHistory;
@@ -42,6 +44,7 @@ export default class ConfiguratorSceneManager extends SceneManager implements Co
42
44
  private _sceneEventHandler;
43
45
  private _currentComponent;
44
46
  private _isComponentDimensionsVisible;
47
+ private _dimensionUpdateDebounced;
45
48
  constructor(creator: string, offset: CanvasOffset, mode: Enumify<typeof CAMERA_TYPE>);
46
49
  private _initOptionalModules;
47
50
  protected _changeCameraBehaviour(cameraBehaviour: CameraBehaviour): void;
@@ -118,6 +121,11 @@ export default class ConfiguratorSceneManager extends SceneManager implements Co
118
121
  showDimensions(): Promise<void>;
119
122
  private _initDimensions;
120
123
  hideDimensions(): void;
124
+ private _updateComponentDimensionLabels;
125
+ /**
126
+ * Resolve label collisions by hiding lower priority overlapping labels
127
+ */
128
+ private _resolveCollisions;
121
129
  loadSceneSettings(sceneSetting: SceneSettings): Promise<void>;
122
130
  protected onCameraChanged(): void;
123
131
  requestDockingsPreview(userInitiated: boolean, possibleChild?: UiPossibleChild, dragEvent?: DragEvent, dragIn?: boolean): void;
@@ -112,4 +112,5 @@ export default class PlannerKernelAccess extends ConfiguratorKernelAccess {
112
112
  private _externalPlanComponentDeleted;
113
113
  dockExternalObjectComponent(parentId: number, parentDockId: number, childId: number, childDockId: number): void;
114
114
  configureExternalObjectApi(externalObjectSettings?: ExternalObjectApiConfiguration): Promise<void>;
115
+ setComponentParameter(componentId: number, interactionKey: string, newValue: any): void;
115
116
  }
@@ -97,6 +97,30 @@ export interface DimensionDefinition<Vector2Type = Vector3 | Position2, Vector3T
97
97
  isCurrentlyDrawn?: boolean;
98
98
  attic?: AtticDimension<Vector2Type, Vector3Type>;
99
99
  }
100
+ export interface DimensionLabelsTransferable {
101
+ labels: DimensionLabel[];
102
+ componentId: number;
103
+ }
104
+ export interface DimensionLabel {
105
+ id: string;
106
+ value: number;
107
+ formattedValue?: string;
108
+ position: {
109
+ x: number;
110
+ y: number;
111
+ };
112
+ level: number;
113
+ angle?: number;
114
+ maxLevel: number;
115
+ isVisible: boolean;
116
+ axisKey?: string;
117
+ interactionKey?: string | null;
118
+ direction?: {
119
+ x: number;
120
+ y: number;
121
+ z: number;
122
+ } | null;
123
+ }
100
124
  export declare const transformMeasurement: (measurement: MeasurementBase<Vector3, Vector3>) => MeasurementBase<Position2, Position3>;
101
125
  export declare const calculateWallPlanPoints: (planObject: WallPlanObject | ConstructionPlanObject, preferredSide: LeftOrRightWallSide) => {
102
126
  from: Vector3;
@@ -118,3 +142,17 @@ export declare const getWallCenterPoints: (planViewModel: ConstructionPlanObject
118
142
  wallFromCenterPoint: Vector3;
119
143
  wallToCenterPoint: Vector3;
120
144
  };
145
+ /**
146
+ * Check if two labels collide in screen space (Case of component dimensions labels)
147
+ */
148
+ export declare const labelsCollide: (label1: {
149
+ position: {
150
+ x: number;
151
+ y: number;
152
+ };
153
+ }, label2: {
154
+ position: {
155
+ x: number;
156
+ y: number;
157
+ };
158
+ }, width: number, height: number, padding: number) => boolean;
@@ -13,7 +13,6 @@ import { CameraParameter } from '../../../common-core/src/cameracontrol/camera-c
13
13
  import { default as PlanViewModel } from '../view-model/plan-view-model';
14
14
  import { default as ConfiguratorSceneManager } from '../../../configurator-core/src/webgl/configurator-scene-manager';
15
15
  import { default as WallPlanElementViewModel } from '../view-model/wall-plan-element-view-model';
16
- import { default as UnitFormatter } from '../../../configurator-core/src/services/unit-formatter';
17
16
  import { Enumify } from '../../../common-core/src/types';
18
17
  import { Object3D, Box3 } from 'three';
19
18
  import { CameraTarget, PrepareImageOptions } from '../../../common-core/src/webgl/image-renderer';
@@ -34,7 +33,6 @@ export default class PlannerSceneManager extends ConfiguratorSceneManager implem
34
33
  private _plannerInputManager;
35
34
  private _roomlePlannerUiCallback;
36
35
  private _localStorageHelper;
37
- protected _unitFormatter: UnitFormatter;
38
36
  private _plannerSceneEventHandler;
39
37
  private _roomlePlannerCallback;
40
38
  private _itemsLoadingStatePromises;
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -15,9 +15,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
15
15
  adjustIcon?: boolean;
16
16
  isSelected?: boolean;
17
17
  }> & Readonly<{}>, {
18
+ isVisible: boolean;
18
19
  onClick: () => void;
19
20
  isSelected: boolean;
20
- isVisible: boolean;
21
21
  showText: boolean;
22
22
  adjustIcon: boolean;
23
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
@@ -9,6 +9,7 @@ import { RapiTagForUi } from '@roomle/web-sdk/typings/rapi-types';
9
9
  import { GridViewVariantElement } from '../components/grid-view/-utils/GridViewHelper';
10
10
  import { WallDimensionTransferable } from '@roomle/web-sdk/planner-core/src/view-model/wall-plan-element-view-model';
11
11
  import { PlanObjectPosition } from '@roomle/web-sdk/typings/planner';
12
+ import { DimensionLabelsTransferable } from '@roomle/web-sdk/planner-core/src/utils/measurements';
12
13
 
13
14
  export type EnsurePrefix<T extends string> = Record<string, `${T}${string}`>;
14
15
  type UiStateIdentifier = EnsurePrefix<'UI_STATE_'>;
@@ -71,6 +72,7 @@ export interface UiState extends SharedUiState {
71
72
  isInIframe: boolean;
72
73
  firstTimeRoomView: boolean;
73
74
  currentInteractionView: Enumify<typeof INTERACTION_VIEW_TYPE>;
75
+ dimensionLabels: Nullable<DimensionLabelsTransferable>;
74
76
  }
75
77
  export declare const UI_STATE_MUTATIONS: UiStateIdentifier;
76
78
  export declare const UI_STATE_ACTIONS: UiStateIdentifier;
@@ -240,8 +240,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
240
240
  isString: BooleanConstructor;
241
241
  disabled: BooleanConstructor;
242
242
  }>> & Readonly<{}>, {
243
- disabled: boolean;
244
243
  isString: boolean;
244
+ disabled: boolean;
245
245
  }, {}, {
246
246
  NumericInput: import('vue').DefineComponent<{
247
247
  valueLabel: string;