From c90fdf95c9a7b17c7efc3f099c679bd5c908b433 Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming Date: Wed, 21 Aug 2024 08:50:57 +0200 Subject: [PATCH 1/5] Initial commit --- .../architecture/base/commands/BaseCommand.ts | 21 +++-- .../architecture/base/commands/BaseTool.ts | 5 +- .../domainObjectsHelpers/CommandChanges.ts | 8 ++ .../concrete/observations/ObservationsTool.ts | 2 + react-components/src/index.ts | 85 ++++++++++++++++++- 5 files changed, 108 insertions(+), 13 deletions(-) create mode 100644 react-components/src/architecture/base/domainObjectsHelpers/CommandChanges.ts diff --git a/react-components/src/architecture/base/commands/BaseCommand.ts b/react-components/src/architecture/base/commands/BaseCommand.ts index 8b73bb262af..e3a2050450f 100644 --- a/react-components/src/architecture/base/commands/BaseCommand.ts +++ b/react-components/src/architecture/base/commands/BaseCommand.ts @@ -5,7 +5,14 @@ import { type TranslateDelegate, type TranslateKey } from '../utilities/TranslateKey'; import { clear, remove } from '../utilities/extensions/arrayExtensions'; -type UpdateDelegate = (command: BaseCommand) => void; +/** + * Represents a delegate function for updating a command. + * + * @param command - The command to be updated. + * @param change - An optional symbol representing the change made to the command. + * if not set, anything can be changed. See changes is CommandChanges for common legal changes. + */ +export type CommandUpdateDelegate = (command: BaseCommand, change?: symbol) => void; /** * Base class for all command and tools. These are object that can do a @@ -20,7 +27,7 @@ export abstract class BaseCommand { // INSTANCE FIELDS // ================================================== - private readonly _listeners: UpdateDelegate[] = []; + private readonly _listeners: CommandUpdateDelegate[] = []; // Unique id for the command, used by in React to force rerender // when the command changes for a button. @@ -130,11 +137,11 @@ export abstract class BaseCommand { // INSTANCE METHODS: Event listeners // ================================================== - public addEventListener(listener: UpdateDelegate): void { + public addEventListener(listener: CommandUpdateDelegate): void { this._listeners.push(listener); } - public removeEventListener(listener: UpdateDelegate): void { + public removeEventListener(listener: CommandUpdateDelegate): void { remove(this._listeners, listener); } @@ -142,12 +149,12 @@ export abstract class BaseCommand { clear(this._listeners); } - public update(): void { + public update(change?: symbol): void { for (const listener of this._listeners) { - listener(this); + listener(this, change); } for (const child of this.getChildren()) { - child.update(); + child.update(change); } } diff --git a/react-components/src/architecture/base/commands/BaseTool.ts b/react-components/src/architecture/base/commands/BaseTool.ts index 38828620367..fb73daef083 100644 --- a/react-components/src/architecture/base/commands/BaseTool.ts +++ b/react-components/src/architecture/base/commands/BaseTool.ts @@ -22,6 +22,7 @@ import { ActiveToolUpdater } from '../reactUpdaters/ActiveToolUpdater'; import { PopupStyle } from '../domainObjectsHelpers/PopupStyle'; import { ThreeView } from '../views/ThreeView'; import { UndoManager } from '../undo/UndoManager'; +import { CommandChanges } from '../domainObjectsHelpers/CommandChanges'; /** * Base class for interactions in the 3D viewer @@ -70,14 +71,14 @@ export abstract class BaseTool extends RenderTargetCommand { } public onActivate(): void { - this.update(); + this.update(CommandChanges.active); this.setDefaultCursor(); this.clearDragging(); ActiveToolUpdater.update(); } public onDeactivate(): void { - this.update(); + this.update(CommandChanges.deactive); this.clearDragging(); ActiveToolUpdater.update(); } diff --git a/react-components/src/architecture/base/domainObjectsHelpers/CommandChanges.ts b/react-components/src/architecture/base/domainObjectsHelpers/CommandChanges.ts new file mode 100644 index 00000000000..a594fa719db --- /dev/null +++ b/react-components/src/architecture/base/domainObjectsHelpers/CommandChanges.ts @@ -0,0 +1,8 @@ +/*! + * Copyright 2024 Cognite AS + */ + +export class CommandChanges { + public static readonly active: symbol = Symbol('active'); + public static readonly deactive: symbol = Symbol('deactive'); +} diff --git a/react-components/src/architecture/concrete/observations/ObservationsTool.ts b/react-components/src/architecture/concrete/observations/ObservationsTool.ts index e3c63ef7ec1..93a262736f3 100644 --- a/react-components/src/architecture/concrete/observations/ObservationsTool.ts +++ b/react-components/src/architecture/concrete/observations/ObservationsTool.ts @@ -36,6 +36,7 @@ export class ObservationsTool extends BaseEditTool { } public override onActivate(): void { + super.onActivate(); let domainObject = this.getObservationsDomainObject(); if (domainObject === undefined) { domainObject = new ObservationsDomainObject(this.renderTarget.fdmSdk); @@ -45,6 +46,7 @@ export class ObservationsTool extends BaseEditTool { } public override onDeactivate(): void { + super.onDeactivate(); const domainObject = this.getObservationsDomainObject(); domainObject?.setSelectedObservation(undefined); } diff --git a/react-components/src/index.ts b/react-components/src/index.ts index bbc7b8b38e0..1a81bf17310 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -29,6 +29,7 @@ export { type Image360AnnotationAssetInfo } from './components/CacheProvider/typ // Hooks export { useReveal } from './components/RevealCanvas/ViewerContext'; +export { useRenderTarget } from './components/RevealCanvas/ViewerContext'; export { useFdmAssetMappings } from './components/CacheProvider/NodeCacheProvider'; export { useSceneDefaultCamera } from './hooks/useSceneDefaultCamera'; export { @@ -161,13 +162,89 @@ export type { CriteriaTypes } from './components/RuleBasedOutputs/types'; -export { ActiveToolToolbar } from './components/Architecture/Toolbar'; -export { DomainObjectPanel } from './components/Architecture/DomainObjectPanel'; -export { RevealButtons } from './components/Architecture/RevealButtons'; - export { RuleBasedOutputsPanel } from './components/RuleBasedOutputs/RuleBasedOutputsPanel'; // Functions export { getRuleTriggerTypes } from './components/RuleBasedOutputs/utils'; export type { InstanceReference, AssetInstanceReference } from './data-providers/types'; + +// ================================================== +// NEW ARCHITECTURE +// ================================================== + +// New architecture: components +export { ActiveToolToolbar } from './components/Architecture/Toolbar'; +export { DomainObjectPanel } from './components/Architecture/DomainObjectPanel'; +export { RevealButtons } from './components/Architecture/RevealButtons'; + +// New architecture: commands +export { BaseCommand } from './architecture/base/commands/BaseCommand'; +export type { CommandUpdateDelegate } from './architecture/base/commands/BaseCommand'; +export { BaseFilterCommand } from './architecture/base/commands/BaseFilterCommand'; +export { BaseOptionCommand } from './architecture/base/commands/BaseOptionCommand'; +export { BaseSliderCommand } from './architecture/base/commands/BaseSliderCommand'; +export { BaseTool } from './architecture/base/commands/BaseTool'; +export { DomainObjectCommand } from './architecture/base/commands/DomainObjectCommand'; +export { InstanceCommand } from './architecture/base/commands/InstanceCommand'; +export { RenderTargetCommand } from './architecture/base/commands/RenderTargetCommand'; +export { BaseEditTool } from './architecture/base/commands/BaseEditTool'; +export { SettingsCommand } from './architecture/base/commands/SettingsCommand'; +export { ShowAllDomainObjectsCommand } from './architecture/base/commands/ShowAllDomainObjectsCommand'; +export { ShowDomainObjectsOnTopCommand } from './architecture/base/commands/ShowDomainObjectsOnTopCommand'; +export { NavigationTool } from './architecture/base/concreteCommands/NavigationTool'; + +// New architecture: domainObjects +export { DomainObject } from './architecture/base/domainObjects/DomainObject'; +export { FolderDomainObject } from './architecture/base/domainObjects/FolderDomainObject'; +export { RootDomainObject } from './architecture/base/domainObjects/RootDomainObject'; +export { VisualDomainObject } from './architecture/base/domainObjects/VisualDomainObject'; + +export { BaseRevealConfig } from './architecture/base/renderTarget/BaseRevealConfig'; +export { CommandsController } from './architecture/base/renderTarget/CommandsController'; +export { DefaultRevealConfig } from './architecture/base/renderTarget/DefaultRevealConfig'; +export { RevealRenderTarget } from './architecture/base/renderTarget/RevealRenderTarget'; +export { UnitSystem } from './architecture/base/renderTarget/UnitSystem'; + +// New architecture: renderStyles +export { RenderStyle } from './architecture/base/renderStyles/RenderStyle'; +export { CommonRenderStyle } from './architecture/base/renderStyles/CommonRenderStyle'; + +// New architecture: domainObjectsHelpers +export { BaseCreator } from './architecture/base/domainObjectsHelpers/BaseCreator'; +export { BaseDragger } from './architecture/base/domainObjectsHelpers/BaseDragger'; +export { Changes } from './architecture/base/domainObjectsHelpers/Changes'; +export { CommandChanges } from './architecture/base/domainObjectsHelpers/CommandChanges'; +export { ColorType } from './architecture/base/domainObjectsHelpers/ColorType'; +export { DomainObjectChange } from './architecture/base/domainObjectsHelpers/DomainObjectChange'; +export { FocusType } from './architecture/base/domainObjectsHelpers/FocusType'; +export { PanelInfo } from './architecture/base/domainObjectsHelpers/PanelInfo'; +export { PopupStyle } from './architecture/base/domainObjectsHelpers/PopupStyle'; +export { Quantity } from './architecture/base/domainObjectsHelpers/Quantity'; +export { Views } from './architecture/base/domainObjectsHelpers/Views'; +export { VisibleState } from './architecture/base/domainObjectsHelpers/VisibleState'; +export type { DomainObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; +export { isDomainObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; +export { isCustomObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; + +// New architecture: undo +export { DomainObjectTransaction } from './architecture/base/undo/DomainObjectTransaction'; +export { Transaction } from './architecture/base/undo/Transaction'; +export { UndoManager } from './architecture/base/undo/UndoManager'; + +// New architecture: utilities +export { ClosestGeometryFinder } from './architecture/base/utilities/geometry/ClosestGeometryFinder'; +export { Index2 } from './architecture/base/utilities/geometry/Index2'; +export { Range1 } from './architecture/base/utilities/geometry/Range1'; +export { Range3 } from './architecture/base/utilities/geometry/Range3'; +export { TrianglesBuffers } from './architecture/base/utilities/geometry/TrianglesBuffers'; +export { getNextColor } from './architecture/base/utilities/colors/getNextColor'; +export { getNextColorByIndex } from './architecture/base/utilities/colors/getNextColor'; +export { getResizeCursor } from './architecture/base/utilities/geometry/getResizeCursor'; +export type { TranslateDelegate } from './architecture/base/utilities/TranslateKey'; +export type { TranslateKey } from './architecture/base/utilities/TranslateKey'; + +// New architecture: views +export { BaseView } from './architecture/base/views/BaseView'; +export { GroupThreeView } from './architecture/base/views/GroupThreeView'; +export { ThreeView } from './architecture/base/views/ThreeView'; From 9460d1c209580315cd2d5edabbd5cf5541412ac8 Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming Date: Wed, 21 Aug 2024 09:02:42 +0200 Subject: [PATCH 2/5] Update index.ts --- react-components/src/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 1a81bf17310..876c0712ae2 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -192,7 +192,20 @@ export { BaseEditTool } from './architecture/base/commands/BaseEditTool'; export { SettingsCommand } from './architecture/base/commands/SettingsCommand'; export { ShowAllDomainObjectsCommand } from './architecture/base/commands/ShowAllDomainObjectsCommand'; export { ShowDomainObjectsOnTopCommand } from './architecture/base/commands/ShowDomainObjectsOnTopCommand'; + +// New architecture: concreteCommands +export { CopyToClipboardCommand } from './architecture/base/concreteCommands/CopyToClipboardCommand'; +export { DeleteDomainObjectCommand } from './architecture/base/concreteCommands/DeleteDomainObjectCommand'; +export { FitViewCommand } from './architecture/base/concreteCommands/FitViewCommand'; +export { KeyboardSpeedCommand } from './architecture/base/concreteCommands/KeyboardSpeedCommand'; export { NavigationTool } from './architecture/base/concreteCommands/NavigationTool'; +export { PointCloudFilterCommand } from './architecture/base/concreteCommands/PointCloudFilterCommand'; +export { SetPointColorTypeCommand } from './architecture/base/concreteCommands/SetPointColorTypeCommand'; +export { SetPointShapeCommand } from './architecture/base/concreteCommands/SetPointShapeCommand'; +export { SetPointSizeCommand } from './architecture/base/concreteCommands/SetPointSizeCommand'; +export { SetQualityCommand } from './architecture/base/concreteCommands/SetQualityCommand'; +export { ToggleMetricUnitsCommand } from './architecture/base/concreteCommands/ToggleMetricUnitsCommand'; +export { UndoCommand } from './architecture/base/concreteCommands/UndoCommand'; // New architecture: domainObjects export { DomainObject } from './architecture/base/domainObjects/DomainObject'; From c7816e1615bdd07cf9d4a59c447a9bb963b6a2f6 Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming Date: Wed, 21 Aug 2024 13:19:50 +0200 Subject: [PATCH 3/5] Move Architecture stuff out of the index file --- react-components/src/architecture/index.ts | 93 +++++++++++++++++++++ react-components/src/index.ts | 97 ++-------------------- 2 files changed, 99 insertions(+), 91 deletions(-) create mode 100644 react-components/src/architecture/index.ts diff --git a/react-components/src/architecture/index.ts b/react-components/src/architecture/index.ts new file mode 100644 index 00000000000..71154c1c5b4 --- /dev/null +++ b/react-components/src/architecture/index.ts @@ -0,0 +1,93 @@ +/*! + * Copyright 2023 Cognite AS + */ + +// New architecture: components + +export { ActiveToolToolbar } from '../components/Architecture/Toolbar'; +export { DomainObjectPanel } from '../components/Architecture/DomainObjectPanel'; +export { RevealButtons } from '../components/Architecture/RevealButtons'; + +// New architecture: commands +export { BaseCommand } from './base/commands/BaseCommand'; +export type { CommandUpdateDelegate } from './base/commands/BaseCommand'; +export { BaseFilterCommand } from './base/commands/BaseFilterCommand'; +export { BaseOptionCommand } from './base/commands/BaseOptionCommand'; +export { BaseSliderCommand } from './base/commands/BaseSliderCommand'; +export { BaseTool } from './base/commands/BaseTool'; +export { DomainObjectCommand } from './base/commands/DomainObjectCommand'; +export { InstanceCommand } from './base/commands/InstanceCommand'; +export { RenderTargetCommand } from './base/commands/RenderTargetCommand'; +export { BaseEditTool } from './base/commands/BaseEditTool'; +export { SettingsCommand } from './base/commands/SettingsCommand'; +export { ShowAllDomainObjectsCommand } from './base/commands/ShowAllDomainObjectsCommand'; +export { ShowDomainObjectsOnTopCommand } from './base/commands/ShowDomainObjectsOnTopCommand'; + +// New architecture: concreteCommands +export { CopyToClipboardCommand } from './base/concreteCommands/CopyToClipboardCommand'; +export { DeleteDomainObjectCommand } from './base/concreteCommands/DeleteDomainObjectCommand'; +export { FitViewCommand } from './base/concreteCommands/FitViewCommand'; +export { KeyboardSpeedCommand } from './base/concreteCommands/KeyboardSpeedCommand'; +export { NavigationTool } from './base/concreteCommands/NavigationTool'; +export { PointCloudFilterCommand } from './base/concreteCommands/PointCloudFilterCommand'; +export { SetPointColorTypeCommand } from './base/concreteCommands/SetPointColorTypeCommand'; +export { SetPointShapeCommand } from './base/concreteCommands/SetPointShapeCommand'; +export { SetPointSizeCommand } from './base/concreteCommands/SetPointSizeCommand'; +export { SetQualityCommand } from './base/concreteCommands/SetQualityCommand'; +export { ToggleMetricUnitsCommand } from './base/concreteCommands/ToggleMetricUnitsCommand'; +export { UndoCommand } from './base/concreteCommands/UndoCommand'; + +// New architecture: domainObjects +export { DomainObject } from './base/domainObjects/DomainObject'; +export { FolderDomainObject } from './base/domainObjects/FolderDomainObject'; +export { RootDomainObject } from './base/domainObjects/RootDomainObject'; +export { VisualDomainObject } from './base/domainObjects/VisualDomainObject'; + +export { BaseRevealConfig } from './base/renderTarget/BaseRevealConfig'; +export { CommandsController } from './base/renderTarget/CommandsController'; +export { DefaultRevealConfig } from './base/renderTarget/DefaultRevealConfig'; +export { RevealRenderTarget } from './base/renderTarget/RevealRenderTarget'; +export { UnitSystem } from './base/renderTarget/UnitSystem'; + +// New architecture: renderStyles +export { RenderStyle } from './base/renderStyles/RenderStyle'; +export { CommonRenderStyle } from './base/renderStyles/CommonRenderStyle'; + +// New architecture: domainObjectsHelpers +export { BaseCreator } from './base/domainObjectsHelpers/BaseCreator'; +export { BaseDragger } from './base/domainObjectsHelpers/BaseDragger'; +export { Changes } from './base/domainObjectsHelpers/Changes'; +export { CommandChanges } from './base/domainObjectsHelpers/CommandChanges'; +export { ColorType } from './base/domainObjectsHelpers/ColorType'; +export { DomainObjectChange } from './base/domainObjectsHelpers/DomainObjectChange'; +export { FocusType } from './base/domainObjectsHelpers/FocusType'; +export { PanelInfo } from './base/domainObjectsHelpers/PanelInfo'; +export { PopupStyle } from './base/domainObjectsHelpers/PopupStyle'; +export { Quantity } from './base/domainObjectsHelpers/Quantity'; +export { Views } from './base/domainObjectsHelpers/Views'; +export { VisibleState } from './base/domainObjectsHelpers/VisibleState'; +export type { DomainObjectIntersection } from './base/domainObjectsHelpers/DomainObjectIntersection'; +export { isDomainObjectIntersection } from './base/domainObjectsHelpers/DomainObjectIntersection'; +export { isCustomObjectIntersection } from './base/domainObjectsHelpers/DomainObjectIntersection'; + +// New architecture: undo +export { DomainObjectTransaction } from './base/undo/DomainObjectTransaction'; +export { Transaction } from './base/undo/Transaction'; +export { UndoManager } from './base/undo/UndoManager'; + +// New architecture: utilities +export { ClosestGeometryFinder } from './base/utilities/geometry/ClosestGeometryFinder'; +export { Index2 } from './base/utilities/geometry/Index2'; +export { Range1 } from './base/utilities/geometry/Range1'; +export { Range3 } from './base/utilities/geometry/Range3'; +export { TrianglesBuffers } from './base/utilities/geometry/TrianglesBuffers'; +export { getNextColor } from './base/utilities/colors/getNextColor'; +export { getNextColorByIndex } from './base/utilities/colors/getNextColor'; +export { getResizeCursor } from './base/utilities/geometry/getResizeCursor'; +export type { TranslateDelegate } from './base/utilities/TranslateKey'; +export type { TranslateKey } from './base/utilities/TranslateKey'; + +// New architecture: views +export { BaseView } from './base/views/BaseView'; +export { GroupThreeView } from './base/views/GroupThreeView'; +export { ThreeView } from './base/views/ThreeView'; diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 876c0712ae2..9f24831e892 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -169,95 +169,10 @@ export { getRuleTriggerTypes } from './components/RuleBasedOutputs/utils'; export type { InstanceReference, AssetInstanceReference } from './data-providers/types'; -// ================================================== -// NEW ARCHITECTURE -// ================================================== - -// New architecture: components -export { ActiveToolToolbar } from './components/Architecture/Toolbar'; -export { DomainObjectPanel } from './components/Architecture/DomainObjectPanel'; -export { RevealButtons } from './components/Architecture/RevealButtons'; - -// New architecture: commands -export { BaseCommand } from './architecture/base/commands/BaseCommand'; -export type { CommandUpdateDelegate } from './architecture/base/commands/BaseCommand'; -export { BaseFilterCommand } from './architecture/base/commands/BaseFilterCommand'; -export { BaseOptionCommand } from './architecture/base/commands/BaseOptionCommand'; -export { BaseSliderCommand } from './architecture/base/commands/BaseSliderCommand'; -export { BaseTool } from './architecture/base/commands/BaseTool'; -export { DomainObjectCommand } from './architecture/base/commands/DomainObjectCommand'; -export { InstanceCommand } from './architecture/base/commands/InstanceCommand'; -export { RenderTargetCommand } from './architecture/base/commands/RenderTargetCommand'; -export { BaseEditTool } from './architecture/base/commands/BaseEditTool'; -export { SettingsCommand } from './architecture/base/commands/SettingsCommand'; -export { ShowAllDomainObjectsCommand } from './architecture/base/commands/ShowAllDomainObjectsCommand'; -export { ShowDomainObjectsOnTopCommand } from './architecture/base/commands/ShowDomainObjectsOnTopCommand'; - -// New architecture: concreteCommands -export { CopyToClipboardCommand } from './architecture/base/concreteCommands/CopyToClipboardCommand'; -export { DeleteDomainObjectCommand } from './architecture/base/concreteCommands/DeleteDomainObjectCommand'; -export { FitViewCommand } from './architecture/base/concreteCommands/FitViewCommand'; -export { KeyboardSpeedCommand } from './architecture/base/concreteCommands/KeyboardSpeedCommand'; -export { NavigationTool } from './architecture/base/concreteCommands/NavigationTool'; -export { PointCloudFilterCommand } from './architecture/base/concreteCommands/PointCloudFilterCommand'; -export { SetPointColorTypeCommand } from './architecture/base/concreteCommands/SetPointColorTypeCommand'; -export { SetPointShapeCommand } from './architecture/base/concreteCommands/SetPointShapeCommand'; -export { SetPointSizeCommand } from './architecture/base/concreteCommands/SetPointSizeCommand'; -export { SetQualityCommand } from './architecture/base/concreteCommands/SetQualityCommand'; -export { ToggleMetricUnitsCommand } from './architecture/base/concreteCommands/ToggleMetricUnitsCommand'; -export { UndoCommand } from './architecture/base/concreteCommands/UndoCommand'; - -// New architecture: domainObjects -export { DomainObject } from './architecture/base/domainObjects/DomainObject'; -export { FolderDomainObject } from './architecture/base/domainObjects/FolderDomainObject'; -export { RootDomainObject } from './architecture/base/domainObjects/RootDomainObject'; -export { VisualDomainObject } from './architecture/base/domainObjects/VisualDomainObject'; - -export { BaseRevealConfig } from './architecture/base/renderTarget/BaseRevealConfig'; -export { CommandsController } from './architecture/base/renderTarget/CommandsController'; -export { DefaultRevealConfig } from './architecture/base/renderTarget/DefaultRevealConfig'; -export { RevealRenderTarget } from './architecture/base/renderTarget/RevealRenderTarget'; -export { UnitSystem } from './architecture/base/renderTarget/UnitSystem'; - -// New architecture: renderStyles -export { RenderStyle } from './architecture/base/renderStyles/RenderStyle'; -export { CommonRenderStyle } from './architecture/base/renderStyles/CommonRenderStyle'; - -// New architecture: domainObjectsHelpers -export { BaseCreator } from './architecture/base/domainObjectsHelpers/BaseCreator'; -export { BaseDragger } from './architecture/base/domainObjectsHelpers/BaseDragger'; -export { Changes } from './architecture/base/domainObjectsHelpers/Changes'; -export { CommandChanges } from './architecture/base/domainObjectsHelpers/CommandChanges'; -export { ColorType } from './architecture/base/domainObjectsHelpers/ColorType'; -export { DomainObjectChange } from './architecture/base/domainObjectsHelpers/DomainObjectChange'; -export { FocusType } from './architecture/base/domainObjectsHelpers/FocusType'; -export { PanelInfo } from './architecture/base/domainObjectsHelpers/PanelInfo'; -export { PopupStyle } from './architecture/base/domainObjectsHelpers/PopupStyle'; -export { Quantity } from './architecture/base/domainObjectsHelpers/Quantity'; -export { Views } from './architecture/base/domainObjectsHelpers/Views'; -export { VisibleState } from './architecture/base/domainObjectsHelpers/VisibleState'; -export type { DomainObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; -export { isDomainObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; -export { isCustomObjectIntersection } from './architecture/base/domainObjectsHelpers/DomainObjectIntersection'; - -// New architecture: undo -export { DomainObjectTransaction } from './architecture/base/undo/DomainObjectTransaction'; -export { Transaction } from './architecture/base/undo/Transaction'; -export { UndoManager } from './architecture/base/undo/UndoManager'; - -// New architecture: utilities -export { ClosestGeometryFinder } from './architecture/base/utilities/geometry/ClosestGeometryFinder'; -export { Index2 } from './architecture/base/utilities/geometry/Index2'; -export { Range1 } from './architecture/base/utilities/geometry/Range1'; -export { Range3 } from './architecture/base/utilities/geometry/Range3'; -export { TrianglesBuffers } from './architecture/base/utilities/geometry/TrianglesBuffers'; -export { getNextColor } from './architecture/base/utilities/colors/getNextColor'; -export { getNextColorByIndex } from './architecture/base/utilities/colors/getNextColor'; -export { getResizeCursor } from './architecture/base/utilities/geometry/getResizeCursor'; -export type { TranslateDelegate } from './architecture/base/utilities/TranslateKey'; -export type { TranslateKey } from './architecture/base/utilities/TranslateKey'; +/** + * Export classes and types from architecture + * Note: This is not stable code yet and is subject to change. + * @beta + */ -// New architecture: views -export { BaseView } from './architecture/base/views/BaseView'; -export { GroupThreeView } from './architecture/base/views/GroupThreeView'; -export { ThreeView } from './architecture/base/views/ThreeView'; +export * as Architecture from './architecture/index'; From 50e5176d4e28e2cd607e46253624d817fac1a93e Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming Date: Wed, 21 Aug 2024 13:23:16 +0200 Subject: [PATCH 4/5] Fix architecture components --- react-components/src/architecture/index.ts | 7 ------- react-components/src/index.ts | 5 ++++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/react-components/src/architecture/index.ts b/react-components/src/architecture/index.ts index 71154c1c5b4..9d9813a0397 100644 --- a/react-components/src/architecture/index.ts +++ b/react-components/src/architecture/index.ts @@ -1,13 +1,6 @@ /*! * Copyright 2023 Cognite AS */ - -// New architecture: components - -export { ActiveToolToolbar } from '../components/Architecture/Toolbar'; -export { DomainObjectPanel } from '../components/Architecture/DomainObjectPanel'; -export { RevealButtons } from '../components/Architecture/RevealButtons'; - // New architecture: commands export { BaseCommand } from './base/commands/BaseCommand'; export type { CommandUpdateDelegate } from './base/commands/BaseCommand'; diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 9f24831e892..4f05a5fdae4 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -169,10 +169,13 @@ export { getRuleTriggerTypes } from './components/RuleBasedOutputs/utils'; export type { InstanceReference, AssetInstanceReference } from './data-providers/types'; +export { ActiveToolToolbar } from './components/Architecture/Toolbar'; +export { DomainObjectPanel } from './components/Architecture/DomainObjectPanel'; +export { RevealButtons } from './components/Architecture/RevealButtons'; + /** * Export classes and types from architecture * Note: This is not stable code yet and is subject to change. * @beta */ - export * as Architecture from './architecture/index'; From 8822396f97a0c5be0d3b9f90f8e81c665c10d040 Mon Sep 17 00:00:00 2001 From: Nils Petter Fremming Date: Wed, 21 Aug 2024 13:27:35 +0200 Subject: [PATCH 5/5] Update index.ts --- react-components/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-components/src/index.ts b/react-components/src/index.ts index 4f05a5fdae4..986ad954ca5 100644 --- a/react-components/src/index.ts +++ b/react-components/src/index.ts @@ -29,7 +29,6 @@ export { type Image360AnnotationAssetInfo } from './components/CacheProvider/typ // Hooks export { useReveal } from './components/RevealCanvas/ViewerContext'; -export { useRenderTarget } from './components/RevealCanvas/ViewerContext'; export { useFdmAssetMappings } from './components/CacheProvider/NodeCacheProvider'; export { useSceneDefaultCamera } from './hooks/useSceneDefaultCamera'; export { @@ -172,6 +171,7 @@ export type { InstanceReference, AssetInstanceReference } from './data-providers export { ActiveToolToolbar } from './components/Architecture/Toolbar'; export { DomainObjectPanel } from './components/Architecture/DomainObjectPanel'; export { RevealButtons } from './components/Architecture/RevealButtons'; +export { useRenderTarget } from './components/RevealCanvas/ViewerContext'; /** * Export classes and types from architecture