@itwin/appui-react 5.0.0-dev.3 → 5.0.1
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 +85 -1
- package/lib/appui-react/UiFramework.d.ts +2 -2
- package/lib/appui-react/UiFramework.d.ts.map +1 -1
- package/lib/appui-react/UiFramework.js +3 -1
- package/lib/appui-react/UiFramework.js.map +1 -1
- package/lib/appui-react/childwindow/ChildWindowWidget.d.ts.map +1 -1
- package/lib/appui-react/childwindow/ChildWindowWidget.js +4 -1
- package/lib/appui-react/childwindow/ChildWindowWidget.js.map +1 -1
- package/lib/appui-react/framework/FrameworkFrontstages.d.ts +3 -3
- package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
- package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
- package/lib/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/appui-react/frontstage/FrontstageDef.js +1 -0
- package/lib/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/appui-react/frontstage/ModalFrontstage.d.ts +4 -2
- package/lib/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
- package/lib/appui-react/frontstage/ModalFrontstage.js +5 -7
- package/lib/appui-react/frontstage/ModalFrontstage.js.map +1 -1
- package/lib/appui-react/frontstage/ModalFrontstage.scss +0 -5
- package/lib/appui-react/frontstage/ModalFrontstageButton.d.ts +22 -0
- package/lib/appui-react/frontstage/ModalFrontstageButton.d.ts.map +1 -0
- package/lib/appui-react/frontstage/ModalFrontstageButton.js +29 -0
- package/lib/appui-react/frontstage/ModalFrontstageButton.js.map +1 -0
- package/lib/appui-react/{layout/widget/tools/button/Back.scss → frontstage/ModalFrontstageButton.scss} +15 -3
- package/lib/appui-react/icons/SvgAssetClassificationHide.d.ts +7 -0
- package/lib/appui-react/icons/SvgAssetClassificationHide.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgAssetClassificationHide.js +14 -0
- package/lib/appui-react/icons/SvgAssetClassificationHide.js.map +1 -0
- package/lib/appui-react/icons/SvgAssetIsolate.d.ts +7 -0
- package/lib/appui-react/icons/SvgAssetIsolate.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgAssetIsolate.js +14 -0
- package/lib/appui-react/icons/SvgAssetIsolate.js.map +1 -0
- package/lib/appui-react/icons/SvgGyroscope.d.ts +7 -0
- package/lib/appui-react/icons/SvgGyroscope.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgGyroscope.js +15 -0
- package/lib/appui-react/icons/SvgGyroscope.js.map +1 -0
- package/lib/appui-react/icons/SvgLayersHide.d.ts +7 -0
- package/lib/appui-react/icons/SvgLayersHide.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgLayersHide.js +14 -0
- package/lib/appui-react/icons/SvgLayersHide.js.map +1 -0
- package/lib/appui-react/icons/SvgLayersIsolate.d.ts +7 -0
- package/lib/appui-react/icons/SvgLayersIsolate.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgLayersIsolate.js +14 -0
- package/lib/appui-react/icons/SvgLayersIsolate.js.map +1 -0
- package/lib/appui-react/icons/SvgModelHide.d.ts +7 -0
- package/lib/appui-react/icons/SvgModelHide.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgModelHide.js +15 -0
- package/lib/appui-react/icons/SvgModelHide.js.map +1 -0
- package/lib/appui-react/icons/SvgModelIsolate.d.ts +7 -0
- package/lib/appui-react/icons/SvgModelIsolate.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgModelIsolate.js +15 -0
- package/lib/appui-react/icons/SvgModelIsolate.js.map +1 -0
- package/lib/appui-react/icons/SvgSavedView.d.ts +7 -0
- package/lib/appui-react/icons/SvgSavedView.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgSavedView.js +15 -0
- package/lib/appui-react/icons/SvgSavedView.js.map +1 -0
- package/lib/appui-react/icons/SvgSectionTool.d.ts +7 -0
- package/lib/appui-react/icons/SvgSectionTool.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgSectionTool.js +15 -0
- package/lib/appui-react/icons/SvgSectionTool.js.map +1 -0
- package/lib/appui-react/icons/SvgSelectionClear.d.ts +7 -0
- package/lib/appui-react/icons/SvgSelectionClear.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgSelectionClear.js +14 -0
- package/lib/appui-react/icons/SvgSelectionClear.js.map +1 -0
- package/lib/appui-react/icons/SvgViewLayouts.d.ts +7 -0
- package/lib/appui-react/icons/SvgViewLayouts.d.ts.map +1 -0
- package/lib/appui-react/icons/SvgViewLayouts.js +14 -0
- package/lib/appui-react/icons/SvgViewLayouts.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceBottom.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceBottom.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceBottom.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceBottom.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceFront.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceFront.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceFront.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceFront.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoLeft.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoLeft.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoLeft.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoLeft.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoRight.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoRight.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoRight.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceIsoRight.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceLeft.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceLeft.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceLeft.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceLeft.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRear.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRear.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRear.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRear.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRight.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRight.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRight.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceRight.js.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceTop.d.ts +7 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceTop.d.ts.map +1 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceTop.js +15 -0
- package/lib/appui-react/icons/cube-faces/SvgCubeFaceTop.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnaps.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnaps.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnaps.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnaps.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsBisector.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsBisector.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsBisector.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsBisector.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsCenter.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsCenter.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsCenter.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsCenter.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsIntersection.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsIntersection.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsIntersection.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsIntersection.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsMidpoint.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsMidpoint.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsMidpoint.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsMidpoint.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsNearest.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsNearest.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsNearest.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsNearest.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsOrigin.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsOrigin.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsOrigin.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsOrigin.js.map +1 -0
- package/lib/appui-react/layout/footer/snap-mode/Snap.d.ts.map +1 -1
- package/lib/appui-react/layout/footer/snap-mode/Snap.js +2 -2
- package/lib/appui-react/layout/footer/snap-mode/Snap.js.map +1 -1
- package/lib/appui-react/layout/footer/snap-mode/Snap.scss +4 -0
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +16 -16
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/appui-react/pickers/ViewSelector.d.ts.map +1 -1
- package/lib/appui-react/pickers/ViewSelector.js +5 -2
- package/lib/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/appui-react/redux/FrameworkState.d.ts +5 -2
- package/lib/appui-react/redux/FrameworkState.d.ts.map +1 -1
- package/lib/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
- package/lib/appui-react/selection/SelectionContextItemDef.js +21 -20
- package/lib/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/appui-react/settings/ui/UiSettingsPage.js +2 -2
- package/lib/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/appui-react/statusfields/SectionsField.js +2 -2
- package/lib/appui-react/statusfields/SectionsField.js.map +1 -1
- package/lib/appui-react/statusfields/SnapMode.d.ts.map +1 -1
- package/lib/appui-react/statusfields/SnapMode.js +21 -30
- package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/appui-react/toolbar/ToolbarItemUtilities.d.ts.map +1 -1
- package/lib/appui-react/toolbar/ToolbarItemUtilities.js +5 -0
- package/lib/appui-react/toolbar/ToolbarItemUtilities.js.map +1 -1
- package/lib/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/appui-react/tools/CoreToolDefinitions.js +12 -13
- package/lib/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/appui-react/tools/KeyinPaletteTools.d.ts +11 -6
- package/lib/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
- package/lib/appui-react/tools/KeyinPaletteTools.js +12 -9
- package/lib/appui-react/tools/KeyinPaletteTools.js.map +1 -1
- package/lib/appui-react/tools/OpenSettingsTool.d.ts +10 -5
- package/lib/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
- package/lib/appui-react/tools/OpenSettingsTool.js +11 -8
- package/lib/appui-react/tools/OpenSettingsTool.js.map +1 -1
- package/lib/appui-react/tools/RestoreLayoutTool.d.ts +16 -8
- package/lib/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/appui-react/tools/RestoreLayoutTool.js +17 -13
- package/lib/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/appui-react/widget-panels/Content.d.ts +2 -0
- package/lib/appui-react/widget-panels/Content.d.ts.map +1 -1
- package/lib/appui-react/widget-panels/Content.js +2 -1
- package/lib/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/appui-react/widget-panels/ModalFrontstageComposer.d.ts.map +1 -1
- package/lib/appui-react/widget-panels/ModalFrontstageComposer.js +2 -2
- package/lib/appui-react/widget-panels/ModalFrontstageComposer.js.map +1 -1
- package/lib/appui-react/widgets/WidgetDef.d.ts +0 -1
- package/lib/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/appui-react/widgets/WidgetDef.js +0 -1
- package/lib/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/appui-react.d.ts +1 -0
- package/lib/appui-react.d.ts.map +1 -1
- package/lib/appui-react.js +1 -0
- package/lib/appui-react.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalFrontstage.scss +0 -5
- package/lib/cjs/appui-react/{layout/widget/tools/button/Back.scss → frontstage/ModalFrontstageButton.scss} +15 -3
- package/lib/cjs/appui-react/layout/footer/snap-mode/Snap.scss +4 -0
- package/lib/esm/appui-react/frontstage/ModalFrontstage.scss +0 -5
- package/lib/esm/appui-react/{layout/widget/tools/button/Back.scss → frontstage/ModalFrontstageButton.scss} +15 -3
- package/lib/esm/appui-react/layout/footer/snap-mode/Snap.scss +4 -0
- package/package.json +11 -13
|
@@ -5,71 +5,60 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module StatusBar
|
|
7
7
|
*/
|
|
8
|
-
import snapModeBisector from "@bentley/icons-generic/icons/snaps-bisector.svg";
|
|
9
|
-
import snapModeCenter from "@bentley/icons-generic/icons/snaps-center.svg";
|
|
10
|
-
import snapModeIntersection from "@bentley/icons-generic/icons/snaps-intersection.svg";
|
|
11
|
-
import snapModeMidpoint from "@bentley/icons-generic/icons/snaps-midpoint.svg";
|
|
12
|
-
import snapModeNearest from "@bentley/icons-generic/icons/snaps-nearest.svg";
|
|
13
|
-
import snapModeOrigin from "@bentley/icons-generic/icons/snaps-origin.svg";
|
|
14
|
-
import snapModeKeypoint from "@bentley/icons-generic/icons/snaps.svg";
|
|
15
8
|
import { SnapMode } from "@itwin/core-frontend";
|
|
16
|
-
import { Icon } from "@itwin/core-react";
|
|
17
9
|
import * as React from "react";
|
|
18
10
|
import { UiFramework } from "../UiFramework.js";
|
|
19
11
|
import { SnapModePanel } from "../layout/footer/snap-mode/Panel.js";
|
|
20
12
|
import { Snap } from "../layout/footer/snap-mode/Snap.js";
|
|
21
13
|
import { useTranslation } from "../hooks/useTranslation.js";
|
|
22
14
|
import { useReduxFrameworkState } from "../uistate/useReduxFrameworkState.js";
|
|
23
|
-
import { Button } from "@itwin/itwinui-react";
|
|
15
|
+
import { Button, Icon } from "@itwin/itwinui-react";
|
|
24
16
|
import { StatusBarPopover } from "../statusbar/popup/StatusBarPopover.js";
|
|
17
|
+
import { SvgSnapsBisector } from "../icons/snaps/SvgSnapsBisector.js";
|
|
18
|
+
import { SvgSnapsCenter } from "../icons/snaps/SvgSnapsCenter.js";
|
|
19
|
+
import { SvgSnapsIntersection } from "../icons/snaps/SvgSnapsIntersection.js";
|
|
20
|
+
import { SvgSnapsMidpoint } from "../icons/snaps/SvgSnapsMidpoint.js";
|
|
21
|
+
import { SvgSnapsNearest } from "../icons/snaps/SvgSnapsNearest.js";
|
|
22
|
+
import { SvgSnapsOrigin } from "../icons/snaps/SvgSnapsOrigin.js";
|
|
23
|
+
import { SvgSnaps } from "../icons/snaps/SvgSnaps.js";
|
|
25
24
|
// Field entry of all possible snap modes.
|
|
26
25
|
const allSnapModeFieldEntries = [
|
|
27
26
|
{
|
|
28
27
|
labelKey: "snapModeField.keypoint",
|
|
29
28
|
value: SnapMode.NearestKeypoint,
|
|
30
|
-
|
|
29
|
+
icon: React.createElement(SvgSnaps, null),
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
32
|
labelKey: "snapModeField.intersection",
|
|
34
33
|
value: SnapMode.Intersection,
|
|
35
|
-
|
|
34
|
+
icon: React.createElement(SvgSnapsIntersection, null),
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
labelKey: "snapModeField.center",
|
|
39
38
|
value: SnapMode.Center,
|
|
40
|
-
|
|
39
|
+
icon: React.createElement(SvgSnapsCenter, null),
|
|
41
40
|
},
|
|
42
41
|
{
|
|
43
42
|
labelKey: "snapModeField.nearest",
|
|
44
43
|
value: SnapMode.Nearest,
|
|
45
|
-
|
|
44
|
+
icon: React.createElement(SvgSnapsNearest, null),
|
|
46
45
|
},
|
|
47
46
|
{
|
|
48
47
|
labelKey: "snapModeField.origin",
|
|
49
48
|
value: SnapMode.Origin,
|
|
50
|
-
|
|
49
|
+
icon: React.createElement(SvgSnapsOrigin, null),
|
|
51
50
|
},
|
|
52
51
|
{
|
|
53
52
|
labelKey: "snapModeField.midpoint",
|
|
54
53
|
value: SnapMode.MidPoint,
|
|
55
|
-
|
|
54
|
+
icon: React.createElement(SvgSnapsMidpoint, null),
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
57
|
labelKey: "snapModeField.bisector",
|
|
59
58
|
value: SnapMode.Bisector,
|
|
60
|
-
|
|
59
|
+
icon: React.createElement(SvgSnapsBisector, null),
|
|
61
60
|
},
|
|
62
61
|
];
|
|
63
|
-
/** Return icon for a specific snapMode. */
|
|
64
|
-
const getSnapModeIcon = (snapMode) => {
|
|
65
|
-
// Get all the modes present in the bitmask.
|
|
66
|
-
const modes = allSnapModeFieldEntries.filter((entry) => {
|
|
67
|
-
return (entry.value & snapMode) === entry.value;
|
|
68
|
-
});
|
|
69
|
-
return (
|
|
70
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
71
|
-
React.createElement(Icon, { iconSpec: modes.length === 1 ? modes[0].iconSpec : snapModeKeypoint }));
|
|
72
|
-
};
|
|
73
62
|
/** `SnapModeField` component designed to be specified in a status bar. It will
|
|
74
63
|
* display the active snap mode that AccuSnap will use and allow the user to select a new snap mode.
|
|
75
64
|
* @public
|
|
@@ -86,6 +75,10 @@ export function SnapModeField(props) {
|
|
|
86
75
|
// eslint-disable-next-line deprecation/deprecation
|
|
87
76
|
(state) => state?.configurableUiState.snapMode);
|
|
88
77
|
const snapMode = props.snapMode ?? reduxSnapMode ?? SnapMode.NearestKeypoint;
|
|
78
|
+
// Get all the modes present in the bitmask.
|
|
79
|
+
const enabledSnaps = allSnapModeFieldEntries.filter((entry) => {
|
|
80
|
+
return (entry.value & snapMode) === entry.value;
|
|
81
|
+
});
|
|
89
82
|
const title = translate("snapModeField.snapMode");
|
|
90
83
|
return (React.createElement(StatusBarPopover, { content: React.createElement(SnapModePanel, { title: title }, snapModeEntries.map((entry, index) => (React.createElement(Snap, { key: `SM_${index}`, onClick: () => {
|
|
91
84
|
if (props.onChange) {
|
|
@@ -94,10 +87,8 @@ export function SnapModeField(props) {
|
|
|
94
87
|
}
|
|
95
88
|
// eslint-disable-next-line deprecation/deprecation
|
|
96
89
|
UiFramework.setAccudrawSnapMode(entry.value);
|
|
97
|
-
}, isActive: (snapMode & entry.value) === entry.value, icon:
|
|
98
|
-
|
|
99
|
-
React.createElement(Icon, { className: `icon`, iconSpec: entry.iconSpec }) }, translate(entry.labelKey))))) },
|
|
100
|
-
React.createElement(Button, { styleType: "borderless", title: title, endIcon: getSnapModeIcon(snapMode) },
|
|
90
|
+
}, isActive: (snapMode & entry.value) === entry.value, icon: React.createElement(Icon, null, entry.icon) }, translate(entry.labelKey))))) },
|
|
91
|
+
React.createElement(Button, { styleType: "borderless", title: title, endIcon: enabledSnaps.length === 1 ? enabledSnaps[0].icon : React.createElement(SvgSnaps, null) },
|
|
101
92
|
title,
|
|
102
93
|
React.createElement(StatusBarPopover.ExpandIndicator, null))));
|
|
103
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapMode.js","sourceRoot":"","sources":["../../../src/appui-react/statusfields/SnapMode.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AA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,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 StatusBar\n */\n\nimport { SnapMode } from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SnapModePanel } from \"../layout/footer/snap-mode/Panel.js\";\nimport { Snap } from \"../layout/footer/snap-mode/Snap.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport { Button, Icon } from \"@itwin/itwinui-react\";\nimport { StatusBarPopover } from \"../statusbar/popup/StatusBarPopover.js\";\nimport { SvgSnapsBisector } from \"../icons/snaps/SvgSnapsBisector.js\";\nimport { SvgSnapsCenter } from \"../icons/snaps/SvgSnapsCenter.js\";\nimport { SvgSnapsIntersection } from \"../icons/snaps/SvgSnapsIntersection.js\";\nimport { SvgSnapsMidpoint } from \"../icons/snaps/SvgSnapsMidpoint.js\";\nimport { SvgSnapsNearest } from \"../icons/snaps/SvgSnapsNearest.js\";\nimport { SvgSnapsOrigin } from \"../icons/snaps/SvgSnapsOrigin.js\";\nimport { SvgSnaps } from \"../icons/snaps/SvgSnaps.js\";\n\n/** Define the properties that will be used to represent the available snap modes. */\ninterface SnapModeFieldEntry {\n labelKey: string;\n value: number;\n icon: React.ReactElement;\n}\n\n// Field entry of all possible snap modes.\nconst allSnapModeFieldEntries: SnapModeFieldEntry[] = [\n {\n labelKey: \"snapModeField.keypoint\",\n value: SnapMode.NearestKeypoint as number,\n icon: <SvgSnaps />,\n },\n {\n labelKey: \"snapModeField.intersection\",\n value: SnapMode.Intersection as number,\n icon: <SvgSnapsIntersection />,\n },\n {\n labelKey: \"snapModeField.center\",\n value: SnapMode.Center as number,\n icon: <SvgSnapsCenter />,\n },\n {\n labelKey: \"snapModeField.nearest\",\n value: SnapMode.Nearest as number,\n icon: <SvgSnapsNearest />,\n },\n {\n labelKey: \"snapModeField.origin\",\n value: SnapMode.Origin as number,\n icon: <SvgSnapsOrigin />,\n },\n {\n labelKey: \"snapModeField.midpoint\",\n value: SnapMode.MidPoint as number,\n icon: <SvgSnapsMidpoint />,\n },\n {\n labelKey: \"snapModeField.bisector\",\n value: SnapMode.Bisector as number,\n icon: <SvgSnapsBisector />,\n },\n];\n\n/** Defines properties supported by the SnapMode Field Component. */\n// eslint-disable-next-line deprecation/deprecation\ninterface SnapModeFieldProps extends CommonProps {\n /** Uses redux store as a fallback. Defaults to {@link SnapMode.NearestKeypoint}.\n * @note Enum flags are supported.\n */\n snapMode?: SnapMode;\n /** The list of snap modes available for selection. Defaults to all the modes.*/\n availableSnapModes?: SnapMode[];\n onChange?: (newSnapMode: SnapMode) => void;\n}\n\n/** `SnapModeField` component designed to be specified in a status bar. It will\n * display the active snap mode that AccuSnap will use and allow the user to select a new snap mode.\n * @public\n */\nexport function SnapModeField(props: SnapModeFieldProps) {\n const { translate } = useTranslation();\n const snapModeEntries: SnapModeFieldEntry[] = props.availableSnapModes\n ? allSnapModeFieldEntries.filter((entry) => {\n return (\n props.availableSnapModes &&\n props.availableSnapModes.some(\n (availableSnap) => availableSnap === (entry.value as SnapMode)\n )\n );\n })\n : allSnapModeFieldEntries;\n\n const reduxSnapMode = useReduxFrameworkState(\n // eslint-disable-next-line deprecation/deprecation\n (state) => state?.configurableUiState.snapMode\n );\n const snapMode = props.snapMode ?? reduxSnapMode ?? SnapMode.NearestKeypoint;\n\n // Get all the modes present in the bitmask.\n const enabledSnaps: SnapModeFieldEntry[] = allSnapModeFieldEntries.filter(\n (entry) => {\n return (entry.value & snapMode) === entry.value;\n }\n );\n\n const title = translate(\"snapModeField.snapMode\");\n return (\n <StatusBarPopover\n content={\n <SnapModePanel title={title}>\n {snapModeEntries.map((entry, index) => (\n <Snap\n key={`SM_${index}`}\n onClick={() => {\n if (props.onChange) {\n props.onChange(entry.value);\n return;\n }\n // eslint-disable-next-line deprecation/deprecation\n UiFramework.setAccudrawSnapMode(entry.value);\n }}\n isActive={(snapMode & entry.value) === entry.value}\n icon={<Icon>{entry.icon}</Icon>}\n >\n {translate(entry.labelKey)}\n </Snap>\n ))}\n </SnapModePanel>\n }\n >\n <Button\n styleType=\"borderless\"\n title={title}\n endIcon={\n enabledSnaps.length === 1 ? enabledSnaps[0].icon : <SvgSnaps />\n }\n >\n {title}\n <StatusBarPopover.ExpandIndicator />\n </Button>\n </StatusBarPopover>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarItemUtilities.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemUtilities.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolbarItemUtilities.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemUtilities.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAI1B;;GAEG;AACH,yBAAiB,oBAAoB,CAAC;IACpC,UAAU,oBACR,SAAQ,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,EAClE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC;QAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;KACtC;IAED,KAAK,wBAAwB,GAAG;QA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AI,CAAC,CAAC,EAClE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC;QAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;KACtC;IAED,KAAK,wBAAwB,GAAG;QAC9B,EAAE,EAAE,MAAM;QACV,YAAY,EAAE,MAAM;QACpB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC;QAC/B,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;QACjC,YAAY,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC;QAChD,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC;KACvC,CAAC;IAsBF,6BAA6B;IAC7B,MAAM,UAAU,gBAAgB,CAC9B,IAAI,EAAE,oBAAoB,GACzB,iBAAiB,CAAC;IACrB;;OAEG;IACH,MAAM,UAAU,gBAAgB,CAC9B,GAAG,IAAI,EAAE,wBAAwB,GAChC,iBAAiB,CAAC;IAiBrB,2DAA2D;IAC3D,MAAM,UAAU,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,iBAAiB,CAoBnB;;CACF"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { IModelApp } from "@itwin/core-frontend";
|
|
10
10
|
import { isArgsUtil } from "../backstage/BackstageItemUtilities.js";
|
|
11
|
+
import { ToolUtilities } from "@itwin/imodel-components-react";
|
|
11
12
|
/** Helper namespace to create toolbar items.
|
|
12
13
|
* @public
|
|
13
14
|
*/
|
|
@@ -91,11 +92,15 @@ export var ToolbarItemUtilities;
|
|
|
91
92
|
ToolbarItemUtilities.createCustomItem = createCustomItem;
|
|
92
93
|
/** Creates an action item from the specified tool type. */
|
|
93
94
|
function createForTool(toolType, overrides) {
|
|
95
|
+
const iconNode = ToolUtilities.isWithIcon(toolType)
|
|
96
|
+
? toolType.iconElement
|
|
97
|
+
: undefined;
|
|
94
98
|
// eslint-disable-next-line deprecation/deprecation
|
|
95
99
|
return ToolbarItemUtilities.createActionItem(toolType.toolId, 0, toolType.iconSpec, toolType.flyover, () => {
|
|
96
100
|
void IModelApp.tools.run(toolType.toolId);
|
|
97
101
|
}, {
|
|
98
102
|
description: toolType.description,
|
|
103
|
+
iconNode,
|
|
99
104
|
...overrides,
|
|
100
105
|
});
|
|
101
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarItemUtilities.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemUtilities.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAMhE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolbarItemUtilities.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarItemUtilities.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAMhE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;GAEG;AACH,MAAM,KAAW,oBAAoB,CA+NpC;AA/ND,WAAiB,oBAAoB;IAgBnC,SAAS,0BAA0B,CACjC,GAAG,CACD,EAAE,EACF,YAAY,EACZ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACgB;QAE3B,OAAO;YACL,EAAE;YACF,YAAY;YACZ,IAAI;YACJ,KAAK;YACL,OAAO;YACP,GAAG,SAAS;SACb,CAAC;IACJ,CAAC;IAYD,8BAA8B;IAC9B,SAAgB,gBAAgB,CAC9B,GAAG,IA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WAAW;YACjC,QAAQ;YACR,GAAG,SAAS;SACb,CACF,CAAC;IACJ,CAAC;IAvBe,kCAAa,gBAuB5B,CAAA;AACH,CAAC,EA/NgB,oBAAoB,KAApB,oBAAoB,QA+NpC","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 Toolbar\n */\n\nimport * as React from \"react\";\nimport { IModelApp, type ToolType } from \"@itwin/core-frontend\";\nimport type {\n ToolbarActionItem,\n ToolbarCustomItem,\n ToolbarGroupItem,\n} from \"./ToolbarItem.js\";\nimport { isArgsUtil } from \"../backstage/BackstageItemUtilities.js\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\n\n/** Helper namespace to create toolbar items.\n * @public\n */\nexport namespace ToolbarItemUtilities {\n interface CreateActionItemArgs\n extends Partial<Omit<ToolbarActionItem, \"icon\" | \"iconNode\" | \"id\">>,\n Pick<ToolbarActionItem, \"id\"> {\n icon?: ToolbarActionItem[\"iconNode\"];\n }\n\n type DeprecatedActionItemArgs = [\n id: ToolbarActionItem[\"id\"],\n itemPriority: ToolbarActionItem[\"itemPriority\"],\n icon: ToolbarActionItem[\"icon\"],\n label: ToolbarActionItem[\"label\"],\n execute: ToolbarActionItem[\"execute\"],\n overrides?: Partial<ToolbarActionItem>\n ];\n\n function createDeprecatedActionItem(\n ...[\n id,\n itemPriority,\n icon,\n label,\n execute,\n overrides,\n ]: DeprecatedActionItemArgs\n ): ToolbarActionItem {\n return {\n id,\n itemPriority,\n icon,\n label,\n execute,\n ...overrides,\n };\n }\n\n /** Creates an action item. */\n export function createActionItem(\n args: CreateActionItemArgs\n ): ToolbarActionItem;\n /** Creates an action item.\n * @deprecated in 4.16.0. Uses a deprecated {@link @itwin/core-react#IconSpec} type. Use an overload instead.\n */\n export function createActionItem(\n ...args: DeprecatedActionItemArgs\n ): ToolbarActionItem;\n /** Creates an action item. */\n export function createActionItem(\n ...args: DeprecatedActionItemArgs | [CreateActionItemArgs]\n ): ToolbarActionItem {\n if (isArgsUtil(args)) {\n const {\n execute = () => {},\n icon,\n itemPriority = 0,\n label = \"\",\n ...other\n } = args[0];\n return {\n execute,\n itemPriority,\n iconNode: icon,\n icon: icon ? <>{icon}</> : undefined,\n label,\n ...other,\n };\n }\n return createDeprecatedActionItem(...args);\n }\n\n interface CreateGroupItemArgs\n extends Partial<Omit<ToolbarGroupItem, \"icon\" | \"iconNode\" | \"id\">>,\n Pick<ToolbarGroupItem, \"id\"> {\n icon?: ToolbarGroupItem[\"iconNode\"];\n }\n\n type DeprecatedGroupItemArgs = [\n id: string,\n itemPriority: number,\n icon: ToolbarGroupItem[\"icon\"],\n label: ToolbarGroupItem[\"label\"],\n items: ToolbarGroupItem[\"items\"],\n overrides?: Partial<ToolbarGroupItem>\n ];\n\n function createDeprecatedGroupItem(\n ...[\n id,\n itemPriority,\n icon,\n label,\n items,\n overrides,\n ]: DeprecatedGroupItemArgs\n ): ToolbarGroupItem {\n return {\n id,\n itemPriority,\n icon,\n label,\n items,\n ...overrides,\n };\n }\n\n /** Creates a group item. */\n export function createGroupItem(args: CreateGroupItemArgs): ToolbarGroupItem;\n /** Creates a group item.\n * @deprecated in 4.16.0. Uses a deprecated {@link @itwin/core-react#IconSpec} type. Use an overload instead.\n */\n export function createGroupItem(\n ...args: DeprecatedGroupItemArgs\n ): ToolbarGroupItem;\n /** Creates a group item. */\n export function createGroupItem(\n ...args: DeprecatedGroupItemArgs | [CreateGroupItemArgs]\n ): ToolbarGroupItem {\n if (isArgsUtil(args)) {\n const {\n icon,\n itemPriority = 0,\n items = [],\n label = \"\",\n ...other\n } = args[0];\n return {\n itemPriority,\n items,\n iconNode: icon,\n icon: icon ? <>{icon}</> : undefined,\n label,\n ...other,\n };\n }\n return createDeprecatedGroupItem(...args);\n }\n\n interface CreateCustomItemArgs\n extends Partial<Omit<ToolbarCustomItem, \"icon\" | \"iconNode\" | \"id\">>,\n Pick<ToolbarCustomItem, \"id\"> {\n icon?: ToolbarCustomItem[\"iconNode\"];\n }\n\n type DeprecatedCustomItemArgs = [\n id: string,\n itemPriority: number,\n icon: ToolbarCustomItem[\"icon\"],\n label: ToolbarCustomItem[\"label\"],\n panelContent?: ToolbarCustomItem[\"panelContent\"],\n overrides?: Partial<ToolbarCustomItem>\n ];\n\n function createDeprecatedCustomItem(\n ...[\n id,\n itemPriority,\n icon,\n label,\n panelContent,\n overrides,\n ]: DeprecatedCustomItemArgs\n ): ToolbarCustomItem {\n return {\n id,\n itemPriority,\n icon,\n label,\n panelContent,\n ...overrides,\n };\n }\n\n /** Creates a custom item. */\n export function createCustomItem(\n args: CreateCustomItemArgs\n ): ToolbarCustomItem;\n /** Creates a custom item.\n * @deprecated in 4.16.0. Uses a deprecated {@link @itwin/core-react#IconSpec} type. Use an overload instead.\n */\n export function createCustomItem(\n ...args: DeprecatedCustomItemArgs\n ): ToolbarCustomItem;\n /** Creates a custom item. */\n export function createCustomItem(\n ...args: DeprecatedCustomItemArgs | [CreateCustomItemArgs]\n ): ToolbarCustomItem {\n if (isArgsUtil(args)) {\n const { icon, itemPriority = 0, ...other } = args[0];\n return {\n itemPriority,\n iconNode: icon,\n icon: icon ? <>{icon}</> : undefined,\n ...other,\n };\n }\n return createDeprecatedCustomItem(...args);\n }\n\n /** Creates an action item from the specified tool type. */\n export function createForTool(\n toolType: ToolType,\n overrides?: Partial<ToolbarActionItem>\n ): ToolbarActionItem {\n const iconNode = ToolUtilities.isWithIcon(toolType)\n ? toolType.iconElement\n : undefined;\n\n // eslint-disable-next-line deprecation/deprecation\n return ToolbarItemUtilities.createActionItem(\n toolType.toolId,\n 0,\n toolType.iconSpec,\n toolType.flyover,\n () => {\n void IModelApp.tools.run(toolType.toolId);\n },\n {\n description: toolType.description,\n iconNode,\n ...overrides,\n }\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreToolDefinitions.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAkCH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CoreToolDefinitions.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAkCH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiBvD;;;GAGG;AACH,qBAAa,SAAS;IACpB,WAAkB,yBAAyB,gBAW1C;IAED,WAAkB,cAAc,gBAa/B;IAED,WAAkB,iBAAiB,gBAYlC;IAED,WAAkB,eAAe,gBAYhC;IAED,WAAkB,cAAc,gBAY/B;IAED,WAAkB,iBAAiB,gBAoBlC;IAED,WAAkB,eAAe,gBAoBhC;IAED,WAAkB,oBAAoB,gBAQrC;IAED,WAAkB,mBAAmB,gBAQpC;IAED,WAAkB,uBAAuB,gBA2CxC;IAED,WAAkB,cAAc,gBAY/B;IAID,WAAkB,eAAe,gBAqBhC;IAED,WAAkB,eAAe,gBAqBhC;IAED,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAS/B,WAAkB,4BAA4B,gBAc7C;IAGD,WAAkB,8BAA8B,gBAc/C;IAGD,WAAkB,4BAA4B,gBAc7C;IAGD,WAAkB,4BAA4B,gBAc7C;IAED,WAAkB,gBAAgB,iBA0BjC;IAED,WAAkB,yBAAyB,iBAuC1C;IAGD,WAAkB,0BAA0B,gBAU3C;IAGD,WAAkB,0BAA0B,gBAU3C;IAED,WAAkB,gBAAgB,iBAWjC;IAED,WAAkB,qBAAqB,mBAgBtC;IAED,WAAkB,qCAAqC,gBAUtD;CACF"}
|
|
@@ -16,11 +16,10 @@ import { SyncUiEventId } from "../syncui/SyncUiEventDispatcher.js";
|
|
|
16
16
|
import { GroupItemDef } from "../toolbar/GroupItem.js";
|
|
17
17
|
import { RestoreFrontstageLayoutTool } from "./RestoreLayoutTool.js";
|
|
18
18
|
import { UiFramework } from "../UiFramework.js";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { SvgMeasure, SvgProcess } from "@itwin/itwinui-icons-react";
|
|
19
|
+
import { SvgGyroscope } from "../icons/SvgGyroscope.js";
|
|
20
|
+
import { SvgSectionTool } from "../icons/SvgSectionTool.js";
|
|
21
|
+
import { SvgSelectionClear } from "../icons/SvgSelectionClear.js";
|
|
22
|
+
import { SvgMeasure, SvgProcess, SvgRotateLeft, } from "@itwin/itwinui-icons-react";
|
|
24
23
|
import { ConditionalIconItem } from "@itwin/core-react";
|
|
25
24
|
import { getActiveViewport } from "../utils/getActiveViewport.js";
|
|
26
25
|
/* eslint-disable deprecation/deprecation */
|
|
@@ -32,7 +31,7 @@ export class CoreTools {
|
|
|
32
31
|
static get keyinPaletteButtonItemDef() {
|
|
33
32
|
return new ToolItemDef({
|
|
34
33
|
toolId: "uif:keyinpalette",
|
|
35
|
-
|
|
34
|
+
icon: React.createElement(SvgProcess, null),
|
|
36
35
|
labelKey: "UiFramework:keyinbrowser.label",
|
|
37
36
|
execute: () => {
|
|
38
37
|
UiFramework.showKeyinPalette(IModelApp.tools.getToolList().map((tool) => ({ value: tool.keyin })));
|
|
@@ -78,11 +77,11 @@ export class CoreTools {
|
|
|
78
77
|
static get rotateViewCommand() {
|
|
79
78
|
return new ToolItemDef({
|
|
80
79
|
toolId: RotateViewTool.toolId,
|
|
81
|
-
|
|
80
|
+
icon: new ConditionalIconItem(() => {
|
|
82
81
|
const viewport = getActiveViewport();
|
|
83
82
|
if (viewport?.view.is2d())
|
|
84
|
-
return
|
|
85
|
-
return
|
|
83
|
+
return React.createElement(SvgRotateLeft, null);
|
|
84
|
+
return React.createElement(SvgGyroscope, null);
|
|
86
85
|
}, [
|
|
87
86
|
SyncUiEventId.ActiveContentChanged,
|
|
88
87
|
SyncUiEventId.ActiveViewportChanged,
|
|
@@ -281,7 +280,7 @@ export class CoreTools {
|
|
|
281
280
|
return new GroupItemDef({
|
|
282
281
|
groupId: "sectionTools-group",
|
|
283
282
|
labelKey: "UiFramework:tools.sectionTools",
|
|
284
|
-
|
|
283
|
+
icon: React.createElement(SvgSectionTool, null),
|
|
285
284
|
isHidden: new ConditionalBooleanValue(() => {
|
|
286
285
|
const viewport = getActiveViewport();
|
|
287
286
|
return !!viewport?.view.is2d();
|
|
@@ -308,7 +307,7 @@ export class CoreTools {
|
|
|
308
307
|
groupId: "sectionTools-group-with-panel",
|
|
309
308
|
labelKey: "UiFramework:tools.sectionTools",
|
|
310
309
|
panelLabelKey: "UiFramework:tools.sectionPanelLabel",
|
|
311
|
-
|
|
310
|
+
icon: React.createElement(SvgSectionTool, null),
|
|
312
311
|
isHidden: new ConditionalBooleanValue(() => {
|
|
313
312
|
const viewport = getActiveViewport();
|
|
314
313
|
return !!viewport?.view.is2d();
|
|
@@ -368,7 +367,7 @@ export class CoreTools {
|
|
|
368
367
|
return new GroupItemDef({
|
|
369
368
|
groupId: "measureTools-group",
|
|
370
369
|
labelKey: "UiFramework:tools.measureTools",
|
|
371
|
-
|
|
370
|
+
icon: React.createElement(SvgMeasure, null),
|
|
372
371
|
items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],
|
|
373
372
|
itemsInColumn: 2,
|
|
374
373
|
});
|
|
@@ -376,7 +375,7 @@ export class CoreTools {
|
|
|
376
375
|
static get clearSelectionItemDef() {
|
|
377
376
|
return new CommandItemDef({
|
|
378
377
|
commandId: "UiFramework.ClearSelection",
|
|
379
|
-
|
|
378
|
+
icon: React.createElement(SvgSelectionClear, null),
|
|
380
379
|
labelKey: "UiFramework:buttons.clearSelection",
|
|
381
380
|
isHidden: getIsHiddenIfSelectionNotActive(),
|
|
382
381
|
execute: async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC,CAAC,6BAA6B;AAC7D,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,aAAa,MAAM,8CAA8C,CAAC;AACzE,OAAO,cAAc,MAAM,+CAA+C,CAAC;AAC3E,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QAAQ,EAAE,oBAAC,UAAU,OAAG;YACxB,KAAK,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,IAAI,CAAC,0BAA0B,CAAC;YACzE,aAAa,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qBAAqB;QACrC,OAAO,IAAI,cAAc,CAAC;YACxB,SAAS,EAAE,4BAA4B;YACvC,QAAQ,EAAE,iBAAiB;YAC3B,QAAQ,EAAE,oCAAoC;YAC9C,QAAQ,EAAE,+BAA+B,EAAE;YAC3C,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,gBAAgB,GAAG,WAAW,CAAC,mBAAmB,EAAE,CAAC;gBAC3D,IAAI,gBAAgB,EAAE,CAAC;oBACrB,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;gBAC3C,CAAC;gBACD,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC/C,IAAI,IAAI;oBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;;oBAChC,MAAM,SAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,WAAW,CAAC;YACrB,MAAM,EAAE,2BAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,2BAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,2BAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,2BAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF","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 Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport {\n SvgCameraAnimation,\n SvgCameraAnimationDisabled,\n} from \"@itwin/itwinui-icons-react\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef.js\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { ToolItemDef } from \"../shared/ToolItemDef.js\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher.js\";\nimport { GroupItemDef } from \"../toolbar/GroupItem.js\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport svgGyroscope from \"@bentley/icons-generic/icons/gyroscope.svg\";\nimport svgRotateLeft from \"@bentley/icons-generic/icons/rotate-left.svg\";\nimport svgSectionTool from \"@bentley/icons-generic/icons/section-tool.svg\";\nimport svgSelectionClear from \"@bentley/icons-generic/icons/selection-clear.svg\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport type { ToolbarItems } from \"./ToolbarItems.js\";\nimport { getActiveViewport } from \"../utils/getActiveViewport.js\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n * @deprecated in 4.15.0. Use {@link ToolbarItems} instead.\n */\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n iconSpec: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n UiFramework.showKeyinPalette(\n IModelApp.tools.getToolList().map((tool) => ({ value: tool.keyin }))\n );\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is2d()) return svgRotateLeft;\n return svgGyroscope;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalIconItem(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return <SvgCameraAnimation />;\n }\n\n return <SvgCameraAnimationDisabled />;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !(viewport?.view.is3d() && viewport?.view.supportsCamera());\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isUndoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isRedoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n iconSpec: svgSectionTool,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n iconSpec: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n iconSpec: svgSelectionClear,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC,CAAC,6BAA6B;AAC7D,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAA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C,KAAK,CAAC,GAAG,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF","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 Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport {\n SvgCameraAnimation,\n SvgCameraAnimationDisabled,\n} from \"@itwin/itwinui-icons-react\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef.js\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { ToolItemDef } from \"../shared/ToolItemDef.js\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher.js\";\nimport { GroupItemDef } from \"../toolbar/GroupItem.js\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SvgGyroscope } from \"../icons/SvgGyroscope.js\";\nimport { SvgSectionTool } from \"../icons/SvgSectionTool.js\";\nimport { SvgSelectionClear } from \"../icons/SvgSelectionClear.js\";\nimport {\n SvgMeasure,\n SvgProcess,\n SvgRotateLeft,\n} from \"@itwin/itwinui-icons-react\";\nimport { ConditionalIconItem } from \"@itwin/core-react\";\nimport type { ToolbarItems } from \"./ToolbarItems.js\";\nimport { getActiveViewport } from \"../utils/getActiveViewport.js\";\n\n/* eslint-disable deprecation/deprecation */\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n * @deprecated in 4.15.0. Use {@link ToolbarItems} instead.\n */\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n icon: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n UiFramework.showKeyinPalette(\n IModelApp.tools.getToolList().map((tool) => ({ value: tool.keyin }))\n );\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n icon: new ConditionalIconItem(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is2d()) return <SvgRotateLeft />;\n return <SvgGyroscope />;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalIconItem(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return <SvgCameraAnimation />;\n }\n\n return <SvgCameraAnimationDisabled />;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const viewport = getActiveViewport();\n if (viewport?.view.is3d() && viewport?.isCameraOn) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !(viewport?.view.is3d() && viewport?.view.supportsCamera());\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isUndoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n if (!viewport) return false;\n return !viewport.isRedoPossible;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n icon: <SvgSectionTool />,\n isHidden: new ConditionalBooleanValue(() => {\n const viewport = getActiveViewport();\n return !!viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n icon: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n icon: <SvgSelectionClear />,\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Tools
|
|
3
3
|
*/
|
|
4
|
+
import * as React from "react";
|
|
4
5
|
import { Tool } from "@itwin/core-frontend";
|
|
5
|
-
|
|
6
|
-
* Immediate tool that will clear the recent history of command/tool keyins shown in
|
|
7
|
-
* the command palette.
|
|
8
|
-
* @alpha
|
|
9
|
-
*/
|
|
10
|
-
export declare class ClearKeyinPaletteHistoryTool extends Tool {
|
|
6
|
+
declare class ClearKeyinPaletteHistoryCoreTool extends Tool {
|
|
11
7
|
static toolId: string;
|
|
12
8
|
static iconSpec: string;
|
|
13
9
|
static get minArgs(): number;
|
|
14
10
|
static get maxArgs(): number;
|
|
15
11
|
run(): Promise<boolean>;
|
|
16
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Immediate tool that will clear the recent history of command/tool keyins shown in
|
|
15
|
+
* the command palette.
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export declare const ClearKeyinPaletteHistoryTool: typeof ClearKeyinPaletteHistoryCoreTool & {
|
|
19
|
+
iconElement: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
17
22
|
//# sourceMappingURL=KeyinPaletteTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyinPaletteTools.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.
|
|
1
|
+
{"version":3,"file":"KeyinPaletteTools.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAI5C,cAAM,gCAAiC,SAAQ,IAAI;IACjD,OAAuB,MAAM,SAA8B;IAC3D,OAAuB,QAAQ,SAAiB;IAEhD,WAA2B,OAAO,WAEjC;IACD,WAA2B,OAAO,WAEjC;IAEqB,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;CAI9C;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;CAGxC,CAAC"}
|
|
@@ -5,15 +5,12 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Tools
|
|
7
7
|
*/
|
|
8
|
+
import * as React from "react";
|
|
8
9
|
import { clearKeyinPaletteHistory } from "../popup/KeyinPalettePanel.js";
|
|
9
10
|
import { Tool } from "@itwin/core-frontend";
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* the command palette.
|
|
14
|
-
* @alpha
|
|
15
|
-
*/
|
|
16
|
-
export class ClearKeyinPaletteHistoryTool extends Tool {
|
|
11
|
+
import { ToolUtilities } from "@itwin/imodel-components-react";
|
|
12
|
+
import { SvgRemove } from "@itwin/itwinui-icons-react";
|
|
13
|
+
class ClearKeyinPaletteHistoryCoreTool extends Tool {
|
|
17
14
|
static get minArgs() {
|
|
18
15
|
return 0;
|
|
19
16
|
}
|
|
@@ -25,6 +22,12 @@ export class ClearKeyinPaletteHistoryTool extends Tool {
|
|
|
25
22
|
return true;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
ClearKeyinPaletteHistoryCoreTool.toolId = "ClearKeyinPaletteHistory";
|
|
26
|
+
ClearKeyinPaletteHistoryCoreTool.iconSpec = "icon-remove";
|
|
27
|
+
/**
|
|
28
|
+
* Immediate tool that will clear the recent history of command/tool keyins shown in
|
|
29
|
+
* the command palette.
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
export const ClearKeyinPaletteHistoryTool = ToolUtilities.defineIcon(ClearKeyinPaletteHistoryCoreTool, React.createElement(SvgRemove, null));
|
|
30
33
|
//# sourceMappingURL=KeyinPaletteTools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyinPaletteTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.
|
|
1
|
+
{"version":3,"file":"KeyinPaletteTools.js","sourceRoot":"","sources":["../../../src/appui-react/tools/KeyinPaletteTools.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,gCAAiC,SAAQ,IAAI;IAI1C,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IACM,MAAM,KAAc,OAAO;QAChC,OAAO,CAAC,CAAC;IACX,CAAC;IAEe,KAAK,CAAC,GAAG;QACvB,wBAAwB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;;AAbsB,uCAAM,GAAG,0BAA0B,CAAC;AACpC,yCAAQ,GAAG,aAAa,CAAC;AAelD;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC,UAAU,CAClE,gCAAgC,EAChC,oBAAC,SAAS,OAAG,CACd,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 Tools\n */\nimport * as React from \"react\";\nimport { clearKeyinPaletteHistory } from \"../popup/KeyinPalettePanel.js\";\nimport { Tool } from \"@itwin/core-frontend\";\nimport { ToolUtilities } from \"@itwin/imodel-components-react\";\nimport { SvgRemove } from \"@itwin/itwinui-icons-react\";\n\nclass ClearKeyinPaletteHistoryCoreTool extends Tool {\n public static override toolId = \"ClearKeyinPaletteHistory\";\n public static override iconSpec = \"icon-remove\";\n\n public static override get minArgs() {\n return 0;\n }\n public static override get maxArgs() {\n return 0;\n }\n\n public override async run(): Promise<boolean> {\n clearKeyinPaletteHistory();\n return true;\n }\n}\n\n/**\n * Immediate tool that will clear the recent history of command/tool keyins shown in\n * the command palette.\n * @alpha\n */\nexport const ClearKeyinPaletteHistoryTool = ToolUtilities.defineIcon(\n ClearKeyinPaletteHistoryCoreTool,\n <SvgRemove />\n);\n"]}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Tools
|
|
3
3
|
*/
|
|
4
|
+
import * as React from "react";
|
|
4
5
|
import { Tool } from "@itwin/core-frontend";
|
|
5
|
-
|
|
6
|
-
* Immediate tool that will open the Settings modal stage.
|
|
7
|
-
* @alpha
|
|
8
|
-
*/
|
|
9
|
-
export declare class OpenSettingsTool extends Tool {
|
|
6
|
+
declare class OpenSettingsCoreTool extends Tool {
|
|
10
7
|
static toolId: string;
|
|
11
8
|
static iconSpec: string;
|
|
12
9
|
static get minArgs(): number;
|
|
@@ -14,4 +11,12 @@ export declare class OpenSettingsTool extends Tool {
|
|
|
14
11
|
run(settingCategory?: string): Promise<boolean>;
|
|
15
12
|
parseAndRun(...args: string[]): Promise<boolean>;
|
|
16
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Immediate tool that will open the Settings modal stage.
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
18
|
+
export declare const OpenSettingsTool: typeof OpenSettingsCoreTool & {
|
|
19
|
+
iconElement: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
17
22
|
//# sourceMappingURL=OpenSettingsTool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenSettingsTool.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/OpenSettingsTool.
|
|
1
|
+
{"version":3,"file":"OpenSettingsTool.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/OpenSettingsTool.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAK5C,cAAM,oBAAqB,SAAQ,IAAI;IACrC,OAAuB,MAAM,SAAkB;IAC/C,OAAuB,QAAQ,SAAmB;IAElD,WAA2B,OAAO,WAEjC;IACD,WAA2B,OAAO,WAEjC;IAEqB,GAAG,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK/C,WAAW,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGvE;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;CAG5B,CAAC"}
|