@itwin/imodel-components-react 5.0.5 → 5.2.0
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/CHANGELOG.md +15 -3
- package/lib/imodel-components-react/color/AlphaSlider.js +2 -2
- package/lib/imodel-components-react/color/AlphaSlider.js.map +1 -1
- package/lib/imodel-components-react/color/ColorPickerButton.d.ts.map +1 -1
- package/lib/imodel-components-react/color/ColorPickerButton.js +2 -3
- package/lib/imodel-components-react/color/ColorPickerButton.js.map +1 -1
- package/lib/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
- package/lib/imodel-components-react/color/ColorPickerPopup.js +1 -1
- package/lib/imodel-components-react/color/ColorPickerPopup.js.map +1 -1
- package/lib/imodel-components-react/color/HueSlider.js.map +1 -1
- package/lib/imodel-components-react/color/SaturationPicker.js.map +1 -1
- package/lib/imodel-components-react/color/Swatch.js +1 -1
- package/lib/imodel-components-react/color/Swatch.js.map +1 -1
- package/lib/imodel-components-react/editors/ColorEditor.d.ts +1 -0
- package/lib/imodel-components-react/editors/ColorEditor.d.ts.map +1 -1
- package/lib/imodel-components-react/editors/ColorEditor.js +2 -1
- package/lib/imodel-components-react/editors/ColorEditor.js.map +1 -1
- package/lib/imodel-components-react/editors/WeightEditor.d.ts +1 -0
- package/lib/imodel-components-react/editors/WeightEditor.d.ts.map +1 -1
- package/lib/imodel-components-react/editors/WeightEditor.js +1 -0
- package/lib/imodel-components-react/editors/WeightEditor.js.map +1 -1
- package/lib/imodel-components-react/inputs/QuantityInput.js.map +1 -1
- package/lib/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
- package/lib/imodel-components-react/lineweight/Swatch.js.map +1 -1
- package/lib/imodel-components-react/lineweight/WeightPickerButton.d.ts.map +1 -1
- package/lib/imodel-components-react/lineweight/WeightPickerButton.js +1 -1
- package/lib/imodel-components-react/lineweight/WeightPickerButton.js.map +1 -1
- package/lib/imodel-components-react/navigationaids/Cube.js.map +1 -1
- package/lib/imodel-components-react/navigationaids/CubeNavigationAid.js +1 -1
- package/lib/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
- package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.d.ts.map +1 -1
- package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.js +0 -1
- package/lib/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatPanel.js +1 -1
- package/lib/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatPrecision.js +1 -1
- package/lib/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatSample.js +2 -2
- package/lib/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatType.js +1 -1
- package/lib/imodel-components-react/quantityformat/FormatType.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -1
- package/lib/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/FormatUnits.js +1 -1
- package/lib/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js +1 -1
- package/lib/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.js +1 -1
- package/lib/imodel-components-react/quantityformat/QuantityFormatPanel.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalPrecision.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/DecimalSeparator.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/FractionPrecision.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/ScientificType.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/SignOption.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSeparatorSelector.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/StationSizeSelector.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSelector.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
- package/lib/imodel-components-react/quantityformat/misc/UnitDescr.js.map +1 -1
- package/lib/imodel-components-react/timeline/InlineEdit.js.map +1 -1
- package/lib/imodel-components-react/timeline/Scrubber.js.map +1 -1
- package/lib/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
- package/lib/imodel-components-react/timeline/SpeedTimeline.js.map +1 -1
- package/lib/imodel-components-react/timeline/TimelineComponent.js +3 -3
- package/lib/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
- package/lib/imodel-components-react/viewport/ViewportComponent.js +6 -6
- package/lib/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
- package/lib/imodel-components-react/viewport/ViewportComponentEvents.js +12 -12
- package/lib/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
- package/lib/imodel-components-react.js +1 -1
- package/lib/imodel-components-react.js.map +1 -1
- package/package.json +18 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,OAAO,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAmCvE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EACJ,SAAS,EAC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AAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;QACD,WAAW,CACR,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Point3d } from \"@itwin/core-geometry\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { NpcCenter } from \"@itwin/core-common\";\nimport type {\n IModelConnection,\n TentativePoint,\n ViewManager,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport {\n IModelApp,\n ScreenViewport,\n StandardView,\n ToolSettings,\n} from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ListenerType } from \"@itwin/core-react/internal\";\nimport { ViewportComponentEvents } from \"./ViewportComponentEvents.js\";\n\n/** Type for a ViewState prop\n * @public\n */\nexport type ViewStateProp = ViewState | (() => ViewState);\n\n/**\n * Properties for [[ViewportComponent]] component.\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nexport interface ViewportProps extends CommonProps {\n /** IModel to display */\n imodel: IModelConnection;\n /** Id of a default view definition to load as a starting point */\n viewDefinitionId?: Id64String;\n /** ViewState to use as a starting point */\n viewState?: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: (v: ScreenViewport) => void;\n /** controlId for this content component @internal */\n controlId?: string;\n /** @internal */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** @internal */\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\n /** @internal used only for testing */\n viewManagerOverride?: ViewManager;\n /** @internal used only for testing */\n screenViewportOverride?: typeof ScreenViewport;\n /** @internal used only for testing */\n tentativePointOverride?: TentativePoint;\n}\n\n/** A viewport React component that creates a ScreenViewport.\n * @public\n */\nexport function ViewportComponent(props: ViewportProps) {\n const {\n viewState,\n imodel,\n viewDefinitionId,\n getViewOverlay,\n viewManagerOverride,\n tentativePointOverride,\n onContextMenu,\n style,\n className,\n screenViewportOverride,\n controlId,\n viewportRef,\n } = props;\n const viewManagerRef = React.useRef(\n viewManagerOverride ?? IModelApp.viewManager\n );\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\n const screenViewportCreated = React.useRef(false);\n const viewportDiv = React.useRef<HTMLDivElement>(null);\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\n const isMounted = React.useRef(false);\n const viewClassFullName = React.useRef(\"\");\n const viewId = React.useRef(\"0\");\n\n const handleViewChanged: ListenerType<ScreenViewport[\"onViewChanged\"]> = (\n vp\n ) => {\n if (!(vp.iModel.isOpen || vp.iModel.isBlank)) return;\n ViewportComponentEvents.setViewMatrix(vp);\n if (viewClassFullName.current !== vp.view.classFullName) {\n setTimeout(() => {\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({\n viewport: vp,\n oldName: viewClassFullName.current,\n newName: vp.view.classFullName,\n });\n viewClassFullName.current = vp.view.classFullName;\n });\n }\n if (viewId.current !== vp.view.id) {\n setTimeout(() => {\n ViewportComponentEvents.onViewIdChangedEvent.emit({\n viewport: vp,\n oldId: viewId.current,\n newId: vp.view.id,\n });\n viewId.current = vp.view.id;\n });\n }\n };\n\n const handleStandardRotationChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onStandardRotationChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n currentScreenViewport.view.setRotationAboutPoint(\n StandardView.getStandardRotation(args.standardRotation)\n );\n currentScreenViewport.synchWithView();\n }\n };\n\n const handleDrawingViewportChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onDrawingViewportChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n currentScreenViewport.view.setOrigin(args.origin);\n currentScreenViewport.view.setRotation(args.rotation);\n currentScreenViewport.synchWithView({\n noSaveInUndo: args.complete !== true,\n });\n }\n };\n\n const targetPoint = React.useRef<Point3d | null>(null);\n\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\n const lastTargetPoint = targetPoint.current;\n const tentativePoint =\n tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\n if (tentativePoint.isActive) return tentativePoint.getPoint();\n\n if (null !== lastTargetPoint) {\n const testPt = vp.worldToView(lastTargetPoint);\n const viewRect = vp.viewRect.clone();\n viewRect.scaleAboutCenter(0.25, 0.25);\n if (viewRect.containsPoint(testPt)) return lastTargetPoint;\n targetPoint.current = null;\n }\n\n const visiblePoint = vp.pickNearestVisibleGeometry(\n vp.npcToWorld(NpcCenter),\n vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches)\n );\n targetPoint.current =\n undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint();\n return targetPoint.current ?? vp.view.getCenter();\n };\n\n const handleCubeRotationChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onCubeRotationChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n const rotMatrix = args.rotMatrix;\n if (currentScreenViewport.rotation !== rotMatrix) {\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\n const center = getRotatePoint(currentScreenViewport);\n const targetMatrix = inverse.multiplyMatrixMatrix(\n currentScreenViewport.view.getRotation()\n );\n const worldTransform = Transform.createFixedPointAndMatrix(\n center,\n targetMatrix\n );\n const frustum = currentScreenViewport.getWorldFrustum();\n frustum.multiply(worldTransform);\n currentScreenViewport.view.setupFromFrustum(frustum);\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\n }\n }\n };\n\n const handleDisconnectFromViewManager = () => {\n const screenViewport = screenViewportRef.current;\n if (screenViewport) {\n const viewManager = IModelApp.viewManager;\n screenViewport.onViewChanged.removeListener(handleViewChanged);\n screenViewportRef.current = null;\n screenViewportCreated.current = false;\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(\n handleDrawingViewportChangeEvent\n );\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(\n handleCubeRotationChangeEvent\n );\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(\n handleStandardRotationChangeEvent\n );\n viewManager.dropViewport(screenViewport, true);\n }\n };\n\n const handleWindowUnload = () => {\n const parentDiv = viewportDiv.current;\n if (parentDiv) {\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n if (parentWindow !== window) {\n handleDisconnectFromViewManager();\n }\n }\n };\n\n const getScreenViewport = (\n parentDiv: HTMLDivElement,\n inViewState: ViewState\n ) => {\n const screenViewportFactory = screenViewportOverride\n ? screenViewportOverride\n : ScreenViewport;\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n parentWindow.addEventListener(\"unload\", handleWindowUnload, {\n once: true,\n capture: true,\n }); // by specifying 'once', listener clears after being called\n ViewportComponentEvents.initialize();\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(\n handleDrawingViewportChangeEvent\n );\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(\n handleCubeRotationChangeEvent\n );\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(\n handleStandardRotationChangeEvent\n );\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\n screenViewportCreated.current = true;\n viewClassFullName.current = screenViewport.view.classFullName;\n viewId.current = screenViewport.view.id;\n screenViewport.onViewChanged.addListener(handleViewChanged);\n return screenViewport;\n };\n\n React.useEffect(() => {\n isMounted.current = true;\n Logger.logInfo(\n \"ViewportComponent\",\n `mounting ViewportComponent for controlId=${controlId}`\n );\n\n return () => {\n isMounted.current = false;\n Logger.logInfo(\n \"ViewportComponent\",\n `un-mounting ViewportComponent for controlId=${controlId}`\n );\n handleDisconnectFromViewManager();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [initialViewState, setInitialViewState] = React.useState<\n ViewState | undefined\n >(undefined);\n React.useEffect(() => {\n setInitialViewState(undefined);\n }, [viewDefinitionId, viewState]);\n React.useEffect(() => {\n async function fetchInitialViewstate() {\n let currentViewState: ViewState | undefined;\n if (viewState) {\n if (typeof viewState === \"function\") currentViewState = viewState();\n else currentViewState = viewState;\n } else if (viewDefinitionId && imodel) {\n try {\n currentViewState = await imodel.views.load(viewDefinitionId);\n if (!currentViewState) {\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } catch (_e) {\n Logger.logError(\"ViewportComponent\", `Viewstate failed to load`);\n }\n } else {\n Logger.logError(\n \"ViewportComponent\",\n `A Viewstate or a viewId and imodel must be provided`\n );\n }\n if (\n isMounted.current &&\n (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)\n ) {\n setInitialViewState(currentViewState?.clone());\n }\n }\n if (undefined === initialViewState) void fetchInitialViewstate();\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\n\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\n\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\n React.useEffect(() => {\n const parentDiv = viewportDiv.current;\n const viewManager = viewManagerRef.current;\n if (\n parentDiv &&\n initialViewState &&\n (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)\n ) {\n if (!screenViewportCreated.current) {\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\n screenViewportRef.current = screenViewport;\n\n if (viewportRef) viewportRef(screenViewport);\n\n Logger.logInfo(\n \"ViewportComponent\",\n `processing viewManager.addViewport for controlId=${controlId}`\n );\n viewManager.addViewport(screenViewport);\n\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\n } else {\n screenViewportRef.current?.changeView(initialViewState);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [controlId, initialViewState, viewportRef]);\n\n const handleContextMenu = React.useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n if (onContextMenu) onContextMenu(e);\n },\n [onContextMenu]\n );\n\n const parentDivStyle: React.CSSProperties = {\n height: \"100%\",\n width: \"100%\",\n position: \"relative\",\n };\n\n const viewportDivStyle: React.CSSProperties = {\n ...style,\n height: \"100%\",\n width: \"100%\",\n };\n\n return (\n <div style={parentDivStyle} data-item-id={controlId}>\n <div\n ref={viewportDiv}\n data-testid=\"viewport-component\"\n className={className}\n style={viewportDivStyle}\n onContextMenu={handleContextMenu}\n />\n {viewOverlay}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewportComponent.js","sourceRoot":"","sources":["../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,OAAO,EACL,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAmCvE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,MAAM,EACJ,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,KAAK,EACL,SAAS,EACT,sBAAsB,EACtB,SAAS,EACT,WAAW,GACZ,GAAG,KAAK,CAAC;IACV,MAAM,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AO,GAAG,cAAc,CAAC;gBAE3C,IAAI,WAAW;oBAAE,WAAW,CAAC,cAAc,CAAC,CAAC;gBAE7C,MAAM,CAAC,OAAO,CACZ,mBAAmB,EACnB,oDAAoD,SAAS,EAAE,CAChE,CAAC;gBACF,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;gBAExC,6HAA6H;gBAC7H,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACzE,CAAC;iBAAM,CAAC;gBACN,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/C,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CACzC,CAAC,CAAmB,EAAE,EAAE;QACtB,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,IAAI,aAAa;YAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,aAAa,CAAC,CAChB,CAAC;IAEF,MAAM,cAAc,GAAwB;QAC1C,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,UAAU;KACrB,CAAC;IAEF,MAAM,gBAAgB,GAAwB;QAC5C,GAAG,KAAK;QACR,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,MAAM;KACd,CAAC;IAEF,OAAO,CACL,6BAAK,KAAK,EAAE,cAAc,kBAAgB,SAAS;QACjD,6BACE,GAAG,EAAE,WAAW,iBACJ,oBAAoB,EAChC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,iBAAiB,GAChC;QACD,WAAW,CACR,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Point3d } from \"@itwin/core-geometry\";\nimport { Transform } from \"@itwin/core-geometry\";\nimport { NpcCenter } from \"@itwin/core-common\";\nimport type {\n IModelConnection,\n TentativePoint,\n ViewManager,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport {\n IModelApp,\n ScreenViewport,\n StandardView,\n ToolSettings,\n} from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ListenerType } from \"@itwin/core-react/internal\";\nimport { ViewportComponentEvents } from \"./ViewportComponentEvents.js\";\n\n/** Type for a ViewState prop\n * @public\n */\nexport type ViewStateProp = ViewState | (() => ViewState);\n\n/**\n * Properties for [[ViewportComponent]] component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ViewportProps extends CommonProps {\n /** IModel to display */\n imodel: IModelConnection;\n /** Id of a default view definition to load as a starting point */\n viewDefinitionId?: Id64String;\n /** ViewState to use as a starting point */\n viewState?: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: (v: ScreenViewport) => void;\n /** controlId for this content component @internal */\n controlId?: string;\n /** @internal */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** @internal */\n getViewOverlay?: (viewport: ScreenViewport) => React.ReactNode;\n /** @internal used only for testing */\n viewManagerOverride?: ViewManager;\n /** @internal used only for testing */\n screenViewportOverride?: typeof ScreenViewport;\n /** @internal used only for testing */\n tentativePointOverride?: TentativePoint;\n}\n\n/** A viewport React component that creates a ScreenViewport.\n * @public\n */\nexport function ViewportComponent(props: ViewportProps) {\n const {\n viewState,\n imodel,\n viewDefinitionId,\n getViewOverlay,\n viewManagerOverride,\n tentativePointOverride,\n onContextMenu,\n style,\n className,\n screenViewportOverride,\n controlId,\n viewportRef,\n } = props;\n const viewManagerRef = React.useRef(\n viewManagerOverride ?? IModelApp.viewManager\n );\n const tentativePointOverrideRef = React.useRef(tentativePointOverride);\n const screenViewportCreated = React.useRef(false);\n const viewportDiv = React.useRef<HTMLDivElement>(null);\n const screenViewportRef = React.useRef<ScreenViewport | null>(null);\n const isMounted = React.useRef(false);\n const viewClassFullName = React.useRef(\"\");\n const viewId = React.useRef(\"0\");\n\n const handleViewChanged: ListenerType<ScreenViewport[\"onViewChanged\"]> = (\n vp\n ) => {\n if (!(vp.iModel.isOpen || vp.iModel.isBlank)) return;\n ViewportComponentEvents.setViewMatrix(vp);\n if (viewClassFullName.current !== vp.view.classFullName) {\n setTimeout(() => {\n ViewportComponentEvents.onViewClassFullNameChangedEvent.emit({\n viewport: vp,\n oldName: viewClassFullName.current,\n newName: vp.view.classFullName,\n });\n viewClassFullName.current = vp.view.classFullName;\n });\n }\n if (viewId.current !== vp.view.id) {\n setTimeout(() => {\n ViewportComponentEvents.onViewIdChangedEvent.emit({\n viewport: vp,\n oldId: viewId.current,\n newId: vp.view.id,\n });\n viewId.current = vp.view.id;\n });\n }\n };\n\n const handleStandardRotationChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onStandardRotationChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n currentScreenViewport.view.setRotationAboutPoint(\n StandardView.getStandardRotation(args.standardRotation)\n );\n currentScreenViewport.synchWithView();\n }\n };\n\n const handleDrawingViewportChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onDrawingViewportChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n currentScreenViewport.view.setOrigin(args.origin);\n currentScreenViewport.view.setRotation(args.rotation);\n currentScreenViewport.synchWithView({\n noSaveInUndo: args.complete !== true,\n });\n }\n };\n\n const targetPoint = React.useRef<Point3d | null>(null);\n\n const getRotatePoint = (vp: ScreenViewport): Point3d => {\n const lastTargetPoint = targetPoint.current;\n const tentativePoint =\n tentativePointOverrideRef.current ?? IModelApp.tentativePoint;\n if (tentativePoint.isActive) return tentativePoint.getPoint();\n\n if (null !== lastTargetPoint) {\n const testPt = vp.worldToView(lastTargetPoint);\n const viewRect = vp.viewRect.clone();\n viewRect.scaleAboutCenter(0.25, 0.25);\n if (viewRect.containsPoint(testPt)) return lastTargetPoint;\n targetPoint.current = null;\n }\n\n const visiblePoint = vp.pickNearestVisibleGeometry(\n vp.npcToWorld(NpcCenter),\n vp.pixelsFromInches(ToolSettings.viewToolPickRadiusInches)\n );\n targetPoint.current =\n undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint();\n return targetPoint.current ?? vp.view.getCenter();\n };\n\n const handleCubeRotationChangeEvent: ListenerType<\n typeof ViewportComponentEvents.onCubeRotationChangeEvent\n > = (args) => {\n const viewManager = viewManagerRef.current;\n const currentScreenViewport = screenViewportRef.current;\n if (\n currentScreenViewport &&\n viewManager.selectedView === currentScreenViewport\n ) {\n const rotMatrix = args.rotMatrix;\n if (currentScreenViewport.rotation !== rotMatrix) {\n const inverse = rotMatrix.transpose(); // rotation is from current nav cube state...\n const center = getRotatePoint(currentScreenViewport);\n const targetMatrix = inverse.multiplyMatrixMatrix(\n currentScreenViewport.view.getRotation()\n );\n const worldTransform = Transform.createFixedPointAndMatrix(\n center,\n targetMatrix\n );\n const frustum = currentScreenViewport.getWorldFrustum();\n frustum.multiply(worldTransform);\n currentScreenViewport.view.setupFromFrustum(frustum);\n currentScreenViewport.synchWithView({ noSaveInUndo: !args.complete });\n }\n }\n };\n\n const handleDisconnectFromViewManager = () => {\n const screenViewport = screenViewportRef.current;\n if (screenViewport) {\n const viewManager = IModelApp.viewManager;\n screenViewport.onViewChanged.removeListener(handleViewChanged);\n screenViewportRef.current = null;\n screenViewportCreated.current = false;\n ViewportComponentEvents.onDrawingViewportChangeEvent.removeListener(\n handleDrawingViewportChangeEvent\n );\n ViewportComponentEvents.onCubeRotationChangeEvent.removeListener(\n handleCubeRotationChangeEvent\n );\n ViewportComponentEvents.onStandardRotationChangeEvent.removeListener(\n handleStandardRotationChangeEvent\n );\n viewManager.dropViewport(screenViewport, true);\n }\n };\n\n const handleWindowUnload = () => {\n const parentDiv = viewportDiv.current;\n if (parentDiv) {\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n if (parentWindow !== window) {\n handleDisconnectFromViewManager();\n }\n }\n };\n\n const getScreenViewport = (\n parentDiv: HTMLDivElement,\n inViewState: ViewState\n ) => {\n const screenViewportFactory = screenViewportOverride\n ? screenViewportOverride\n : ScreenViewport;\n const parentWindow = parentDiv.ownerDocument.defaultView as Window;\n parentWindow.addEventListener(\"unload\", handleWindowUnload, {\n once: true,\n capture: true,\n }); // by specifying 'once', listener clears after being called\n ViewportComponentEvents.initialize();\n ViewportComponentEvents.onDrawingViewportChangeEvent.addListener(\n handleDrawingViewportChangeEvent\n );\n ViewportComponentEvents.onCubeRotationChangeEvent.addListener(\n handleCubeRotationChangeEvent\n );\n ViewportComponentEvents.onStandardRotationChangeEvent.addListener(\n handleStandardRotationChangeEvent\n );\n const screenViewport = screenViewportFactory.create(parentDiv, inViewState);\n screenViewportCreated.current = true;\n viewClassFullName.current = screenViewport.view.classFullName;\n viewId.current = screenViewport.view.id;\n screenViewport.onViewChanged.addListener(handleViewChanged);\n return screenViewport;\n };\n\n React.useEffect(() => {\n isMounted.current = true;\n Logger.logInfo(\n \"ViewportComponent\",\n `mounting ViewportComponent for controlId=${controlId}`\n );\n\n return () => {\n isMounted.current = false;\n Logger.logInfo(\n \"ViewportComponent\",\n `un-mounting ViewportComponent for controlId=${controlId}`\n );\n handleDisconnectFromViewManager();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [initialViewState, setInitialViewState] = React.useState<\n ViewState | undefined\n >(undefined);\n React.useEffect(() => {\n setInitialViewState(undefined);\n }, [viewDefinitionId, viewState]);\n React.useEffect(() => {\n async function fetchInitialViewState() {\n let currentViewState: ViewState | undefined;\n if (viewState) {\n if (typeof viewState === \"function\") currentViewState = viewState();\n else currentViewState = viewState;\n } else if (viewDefinitionId && imodel) {\n try {\n currentViewState = await imodel.views.load(viewDefinitionId);\n if (!currentViewState) {\n Logger.logError(\"ViewportComponent\", `ViewState failed to load`);\n }\n } catch {\n Logger.logError(\"ViewportComponent\", `ViewState failed to load`);\n }\n } else {\n Logger.logError(\n \"ViewportComponent\",\n `A ViewState or a viewId and imodel must be provided`\n );\n }\n if (\n isMounted.current &&\n (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)\n ) {\n setInitialViewState(currentViewState?.clone());\n }\n }\n if (undefined === initialViewState) void fetchInitialViewState();\n }, [imodel, initialViewState, viewDefinitionId, viewState]);\n\n const [viewOverlay, setViewOverlay] = React.useState<React.ReactNode>(null);\n\n // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.\n React.useEffect(() => {\n const parentDiv = viewportDiv.current;\n const viewManager = viewManagerRef.current;\n if (\n parentDiv &&\n initialViewState &&\n (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)\n ) {\n if (!screenViewportCreated.current) {\n const screenViewport = getScreenViewport(parentDiv, initialViewState);\n screenViewportRef.current = screenViewport;\n\n if (viewportRef) viewportRef(screenViewport);\n\n Logger.logInfo(\n \"ViewportComponent\",\n `processing viewManager.addViewport for controlId=${controlId}`\n );\n viewManager.addViewport(screenViewport);\n\n // overlay component is set up once a ScreenViewport is available. The overlay component must handle any view changes itself.\n setViewOverlay(getViewOverlay ? getViewOverlay(screenViewport) : null);\n } else {\n screenViewportRef.current?.changeView(initialViewState);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [controlId, initialViewState, viewportRef]);\n\n const handleContextMenu = React.useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n if (onContextMenu) onContextMenu(e);\n },\n [onContextMenu]\n );\n\n const parentDivStyle: React.CSSProperties = {\n height: \"100%\",\n width: \"100%\",\n position: \"relative\",\n };\n\n const viewportDivStyle: React.CSSProperties = {\n ...style,\n height: \"100%\",\n width: \"100%\",\n };\n\n return (\n <div style={parentDivStyle} data-item-id={controlId}>\n <div\n ref={viewportDiv}\n data-testid=\"viewport-component\"\n className={className}\n style={viewportDivStyle}\n onContextMenu={handleContextMenu}\n />\n {viewOverlay}\n </div>\n );\n}\n"]}
|
|
@@ -13,42 +13,42 @@ import { Face } from "../navigationaids/Cube.js";
|
|
|
13
13
|
* @public
|
|
14
14
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
15
15
|
*/
|
|
16
|
-
// eslint-disable-next-line
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
17
17
|
export class DrawingViewportChangeEvent extends UiEvent {
|
|
18
18
|
}
|
|
19
19
|
/** 3d Cube Rotation Change event
|
|
20
20
|
* @public
|
|
21
21
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
22
22
|
*/
|
|
23
|
-
// eslint-disable-next-line
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
24
24
|
export class CubeRotationChangeEvent extends UiEvent {
|
|
25
25
|
}
|
|
26
26
|
/** Standard Rotation Change event
|
|
27
27
|
* @public
|
|
28
28
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
29
29
|
*/
|
|
30
|
-
// eslint-disable-next-line
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
31
31
|
export class StandardRotationChangeEvent extends UiEvent {
|
|
32
32
|
}
|
|
33
33
|
/** View Rotation Change event
|
|
34
34
|
* @public
|
|
35
35
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
36
36
|
*/
|
|
37
|
-
// eslint-disable-next-line
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
38
38
|
export class ViewRotationChangeEvent extends UiEvent {
|
|
39
39
|
}
|
|
40
40
|
/** View Class Full Name Change event
|
|
41
41
|
* @public
|
|
42
42
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
43
43
|
*/
|
|
44
|
-
// eslint-disable-next-line
|
|
44
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
45
45
|
export class ViewClassFullNameChangedEvent extends UiEvent {
|
|
46
46
|
}
|
|
47
47
|
/** View Id Change event
|
|
48
48
|
* @public
|
|
49
49
|
* @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
|
|
50
50
|
*/
|
|
51
|
-
// eslint-disable-next-line
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
52
52
|
export class ViewIdChangedEvent extends UiEvent {
|
|
53
53
|
}
|
|
54
54
|
/** Viewport Rotation events and methods
|
|
@@ -95,12 +95,12 @@ ViewportComponentEvents.face = Face.None;
|
|
|
95
95
|
ViewportComponentEvents.origin = Point3d.createZero();
|
|
96
96
|
ViewportComponentEvents.extents = Vector3d.createZero();
|
|
97
97
|
ViewportComponentEvents.rotationMatrix = Matrix3d.createIdentity();
|
|
98
|
-
ViewportComponentEvents.onDrawingViewportChangeEvent = new DrawingViewportChangeEvent(); // eslint-disable-line
|
|
99
|
-
ViewportComponentEvents.onCubeRotationChangeEvent = new CubeRotationChangeEvent(); // eslint-disable-line
|
|
100
|
-
ViewportComponentEvents.onStandardRotationChangeEvent = new StandardRotationChangeEvent(); // eslint-disable-line
|
|
101
|
-
ViewportComponentEvents.onViewRotationChangeEvent = new ViewRotationChangeEvent(); // eslint-disable-line
|
|
102
|
-
ViewportComponentEvents.onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent(); // eslint-disable-line
|
|
103
|
-
// eslint-disable-next-line
|
|
98
|
+
ViewportComponentEvents.onDrawingViewportChangeEvent = new DrawingViewportChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
99
|
+
ViewportComponentEvents.onCubeRotationChangeEvent = new CubeRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
100
|
+
ViewportComponentEvents.onStandardRotationChangeEvent = new StandardRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
101
|
+
ViewportComponentEvents.onViewRotationChangeEvent = new ViewRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
102
|
+
ViewportComponentEvents.onViewClassFullNameChangedEvent = new ViewClassFullNameChangedEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
104
104
|
ViewportComponentEvents.onViewIdChangedEvent = new ViewIdChangedEvent();
|
|
105
105
|
ViewportComponentEvents._handleSelectedViewportChanged = (args) => {
|
|
106
106
|
if (args.current)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../../../src/imodel-components-react/viewport/ViewportComponentEvents.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAajD;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,0BAA2B,SAAQ,OAAuC;CAAG;AAY1F;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,uBAAwB,SAAQ,OAAoC;CAAG;AAUpF;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,2BAA4B,SAAQ,OAAwC;CAAG;AAW5F;;;GAGG;AACH,mDAAmD;AACnD,MAAM,OAAO,uBAAwB,SAAQ,OAAo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AC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport type { StandardViewId, Viewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Face } from \"../navigationaids/Cube.js\";\nimport type { ListenerType } from \"@itwin/core-react/internal\";\n\n/** Arguments for [[DrawingViewportChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface DrawingViewportChangeEventArgs {\n rotation: Matrix3d;\n origin: Point3d;\n complete: boolean;\n}\n\n/** Drawing View Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> {}\n\n/** Arguments for [[CubeRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface CubeRotationChangeEventArgs {\n rotMatrix: Matrix3d;\n face: Face;\n complete?: boolean;\n}\n\n/** 3d Cube Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> {}\n\n/** Arguments for [[StandardRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface StandardRotationChangeEventArgs {\n standardRotation: StandardViewId;\n}\n\n/** Standard Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> {}\n\n/** Arguments for [[ViewRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewRotationChangeEventArgs {\n viewport: Viewport;\n animationTime?: number;\n}\n\n/** View Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> {}\n\n/** Arguments for [[ViewClassFullNameChangedEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewClassFullNameChangedEventArgs {\n viewport: Viewport;\n oldName: string;\n newName: string;\n}\n\n/** View Class Full Name Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> {}\n\n/** Arguments for [[ViewIdChangedEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewIdChangedEventArgs {\n viewport: Viewport;\n oldId: string;\n newId: string;\n}\n\n/** View Id Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> {}\n\n/** Viewport Rotation events and methods\n * @public\n */\nexport class ViewportComponentEvents {\n private static _removeListener?: () => void;\n\n public static initialize() {\n if (undefined !== this._removeListener) return;\n\n this._removeListener =\n IModelApp.viewManager.onSelectedViewportChanged.addListener(\n ViewportComponentEvents._handleSelectedViewportChanged\n );\n }\n\n /** @internal - for unit testing */\n public static terminate() {\n if (this._removeListener) {\n this._removeListener();\n this._removeListener = undefined;\n }\n }\n\n public static face = Face.None;\n public static readonly origin = Point3d.createZero();\n public static readonly extents = Vector3d.createZero();\n public static readonly rotationMatrix = Matrix3d.createIdentity();\n public static readonly onDrawingViewportChangeEvent =\n new DrawingViewportChangeEvent(); // eslint-disable-line deprecation/deprecation\n public static readonly onCubeRotationChangeEvent =\n new CubeRotationChangeEvent(); // eslint-disable-line deprecation/deprecation\n public static readonly onStandardRotationChangeEvent =\n new StandardRotationChangeEvent(); // eslint-disable-line deprecation/deprecation\n public static readonly onViewRotationChangeEvent =\n new ViewRotationChangeEvent(); // eslint-disable-line deprecation/deprecation\n public static readonly onViewClassFullNameChangedEvent =\n new ViewClassFullNameChangedEvent(); // eslint-disable-line deprecation/deprecation\n // eslint-disable-next-line deprecation/deprecation\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\n\n private static _handleSelectedViewportChanged: ListenerType<\n typeof IModelApp.viewManager.onSelectedViewportChanged\n > = (args) => {\n if (args.current) ViewportComponentEvents.setViewMatrix(args.current);\n };\n\n public static setCubeMatrix(\n rotMatrix: Matrix3d,\n face = Face.None,\n complete: boolean = false\n ): void {\n this.rotationMatrix.setFrom(rotMatrix);\n this.face = face;\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\n }\n\n public static setDrawingViewportState(\n origin: Point3d,\n rotation: Matrix3d,\n complete: boolean = false\n ): void {\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\n }\n\n public static setStandardRotation(standardRotation: StandardViewId): void {\n this.onStandardRotationChangeEvent.emit({ standardRotation });\n }\n\n public static setViewMatrix(\n viewport: Viewport,\n animationTime?: number\n ): void {\n // When handling onViewChanged, use setTimeout\n setTimeout(() => {\n if (viewport.view) {\n this.origin.setFrom(viewport.view.getOrigin());\n this.extents.setFrom(viewport.view.getExtents());\n }\n this.rotationMatrix.setFrom(viewport.rotation);\n\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ViewportComponentEvents.js","sourceRoot":"","sources":["../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O,GAAG,QAAQ,CAAC,UAAU,EAAE,CAAC;AAChC,sCAAc,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;AAC3C,oDAA4B,GACjD,IAAI,0BAA0B,EAAE,CAAC,CAAC,uDAAuD;AACpE,iDAAyB,GAC9C,IAAI,uBAAuB,EAAE,CAAC,CAAC,uDAAuD;AACjE,qDAA6B,GAClD,IAAI,2BAA2B,EAAE,CAAC,CAAC,uDAAuD;AACrE,iDAAyB,GAC9C,IAAI,uBAAuB,EAAE,CAAC,CAAC,uDAAuD;AACjE,uDAA+B,GACpD,IAAI,6BAA6B,EAAE,CAAC,CAAC,uDAAuD;AAC9F,4DAA4D;AACrC,4CAAoB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAExD,sDAA8B,GAEzC,CAAC,IAAI,EAAE,EAAE;IACX,IAAI,IAAI,CAAC,OAAO;QAAE,uBAAuB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACxE,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Viewport\n */\n\nimport { Matrix3d, Point3d, Vector3d } from \"@itwin/core-geometry\";\nimport type { StandardViewId, Viewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Face } from \"../navigationaids/Cube.js\";\nimport type { ListenerType } from \"@itwin/core-react/internal\";\n\n/** Arguments for [[DrawingViewportChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface DrawingViewportChangeEventArgs {\n rotation: Matrix3d;\n origin: Point3d;\n complete: boolean;\n}\n\n/** Drawing View Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class DrawingViewportChangeEvent extends UiEvent<DrawingViewportChangeEventArgs> {}\n\n/** Arguments for [[CubeRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface CubeRotationChangeEventArgs {\n rotMatrix: Matrix3d;\n face: Face;\n complete?: boolean;\n}\n\n/** 3d Cube Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class CubeRotationChangeEvent extends UiEvent<CubeRotationChangeEventArgs> {}\n\n/** Arguments for [[StandardRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface StandardRotationChangeEventArgs {\n standardRotation: StandardViewId;\n}\n\n/** Standard Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class StandardRotationChangeEvent extends UiEvent<StandardRotationChangeEventArgs> {}\n\n/** Arguments for [[ViewRotationChangeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewRotationChangeEventArgs {\n viewport: Viewport;\n animationTime?: number;\n}\n\n/** View Rotation Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ViewRotationChangeEvent extends UiEvent<ViewRotationChangeEventArgs> {}\n\n/** Arguments for [[ViewClassFullNameChangedEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewClassFullNameChangedEventArgs {\n viewport: Viewport;\n oldName: string;\n newName: string;\n}\n\n/** View Class Full Name Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ViewClassFullNameChangedEvent extends UiEvent<ViewClassFullNameChangedEventArgs> {}\n\n/** Arguments for [[ViewIdChangedEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ViewIdChangedEventArgs {\n viewport: Viewport;\n oldId: string;\n newId: string;\n}\n\n/** View Id Change event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ViewIdChangedEvent extends UiEvent<ViewIdChangedEventArgs> {}\n\n/** Viewport Rotation events and methods\n * @public\n */\nexport class ViewportComponentEvents {\n private static _removeListener?: () => void;\n\n public static initialize() {\n if (undefined !== this._removeListener) return;\n\n this._removeListener =\n IModelApp.viewManager.onSelectedViewportChanged.addListener(\n ViewportComponentEvents._handleSelectedViewportChanged\n );\n }\n\n /** @internal - for unit testing */\n public static terminate() {\n if (this._removeListener) {\n this._removeListener();\n this._removeListener = undefined;\n }\n }\n\n public static face = Face.None;\n public static readonly origin = Point3d.createZero();\n public static readonly extents = Vector3d.createZero();\n public static readonly rotationMatrix = Matrix3d.createIdentity();\n public static readonly onDrawingViewportChangeEvent =\n new DrawingViewportChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n public static readonly onCubeRotationChangeEvent =\n new CubeRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n public static readonly onStandardRotationChangeEvent =\n new StandardRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n public static readonly onViewRotationChangeEvent =\n new ViewRotationChangeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n public static readonly onViewClassFullNameChangedEvent =\n new ViewClassFullNameChangedEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n public static readonly onViewIdChangedEvent = new ViewIdChangedEvent();\n\n private static _handleSelectedViewportChanged: ListenerType<\n typeof IModelApp.viewManager.onSelectedViewportChanged\n > = (args) => {\n if (args.current) ViewportComponentEvents.setViewMatrix(args.current);\n };\n\n public static setCubeMatrix(\n rotMatrix: Matrix3d,\n face = Face.None,\n complete: boolean = false\n ): void {\n this.rotationMatrix.setFrom(rotMatrix);\n this.face = face;\n this.onCubeRotationChangeEvent.emit({ rotMatrix, complete, face });\n }\n\n public static setDrawingViewportState(\n origin: Point3d,\n rotation: Matrix3d,\n complete: boolean = false\n ): void {\n this.onDrawingViewportChangeEvent.emit({ origin, rotation, complete });\n }\n\n public static setStandardRotation(standardRotation: StandardViewId): void {\n this.onStandardRotationChangeEvent.emit({ standardRotation });\n }\n\n public static setViewMatrix(\n viewport: Viewport,\n animationTime?: number\n ): void {\n // When handling onViewChanged, use setTimeout\n setTimeout(() => {\n if (viewport.view) {\n this.origin.setFrom(viewport.view.getOrigin());\n this.extents.setFrom(viewport.view.getExtents());\n }\n this.rotationMatrix.setFrom(viewport.rotation);\n\n this.onViewRotationChangeEvent.emit({ viewport, animationTime });\n });\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* eslint-disable
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
6
6
|
export { UiIModelComponents } from "./imodel-components-react/UiIModelComponents.js";
|
|
7
7
|
export { AlphaSlider, } from "./imodel-components-react/color/AlphaSlider.js";
|
|
8
8
|
export { ColorPickerButton, } from "./imodel-components-react/color/ColorPickerButton.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,
|
|
1
|
+
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":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;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents.js\";\n\nexport {\n AlphaSlider,\n AlphaSliderProps,\n} from \"./imodel-components-react/color/AlphaSlider.js\";\nexport {\n ColorPickerButton,\n ColorPickerProps,\n} from \"./imodel-components-react/color/ColorPickerButton.js\";\nexport {\n ColorPickerDialog,\n ColorPickerDialogProps,\n} from \"./imodel-components-react/color/ColorPickerDialog.js\";\nexport {\n ColorPickerPopup,\n ColorPickerPopupProps,\n} from \"./imodel-components-react/color/ColorPickerPopup.js\";\nexport {\n HueSlider,\n HueSliderProps,\n} from \"./imodel-components-react/color/HueSlider.js\";\nexport {\n SaturationPicker,\n SaturationPickerProps,\n} from \"./imodel-components-react/color/SaturationPicker.js\";\nexport {\n ColorSwatch,\n ColorSwatchProps,\n} from \"./imodel-components-react/color/Swatch.js\";\n\nexport {\n ColorEditor,\n ColorPropertyEditor,\n} from \"./imodel-components-react/editors/ColorEditor.js\";\nexport {\n WeightEditor,\n WeightPropertyEditor,\n} from \"./imodel-components-react/editors/WeightEditor.js\";\n\nexport {\n QuantityInput,\n QuantityProps,\n} from \"./imodel-components-react/inputs/QuantityInput.js\";\nexport {\n QuantityNumberInput,\n QuantityNumberInputProps,\n StepFunctionProp,\n} from \"./imodel-components-react/inputs/QuantityNumberInput.js\";\n\nexport {\n LineWeightSwatch,\n LineWeightSwatchProps,\n} from \"./imodel-components-react/lineweight/Swatch.js\";\nexport {\n WeightPickerButton,\n WeightPickerProps,\n} from \"./imodel-components-react/lineweight/WeightPickerButton.js\";\n\nexport {\n Cube,\n CubeProps,\n Face,\n} from \"./imodel-components-react/navigationaids/Cube.js\";\nexport {\n CubeNavigationAid,\n CubeNavigationAidProps,\n CubeNavigationHitBoxX,\n CubeNavigationHitBoxY,\n CubeNavigationHitBoxZ,\n} from \"./imodel-components-react/navigationaids/CubeNavigationAid.js\";\nexport {\n DrawingNavigationAid,\n DrawingNavigationAidProps,\n} from \"./imodel-components-react/navigationaids/DrawingNavigationAid.js\";\n\nexport {\n FormatPanel,\n FormatPanelProps,\n} from \"./imodel-components-react/quantityformat/FormatPanel.js\";\nexport {\n FormatPrecision,\n FormatPrecisionProps,\n} from \"./imodel-components-react/quantityformat/FormatPrecision.js\";\nexport {\n FormatSample,\n FormatSampleProps,\n} from \"./imodel-components-react/quantityformat/FormatSample.js\";\nexport {\n FormatTypeOption,\n FormatTypeOptionProps,\n} from \"./imodel-components-react/quantityformat/FormatType.js\";\nexport {\n FormatUnitLabel,\n FormatUnitLabelProps,\n} from \"./imodel-components-react/quantityformat/FormatUnitLabel.js\";\nexport {\n FormatUnits,\n FormatUnitsProps,\n} from \"./imodel-components-react/quantityformat/FormatUnits.js\";\nexport {\n MiscFormatOptions,\n MiscFormatOptionsProps,\n} from \"./imodel-components-react/quantityformat/MiscFormatOptions.js\";\nexport {\n QuantityFormatPanel,\n QuantityFormatPanelProps,\n} from \"./imodel-components-react/quantityformat/QuantityFormatPanel.js\";\n\nexport {\n AnimationFractionChangeHandler,\n PlaybackSettings,\n PlaybackSettingsChangeHandler,\n SolarDataProvider,\n SolarPlaybackProgressHandler,\n TimelineDataProvider,\n TimelineDateDisplay,\n TimelinePausePlayAction,\n TimelinePausePlayArgs,\n TimelineScale,\n} from \"./imodel-components-react/timeline/interfaces.js\";\nexport { BaseTimelineDataProvider } from \"./imodel-components-react/timeline/BaseTimelineDataProvider.js\";\nexport {\n TimelineComponent,\n TimelineComponentProps,\n TimelineDateMarkerProps,\n TimelineMenuItemOption,\n TimelineMenuItemProps,\n} from \"./imodel-components-react/timeline/TimelineComponent.js\";\nexport { SolarTimeline } from \"./imodel-components-react/timeline/SolarTimeline.js\";\nexport { BaseSolarDataProvider } from \"./imodel-components-react/timeline/BaseSolarDataProvider.js\";\n\nexport {\n ViewStateProp,\n ViewportComponent,\n ViewportProps,\n} from \"./imodel-components-react/viewport/ViewportComponent.js\";\nexport {\n ViewportComponentEvents,\n CubeRotationChangeEvent,\n CubeRotationChangeEventArgs,\n DrawingViewportChangeEvent,\n DrawingViewportChangeEventArgs,\n StandardRotationChangeEvent,\n StandardRotationChangeEventArgs,\n ViewClassFullNameChangedEvent,\n ViewClassFullNameChangedEventArgs,\n ViewIdChangedEvent,\n ViewIdChangedEventArgs,\n ViewRotationChangeEvent,\n ViewRotationChangeEventArgs,\n} from \"./imodel-components-react/viewport/ViewportComponentEvents.js\";\n\nexport { ToolUtilities } from \"./imodel-components-react/ToolUtilities.js\";\n\n// #region \"SideEffects\"\n\nimport { StandardEditorNames, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { PropertyEditorManager } from \"@itwin/components-react\";\nimport { ColorPropertyEditor } from \"./imodel-components-react/editors/ColorEditor.js\";\nimport { WeightPropertyEditor } from \"./imodel-components-react/editors/WeightEditor.js\";\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n ColorPropertyEditor,\n StandardEditorNames.ColorPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n WeightPropertyEditor,\n StandardEditorNames.WeightPicker\n);\n\n// #endregion \"SideEffects\"\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "A react component library of iTwin.js UI iModel components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/imodel-components-react.d.ts",
|
|
@@ -36,55 +36,57 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@itwin/appui-abstract": "^4.0.0",
|
|
39
|
-
"@itwin/components-react": "^5.0
|
|
39
|
+
"@itwin/components-react": "^5.2.0",
|
|
40
40
|
"@itwin/core-bentley": "^4.0.0",
|
|
41
41
|
"@itwin/core-common": "^4.0.0",
|
|
42
42
|
"@itwin/core-frontend": "^4.0.0",
|
|
43
43
|
"@itwin/core-geometry": "^4.0.0",
|
|
44
44
|
"@itwin/core-quantity": "^4.0.0",
|
|
45
|
-
"@itwin/core-react": "^5.0
|
|
45
|
+
"@itwin/core-react": "^5.2.0",
|
|
46
46
|
"@itwin/itwinui-react": "^3.15.0",
|
|
47
47
|
"react": "^18.0.0",
|
|
48
48
|
"react-dom": "^18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@itwin/appui-abstract": "^4.0.0",
|
|
52
|
-
"@itwin/build-tools": "4.10.
|
|
52
|
+
"@itwin/build-tools": "4.10.2",
|
|
53
53
|
"@itwin/core-bentley": "^4.0.0",
|
|
54
54
|
"@itwin/core-common": "^4.0.0",
|
|
55
55
|
"@itwin/core-frontend": "^4.0.0",
|
|
56
56
|
"@itwin/core-geometry": "^4.0.0",
|
|
57
57
|
"@itwin/core-orbitgt": "^4.0.0",
|
|
58
58
|
"@itwin/core-quantity": "^4.0.0",
|
|
59
|
-
"@itwin/eslint-plugin": "
|
|
60
|
-
"@itwin/itwinui-react": "^3.
|
|
59
|
+
"@itwin/eslint-plugin": "5.0.0-dev.2",
|
|
60
|
+
"@itwin/itwinui-react": "^3.17.0",
|
|
61
61
|
"@itwin/webgl-compatibility": "^4.0.0",
|
|
62
62
|
"@testing-library/dom": "^10.1.0",
|
|
63
63
|
"@testing-library/react": "^15.0.7",
|
|
64
64
|
"@testing-library/user-event": "^14.5.2",
|
|
65
65
|
"@types/faker": "^4.1.0",
|
|
66
|
-
"@types/node": "
|
|
67
|
-
"@types/react": "^18.3.
|
|
68
|
-
"@types/react-dom": "^18.3.
|
|
69
|
-
"@vitest/coverage-v8": "^
|
|
66
|
+
"@types/node": "20.17.8",
|
|
67
|
+
"@types/react": "^18.3.12",
|
|
68
|
+
"@types/react-dom": "^18.3.1",
|
|
69
|
+
"@vitest/coverage-v8": "^3.0.6",
|
|
70
70
|
"cpx2": "^3.0.0",
|
|
71
71
|
"eslint": "^8.57.1",
|
|
72
72
|
"eslint-config-prettier": "~8.8.0",
|
|
73
73
|
"faker": "^4.1.0",
|
|
74
74
|
"ignore-styles": "^5.0.1",
|
|
75
|
+
"inversify": "^6.0.1",
|
|
75
76
|
"jsdom": "^24.0.0",
|
|
76
77
|
"npm-run-all": "^4.1.5",
|
|
77
78
|
"raf": "^3.4.0",
|
|
78
79
|
"react": "^18.3.1",
|
|
79
80
|
"react-dom": "^18.3.1",
|
|
80
|
-
"
|
|
81
|
+
"reflect-metadata": "^0.1.13",
|
|
82
|
+
"rimraf": "^6.0.1",
|
|
81
83
|
"ts-node": "^10.8.2",
|
|
82
84
|
"typemoq": "^2.1.0",
|
|
83
|
-
"typescript": "~5.
|
|
85
|
+
"typescript": "~5.6.2",
|
|
84
86
|
"upath": "^2.0.1",
|
|
85
|
-
"vitest": "^
|
|
86
|
-
"@itwin/components-react": "5.0
|
|
87
|
-
"@itwin/core-react": "5.0
|
|
87
|
+
"vitest": "^3.0.6",
|
|
88
|
+
"@itwin/components-react": "5.2.0",
|
|
89
|
+
"@itwin/core-react": "5.2.0"
|
|
88
90
|
},
|
|
89
91
|
"dependencies": {
|
|
90
92
|
"@itwin/itwinui-icons-react": "^2.8.0",
|
|
@@ -99,7 +101,7 @@
|
|
|
99
101
|
"compat:css": "npm run compat:cjs && npm run compat:esm",
|
|
100
102
|
"compat:cjs": "cpx \"./src/**/*.{*css,svg}\" ./lib/cjs",
|
|
101
103
|
"compat:esm": "cpx \"./src/**/*.{*css,svg}\" ./lib/esm",
|
|
102
|
-
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
104
|
+
"clean": "rimraf -g lib .rush/temp/package-deps*.json",
|
|
103
105
|
"cover": "vitest run --coverage",
|
|
104
106
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
105
107
|
"lint:fix": "npm run -s lint -- --fix",
|