@itwin/appui-react 5.5.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.
Files changed (99) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/lib/appui-react/UiFramework.json +3 -1
  3. package/lib/appui-react/editors/CustomNumberEditor.d.ts +10 -0
  4. package/lib/appui-react/editors/CustomNumberEditor.d.ts.map +1 -0
  5. package/lib/appui-react/editors/CustomNumberEditor.js +24 -0
  6. package/lib/appui-react/editors/CustomNumberEditor.js.map +1 -0
  7. package/lib/appui-react/editors/LockEditor.d.ts +12 -0
  8. package/lib/appui-react/editors/LockEditor.d.ts.map +1 -0
  9. package/lib/appui-react/editors/LockEditor.js +64 -0
  10. package/lib/appui-react/editors/LockEditor.js.map +1 -0
  11. package/lib/appui-react/editors/LockProvider.d.ts +48 -0
  12. package/lib/appui-react/editors/LockProvider.d.ts.map +1 -0
  13. package/lib/appui-react/editors/LockProvider.js +121 -0
  14. package/lib/appui-react/editors/LockProvider.js.map +1 -0
  15. package/lib/appui-react/editors/NumericEditor.d.ts +10 -0
  16. package/lib/appui-react/editors/NumericEditor.d.ts.map +1 -0
  17. package/lib/appui-react/editors/NumericEditor.js +24 -0
  18. package/lib/appui-react/editors/NumericEditor.js.map +1 -0
  19. package/lib/appui-react/editors/TextEditor.d.ts +10 -0
  20. package/lib/appui-react/editors/TextEditor.d.ts.map +1 -0
  21. package/lib/appui-react/editors/TextEditor.js +24 -0
  22. package/lib/appui-react/editors/TextEditor.js.map +1 -0
  23. package/lib/appui-react/editors/registerEditors.d.ts +6 -0
  24. package/lib/appui-react/editors/registerEditors.d.ts.map +1 -0
  25. package/lib/appui-react/editors/registerEditors.js +28 -0
  26. package/lib/appui-react/editors/registerEditors.js.map +1 -0
  27. package/lib/appui-react/hooks/useControlledState.d.ts +4 -0
  28. package/lib/appui-react/hooks/useControlledState.d.ts.map +1 -0
  29. package/lib/appui-react/hooks/useControlledState.js +16 -0
  30. package/lib/appui-react/hooks/useControlledState.js.map +1 -0
  31. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts +7 -0
  32. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.d.ts.map +1 -0
  33. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js +14 -0
  34. package/lib/appui-react/icons/snaps/SvgSnapsPerpendicular.js.map +1 -0
  35. package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts +7 -0
  36. package/lib/appui-react/icons/snaps/SvgSnapsTangent.d.ts.map +1 -0
  37. package/lib/appui-react/icons/snaps/SvgSnapsTangent.js +14 -0
  38. package/lib/appui-react/icons/snaps/SvgSnapsTangent.js.map +1 -0
  39. package/lib/appui-react/new-editors/CustomNumberEditor.d.ts +7 -0
  40. package/lib/appui-react/new-editors/CustomNumberEditor.d.ts.map +1 -0
  41. package/lib/appui-react/new-editors/CustomNumberEditor.js +18 -0
  42. package/lib/appui-react/new-editors/CustomNumberEditor.js.map +1 -0
  43. package/lib/appui-react/new-editors/LockEditor.d.ts +3 -0
  44. package/lib/appui-react/new-editors/LockEditor.d.ts.map +1 -0
  45. package/lib/appui-react/new-editors/LockEditor.js +40 -0
  46. package/lib/appui-react/new-editors/LockEditor.js.map +1 -0
  47. package/lib/appui-react/new-editors/NumericEditor.d.ts +3 -0
  48. package/lib/appui-react/new-editors/NumericEditor.d.ts.map +1 -0
  49. package/lib/appui-react/new-editors/NumericEditor.js +34 -0
  50. package/lib/appui-react/new-editors/NumericEditor.js.map +1 -0
  51. package/lib/appui-react/new-editors/TextEditor.d.ts +3 -0
  52. package/lib/appui-react/new-editors/TextEditor.d.ts.map +1 -0
  53. package/lib/appui-react/new-editors/TextEditor.js +23 -0
  54. package/lib/appui-react/new-editors/TextEditor.js.map +1 -0
  55. package/lib/appui-react/preview/PreviewFeatures.d.ts +6 -0
  56. package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
  57. package/lib/appui-react/preview/PreviewFeatures.js +1 -0
  58. package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
  59. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts +7 -0
  60. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.d.ts.map +1 -0
  61. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js +55 -0
  62. package/lib/appui-react/preview/tool-settings-lock-button/useToolSettingsLockButton.js.map +1 -0
  63. package/lib/appui-react/preview/tool-settings-new-editors/{useToolsSettingsNewEditors.d.ts → useToolSettingsNewEditors.d.ts} +1 -1
  64. package/lib/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.d.ts.map +1 -0
  65. package/lib/appui-react/preview/tool-settings-new-editors/{useToolsSettingsNewEditors.js → useToolSettingsNewEditors.js} +1 -1
  66. package/lib/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.js.map +1 -0
  67. package/lib/appui-react/statusfields/SnapMode.d.ts.map +1 -1
  68. package/lib/appui-react/statusfields/SnapMode.js +24 -0
  69. package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
  70. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts +12 -1
  71. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  72. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +13 -17
  73. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  74. package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
  75. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +1 -1
  76. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
  77. package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
  78. package/lib/appui-react/toolbar/new-toolbars/Item.js +1 -1
  79. package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
  80. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.d.ts.map +1 -1
  81. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +12 -3
  82. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  83. package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
  84. package/lib/appui-react/uiprovider/ComponentGenerator.js +27 -14
  85. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  86. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.d.ts.map +1 -1
  87. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js +2 -1
  88. package/lib/appui-react/uiprovider/DefaultDialogGridContainer.js.map +1 -1
  89. package/lib/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  90. package/lib/appui-react/widget-panels/ToolSettings.js +12 -7
  91. package/lib/appui-react/widget-panels/ToolSettings.js.map +1 -1
  92. package/lib/appui-react.d.ts +1 -0
  93. package/lib/appui-react.d.ts.map +1 -1
  94. package/lib/appui-react.js +3 -0
  95. package/lib/appui-react.js.map +1 -1
  96. package/lib/public/locales/en/UiFramework.json +3 -1
  97. package/package.json +7 -7
  98. package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.d.ts.map +0 -1
  99. package/lib/appui-react/preview/tool-settings-new-editors/useToolsSettingsNewEditors.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registerEditors.js","sourceRoot":"","sources":["../../../src/appui-react/editors/registerEditors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAEhE,gBAAgB;AAChB,MAAM,UAAU,eAAe;IAC7B,yCAAyC;IACzC,6BAA6B,CAC3B,iBAAiB,CAAC,IAAI,EACtB,kBAAkB,EAClB,SAAS,EACT,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,MAAM,EACxB,kBAAkB,EAClB,SAAS,EACT,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,EAChC,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,GAAG,EACrB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,EAChC,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,KAAK,EACvB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,EAChC,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,EAChC,IAAI,CACL,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,MAAM,EACxB,0BAA0B,EAC1B,mBAAmB,CAAC,YAAY,EAChC,IAAI,CACL,CAAC;IAEF,kCAAkC;IAClC,6BAA6B,CAC3B,iBAAiB,CAAC,IAAI,EACtB,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;IACF,6BAA6B,CAC3B,iBAAiB,CAAC,OAAO,EACzB,kBAAkB,EAClB,sBAAsB,CACvB,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 PropertyEditors\n */\n\nimport { StandardEditorNames, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { registerDefaultPropertyEditor } from \"@itwin/components-react/internal\";\nimport { LockPropertyEditor, LockPropertyEditorName } from \"./LockEditor.js\";\nimport { CustomNumberPropertyEditor } from \"./CustomNumberEditor.js\";\nimport { TextPropertyEditor } from \"./TextEditor.js\";\nimport { NumericInputPropertyEditor } from \"./NumericEditor.js\";\n\n/** @internal */\nexport function registerEditors() {\n // Editors that support lock decorations.\n registerDefaultPropertyEditor(\n StandardTypeNames.Text,\n TextPropertyEditor,\n undefined,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.String,\n TextPropertyEditor,\n undefined,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Number,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Int,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Float,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Double,\n NumericInputPropertyEditor,\n StandardEditorNames.NumericInput,\n true\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Number,\n CustomNumberPropertyEditor,\n StandardEditorNames.NumberCustom,\n true\n );\n\n // `appui-react` specific editors.\n registerDefaultPropertyEditor(\n StandardTypeNames.Bool,\n LockPropertyEditor,\n LockPropertyEditorName\n );\n registerDefaultPropertyEditor(\n StandardTypeNames.Boolean,\n LockPropertyEditor,\n LockPropertyEditorName\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ /** @internal */
3
+ export declare function useControlledState<T>(initialValue: T, controlledState: T | undefined, setControlledState?: React.Dispatch<React.SetStateAction<T>>): readonly [T, React.Dispatch<React.SetStateAction<T>>];
4
+ //# sourceMappingURL=useControlledState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useControlledState.d.ts","sourceRoot":"","sources":["../../../src/appui-react/hooks/useControlledState.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,YAAY,EAAE,CAAC,EACf,eAAe,EAAE,CAAC,GAAG,SAAS,EAC9B,kBAAkB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,yDAmB7D"}
@@ -0,0 +1,16 @@
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
+ /** @internal */
7
+ export function useControlledState(initialValue, controlledState, setControlledState) {
8
+ const [uncontrolledState, setUncontrolledState] = React.useState(initialValue);
9
+ const state = React.useMemo(() => (controlledState !== undefined ? controlledState : uncontrolledState), [controlledState, uncontrolledState]);
10
+ const setState = React.useCallback((value) => {
11
+ setUncontrolledState(value);
12
+ setControlledState?.(value);
13
+ }, [setControlledState, setUncontrolledState]);
14
+ return [state, setState];
15
+ }
16
+ //# sourceMappingURL=useControlledState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useControlledState.js","sourceRoot":"","sources":["../../../src/appui-react/hooks/useControlledState.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,MAAM,UAAU,kBAAkB,CAChC,YAAe,EACf,eAA8B,EAC9B,kBAA4D;IAE5D,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAC7C,KAAK,CAAC,QAAQ,CAAI,YAAY,CAAC,CAAC;IAElC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CACzB,GAAG,EAAE,CAAC,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAC3E,CAAC,eAAe,EAAE,iBAAiB,CAAC,CACrC,CAAC;IAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAChC,CAAC,KAAK,EAAE,EAAE;QACR,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC5B,kBAAkB,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,EACD,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CACA,CAAC;IAE7C,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAU,CAAC;AACpC,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\";\n\n/** @internal */\nexport function useControlledState<T>(\n initialValue: T,\n controlledState: T | undefined,\n setControlledState?: React.Dispatch<React.SetStateAction<T>>\n) {\n const [uncontrolledState, setUncontrolledState] =\n React.useState<T>(initialValue);\n\n const state = React.useMemo(\n () => (controlledState !== undefined ? controlledState : uncontrolledState),\n [controlledState, uncontrolledState]\n );\n\n const setState = React.useCallback(\n (value) => {\n setUncontrolledState(value);\n setControlledState?.(value);\n },\n [setControlledState, setUncontrolledState]\n ) as React.Dispatch<React.SetStateAction<T>>;\n\n return [state, setState] as const;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /** @packageDocumentation
2
+ * @module Utilities
3
+ */
4
+ import * as React from "react";
5
+ /** @internal */
6
+ export declare function SvgSnapsPerpendicular(): React.JSX.Element;
7
+ //# sourceMappingURL=SvgSnapsPerpendicular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvgSnapsPerpendicular.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/icons/snaps/SvgSnapsPerpendicular.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,wBAAgB,qBAAqB,sBAYpC"}
@@ -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 SvgSnapsPerpendicular() {
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 2a.5.5 0 0 1 .5.5v7.565A2 2 0 0 1 9.935 11.5H13.5a.5.5 0 0 1 0 1H9.935a1.999 1.999 0 0 1-3.87 0H2.5a.5.5 0 0 1 0-1h3.565A2 2 0 0 1 7.5 10.065V2.5A.5.5 0 0 1 8 2Zm0 9a1 1 0 1 0 1 1l-.005-.102A1 1 0 0 0 8 11Z" })));
13
+ }
14
+ //# sourceMappingURL=SvgSnapsPerpendicular.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvgSnapsPerpendicular.js","sourceRoot":"","sources":["../../../../src/appui-react/icons/snaps/SvgSnapsPerpendicular.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,MAAM,UAAU,qBAAqB;IACnC,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,mNAAmN,GAAG,CAC1N,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 SvgSnapsPerpendicular() {\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 2a.5.5 0 0 1 .5.5v7.565A2 2 0 0 1 9.935 11.5H13.5a.5.5 0 0 1 0 1H9.935a1.999 1.999 0 0 1-3.87 0H2.5a.5.5 0 0 1 0-1h3.565A2 2 0 0 1 7.5 10.065V2.5A.5.5 0 0 1 8 2Zm0 9a1 1 0 1 0 1 1l-.005-.102A1 1 0 0 0 8 11Z\" />\n </svg>\n );\n}\n"]}
@@ -0,0 +1,7 @@
1
+ /** @packageDocumentation
2
+ * @module Utilities
3
+ */
4
+ import * as React from "react";
5
+ /** @internal */
6
+ export declare function SvgSnapsTangent(): React.JSX.Element;
7
+ //# sourceMappingURL=SvgSnapsTangent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SvgSnapsTangent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/icons/snaps/SvgSnapsTangent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,wBAAgB,eAAe,sBAY9B"}
@@ -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,3 @@
1
+ /** @internal */
2
+ export declare const LockEditorSpec: import("@itwin/components-react").EditorSpec;
3
+ //# sourceMappingURL=LockEditor.d.ts.map
@@ -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,3 @@
1
+ /** @internal */
2
+ export declare const NumericEditorSpec: import("@itwin/components-react").EditorSpec;
3
+ //# sourceMappingURL=NumericEditor.d.ts.map
@@ -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,3 @@
1
+ /** @internal */
2
+ export declare const TextEditorSpec: import("@itwin/components-react").EditorSpec;
3
+ //# sourceMappingURL=TextEditor.d.ts.map
@@ -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"]}
@@ -58,6 +58,12 @@ interface KnownPreviewFeatures {
58
58
  * However, in order to use custom editors they need to be provided using `EditorsRegistryProvider` component.
59
59
  */
60
60
  toolSettingsNewEditors: boolean;
61
+ /**
62
+ * If `true`, the default tool settings lock editor will be rendered as an icon button rather than a checkbox.
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.
65
+ */
66
+ toolSettingsLockButton: boolean;
61
67
  }
62
68
  /** List of preview features that can be enabled/disabled.
63
69
  * This list is expected to change over time, the interface is made
@@ -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;CACjC;AAiBD;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAAC,oBAAoB,CAAC;IACpE,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC;CAC5B;AAuDD;;GAEG;AACH,wBAAgB,kBAAkB,oBAEjC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GACT,EAAE,4BAA4B,qBAgB9B"}
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;;;;OAIG;IACH,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAkBD;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,OAAO,CAAC,oBAAoB,CAAC;IACpE,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC;CAC5B;AAuDD;;GAEG;AACH,wBAAgB,kBAAkB,oBAEjC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,QAAQ,GACT,EAAE,4BAA4B,qBAgB9B"}
@@ -22,6 +22,7 @@ const knownFeaturesObject = {
22
22
  reparentPopoutWidgets: undefined,
23
23
  controlWidgetVisibility: undefined,
24
24
  toolSettingsNewEditors: undefined,
25
+ toolSettingsLockButton: undefined,
25
26
  };
26
27
  /** Trim an object to only contain known feature keys.
27
28
  * @param previewFeatures object potentially containing unknown features
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewFeatures.js","sourceRoot":"","sources":["../../../src/appui-react/preview/PreviewFeatures.tsx"],"names":[],"mappings":"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","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\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};\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":"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","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"]}
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { type PropertyRecord } from "@itwin/appui-abstract";
3
+ /** @internal */
4
+ export declare function useLockButtonPropertyRecord(record: PropertyRecord, enabled: boolean): PropertyRecord;
5
+ /** @internal */
6
+ export declare function ToolSettingsEditorsProvider({ children, }: React.PropsWithChildren): React.JSX.Element;
7
+ //# sourceMappingURL=useToolSettingsLockButton.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,55 @@
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 { StandardTypeNames, } from "@itwin/appui-abstract";
7
+ import { EditorsRegistryProvider } from "@itwin/components-react";
8
+ import { usePreviewFeatures } from "../PreviewFeatures.js";
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";
14
+ /** @internal */
15
+ export function useLockButtonPropertyRecord(record, enabled) {
16
+ const { toolSettingsLockButton } = usePreviewFeatures();
17
+ return React.useMemo(() => {
18
+ if (!enabled)
19
+ return record;
20
+ if (!toolSettingsLockButton)
21
+ return record;
22
+ // Allow consumers to override the default lock editor.
23
+ if (!isDefaultLockEditor(record.property))
24
+ return record;
25
+ const newRecord = record.copyWithNewValue(record.value, {
26
+ ...record.property,
27
+ editor: {
28
+ ...record.property.editor,
29
+ name: LockPropertyEditorName,
30
+ },
31
+ });
32
+ return newRecord;
33
+ }, [enabled, toolSettingsLockButton, record]);
34
+ }
35
+ function isDefaultLockEditor(property) {
36
+ if (property.typename !== StandardTypeNames.Bool.valueOf() &&
37
+ property.typename !== StandardTypeNames.Boolean.valueOf())
38
+ return false;
39
+ if (property.editor?.name)
40
+ return false;
41
+ return true;
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
+ }
55
+ //# sourceMappingURL=useToolSettingsLockButton.js.map
@@ -0,0 +1 @@
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"]}
@@ -2,4 +2,4 @@
2
2
  * @internal
3
3
  */
4
4
  export declare function useToolSettingsNewEditors(): boolean | undefined;
5
- //# sourceMappingURL=useToolsSettingsNewEditors.d.ts.map
5
+ //# sourceMappingURL=useToolSettingsNewEditors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolSettingsNewEditors.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,yBAAyB,wBAGxC"}
@@ -10,4 +10,4 @@ export function useToolSettingsNewEditors() {
10
10
  const { toolSettingsNewEditors } = usePreviewFeatures();
11
11
  return toolSettingsNewEditors;
12
12
  }
13
- //# sourceMappingURL=useToolsSettingsNewEditors.js.map
13
+ //# sourceMappingURL=useToolSettingsNewEditors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolSettingsNewEditors.js","sourceRoot":"","sources":["../../../../src/appui-react/preview/tool-settings-new-editors/useToolSettingsNewEditors.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,EAAE,sBAAsB,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACxD,OAAO,sBAAsB,CAAC;AAChC,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\nimport { usePreviewFeatures } from \"../PreviewFeatures.js\";\n\n/** If `true`, tool settings will use editors based on the new editors system.\n * @internal\n */\nexport function useToolSettingsNewEditors() {\n const { toolSettingsNewEditors } = usePreviewFeatures();\n return toolSettingsNewEditors;\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;AA8D/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"}
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.