@itwin/appui-react 5.6.0 → 5.7.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 +90 -0
- package/lib/appui-react/UiFramework.json +3 -1
- package/lib/appui-react/editors/CustomNumberEditor.d.ts +10 -0
- package/lib/appui-react/editors/CustomNumberEditor.d.ts.map +1 -0
- package/lib/appui-react/editors/CustomNumberEditor.js +24 -0
- package/lib/appui-react/editors/CustomNumberEditor.js.map +1 -0
- package/lib/appui-react/{uiprovider → editors}/LockEditor.d.ts +1 -1
- package/lib/appui-react/editors/LockEditor.d.ts.map +1 -0
- package/lib/appui-react/editors/LockEditor.js.map +1 -0
- package/lib/appui-react/editors/LockProvider.d.ts +48 -0
- package/lib/appui-react/editors/LockProvider.d.ts.map +1 -0
- package/lib/appui-react/editors/LockProvider.js +121 -0
- package/lib/appui-react/editors/LockProvider.js.map +1 -0
- package/lib/appui-react/editors/NumericEditor.d.ts +10 -0
- package/lib/appui-react/editors/NumericEditor.d.ts.map +1 -0
- package/lib/appui-react/editors/NumericEditor.js +24 -0
- package/lib/appui-react/editors/NumericEditor.js.map +1 -0
- package/lib/appui-react/editors/TextEditor.d.ts +10 -0
- package/lib/appui-react/editors/TextEditor.d.ts.map +1 -0
- package/lib/appui-react/editors/TextEditor.js +24 -0
- package/lib/appui-react/editors/TextEditor.js.map +1 -0
- package/lib/appui-react/editors/registerEditors.d.ts +6 -0
- package/lib/appui-react/editors/registerEditors.d.ts.map +1 -0
- package/lib/appui-react/editors/registerEditors.js +28 -0
- package/lib/appui-react/editors/registerEditors.js.map +1 -0
- package/lib/appui-react/hooks/useControlledState.d.ts +4 -0
- package/lib/appui-react/hooks/useControlledState.d.ts.map +1 -0
- package/lib/appui-react/hooks/useControlledState.js +16 -0
- package/lib/appui-react/hooks/useControlledState.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts +7 -0
- package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts.map +1 -0
- package/lib/appui-react/icons/snaps/SvgSnapsTangent.js +14 -0
- package/lib/appui-react/icons/snaps/SvgSnapsTangent.js.map +1 -0
- package/lib/appui-react/new-editors/CustomNumberEditor.d.ts +7 -0
- package/lib/appui-react/new-editors/CustomNumberEditor.d.ts.map +1 -0
- package/lib/appui-react/new-editors/CustomNumberEditor.js +18 -0
- package/lib/appui-react/new-editors/CustomNumberEditor.js.map +1 -0
- package/lib/appui-react/new-editors/LockEditor.d.ts +3 -0
- package/lib/appui-react/new-editors/LockEditor.d.ts.map +1 -0
- package/lib/appui-react/new-editors/LockEditor.js +40 -0
- package/lib/appui-react/new-editors/LockEditor.js.map +1 -0
- package/lib/appui-react/new-editors/NumericEditor.d.ts +3 -0
- package/lib/appui-react/new-editors/NumericEditor.d.ts.map +1 -0
- package/lib/appui-react/new-editors/NumericEditor.js +34 -0
- package/lib/appui-react/new-editors/NumericEditor.js.map +1 -0
- package/lib/appui-react/new-editors/TextEditor.d.ts +3 -0
- package/lib/appui-react/new-editors/TextEditor.d.ts.map +1 -0
- package/lib/appui-react/new-editors/TextEditor.js +23 -0
- package/lib/appui-react/new-editors/TextEditor.js.map +1 -0
- package/lib/appui-react/preview/PreviewFeatures.d.ts +1 -0
- package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
- package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
- package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts +3 -0
- package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts.map +1 -1
- package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js +18 -1
- package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js.map +1 -1
- package/lib/appui-react/statusfields/SnapMode.d.ts.map +1 -1
- package/lib/appui-react/statusfields/SnapMode.js +24 -0
- package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +12 -1
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +13 -17
- package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.js +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
- package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
- package/lib/appui-react/uiprovider/ComponentGenerator.js +23 -12
- package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/appui-react/uiprovider/DefaultDialogGridContainer.d.ts.map +1 -1
- package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js +2 -1
- package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js.map +1 -1
- package/lib/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/appui-react/widget-panels/ToolSettings.js +12 -7
- package/lib/appui-react/widget-panels/ToolSettings.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 +3 -5
- package/lib/appui-react.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +3 -1
- package/package.json +7 -7
- package/lib/appui-react/uiprovider/LockEditor.d.ts.map +0 -1
- package/lib/appui-react/uiprovider/LockEditor.js.map +0 -1
- /package/lib/appui-react/{uiprovider → editors}/LockEditor.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Utilities
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export function SvgSnapsTangent() {
|
|
11
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentColor", viewBox: "0 0 16 16" },
|
|
12
|
+
React.createElement("path", { d: "M8 4a2 2 0 0 1 1.935 1.5H13.5a.5.5 0 0 1 0 1h-2.185a5.993 5.993 0 0 1 2.685 5 .5.5 0 0 1-1 0 5.001 5.001 0 0 0-3.188-4.66 1.997 1.997 0 0 1-3.625 0A5.001 5.001 0 0 0 3 11.5a.5.5 0 0 1-1 0 5.993 5.993 0 0 1 2.685-5H2.5a.5.5 0 0 1 0-1h3.565A1.999 1.999 0 0 1 8 4Zm0 1a1 1 0 1 0 1 1l-.005-.103A1 1 0 0 0 8 5Z" })));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SvgSnapsTangent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SvgSnapsTangent.js","sourceRoot":"","sources":["../../../../src/appui-react/icons/snaps/SvgSnapsTangent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,MAAM,UAAU,eAAe;IAC7B,OAAO,CACL,6BACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW;QAEnB,8BAAM,CAAC,EAAC,mTAAmT,GAAG,CAC1T,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 Utilities\n */\n\nimport * as React from \"react\";\n\n/** @internal */\nexport function SvgSnapsTangent() {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M8 4a2 2 0 0 1 1.935 1.5H13.5a.5.5 0 0 1 0 1h-2.185a5.993 5.993 0 0 1 2.685 5 .5.5 0 0 1-1 0 5.001 5.001 0 0 0-3.188-4.66 1.997 1.997 0 0 1-3.625 0A5.001 5.001 0 0 0 3 11.5a.5.5 0 0 1-1 0 5.993 5.993 0 0 1 2.685-5H2.5a.5.5 0 0 1 0-1h3.565A1.999 1.999 0 0 1 8 4Zm0 1a1 1 0 1 0 1 1l-.005-.103A1 1 0 0 0 8 5Z\" />\n </svg>\n );\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomNumberEditorSpec as BaseCustomNumberEditorSpec } from "@itwin/components-react/internal";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare const CustomNumberEditorSpec: {
|
|
4
|
+
Editor: (typeof BaseCustomNumberEditorSpec)["Editor"];
|
|
5
|
+
applies: (metaData: import("@itwin/components-react").ValueMetadata, value: import("@itwin/components-react").Value | undefined) => boolean;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=CustomNumberEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomNumberEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/new-editors/CustomNumberEditor.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,sBAAsB,IAAI,0BAA0B,EACrD,MAAM,kCAAkC,CAAC;AAK1C,gBAAgB;AAChB,eAAO,MAAM,sBAAsB;YAEH,CAAC,OAAO,0BAA0B,EAAE,QAAQ,CAAC;;CAC5E,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { CustomNumberEditor as BaseCustomNumberEditor, CustomNumberEditorSpec as BaseCustomNumberEditorSpec, } from "@itwin/components-react/internal";
|
|
7
|
+
import { LockButtonInputDecoration } from "../editors/LockProvider.js";
|
|
8
|
+
/* v8 ignore start */
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const CustomNumberEditorSpec = {
|
|
11
|
+
...BaseCustomNumberEditorSpec,
|
|
12
|
+
Editor: CustomNumberEditor,
|
|
13
|
+
};
|
|
14
|
+
function CustomNumberEditor(props) {
|
|
15
|
+
return (React.createElement(BaseCustomNumberEditor, { ...props, decoration: React.createElement(LockButtonInputDecoration, null) }));
|
|
16
|
+
}
|
|
17
|
+
/* v8 ignore stop */
|
|
18
|
+
//# sourceMappingURL=CustomNumberEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomNumberEditor.js","sourceRoot":"","sources":["../../../src/appui-react/new-editors/CustomNumberEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,IAAI,sBAAsB,EAC5C,sBAAsB,IAAI,0BAA0B,GACrD,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,GAAG,0BAA0B;IAC7B,MAAM,EAAE,kBAAmE;CAC5E,CAAC;AAMF,SAAS,kBAAkB,CACzB,KAAsD;IAEtD,OAAO,CACL,oBAAC,sBAAsB,OACjB,KAAK,EACT,UAAU,EAAE,oBAAC,yBAAyB,OAAG,GACzC,CACH,CAAC;AACJ,CAAC;AAED,oBAAoB","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\nimport * as React from \"react\";\nimport {\n CustomNumberEditor as BaseCustomNumberEditor,\n CustomNumberEditorSpec as BaseCustomNumberEditorSpec,\n} from \"@itwin/components-react/internal\";\nimport { LockButtonInputDecoration } from \"../editors/LockProvider.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const CustomNumberEditorSpec = {\n ...BaseCustomNumberEditorSpec,\n Editor: CustomNumberEditor as (typeof BaseCustomNumberEditorSpec)[\"Editor\"],\n};\n\ntype BaseCustomNumberEditorProps = React.ComponentProps<\n typeof BaseCustomNumberEditor\n>;\n\nfunction CustomNumberEditor(\n props: Omit<BaseCustomNumberEditorProps, \"decoration\">\n) {\n return (\n <BaseCustomNumberEditor\n {...props}\n decoration={<LockButtonInputDecoration />}\n />\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LockEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/new-editors/LockEditor.tsx"],"names":[],"mappings":"AAsBA,gBAAgB;AAChB,eAAO,MAAM,cAAc,8CAMzB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { createEditorSpec, ValueUtilities } from "@itwin/components-react";
|
|
7
|
+
import { IconButton } from "@itwin/itwinui-react";
|
|
8
|
+
import { SvgLock, SvgLockUnlocked } from "@itwin/itwinui-icons-react";
|
|
9
|
+
import { LockPropertyEditorName } from "../editors/LockEditor.js";
|
|
10
|
+
import { PropertyEditorContext, useLockProperty, } from "../editors/LockProvider.js";
|
|
11
|
+
/* v8 ignore start */
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const LockEditorSpec = createEditorSpec({
|
|
14
|
+
isMetadataSupported: (metadata) => metadata.type === "bool" &&
|
|
15
|
+
metadata.preferredEditor === LockPropertyEditorName,
|
|
16
|
+
isValueSupported: ValueUtilities.isBoolean,
|
|
17
|
+
Editor: LockEditor,
|
|
18
|
+
});
|
|
19
|
+
/** Used in tool settings as the default lock editor when `toolSettingsLockButton` preview feature is enabled.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
function LockEditor({ value, onChange, commit, disabled, size, }) {
|
|
23
|
+
const context = React.useContext(PropertyEditorContext);
|
|
24
|
+
const property = useLockProperty(context
|
|
25
|
+
? {
|
|
26
|
+
provider: context.uiDataProvider,
|
|
27
|
+
itemPropertyName: context.itemPropertyName,
|
|
28
|
+
}
|
|
29
|
+
: undefined);
|
|
30
|
+
const displayLabel = property?.property.displayLabel;
|
|
31
|
+
const label = displayLabel ? displayLabel : "Toggle lock";
|
|
32
|
+
const currentValue = value?.value ?? false;
|
|
33
|
+
return (React.createElement(IconButton, { label: label, size: size, styleType: "borderless", isActive: currentValue, disabled: disabled, onClick: () => {
|
|
34
|
+
const newValue = { value: !currentValue };
|
|
35
|
+
onChange(newValue);
|
|
36
|
+
commit?.();
|
|
37
|
+
} }, currentValue ? React.createElement(SvgLock, null) : React.createElement(SvgLockUnlocked, null)));
|
|
38
|
+
}
|
|
39
|
+
/* v8 ignore stop */
|
|
40
|
+
//# sourceMappingURL=LockEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LockEditor.js","sourceRoot":"","sources":["../../../src/appui-react/new-editors/LockEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,qBAAqB,EACrB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AAEpC,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC7C,mBAAmB,EAAE,CAAC,QAAQ,EAA6B,EAAE,CAC3D,QAAQ,CAAC,IAAI,KAAK,MAAM;QACxB,QAAQ,CAAC,eAAe,KAAK,sBAAsB;IACrD,gBAAgB,EAAE,cAAc,CAAC,SAAS;IAC1C,MAAM,EAAE,UAAU;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,SAAS,UAAU,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,GACqC;IACzC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,eAAe,CAC9B,OAAO;QACL,CAAC,CAAC;YACE,QAAQ,EAAE,OAAO,CAAC,cAAc;YAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;SAC3C;QACH,CAAC,CAAC,SAAS,CACd,CAAC;IACF,MAAM,YAAY,GAAG,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC;IACrD,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAE1D,MAAM,YAAY,GAAG,KAAK,EAAE,KAAK,IAAI,KAAK,CAAC;IAC3C,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,CAAC,YAAY,EAAE,CAAC;YAC1C,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnB,MAAM,EAAE,EAAE,CAAC;QACb,CAAC,IAEA,YAAY,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CACtC,CACd,CAAC;AACJ,CAAC;AAED,oBAAoB","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\nimport * as React from \"react\";\nimport type {\n BooleanValue,\n EditorProps,\n ValueMetadata,\n} from \"@itwin/components-react\";\nimport { createEditorSpec, ValueUtilities } from \"@itwin/components-react\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport { LockPropertyEditorName } from \"../editors/LockEditor.js\";\nimport {\n PropertyEditorContext,\n useLockProperty,\n} from \"../editors/LockProvider.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const LockEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is ValueMetadata =>\n metadata.type === \"bool\" &&\n metadata.preferredEditor === LockPropertyEditorName,\n isValueSupported: ValueUtilities.isBoolean,\n Editor: LockEditor,\n});\n\n/** Used in tool settings as the default lock editor when `toolSettingsLockButton` preview feature is enabled.\n * @internal\n */\nfunction LockEditor({\n value,\n onChange,\n commit,\n disabled,\n size,\n}: EditorProps<ValueMetadata, BooleanValue>) {\n const context = React.useContext(PropertyEditorContext);\n const property = useLockProperty(\n context\n ? {\n provider: context.uiDataProvider,\n itemPropertyName: context.itemPropertyName,\n }\n : undefined\n );\n const displayLabel = property?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n\n const currentValue = value?.value ?? false;\n return (\n <IconButton\n label={label}\n size={size}\n styleType=\"borderless\"\n isActive={currentValue}\n disabled={disabled}\n onClick={() => {\n const newValue = { value: !currentValue };\n onChange(newValue);\n commit?.();\n }}\n >\n {currentValue ? <SvgLock /> : <SvgLockUnlocked />}\n </IconButton>\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/new-editors/NumericEditor.tsx"],"names":[],"mappings":"AAiBA,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,8CAK5B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { InputWithDecorations } from "@itwin/itwinui-react";
|
|
7
|
+
import { createEditorSpec, ValueUtilities } from "@itwin/components-react";
|
|
8
|
+
import { LockButtonInputDecoration } from "../editors/LockProvider.js";
|
|
9
|
+
/* v8 ignore start */
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const NumericEditorSpec = createEditorSpec({
|
|
12
|
+
isMetadataSupported: (metadata) => metadata.type === "number",
|
|
13
|
+
isValueSupported: ValueUtilities.isNumeric,
|
|
14
|
+
Editor: NumericEditor,
|
|
15
|
+
});
|
|
16
|
+
function NumericEditor({ value, onChange, size, disabled, }) {
|
|
17
|
+
const currentValue = getNumericValue(value);
|
|
18
|
+
return (React.createElement(InputWithDecorations, { size: size },
|
|
19
|
+
React.createElement(InputWithDecorations.Input, { value: currentValue.displayValue, onChange: (e) => {
|
|
20
|
+
const parsedValue = parseFloat(e.target.value);
|
|
21
|
+
onChange({
|
|
22
|
+
rawValue: Number.isNaN(parsedValue)
|
|
23
|
+
? undefined
|
|
24
|
+
: parseFloat(e.target.value),
|
|
25
|
+
displayValue: e.target.value,
|
|
26
|
+
});
|
|
27
|
+
}, size: size, disabled: disabled }),
|
|
28
|
+
React.createElement(LockButtonInputDecoration, null)));
|
|
29
|
+
}
|
|
30
|
+
function getNumericValue(value) {
|
|
31
|
+
return value ? value : { rawValue: undefined, displayValue: "" };
|
|
32
|
+
}
|
|
33
|
+
/* v8 ignore stop */
|
|
34
|
+
//# sourceMappingURL=NumericEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumericEditor.js","sourceRoot":"","sources":["../../../src/appui-react/new-editors/NumericEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAM5D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;IAChD,mBAAmB,EAAE,CAAC,QAAQ,EAA6B,EAAE,CAC3D,QAAQ,CAAC,IAAI,KAAK,QAAQ;IAC5B,gBAAgB,EAAE,cAAc,CAAC,SAAS;IAC1C,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC;AAEH,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,GACiC;IACzC,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI;QAC9B,oBAAC,oBAAoB,CAAC,KAAK,IACzB,KAAK,EAAE,YAAY,CAAC,YAAY,EAChC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC/C,QAAQ,CAAC;oBACP,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC;wBACjC,CAAC,CAAC,SAAS;wBACX,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK;iBAC7B,CAAC,CAAC;YACL,CAAC,EACD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB;QACF,oBAAC,yBAAyB,OAAG,CACR,CACxB,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAA+B;IACtD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;AACnE,CAAC;AAED,oBAAoB","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\nimport * as React from \"react\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport type {\n EditorProps,\n NumericValue,\n ValueMetadata,\n} from \"@itwin/components-react\";\nimport { createEditorSpec, ValueUtilities } from \"@itwin/components-react\";\nimport { LockButtonInputDecoration } from \"../editors/LockProvider.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const NumericEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is ValueMetadata =>\n metadata.type === \"number\",\n isValueSupported: ValueUtilities.isNumeric,\n Editor: NumericEditor,\n});\n\nfunction NumericEditor({\n value,\n onChange,\n size,\n disabled,\n}: EditorProps<ValueMetadata, NumericValue>) {\n const currentValue = getNumericValue(value);\n return (\n <InputWithDecorations size={size}>\n <InputWithDecorations.Input\n value={currentValue.displayValue}\n onChange={(e) => {\n const parsedValue = parseFloat(e.target.value);\n onChange({\n rawValue: Number.isNaN(parsedValue)\n ? undefined\n : parseFloat(e.target.value),\n displayValue: e.target.value,\n });\n }}\n size={size}\n disabled={disabled}\n />\n <LockButtonInputDecoration />\n </InputWithDecorations>\n );\n}\n\nfunction getNumericValue(value: NumericValue | undefined): NumericValue {\n return value ? value : { rawValue: undefined, displayValue: \"\" };\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/new-editors/TextEditor.tsx"],"names":[],"mappings":"AAiBA,gBAAgB;AAChB,eAAO,MAAM,cAAc,8CAKzB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { InputWithDecorations } from "@itwin/itwinui-react";
|
|
7
|
+
import { createEditorSpec, ValueUtilities } from "@itwin/components-react";
|
|
8
|
+
import { LockButtonInputDecoration } from "../editors/LockProvider.js";
|
|
9
|
+
/* v8 ignore start */
|
|
10
|
+
/** @internal */
|
|
11
|
+
export const TextEditorSpec = createEditorSpec({
|
|
12
|
+
isMetadataSupported: (metadata) => metadata.type === "string",
|
|
13
|
+
isValueSupported: ValueUtilities.isText,
|
|
14
|
+
Editor: TextEditor,
|
|
15
|
+
});
|
|
16
|
+
function TextEditor({ value, onChange, size, disabled, }) {
|
|
17
|
+
const currentValue = value ? value : { value: "" };
|
|
18
|
+
return (React.createElement(InputWithDecorations, { size: size },
|
|
19
|
+
React.createElement(InputWithDecorations.Input, { value: currentValue.value, onChange: (e) => onChange({ value: e.target.value }), size: size, disabled: disabled }),
|
|
20
|
+
React.createElement(LockButtonInputDecoration, null)));
|
|
21
|
+
}
|
|
22
|
+
/* v8 ignore stop */
|
|
23
|
+
//# sourceMappingURL=TextEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.js","sourceRoot":"","sources":["../../../src/appui-react/new-editors/TextEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAM5D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,qBAAqB;AAErB,gBAAgB;AAChB,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IAC7C,mBAAmB,EAAE,CAAC,QAAQ,EAA6B,EAAE,CAC3D,QAAQ,CAAC,IAAI,KAAK,QAAQ;IAC5B,gBAAgB,EAAE,cAAc,CAAC,MAAM;IACvC,MAAM,EAAE,UAAU;CACnB,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,EAClB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,GAC8B;IACtC,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAEnD,OAAO,CACL,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI;QAC9B,oBAAC,oBAAoB,CAAC,KAAK,IACzB,KAAK,EAAE,YAAY,CAAC,KAAK,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EACpD,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,GAClB;QACF,oBAAC,yBAAyB,OAAG,CACR,CACxB,CAAC;AACJ,CAAC;AAED,oBAAoB","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\nimport * as React from \"react\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport type {\n EditorProps,\n TextValue,\n ValueMetadata,\n} from \"@itwin/components-react\";\nimport { createEditorSpec, ValueUtilities } from \"@itwin/components-react\";\nimport { LockButtonInputDecoration } from \"../editors/LockProvider.js\";\n\n/* v8 ignore start */\n\n/** @internal */\nexport const TextEditorSpec = createEditorSpec({\n isMetadataSupported: (metadata): metadata is ValueMetadata =>\n metadata.type === \"string\",\n isValueSupported: ValueUtilities.isText,\n Editor: TextEditor,\n});\n\nfunction TextEditor({\n value,\n onChange,\n size,\n disabled,\n}: EditorProps<ValueMetadata, TextValue>) {\n const currentValue = value ? value : { value: \"\" };\n\n return (\n <InputWithDecorations size={size}>\n <InputWithDecorations.Input\n value={currentValue.value}\n onChange={(e) => onChange({ value: e.target.value })}\n size={size}\n disabled={disabled}\n />\n <LockButtonInputDecoration />\n </InputWithDecorations>\n );\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -61,6 +61,7 @@ interface KnownPreviewFeatures {
|
|
|
61
61
|
/**
|
|
62
62
|
* If `true`, the default tool settings lock editor will be rendered as an icon button rather than a checkbox.
|
|
63
63
|
* Consumers can still use a custom component to render the lock by customizing the `PropertyDescription`.
|
|
64
|
+
* Additionally, the icon button will be rendered as an input decoration in editors that support it.
|
|
64
65
|
*/
|
|
65
66
|
toolSettingsLockButton: boolean;
|
|
66
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewFeatures.d.ts","sourceRoot":"","sources":["../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,sCAAsC;AACtC,UAAU,oBAAoB;IAC5B;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,6BAA6B,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,0BAA0B,EAAE,OAAO,CAAC;IACpC;;;OAGG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAClC;;;OAGG;IACH,oBAAoB,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;OAGG;IACH,wCAAwC,EAAE,OAAO,CAAC;IAClD;;;;;;OAMG;IACH,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACnD;;;;;OAKG;IACH,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACrD;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC
|
|
1
|
+
{"version":3,"file":"PreviewFeatures.d.ts","sourceRoot":"","sources":["../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGzD,sCAAsC;AACtC,UAAU,oBAAoB;IAC5B;;;;OAIG;IACH,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,6BAA6B,EAAE,OAAO,CAAC;IACvC;;;OAGG;IACH,0B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AAC,GAAG,EAAE,EAAE;IACnE,OAAO;QACL,eAAe,EAAE,EAAE;QACnB,kBAAkB,EAAE,CAAC,kBAAmC,EAAE,EAAE;YAC1D,MAAM,eAAe,GAAG,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;YACpE,GAAG,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,uBAAuB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACnE,CAAC;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GACqB;IAC7B,MAAM,kBAAkB,GAAG,uBAAuB,CAChD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,kBAAkB,CACpC,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,kBAAkB,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEnC,0CAA0C;IAC1C,KAAK,CAAC,SAAS,CACb,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,EACD,CAAC,kBAAkB,CAAC,CACrB,CAAC;IACF,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,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 Utilities\n */\n\nimport * as React from \"react\";\nimport { create } from \"zustand\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { useTransientState } from \"../widget-panels/useTransientState.js\";\nimport type { WidgetDef } from \"../widgets/WidgetDef.js\";\nimport type { UiItemsManager } from \"../ui-items-provider/UiItemsManager.js\";\n\n/** List of known preview features. */\ninterface KnownPreviewFeatures {\n /** If `true`, the panels and tool settings will always be rendered over the content.\n * The content will never change size.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/672\n */\n contentAlwaysMaxSize: boolean;\n /** If `true`, the floating widget will have a \"maximize\" button. Use `enableMaximizedPanelWidget` to enable the feature for panel widgets.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/673\n */\n enableMaximizedFloatingWidget: boolean;\n /** If `true`, the panel widget will have a \"maximize\" button. Use `enableMaximizedFloatingWidget` to enable the feature for floating widgets.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/673\n */\n enableMaximizedPanelWidget: boolean;\n /** If `true`, the horizontal panels will have an additional \"Align\" button.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/706\n */\n horizontalPanelAlignment: boolean;\n /** If enabled, a dropdown menu will be rendered for widgets that exceed the specified threshold of title bar buttons.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/723\n */\n widgetActionDropdown: { threshold: number };\n /** If `true`, the accudraw input field will accept some letters for bearing angle. Defaults to `false`.\n *\n * This allows to type letters for Bearing angles in the accudraw input field. (N, S, E, W)\n */\n allowBearingLettersInAccuDrawInputFields: boolean;\n /** If `true`, popout widgets will not be rendered in a separate element tree, instead widget content will be re-parented to a popout content container.\n * Alternatively, an array of widget ids can be specified to only re-parent specific widgets.\n * @note Use {@link useTransientState} to save and restore DOM transient state when re-parenting widgets.\n * @note There is a known limitation where iTwinUI v2 popover elements will be rendered in the main window. Prefer using iTwinUI v3 when using this feature.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/925\n */\n reparentPopoutWidgets: boolean | WidgetDef[\"id\"][];\n /** If `true`, additional UI elements are rendered to allow the end user of the layout to control widget visibility.\n * Alternatively, an array of widget ids can be specified to only control specific widgets.\n * @note Use {@link UiItemsManager} APIs to manage what widgets are available to the end-user.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/859\n */\n controlWidgetVisibility: boolean | WidgetDef[\"id\"][];\n /**\n * If `true`, the tool settings will be using the new editor API. The new system delivers same default editors as the old one.\n * However, in order to use custom editors they need to be provided using `EditorsRegistryProvider` component.\n */\n toolSettingsNewEditors: boolean;\n /**\n * If `true`, the default tool settings lock editor will be rendered as an icon button rather than a checkbox.\n * Consumers can still use a custom component to render the lock by customizing the `PropertyDescription`.\n */\n toolSettingsLockButton: boolean;\n}\n\n/** Object used trim to only known features at runtime.\n * @internal\n */\nconst knownFeaturesObject: Record<keyof KnownPreviewFeatures, undefined> = {\n contentAlwaysMaxSize: undefined,\n enableMaximizedFloatingWidget: undefined,\n enableMaximizedPanelWidget: undefined,\n horizontalPanelAlignment: undefined,\n widgetActionDropdown: undefined,\n allowBearingLettersInAccuDrawInputFields: undefined,\n reparentPopoutWidgets: undefined,\n controlWidgetVisibility: undefined,\n toolSettingsNewEditors: undefined,\n toolSettingsLockButton: undefined,\n};\n\n/** List of preview features that can be enabled/disabled.\n * This list is expected to change over time, the interface is made\n * so that new features can be added or removed without breaking existing code.\n * A console warning will simply appear if unknown features are passed.\n * @beta\n */\nexport interface PreviewFeatures extends Partial<KnownPreviewFeatures> {\n [featureName: string]: any;\n}\n\n/** Trim an object to only contain known feature keys.\n * @param previewFeatures object potentially containing unknown features\n * @returns object containing only known features\n * @internal\n */\nfunction trimToKnownFeaturesOnly(previewFeatures: PreviewFeatures) {\n const knownFeatureKeys = Object.keys(knownFeaturesObject);\n const [knownFeatures, unknownFeatures] = Object.entries(\n previewFeatures\n ).reduce(\n ([known, unknown], [key, value]) => {\n if (knownFeatureKeys.includes(key)) {\n known[key] = value;\n } else {\n unknown.push(key);\n }\n return [known, unknown];\n },\n [{}, []] as [PreviewFeatures, string[]]\n );\n if (Object.keys(unknownFeatures).length > 0) {\n Logger.logWarning(\n UiFramework.loggerCategory(\"trimToKnownFeaturesOnly\"),\n `Features used in \"setPreviewFeatures\" are unknown or no longer in preview`,\n {\n unknownFeatures,\n }\n );\n }\n return knownFeatures;\n}\n\ninterface PreviewFeaturesState {\n previewFeatures: PreviewFeatures;\n setPreviewFeatures: (previewFeatures: PreviewFeatures) => void;\n}\n\n/** Preview features store used by `UiFramework.previewFeatures` and `UiFramework.setPreviewFeatures()` APIs to manage the preview features.\n * Use `usePreviewFeatures` hook to access the preview features set from a react component.\n * Use `usePreviewFeaturesStore.getState().previewFeatures` to access the preview features set from a non-react component.\n * Use `usePreviewFeaturesStore.subscribe()` to subscribe to changes to the preview features set from a non-react component.\n * @internal\n */\nconst usePreviewFeaturesStore = create<PreviewFeaturesState>((set) => {\n return {\n previewFeatures: {},\n setPreviewFeatures: (newPreviewFeatures: PreviewFeatures) => {\n const previewFeatures = trimToKnownFeaturesOnly(newPreviewFeatures);\n set({ previewFeatures });\n },\n };\n});\n\n/** Hook to access the preview features set.\n * @internal\n */\nexport function usePreviewFeatures() {\n return usePreviewFeaturesStore((state) => state.previewFeatures);\n}\n\n/** Props for PreviewFeaturesProvider.\n * @beta\n */\nexport interface PreviewFeaturesProviderProps {\n children?: React.ReactNode;\n features?: PreviewFeatures;\n}\n\n/** Set which preview features are enabled. These features are not yet ready for production use nor have\n * a proper API defined yet.\n * The available set of features are defined in the [[PreviewFeatures]] interface.\n *\n * This component should wrap the Provider component.\n *\n * ```tsx\n * <PreviewFeaturesProvider features={{ enableMaximizedFloatingWidget: true }}>\n * <Provider store={UiFramework.store}>\n * [...]\n * <ConfigurableUIContent />\n * [/...]\n * </Provider>\n * </PreviewFeaturesProvider>\n * ```\n * @beta\n */\nexport function PreviewFeaturesProvider({\n children,\n features,\n}: PreviewFeaturesProviderProps) {\n const setPreviewFeatures = usePreviewFeaturesStore(\n (state) => state.setPreviewFeatures\n );\n React.useEffect(() => {\n setPreviewFeatures(features ?? {});\n }, [features, setPreviewFeatures]);\n\n // Clear preview features when unmounting.\n React.useEffect(\n () => () => {\n setPreviewFeatures({});\n },\n [setPreviewFeatures]\n );\n return <>{children}</>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PreviewFeatures.js","sourceRoot":"","sources":["../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAkEhD;;GAEG;AACH,MAAM,mBAAmB,GAAkD;IACzE,oBAAoB,EAAE,SAAS;IAC/B,6BAA6B,EAAE,SAAS;IACxC,0BAA0B,EAAE,SAAS;IACrC,wBAAwB,EAAE,SAAS;IACnC,oBAAoB,EAAE,SAAS;IAC/B,wCAAwC,EAAE,SAAS;IACnD,qBAAqB,EAAE,SAAS;IAChC,uBAAuB,EAAE,SAAS;IAClC,sBAAsB,EAAE,SAAS;IACjC,sBAAsB,EAAE,SAAS;CAClC,CAAC;AAYF;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,eAAgC;IAC/D,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,OAAO,CACrD,eAAe,CAChB,CAAC,MAAM,CACN,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACjC,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,GAAG,CA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,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC,EACD,CAAC,kBAAkB,CAAC,CACrB,CAAC;IACF,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,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 Utilities\n */\n\nimport * as React from \"react\";\nimport { create } from \"zustand\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { useTransientState } from \"../widget-panels/useTransientState.js\";\nimport type { WidgetDef } from \"../widgets/WidgetDef.js\";\nimport type { UiItemsManager } from \"../ui-items-provider/UiItemsManager.js\";\n\n/** List of known preview features. */\ninterface KnownPreviewFeatures {\n /** If `true`, the panels and tool settings will always be rendered over the content.\n * The content will never change size.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/672\n */\n contentAlwaysMaxSize: boolean;\n /** If `true`, the floating widget will have a \"maximize\" button. Use `enableMaximizedPanelWidget` to enable the feature for panel widgets.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/673\n */\n enableMaximizedFloatingWidget: boolean;\n /** If `true`, the panel widget will have a \"maximize\" button. Use `enableMaximizedFloatingWidget` to enable the feature for floating widgets.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/673\n */\n enableMaximizedPanelWidget: boolean;\n /** If `true`, the horizontal panels will have an additional \"Align\" button.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/706\n */\n horizontalPanelAlignment: boolean;\n /** If enabled, a dropdown menu will be rendered for widgets that exceed the specified threshold of title bar buttons.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/723\n */\n widgetActionDropdown: { threshold: number };\n /** If `true`, the accudraw input field will accept some letters for bearing angle. Defaults to `false`.\n *\n * This allows to type letters for Bearing angles in the accudraw input field. (N, S, E, W)\n */\n allowBearingLettersInAccuDrawInputFields: boolean;\n /** If `true`, popout widgets will not be rendered in a separate element tree, instead widget content will be re-parented to a popout content container.\n * Alternatively, an array of widget ids can be specified to only re-parent specific widgets.\n * @note Use {@link useTransientState} to save and restore DOM transient state when re-parenting widgets.\n * @note There is a known limitation where iTwinUI v2 popover elements will be rendered in the main window. Prefer using iTwinUI v3 when using this feature.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/925\n */\n reparentPopoutWidgets: boolean | WidgetDef[\"id\"][];\n /** If `true`, additional UI elements are rendered to allow the end user of the layout to control widget visibility.\n * Alternatively, an array of widget ids can be specified to only control specific widgets.\n * @note Use {@link UiItemsManager} APIs to manage what widgets are available to the end-user.\n *\n * Discuss or upvote this feature: https://github.com/iTwin/appui/discussions/859\n */\n controlWidgetVisibility: boolean | WidgetDef[\"id\"][];\n /**\n * If `true`, the tool settings will be using the new editor API. The new system delivers same default editors as the old one.\n * However, in order to use custom editors they need to be provided using `EditorsRegistryProvider` component.\n */\n toolSettingsNewEditors: boolean;\n /**\n * If `true`, the default tool settings lock editor will be rendered as an icon button rather than a checkbox.\n * Consumers can still use a custom component to render the lock by customizing the `PropertyDescription`.\n * Additionally, the icon button will be rendered as an input decoration in editors that support it.\n */\n toolSettingsLockButton: boolean;\n}\n\n/** Object used trim to only known features at runtime.\n * @internal\n */\nconst knownFeaturesObject: Record<keyof KnownPreviewFeatures, undefined> = {\n contentAlwaysMaxSize: undefined,\n enableMaximizedFloatingWidget: undefined,\n enableMaximizedPanelWidget: undefined,\n horizontalPanelAlignment: undefined,\n widgetActionDropdown: undefined,\n allowBearingLettersInAccuDrawInputFields: undefined,\n reparentPopoutWidgets: undefined,\n controlWidgetVisibility: undefined,\n toolSettingsNewEditors: undefined,\n toolSettingsLockButton: undefined,\n};\n\n/** List of preview features that can be enabled/disabled.\n * This list is expected to change over time, the interface is made\n * so that new features can be added or removed without breaking existing code.\n * A console warning will simply appear if unknown features are passed.\n * @beta\n */\nexport interface PreviewFeatures extends Partial<KnownPreviewFeatures> {\n [featureName: string]: any;\n}\n\n/** Trim an object to only contain known feature keys.\n * @param previewFeatures object potentially containing unknown features\n * @returns object containing only known features\n * @internal\n */\nfunction trimToKnownFeaturesOnly(previewFeatures: PreviewFeatures) {\n const knownFeatureKeys = Object.keys(knownFeaturesObject);\n const [knownFeatures, unknownFeatures] = Object.entries(\n previewFeatures\n ).reduce(\n ([known, unknown], [key, value]) => {\n if (knownFeatureKeys.includes(key)) {\n known[key] = value;\n } else {\n unknown.push(key);\n }\n return [known, unknown];\n },\n [{}, []] as [PreviewFeatures, string[]]\n );\n if (Object.keys(unknownFeatures).length > 0) {\n Logger.logWarning(\n UiFramework.loggerCategory(\"trimToKnownFeaturesOnly\"),\n `Features used in \"setPreviewFeatures\" are unknown or no longer in preview`,\n {\n unknownFeatures,\n }\n );\n }\n return knownFeatures;\n}\n\ninterface PreviewFeaturesState {\n previewFeatures: PreviewFeatures;\n setPreviewFeatures: (previewFeatures: PreviewFeatures) => void;\n}\n\n/** Preview features store used by `UiFramework.previewFeatures` and `UiFramework.setPreviewFeatures()` APIs to manage the preview features.\n * Use `usePreviewFeatures` hook to access the preview features set from a react component.\n * Use `usePreviewFeaturesStore.getState().previewFeatures` to access the preview features set from a non-react component.\n * Use `usePreviewFeaturesStore.subscribe()` to subscribe to changes to the preview features set from a non-react component.\n * @internal\n */\nconst usePreviewFeaturesStore = create<PreviewFeaturesState>((set) => {\n return {\n previewFeatures: {},\n setPreviewFeatures: (newPreviewFeatures: PreviewFeatures) => {\n const previewFeatures = trimToKnownFeaturesOnly(newPreviewFeatures);\n set({ previewFeatures });\n },\n };\n});\n\n/** Hook to access the preview features set.\n * @internal\n */\nexport function usePreviewFeatures() {\n return usePreviewFeaturesStore((state) => state.previewFeatures);\n}\n\n/** Props for PreviewFeaturesProvider.\n * @beta\n */\nexport interface PreviewFeaturesProviderProps {\n children?: React.ReactNode;\n features?: PreviewFeatures;\n}\n\n/** Set which preview features are enabled. These features are not yet ready for production use nor have\n * a proper API defined yet.\n * The available set of features are defined in the [[PreviewFeatures]] interface.\n *\n * This component should wrap the Provider component.\n *\n * ```tsx\n * <PreviewFeaturesProvider features={{ enableMaximizedFloatingWidget: true }}>\n * <Provider store={UiFramework.store}>\n * [...]\n * <ConfigurableUIContent />\n * [/...]\n * </Provider>\n * </PreviewFeaturesProvider>\n * ```\n * @beta\n */\nexport function PreviewFeaturesProvider({\n children,\n features,\n}: PreviewFeaturesProviderProps) {\n const setPreviewFeatures = usePreviewFeaturesStore(\n (state) => state.setPreviewFeatures\n );\n React.useEffect(() => {\n setPreviewFeatures(features ?? {});\n }, [features, setPreviewFeatures]);\n\n // Clear preview features when unmounting.\n React.useEffect(\n () => () => {\n setPreviewFeatures({});\n },\n [setPreviewFeatures]\n );\n return <>{children}</>;\n}\n"]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import { type PropertyRecord } from "@itwin/appui-abstract";
|
|
2
3
|
/** @internal */
|
|
3
4
|
export declare function useLockButtonPropertyRecord(record: PropertyRecord, enabled: boolean): PropertyRecord;
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare function ToolSettingsEditorsProvider({ children, }: React.PropsWithChildren): React.JSX.Element;
|
|
4
7
|
//# sourceMappingURL=useToolSettingsLockButton.d.ts.map
|
package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolSettingsLockButton.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.
|
|
1
|
+
{"version":3,"file":"useToolSettingsLockButton.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAU/B,gBAAgB;AAChB,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,OAAO,kBAmBjB;AAYD,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,qBAgBzB"}
|
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { StandardTypeNames, } from "@itwin/appui-abstract";
|
|
7
|
+
import { EditorsRegistryProvider } from "@itwin/components-react";
|
|
7
8
|
import { usePreviewFeatures } from "../PreviewFeatures.js";
|
|
8
|
-
import { LockPropertyEditorName } from "../../
|
|
9
|
+
import { LockPropertyEditorName } from "../../editors/LockEditor.js";
|
|
10
|
+
import { LockEditorSpec } from "../../new-editors/LockEditor.js";
|
|
11
|
+
import { TextEditorSpec } from "../../new-editors/TextEditor.js";
|
|
12
|
+
import { NumericEditorSpec } from "../../new-editors/NumericEditor.js";
|
|
13
|
+
import { CustomNumberEditorSpec } from "../../new-editors/CustomNumberEditor.js";
|
|
9
14
|
/** @internal */
|
|
10
15
|
export function useLockButtonPropertyRecord(record, enabled) {
|
|
11
16
|
const { toolSettingsLockButton } = usePreviewFeatures();
|
|
@@ -35,4 +40,16 @@ function isDefaultLockEditor(property) {
|
|
|
35
40
|
return false;
|
|
36
41
|
return true;
|
|
37
42
|
}
|
|
43
|
+
/** @internal */
|
|
44
|
+
export function ToolSettingsEditorsProvider({ children, }) {
|
|
45
|
+
return (React.createElement(EditorsRegistryProvider, { editors: React.useCallback((editors) => {
|
|
46
|
+
return [
|
|
47
|
+
...editors,
|
|
48
|
+
CustomNumberEditorSpec,
|
|
49
|
+
LockEditorSpec,
|
|
50
|
+
TextEditorSpec,
|
|
51
|
+
NumericEditorSpec,
|
|
52
|
+
];
|
|
53
|
+
}, []) }, children));
|
|
54
|
+
}
|
|
38
55
|
//# sourceMappingURL=useToolSettingsLockButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolSettingsLockButton.js","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.
|
|
1
|
+
{"version":3,"file":"useToolSettingsLockButton.js","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,gBAAgB;AAChB,MAAM,UAAU,2BAA2B,CACzC,MAAsB,EACtB,OAAgB;IAEhB,MAAM,EAAE,sBAAsB,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACxD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,CAAC,OAAO;YAAE,OAAO,MAAM,CAAC;QAC5B,IAAI,CAAC,sBAAsB;YAAE,OAAO,MAAM,CAAC;QAE3C,uDAAuD;QACvD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC;YAAE,OAAO,MAAM,CAAC;QAEzD,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE;YACtD,GAAG,MAAM,CAAC,QAAQ;YAClB,MAAM,EAAE;gBACN,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACzB,IAAI,EAAE,sBAAsB;aAC7B;SACF,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,mBAAmB,CAAC,QAA6B;IACxD,IACE,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE;QACtD,QAAQ,CAAC,QAAQ,KAAK,iBAAiB,CAAC,OAAO,CAAC,OAAO,EAAE;QAEzD,OAAO,KAAK,CAAC;IACf,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,2BAA2B,CAAC,EAC1C,QAAQ,GACgB;IACxB,OAAO,CACL,oBAAC,uBAAuB,IACtB,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,OAAqB,EAAE,EAAE;YACnD,OAAO;gBACL,GAAG,OAAO;gBACV,sBAAsB;gBACtB,cAAc;gBACd,cAAc;gBACd,iBAAiB;aAClB,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,IAEL,QAAQ,CACe,CAC3B,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 *--------------------------------------------------------------------------------------------*/\nimport * as React from \"react\";\nimport {\n type PropertyDescription,\n type PropertyRecord,\n StandardTypeNames,\n} from \"@itwin/appui-abstract\";\nimport type { EditorSpec } from \"@itwin/components-react\";\nimport { EditorsRegistryProvider } from \"@itwin/components-react\";\nimport { usePreviewFeatures } from \"../PreviewFeatures.js\";\nimport { LockPropertyEditorName } from \"../../editors/LockEditor.js\";\nimport { LockEditorSpec } from \"../../new-editors/LockEditor.js\";\nimport { TextEditorSpec } from \"../../new-editors/TextEditor.js\";\nimport { NumericEditorSpec } from \"../../new-editors/NumericEditor.js\";\nimport { CustomNumberEditorSpec } from \"../../new-editors/CustomNumberEditor.js\";\n\n/** @internal */\nexport function useLockButtonPropertyRecord(\n record: PropertyRecord,\n enabled: boolean\n) {\n const { toolSettingsLockButton } = usePreviewFeatures();\n return React.useMemo(() => {\n if (!enabled) return record;\n if (!toolSettingsLockButton) return record;\n\n // Allow consumers to override the default lock editor.\n if (!isDefaultLockEditor(record.property)) return record;\n\n const newRecord = record.copyWithNewValue(record.value, {\n ...record.property,\n editor: {\n ...record.property.editor,\n name: LockPropertyEditorName,\n },\n });\n return newRecord;\n }, [enabled, toolSettingsLockButton, record]);\n}\n\nfunction isDefaultLockEditor(property: PropertyDescription) {\n if (\n property.typename !== StandardTypeNames.Bool.valueOf() &&\n property.typename !== StandardTypeNames.Boolean.valueOf()\n )\n return false;\n if (property.editor?.name) return false;\n return true;\n}\n\n/** @internal */\nexport function ToolSettingsEditorsProvider({\n children,\n}: React.PropsWithChildren) {\n return (\n <EditorsRegistryProvider\n editors={React.useCallback((editors: EditorSpec[]) => {\n return [\n ...editors,\n CustomNumberEditorSpec,\n LockEditorSpec,\n TextEditorSpec,\n NumericEditorSpec,\n ];\n }, [])}\n >\n {children}\n </EditorsRegistryProvider>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapMode.d.ts","sourceRoot":"","sources":["../../../src/appui-react/statusfields/SnapMode.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SnapMode.d.ts","sourceRoot":"","sources":["../../../src/appui-react/statusfields/SnapMode.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsF/B,oEAAoE;AAEpE,UAAU,kBAAmB,SAAQ,WAAW;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC5C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA+DtD"}
|
|
@@ -21,6 +21,8 @@ import { SvgSnapsMidpoint } from "../icons/snaps/SvgSnapsMidpoint.js";
|
|
|
21
21
|
import { SvgSnapsNearest } from "../icons/snaps/SvgSnapsNearest.js";
|
|
22
22
|
import { SvgSnapsOrigin } from "../icons/snaps/SvgSnapsOrigin.js";
|
|
23
23
|
import { SvgSnaps } from "../icons/snaps/SvgSnaps.js";
|
|
24
|
+
import { SvgSnapsPerpendicular } from "../icons/snaps/SvgSnapsPerpendicular.js";
|
|
25
|
+
import { SvgSnapsTangent } from "../icons/snaps/SvgSnapsTangent.js";
|
|
24
26
|
// Field entry of all possible snap modes.
|
|
25
27
|
const allSnapModeFieldEntries = [
|
|
26
28
|
{
|
|
@@ -58,6 +60,28 @@ const allSnapModeFieldEntries = [
|
|
|
58
60
|
value: SnapMode.Bisector,
|
|
59
61
|
icon: React.createElement(SvgSnapsBisector, null),
|
|
60
62
|
},
|
|
63
|
+
// @ts-ignore Introduced in @itwin/core-frontend@5.0.0
|
|
64
|
+
...(SnapMode.PerpendicularPoint === undefined
|
|
65
|
+
? []
|
|
66
|
+
: [
|
|
67
|
+
{
|
|
68
|
+
labelKey: "snapModeField.perpendicularPoint",
|
|
69
|
+
// @ts-ignore Introduced in @itwin/core-frontend@5.0.0
|
|
70
|
+
value: SnapMode.PerpendicularPoint,
|
|
71
|
+
icon: React.createElement(SvgSnapsPerpendicular, null),
|
|
72
|
+
},
|
|
73
|
+
]),
|
|
74
|
+
// @ts-ignore Introduced in @itwin/core-frontend@5.0.0
|
|
75
|
+
...(SnapMode.TangentPoint === undefined
|
|
76
|
+
? []
|
|
77
|
+
: [
|
|
78
|
+
{
|
|
79
|
+
labelKey: "snapModeField.tangentPoint",
|
|
80
|
+
// @ts-ignore Introduced in @itwin/core-frontend@5.0.0
|
|
81
|
+
value: SnapMode.TangentPoint,
|
|
82
|
+
icon: React.createElement(SvgSnapsTangent, null),
|
|
83
|
+
},
|
|
84
|
+
]),
|
|
61
85
|
];
|
|
62
86
|
/** `SnapModeField` component designed to be specified in a status bar. It will
|
|
63
87
|
* display the active snap mode that AccuSnap will use and allow the user to select a new snap mode.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnapMode.js","sourceRoot":"","sources":["../../../src/appui-react/statusfields/SnapMode.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,M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,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC5B,OAAO;gBACT,CAAC;gBACD,4DAA4D;gBAC5D,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC/C,CAAC,EACD,QAAQ,EAAE,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,KAAK,EAClD,IAAI,EAAE,oBAAC,IAAI,QAAE,KAAK,CAAC,IAAI,CAAQ,IAE9B,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CACrB,CACR,CAAC,CACY;QAGlB,oBAAC,MAAM,IACL,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EACL,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG;YAGhE,KAAK;YACN,oBAAC,gBAAgB,CAAC,eAAe,OAAG,CAC7B,CACQ,CACpB,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 @typescript-eslint/no-deprecated\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 @typescript-eslint/no-deprecated\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 @typescript-eslint/no-deprecated\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
|
+
{"version":3,"file":"SnapMode.js","sourceRoot":"","sources":["../../../src/appui-react/statusfields/SnapMode.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;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K,KAAK,CAAC,KAAK,EAClD,IAAI,EAAE,oBAAC,IAAI,QAAE,KAAK,CAAC,IAAI,CAAQ,IAE9B,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CACrB,CACR,CAAC,CACY;QAGlB,oBAAC,MAAM,IACL,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EACL,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAC,QAAQ,OAAG;YAGhE,KAAK;YACN,oBAAC,gBAAgB,CAAC,eAAe,OAAG,CAC7B,CACQ,CACpB,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\";\nimport { SvgSnapsPerpendicular } from \"../icons/snaps/SvgSnapsPerpendicular.js\";\nimport { SvgSnapsTangent } from \"../icons/snaps/SvgSnapsTangent.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 // @ts-ignore Introduced in @itwin/core-frontend@5.0.0\n ...(SnapMode.PerpendicularPoint === undefined\n ? []\n : [\n {\n labelKey: \"snapModeField.perpendicularPoint\",\n // @ts-ignore Introduced in @itwin/core-frontend@5.0.0\n value: SnapMode.PerpendicularPoint as number,\n icon: <SvgSnapsPerpendicular />,\n },\n ]),\n // @ts-ignore Introduced in @itwin/core-frontend@5.0.0\n ...(SnapMode.TangentPoint === undefined\n ? []\n : [\n {\n labelKey: \"snapModeField.tangentPoint\",\n // @ts-ignore Introduced in @itwin/core-frontend@5.0.0\n value: SnapMode.TangentPoint as number,\n icon: <SvgSnapsTangent />,\n },\n ]),\n];\n\n/** Defines properties supported by the SnapMode Field Component. */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\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 @typescript-eslint/no-deprecated\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 @typescript-eslint/no-deprecated\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"]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type { CommonProps } from "@itwin/core-react";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import "./ToolAssistanceField.scss";
|
|
7
|
+
import { StatusBarPopover } from "../../statusbar/popup/StatusBarPopover.js";
|
|
7
8
|
import { type UiStateStorage } from "../../uistate/UiStateStorage.js";
|
|
8
9
|
/** Properties of [[ToolAssistanceField]] component.
|
|
9
10
|
* @public
|
|
@@ -24,7 +25,17 @@ export interface ToolAssistanceFieldProps extends CommonProps {
|
|
|
24
25
|
/** When set to `true` will show prompt at cursor only when the content area is hovered. */
|
|
25
26
|
promptAtContent?: boolean;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
type PopoverProps = React.ComponentProps<typeof StatusBarPopover>;
|
|
29
|
+
interface Props extends Omit<ToolAssistanceFieldProps, "includePromptAtCursor" | "cursorPromptTimeout" | "fadeOutCursorPrompt" | "defaultPromptAtCursor">, Partial<Pick<ToolAssistanceFieldProps, "includePromptAtCursor" | "cursorPromptTimeout" | "fadeOutCursorPrompt" | "defaultPromptAtCursor">>, Pick<PopoverProps, "visible" | "onVisibleChange"> {
|
|
30
|
+
/**
|
|
31
|
+
* Controlled flag for whether the popover is pinned.
|
|
32
|
+
*/
|
|
33
|
+
pinned?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Callback invoked every time the popover is pinned or unpinned as a result
|
|
36
|
+
* of internal logic. Should be used alongside `pinned` prop.
|
|
37
|
+
*/
|
|
38
|
+
onPinnedChange?: (pinned: boolean) => void;
|
|
28
39
|
}
|
|
29
40
|
/** Tool Assistance Field React component.
|
|
30
41
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolAssistanceField.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/toolassistance/ToolAssistanceField.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAaH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolAssistanceField.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/toolassistance/ToolAssistanceField.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAaH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,4BAA4B,CAAC;AAsBpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAC;AAUzC;;GAEG;AAEH,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,gFAAgF;IAChF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,0FAA0F;IAC1F,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gFAAgF;IAChF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,2FAA2F;IAC3F,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,KAAK,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAElE,UAAU,KACR,SAAQ,IAAI,CACR,wBAAwB,EACtB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,uBAAuB,CAC1B,EACD,OAAO,CACL,IAAI,CACF,wBAAwB,EACtB,uBAAuB,GACvB,qBAAqB,GACrB,qBAAqB,GACrB,uBAAuB,CAC1B,CACF,EACD,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACnD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAaD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,qBAwT/C"}
|
|
@@ -31,6 +31,7 @@ import { SvgMouseClickRightDrag } from "../../icons/SvgMouseClickRightDrag.js";
|
|
|
31
31
|
import { SvgMouseClickWheelDrag } from "../../icons/SvgMouseClickWheelDrag.js";
|
|
32
32
|
import { useTranslation } from "../../hooks/useTranslation.js";
|
|
33
33
|
import { useActiveTool } from "../../hooks/useActiveTool.js";
|
|
34
|
+
import { useControlledState } from "../../hooks/useControlledState.js";
|
|
34
35
|
const toolAssistanceKey = "ToolAssistance";
|
|
35
36
|
const showPromptAtCursorKey = "showPromptAtCursor";
|
|
36
37
|
const mouseTouchTabIndexKey = "mouseTouchTabIndex";
|
|
@@ -39,7 +40,7 @@ const mouseTouchTabIndexKey = "mouseTouchTabIndex";
|
|
|
39
40
|
* @note Tool assistance field will only display 30 characters in the status bar. Any additional text will be hidden. The full text will always be shown in the opened popover.
|
|
40
41
|
*/
|
|
41
42
|
export function ToolAssistanceField(props) {
|
|
42
|
-
const { includePromptAtCursor = true, cursorPromptTimeout = 5000, fadeOutCursorPrompt = true, defaultPromptAtCursor = false, uiStateStorage: uiStateStorageProp, promptAtContent = false, } = props;
|
|
43
|
+
const { includePromptAtCursor = true, cursorPromptTimeout = 5000, fadeOutCursorPrompt = true, defaultPromptAtCursor = false, uiStateStorage: uiStateStorageProp, promptAtContent = false, visible: visibleProp, onVisibleChange, pinned: pinnedProp, onPinnedChange, } = props;
|
|
43
44
|
const uiStateStorageCtx = React.useContext(UiStateStorageContext);
|
|
44
45
|
const uiStateStorage = uiStateStorageProp ?? uiStateStorageCtx;
|
|
45
46
|
const { translate } = useTranslation();
|
|
@@ -50,8 +51,6 @@ export function ToolAssistanceField(props) {
|
|
|
50
51
|
toolIconSpec: "",
|
|
51
52
|
showPromptAtCursor: defaultPromptAtCursor,
|
|
52
53
|
mouseTouchTabIndex: 0,
|
|
53
|
-
isPinned: false,
|
|
54
|
-
isOpen: false,
|
|
55
54
|
};
|
|
56
55
|
});
|
|
57
56
|
const { showPromptAtCursor, toolIconSpec, mouseTouchTabIndex, instructions } = state;
|
|
@@ -64,14 +63,11 @@ export function ToolAssistanceField(props) {
|
|
|
64
63
|
fadeOut: fadeOutCursorPrompt,
|
|
65
64
|
promptAtContent,
|
|
66
65
|
});
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
if (!isOpen && state.isPinned) {
|
|
72
|
-
newState = { ...newState, ...{ isPinned: false } };
|
|
66
|
+
const handleClose = () => {
|
|
67
|
+
if (pinned) {
|
|
68
|
+
setPinned(false);
|
|
73
69
|
}
|
|
74
|
-
|
|
70
|
+
setVisible(false);
|
|
75
71
|
};
|
|
76
72
|
const getDisplayableInstructions = (section) => {
|
|
77
73
|
const displayableInstructions = section.instructions.filter((instruction) => {
|
|
@@ -168,15 +164,15 @@ export function ToolAssistanceField(props) {
|
|
|
168
164
|
translate("toolAssistance.mouse"),
|
|
169
165
|
translate("toolAssistance.touch"),
|
|
170
166
|
];
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (
|
|
175
|
-
|
|
167
|
+
const [visible, setVisible] = useControlledState(false, visibleProp, onVisibleChange);
|
|
168
|
+
const [pinned, setPinned] = useControlledState(false, pinnedProp, onPinnedChange);
|
|
169
|
+
return (React.createElement(StatusBarPopover, { visible: visible, onVisibleChange: setVisible, closeOnOutsideClick: !pinned, content: React.createElement(ToolAssistanceDialog, { buttons: React.createElement(StatusBarDialog.TitleBarButton, { onClick: () => {
|
|
170
|
+
if (pinned) {
|
|
171
|
+
handleClose();
|
|
176
172
|
return;
|
|
177
173
|
}
|
|
178
|
-
|
|
179
|
-
}, title: translate(
|
|
174
|
+
setPinned(true);
|
|
175
|
+
}, title: translate(pinned ? "dialog.close" : "toolAssistance.pin") }, pinned ? React.createElement(SvgClose, null) : React.createElement(SvgPin, null)), title: dialogTitle },
|
|
180
176
|
React.createElement("div", null,
|
|
181
177
|
showMouseTouchTabs && (React.createElement(Tabs.Wrapper, { type: "pill", value: String(mouseTouchTabIndex) },
|
|
182
178
|
React.createElement(Tabs.TabList, { className: "uifw-toolAssistance-tabs" }, tabs.map((tab, index) => (React.createElement(Tabs.Tab, { key: index, className: "uifw-tab", value: String(index), label: tab, onClick: async () => {
|