@itwin/imodel-components-react 5.13.1 → 5.15.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 +21 -0
- package/lib/imodel-components-react/IModelConnectionContext.d.ts +17 -0
- package/lib/imodel-components-react/IModelConnectionContext.d.ts.map +1 -0
- package/lib/imodel-components-react/IModelConnectionContext.js +23 -0
- package/lib/imodel-components-react/IModelConnectionContext.js.map +1 -0
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.d.ts.map +1 -1
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.js +56 -7
- package/lib/imodel-components-react/inputs/new-editors/UseQuantityInfo.js.map +1 -1
- package/lib/imodel-components-react.d.ts +1 -0
- package/lib/imodel-components-react.d.ts.map +1 -1
- package/lib/imodel-components-react.js +1 -0
- package/lib/imodel-components-react.js.map +1 -1
- package/package.json +15 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Change Log - @itwin/imodel-components-react
|
|
2
2
|
|
|
3
|
+
## 5.15.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 16da69d: Use higher precision when formatting kind of quantity values in editor.
|
|
8
|
+
- @itwin/components-react@5.15.0
|
|
9
|
+
- @itwin/core-react@5.15.0
|
|
10
|
+
|
|
11
|
+
## 5.14.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- bdd16f3: Updated `QuantityEditor` to support `IModelApp.formatsProvider` and react to format settings changes.
|
|
16
|
+
`IModelApp.formatsProvider` is available with `@itwin/core-frontend` v5. If v4 is used it fallbacks to using `IModelApp.quantityFormatter`.
|
|
17
|
+
- bdd16f3: Introduced `IModelConnectionProvider` component that allows supplying `IModelConnection` through context to the components that required it.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- @itwin/components-react@5.14.0
|
|
22
|
+
- @itwin/core-react@5.14.0
|
|
23
|
+
|
|
3
24
|
## 5.13.1
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Common
|
|
3
|
+
*/
|
|
4
|
+
import type { IModelConnection } from "@itwin/core-frontend";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
/**
|
|
7
|
+
* Provides `IModelConnection` to the components wrapped by the provider.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare function IModelConnectionProvider({ iModelConnection, children, }: React.PropsWithChildren<{
|
|
11
|
+
iModelConnection?: IModelConnection;
|
|
12
|
+
}>): React.JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function useIModelConnection(): IModelConnection | undefined;
|
|
17
|
+
//# sourceMappingURL=IModelConnectionContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelConnectionContext.d.ts","sourceRoot":"","sources":["../../src/imodel-components-react/IModelConnectionContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,gBAAgB,EAChB,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAC,qBAMlE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,iCAElC"}
|
|
@@ -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
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Common
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
const IModelConnectionContext = React.createContext(undefined);
|
|
10
|
+
/**
|
|
11
|
+
* Provides `IModelConnection` to the components wrapped by the provider.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export function IModelConnectionProvider({ iModelConnection, children, }) {
|
|
15
|
+
return (React.createElement(IModelConnectionContext.Provider, { value: iModelConnection }, children));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export function useIModelConnection() {
|
|
21
|
+
return React.useContext(IModelConnectionContext);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=IModelConnectionContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelConnectionContext.js","sourceRoot":"","sources":["../../src/imodel-components-react/IModelConnectionContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAEjD,SAAS,CAAC,CAAC;AAEb;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,EACvC,gBAAgB,EAChB,QAAQ,GACyD;IACjE,OAAO,CACL,oBAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,gBAAgB,IACtD,QAAQ,CACwB,CACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AACnD,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 Common\n */\n\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport * as React from \"react\";\n\nconst IModelConnectionContext = React.createContext<\n IModelConnection | undefined\n>(undefined);\n\n/**\n * Provides `IModelConnection` to the components wrapped by the provider.\n * @public\n */\nexport function IModelConnectionProvider({\n iModelConnection,\n children,\n}: React.PropsWithChildren<{ iModelConnection?: IModelConnection }>) {\n return (\n <IModelConnectionContext.Provider value={iModelConnection}>\n {children}\n </IModelConnectionContext.Provider>\n );\n}\n\n/**\n * @internal\n */\nexport function useIModelConnection() {\n return React.useContext(IModelConnectionContext);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseQuantityInfo.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"UseQuantityInfo.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOtE,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,EAAE,oBAAoB;;;EA8D7D"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
import { IModelApp } from "@itwin/core-frontend";
|
|
6
6
|
import * as React from "react";
|
|
7
|
+
import { useIModelConnection } from "../../IModelConnectionContext.js";
|
|
7
8
|
/**
|
|
8
9
|
* Hook that finds the formatter and parser in `IModelApp.quantityFormatter` for a given quantity type.
|
|
9
10
|
* @internal
|
|
@@ -13,6 +14,7 @@ export function useQuantityInfo({ type }) {
|
|
|
13
14
|
formatter: undefined,
|
|
14
15
|
parser: undefined,
|
|
15
16
|
}));
|
|
17
|
+
const imodel = useIModelConnection();
|
|
16
18
|
React.useEffect(() => {
|
|
17
19
|
if (type === undefined) {
|
|
18
20
|
setState({
|
|
@@ -21,27 +23,74 @@ export function useQuantityInfo({ type }) {
|
|
|
21
23
|
});
|
|
22
24
|
return;
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const parserSpec =
|
|
27
|
-
|
|
26
|
+
let disposed = false;
|
|
27
|
+
const loadFormatterParser = async () => {
|
|
28
|
+
const { formatterSpec, parserSpec } = await getFormatterParserSpec({
|
|
29
|
+
imodel,
|
|
30
|
+
type,
|
|
31
|
+
});
|
|
32
|
+
if (!disposed) {
|
|
33
|
+
setState({ formatter: formatterSpec, parser: parserSpec });
|
|
34
|
+
}
|
|
28
35
|
};
|
|
29
|
-
loadFormatterParser();
|
|
36
|
+
void loadFormatterParser();
|
|
30
37
|
const removeListeners = [
|
|
31
38
|
IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(loadFormatterParser),
|
|
32
39
|
IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(({ quantityType }) => {
|
|
33
40
|
if (quantityType === type) {
|
|
34
|
-
loadFormatterParser();
|
|
41
|
+
void loadFormatterParser();
|
|
35
42
|
}
|
|
36
43
|
}),
|
|
37
44
|
];
|
|
45
|
+
if (IModelApp.formatsProvider) {
|
|
46
|
+
removeListeners.push(IModelApp.formatsProvider.onFormatsChanged.addListener(async () => loadFormatterParser()));
|
|
47
|
+
}
|
|
38
48
|
return () => {
|
|
49
|
+
disposed = true;
|
|
39
50
|
removeListeners.forEach((remove) => {
|
|
40
51
|
remove();
|
|
41
52
|
});
|
|
42
53
|
};
|
|
43
|
-
}, [type]);
|
|
54
|
+
}, [imodel, type]);
|
|
44
55
|
return { formatter, parser };
|
|
45
56
|
}
|
|
57
|
+
async function getFormatterParserSpec({ imodel, type, }) {
|
|
58
|
+
// fallback to IModelApp.quantityFormatter:
|
|
59
|
+
// - if `itwinjs-core` v4 is used
|
|
60
|
+
// - don't have an iModelConnection to look up KOQ
|
|
61
|
+
// - old quantity type enum is used instead of KOQ name
|
|
62
|
+
if (!IModelApp.formatsProvider || !imodel || typeof type !== "string") {
|
|
63
|
+
const quantityFormatterSpec = IModelApp.quantityFormatter.findFormatterSpecByQuantityType(type);
|
|
64
|
+
const quantityParserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(type);
|
|
65
|
+
return {
|
|
66
|
+
formatterSpec: quantityFormatterSpec,
|
|
67
|
+
parserSpec: quantityParserSpec,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const koq = await imodel.schemaContext.getSchemaItem(type);
|
|
71
|
+
if (!koq) {
|
|
72
|
+
return { formatter: undefined, parser: undefined };
|
|
73
|
+
}
|
|
74
|
+
// TODO: `KindOfQuantity` here is used only as a type because we don't have peerDep on `ecschema-metadata`
|
|
75
|
+
// It should be added when dropping `itwinjs-core` v4 support
|
|
76
|
+
const persistenceUnit = await koq.persistenceUnit;
|
|
77
|
+
const formatProps = await IModelApp.formatsProvider.getFormat(type);
|
|
78
|
+
if (!persistenceUnit || !formatProps) {
|
|
79
|
+
return { formatter: undefined, parser: undefined };
|
|
80
|
+
}
|
|
81
|
+
const persistenceUnitName = persistenceUnit.fullName;
|
|
82
|
+
const formatterSpec = await IModelApp.quantityFormatter.createFormatterSpec({
|
|
83
|
+
formatProps: { ...formatProps, precision: 12 },
|
|
84
|
+
persistenceUnitName,
|
|
85
|
+
});
|
|
86
|
+
const parserSpec = await IModelApp.quantityFormatter.createParserSpec({
|
|
87
|
+
formatProps,
|
|
88
|
+
persistenceUnitName,
|
|
89
|
+
});
|
|
90
|
+
return {
|
|
91
|
+
formatterSpec,
|
|
92
|
+
parserSpec,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
46
95
|
/* v8 ignore stop */
|
|
47
96
|
//# sourceMappingURL=UseQuantityInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseQuantityInfo.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UseQuantityInfo.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/inputs/new-editors/UseQuantityInfo.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AASvE;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,IAAI,EAAwB;IAC5D,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAGrD,GAAG,EAAE,CAAC,CAAC;QACR,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC,CAAC;IAEJ,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IAErC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,QAAQ,CAAC;gBACP,SAAS,EAAE,SAAS;gBACpB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;YACrC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,MAAM,sBAAsB,CAAC;gBACjE,MAAM;gBACN,IAAI;aACL,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,EAAE,CAAC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AI,CAAC,CAAC;QACpE,MAAM,kBAAkB,GACtB,SAAS,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC;QAEjE,OAAO;YACL,aAAa,EAAE,qBAAqB;YACpC,UAAU,EAAE,kBAAkB;SAC/B,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACrD,CAAC;IAED,0GAA0G;IAC1G,6DAA6D;IAC7D,MAAM,eAAe,GAAG,MAAO,GAAsB,CAAC,eAAe,CAAC;IACtE,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACpE,IAAI,CAAC,eAAe,IAAI,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACrD,CAAC;IAED,MAAM,mBAAmB,GAAG,eAAe,CAAC,QAAQ,CAAC;IACrD,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,mBAAmB,CAAC;QAC1E,WAAW,EAAE,EAAE,GAAG,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE;QAC9C,mBAAmB;KACpB,CAAC,CAAC;IACH,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,iBAAiB,CAAC,gBAAgB,CAAC;QACpE,WAAW;QACX,mBAAmB;KACpB,CAAC,CAAC;IACH,OAAO;QACL,aAAa;QACb,UAAU;KACX,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 type { IModelConnection, QuantityTypeArg } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { FormatterSpec, ParserSpec } from \"@itwin/core-quantity\";\nimport * as React from \"react\";\nimport { useIModelConnection } from \"../../IModelConnectionContext.js\";\nimport type { KindOfQuantity } from \"@itwin/ecschema-metadata\";\n\n/* v8 ignore start */\n\ninterface UseQuantityInfoProps {\n type: QuantityTypeArg | undefined;\n}\n\n/**\n * Hook that finds the formatter and parser in `IModelApp.quantityFormatter` for a given quantity type.\n * @internal\n */\nexport function useQuantityInfo({ type }: UseQuantityInfoProps) {\n const [{ formatter, parser }, setState] = React.useState<{\n formatter: FormatterSpec | undefined;\n parser: ParserSpec | undefined;\n }>(() => ({\n formatter: undefined,\n parser: undefined,\n }));\n\n const imodel = useIModelConnection();\n\n React.useEffect(() => {\n if (type === undefined) {\n setState({\n formatter: undefined,\n parser: undefined,\n });\n return;\n }\n\n let disposed = false;\n const loadFormatterParser = async () => {\n const { formatterSpec, parserSpec } = await getFormatterParserSpec({\n imodel,\n type,\n });\n if (!disposed) {\n setState({ formatter: formatterSpec, parser: parserSpec });\n }\n };\n\n void loadFormatterParser();\n\n const removeListeners = [\n IModelApp.quantityFormatter.onActiveFormattingUnitSystemChanged.addListener(\n loadFormatterParser\n ),\n IModelApp.quantityFormatter.onQuantityFormatsChanged.addListener(\n ({ quantityType }) => {\n if (quantityType === type) {\n void loadFormatterParser();\n }\n }\n ),\n ];\n if (IModelApp.formatsProvider) {\n removeListeners.push(\n IModelApp.formatsProvider.onFormatsChanged.addListener(async () =>\n loadFormatterParser()\n )\n );\n }\n\n return () => {\n disposed = true;\n removeListeners.forEach((remove) => {\n remove();\n });\n };\n }, [imodel, type]);\n\n return { formatter, parser };\n}\n\nasync function getFormatterParserSpec({\n imodel,\n type,\n}: {\n imodel?: IModelConnection;\n type: QuantityTypeArg;\n}) {\n // fallback to IModelApp.quantityFormatter:\n // - if `itwinjs-core` v4 is used\n // - don't have an iModelConnection to look up KOQ\n // - old quantity type enum is used instead of KOQ name\n if (!IModelApp.formatsProvider || !imodel || typeof type !== \"string\") {\n const quantityFormatterSpec =\n IModelApp.quantityFormatter.findFormatterSpecByQuantityType(type);\n const quantityParserSpec =\n IModelApp.quantityFormatter.findParserSpecByQuantityType(type);\n\n return {\n formatterSpec: quantityFormatterSpec,\n parserSpec: quantityParserSpec,\n };\n }\n\n const koq = await imodel.schemaContext.getSchemaItem(type);\n if (!koq) {\n return { formatter: undefined, parser: undefined };\n }\n\n // TODO: `KindOfQuantity` here is used only as a type because we don't have peerDep on `ecschema-metadata`\n // It should be added when dropping `itwinjs-core` v4 support\n const persistenceUnit = await (koq as KindOfQuantity).persistenceUnit;\n const formatProps = await IModelApp.formatsProvider.getFormat(type);\n if (!persistenceUnit || !formatProps) {\n return { formatter: undefined, parser: undefined };\n }\n\n const persistenceUnitName = persistenceUnit.fullName;\n const formatterSpec = await IModelApp.quantityFormatter.createFormatterSpec({\n formatProps: { ...formatProps, precision: 12 },\n persistenceUnitName,\n });\n const parserSpec = await IModelApp.quantityFormatter.createParserSpec({\n formatProps,\n persistenceUnitName,\n });\n return {\n formatterSpec,\n parserSpec,\n };\n}\n\n/* v8 ignore stop */\n"]}
|
|
@@ -33,6 +33,7 @@ export { BaseSolarDataProvider } from "./imodel-components-react/timeline/BaseSo
|
|
|
33
33
|
export { ViewStateProp, ViewportComponent, ViewportProps, } from "./imodel-components-react/viewport/ViewportComponent.js";
|
|
34
34
|
export { ViewportComponentEvents, CubeRotationChangeEvent, CubeRotationChangeEventArgs, DrawingViewportChangeEvent, DrawingViewportChangeEventArgs, StandardRotationChangeEvent, StandardRotationChangeEventArgs, ViewClassFullNameChangedEvent, ViewClassFullNameChangedEventArgs, ViewIdChangedEvent, ViewIdChangedEventArgs, ViewRotationChangeEvent, ViewRotationChangeEventArgs, } from "./imodel-components-react/viewport/ViewportComponentEvents.js";
|
|
35
35
|
export { ToolUtilities } from "./imodel-components-react/ToolUtilities.js";
|
|
36
|
+
export { IModelConnectionProvider } from "./imodel-components-react/IModelConnectionContext.js";
|
|
36
37
|
/** @docs-package-description
|
|
37
38
|
* The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.
|
|
38
39
|
* The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,cAAc,GACf,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,OAAO,EACL,aAAa,EACb,aAAa,GACd,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAEpG,OAAO,EACL,gBAAgB,E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AE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,aAAa,GACd,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"imodel-components-react.d.ts","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,EACT,cAAc,GACf,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,gBAAgB,GACjB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,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ACrB,aAAa,GACd,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gEAAgE,CAAC;AAC1G,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,aAAa,GACd,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,8BAA8B,EAC9B,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAsBhG;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
|
|
@@ -38,6 +38,7 @@ export { BaseSolarDataProvider } from "./imodel-components-react/timeline/BaseSo
|
|
|
38
38
|
export { ViewportComponent, } from "./imodel-components-react/viewport/ViewportComponent.js";
|
|
39
39
|
export { ViewportComponentEvents, CubeRotationChangeEvent, DrawingViewportChangeEvent, StandardRotationChangeEvent, ViewClassFullNameChangedEvent, ViewIdChangedEvent, ViewRotationChangeEvent, } from "./imodel-components-react/viewport/ViewportComponentEvents.js";
|
|
40
40
|
export { ToolUtilities } from "./imodel-components-react/ToolUtilities.js";
|
|
41
|
+
export { IModelConnectionProvider } from "./imodel-components-react/IModelConnectionContext.js";
|
|
41
42
|
// #region "SideEffects"
|
|
42
43
|
import { StandardEditorNames, StandardTypeNames } from "@itwin/appui-abstract";
|
|
43
44
|
import { PropertyEditorManager } from "@itwin/components-react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,GAEZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,GAEV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,WAAW,GAEZ,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,oBAAoB,GACrB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAC;AAExF,OAAO,EACL,aAAa,GAEd,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,mBAAmB,GAGpB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAEpG,OAAO,EACL,gBAAgB,GAEjB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,kBAAkB,GAEnB,MAAM,4DAA4D,CAAC;AAEpE,OAAO,EACL,IAAI,EAEJ,IAAI,GACL,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EACL,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EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAEzF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,mBAAmB,EACnB,mBAAmB,CAAC,WAAW,CAChC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,oBAAoB,EACpB,mBAAmB,CAAC,YAAY,CACjC,CAAC;AAEF,2BAA2B;AAE3B;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents.js\";\n\nexport {\n AlphaSlider,\n AlphaSliderProps,\n} from \"./imodel-components-react/color/AlphaSlider.js\";\nexport {\n ColorPickerButton,\n ColorPickerProps,\n} from \"./imodel-components-react/color/ColorPickerButton.js\";\nexport {\n ColorPickerDialog,\n ColorPickerDialogProps,\n} from \"./imodel-components-react/color/ColorPickerDialog.js\";\nexport {\n ColorPickerPopup,\n ColorPickerPopupProps,\n} from \"./imodel-components-react/color/ColorPickerPopup.js\";\nexport {\n HueSlider,\n HueSliderProps,\n} from \"./imodel-components-react/color/HueSlider.js\";\nexport {\n SaturationPicker,\n SaturationPickerProps,\n} from \"./imodel-components-react/color/SaturationPicker.js\";\nexport {\n ColorSwatch,\n ColorSwatchProps,\n} from \"./imodel-components-react/color/Swatch.js\";\n\nexport {\n ColorEditor,\n ColorPropertyEditor,\n} from \"./imodel-components-react/editors/ColorEditor.js\";\nexport {\n WeightEditor,\n WeightPropertyEditor,\n} from \"./imodel-components-react/editors/WeightEditor.js\";\nexport { WeightEditorSpec } from \"./imodel-components-react/editors/NewWeightEditor.js\";\n\nexport {\n QuantityInput,\n QuantityProps,\n} from \"./imodel-components-react/inputs/QuantityInput.js\";\nexport {\n QuantityNumberInput,\n QuantityNumberInputProps,\n StepFunctionProp,\n} from \"./imodel-components-react/inputs/QuantityNumberInput.js\";\nexport { QuantityEditorSpec } from \"./imodel-components-react/inputs/new-editors/QuantityEditor.js\";\n\nexport {\n LineWeightSwatch,\n LineWeightSwatchProps,\n} from \"./imodel-components-react/lineweight/Swatch.js\";\nexport {\n WeightPickerButton,\n WeightPickerProps,\n} from \"./imodel-components-react/lineweight/WeightPickerButton.js\";\n\nexport {\n Cube,\n CubeProps,\n Face,\n} from \"./imodel-components-react/navigationaids/Cube.js\";\nexport {\n CubeNavigationAid,\n CubeNavigationAidProps,\n CubeNavigationHitBoxX,\n CubeNavigationHitBoxY,\n CubeNavigationHitBoxZ,\n} from \"./imodel-components-react/navigationaids/CubeNavigationAid.js\";\nexport {\n DrawingNavigationAid,\n DrawingNavigationAidProps,\n} from \"./imodel-components-react/navigationaids/DrawingNavigationAid.js\";\n\nexport {\n FormatPanel,\n FormatPanelProps,\n} from \"./imodel-components-react/quantityformat/FormatPanel.js\";\nexport {\n FormatPrecision,\n FormatPrecisionProps,\n} from \"./imodel-components-react/quantityformat/FormatPrecision.js\";\nexport {\n FormatSample,\n FormatSampleProps,\n} from \"./imodel-components-react/quantityformat/FormatSample.js\";\nexport {\n FormatTypeOption,\n FormatTypeOptionProps,\n} from \"./imodel-components-react/quantityformat/FormatType.js\";\nexport {\n FormatUnitLabel,\n FormatUnitLabelProps,\n} from \"./imodel-components-react/quantityformat/FormatUnitLabel.js\";\nexport {\n FormatUnits,\n FormatUnitsProps,\n} from \"./imodel-components-react/quantityformat/FormatUnits.js\";\nexport {\n MiscFormatOptions,\n MiscFormatOptionsProps,\n} from \"./imodel-components-react/quantityformat/MiscFormatOptions.js\";\nexport {\n QuantityFormatPanel,\n QuantityFormatPanelProps,\n} from \"./imodel-components-react/quantityformat/QuantityFormatPanel.js\";\n\nexport {\n AnimationFractionChangeHandler,\n PlaybackSettings,\n PlaybackSettingsChangeHandler,\n SolarDataProvider,\n SolarPlaybackProgressHandler,\n TimelineDataProvider,\n TimelineDateDisplay,\n TimelinePausePlayAction,\n TimelinePausePlayArgs,\n TimelineScale,\n} from \"./imodel-components-react/timeline/interfaces.js\";\nexport { BaseTimelineDataProvider } from \"./imodel-components-react/timeline/BaseTimelineDataProvider.js\";\nexport {\n TimelineComponent,\n TimelineComponentProps,\n TimelineDateMarkerProps,\n TimelineMenuItemOption,\n TimelineMenuItemProps,\n} from \"./imodel-components-react/timeline/TimelineComponent.js\";\nexport { SolarTimeline } from \"./imodel-components-react/timeline/SolarTimeline.js\";\nexport { BaseSolarDataProvider } from \"./imodel-components-react/timeline/BaseSolarDataProvider.js\";\n\nexport {\n ViewStateProp,\n ViewportComponent,\n ViewportProps,\n} from \"./imodel-components-react/viewport/ViewportComponent.js\";\nexport {\n ViewportComponentEvents,\n CubeRotationChangeEvent,\n CubeRotationChangeEventArgs,\n DrawingViewportChangeEvent,\n DrawingViewportChangeEventArgs,\n StandardRotationChangeEvent,\n StandardRotationChangeEventArgs,\n ViewClassFullNameChangedEvent,\n ViewClassFullNameChangedEventArgs,\n ViewIdChangedEvent,\n ViewIdChangedEventArgs,\n ViewRotationChangeEvent,\n ViewRotationChangeEventArgs,\n} from \"./imodel-components-react/viewport/ViewportComponentEvents.js\";\n\nexport { ToolUtilities } from \"./imodel-components-react/ToolUtilities.js\";\n\n// #region \"SideEffects\"\n\nimport { StandardEditorNames, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { PropertyEditorManager } from \"@itwin/components-react\";\nimport { ColorPropertyEditor } from \"./imodel-components-react/editors/ColorEditor.js\";\nimport { WeightPropertyEditor } from \"./imodel-components-react/editors/WeightEditor.js\";\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n ColorPropertyEditor,\n StandardEditorNames.ColorPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n WeightPropertyEditor,\n StandardEditorNames.WeightPicker\n);\n\n// #endregion \"SideEffects\"\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
|
|
1
|
+
{"version":3,"file":"imodel-components-react.js","sourceRoot":"","sources":["../src/imodel-components-react.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,OAAO,EACL,WAAW,GAEZ,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,iBAAiB,GAElB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,SAAS,GAEV,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,qDAAqD,CA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EAAE,MAAM,gEAAgE,CAAC;AAC1G,OAAO,EACL,iBAAiB,GAKlB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAEpG,OAAO,EAEL,iBAAiB,GAElB,MAAM,yDAAyD,CAAC;AACjE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAEvB,0BAA0B,EAE1B,2BAA2B,EAE3B,6BAA6B,EAE7B,kBAAkB,EAElB,uBAAuB,GAExB,MAAM,+DAA+D,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAEhG,wBAAwB;AAExB,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAEzF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,mBAAmB,EACnB,mBAAmB,CAAC,WAAW,CAChC,CAAC;AACF,qBAAqB,CAAC,cAAc,CAClC,iBAAiB,CAAC,MAAM,EACxB,oBAAoB,EACpB,mBAAmB,CAAC,YAAY,CACjC,CAAC;AAEF,2BAA2B;AAE3B;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nexport { UiIModelComponents } from \"./imodel-components-react/UiIModelComponents.js\";\n\nexport {\n AlphaSlider,\n AlphaSliderProps,\n} from \"./imodel-components-react/color/AlphaSlider.js\";\nexport {\n ColorPickerButton,\n ColorPickerProps,\n} from \"./imodel-components-react/color/ColorPickerButton.js\";\nexport {\n ColorPickerDialog,\n ColorPickerDialogProps,\n} from \"./imodel-components-react/color/ColorPickerDialog.js\";\nexport {\n ColorPickerPopup,\n ColorPickerPopupProps,\n} from \"./imodel-components-react/color/ColorPickerPopup.js\";\nexport {\n HueSlider,\n HueSliderProps,\n} from \"./imodel-components-react/color/HueSlider.js\";\nexport {\n SaturationPicker,\n SaturationPickerProps,\n} from \"./imodel-components-react/color/SaturationPicker.js\";\nexport {\n ColorSwatch,\n ColorSwatchProps,\n} from \"./imodel-components-react/color/Swatch.js\";\n\nexport {\n ColorEditor,\n ColorPropertyEditor,\n} from \"./imodel-components-react/editors/ColorEditor.js\";\nexport {\n WeightEditor,\n WeightPropertyEditor,\n} from \"./imodel-components-react/editors/WeightEditor.js\";\nexport { WeightEditorSpec } from \"./imodel-components-react/editors/NewWeightEditor.js\";\n\nexport {\n QuantityInput,\n QuantityProps,\n} from \"./imodel-components-react/inputs/QuantityInput.js\";\nexport {\n QuantityNumberInput,\n QuantityNumberInputProps,\n StepFunctionProp,\n} from \"./imodel-components-react/inputs/QuantityNumberInput.js\";\nexport { QuantityEditorSpec } from \"./imodel-components-react/inputs/new-editors/QuantityEditor.js\";\n\nexport {\n LineWeightSwatch,\n LineWeightSwatchProps,\n} from \"./imodel-components-react/lineweight/Swatch.js\";\nexport {\n WeightPickerButton,\n WeightPickerProps,\n} from \"./imodel-components-react/lineweight/WeightPickerButton.js\";\n\nexport {\n Cube,\n CubeProps,\n Face,\n} from \"./imodel-components-react/navigationaids/Cube.js\";\nexport {\n CubeNavigationAid,\n CubeNavigationAidProps,\n CubeNavigationHitBoxX,\n CubeNavigationHitBoxY,\n CubeNavigationHitBoxZ,\n} from \"./imodel-components-react/navigationaids/CubeNavigationAid.js\";\nexport {\n DrawingNavigationAid,\n DrawingNavigationAidProps,\n} from \"./imodel-components-react/navigationaids/DrawingNavigationAid.js\";\n\nexport {\n FormatPanel,\n FormatPanelProps,\n} from \"./imodel-components-react/quantityformat/FormatPanel.js\";\nexport {\n FormatPrecision,\n FormatPrecisionProps,\n} from \"./imodel-components-react/quantityformat/FormatPrecision.js\";\nexport {\n FormatSample,\n FormatSampleProps,\n} from \"./imodel-components-react/quantityformat/FormatSample.js\";\nexport {\n FormatTypeOption,\n FormatTypeOptionProps,\n} from \"./imodel-components-react/quantityformat/FormatType.js\";\nexport {\n FormatUnitLabel,\n FormatUnitLabelProps,\n} from \"./imodel-components-react/quantityformat/FormatUnitLabel.js\";\nexport {\n FormatUnits,\n FormatUnitsProps,\n} from \"./imodel-components-react/quantityformat/FormatUnits.js\";\nexport {\n MiscFormatOptions,\n MiscFormatOptionsProps,\n} from \"./imodel-components-react/quantityformat/MiscFormatOptions.js\";\nexport {\n QuantityFormatPanel,\n QuantityFormatPanelProps,\n} from \"./imodel-components-react/quantityformat/QuantityFormatPanel.js\";\n\nexport {\n AnimationFractionChangeHandler,\n PlaybackSettings,\n PlaybackSettingsChangeHandler,\n SolarDataProvider,\n SolarPlaybackProgressHandler,\n TimelineDataProvider,\n TimelineDateDisplay,\n TimelinePausePlayAction,\n TimelinePausePlayArgs,\n TimelineScale,\n} from \"./imodel-components-react/timeline/interfaces.js\";\nexport { BaseTimelineDataProvider } from \"./imodel-components-react/timeline/BaseTimelineDataProvider.js\";\nexport {\n TimelineComponent,\n TimelineComponentProps,\n TimelineDateMarkerProps,\n TimelineMenuItemOption,\n TimelineMenuItemProps,\n} from \"./imodel-components-react/timeline/TimelineComponent.js\";\nexport { SolarTimeline } from \"./imodel-components-react/timeline/SolarTimeline.js\";\nexport { BaseSolarDataProvider } from \"./imodel-components-react/timeline/BaseSolarDataProvider.js\";\n\nexport {\n ViewStateProp,\n ViewportComponent,\n ViewportProps,\n} from \"./imodel-components-react/viewport/ViewportComponent.js\";\nexport {\n ViewportComponentEvents,\n CubeRotationChangeEvent,\n CubeRotationChangeEventArgs,\n DrawingViewportChangeEvent,\n DrawingViewportChangeEventArgs,\n StandardRotationChangeEvent,\n StandardRotationChangeEventArgs,\n ViewClassFullNameChangedEvent,\n ViewClassFullNameChangedEventArgs,\n ViewIdChangedEvent,\n ViewIdChangedEventArgs,\n ViewRotationChangeEvent,\n ViewRotationChangeEventArgs,\n} from \"./imodel-components-react/viewport/ViewportComponentEvents.js\";\n\nexport { ToolUtilities } from \"./imodel-components-react/ToolUtilities.js\";\n\nexport { IModelConnectionProvider } from \"./imodel-components-react/IModelConnectionContext.js\";\n\n// #region \"SideEffects\"\n\nimport { StandardEditorNames, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { PropertyEditorManager } from \"@itwin/components-react\";\nimport { ColorPropertyEditor } from \"./imodel-components-react/editors/ColorEditor.js\";\nimport { WeightPropertyEditor } from \"./imodel-components-react/editors/WeightEditor.js\";\n\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n ColorPropertyEditor,\n StandardEditorNames.ColorPicker\n);\nPropertyEditorManager.registerEditor(\n StandardTypeNames.Number,\n WeightPropertyEditor,\n StandardEditorNames.WeightPicker\n);\n\n// #endregion \"SideEffects\"\n\n/** @docs-package-description\n * The imodel-components-react package contains React components that depend on the core-frontend, core-common or core-quantity packages.\n * The components pertain to Color, Cube, LineWeight, Navigation Aids, Quantity Inputs, Timeline and Viewport.\n */\n/**\n * @docs-group-description Color\n * Classes and components for working with and picking a Color.\n */\n/**\n * @docs-group-description Common\n * Common classes used across various UI components.\n */\n/**\n * @docs-group-description Cube\n * Component for 3D Cube.\n */\n/**\n * @docs-group-description Inputs\n * Input Components that format and parse input for IModelApps.\n */\n/**\n * @docs-group-description LineWeight\n * Classes and components for working with and picking a Line Weight.\n */\n/**\n * @docs-group-description NavigationAids\n * Classes and components for working with Navigation Aids.\n */\n/**\n * @docs-group-description PropertyEditors\n * Classes and components for working with Property Editors.\n */\n/**\n * @docs-group-description QuantityFormat\n * Classes and components for working with a Quantity Formats.\n */\n/**\n * @docs-group-description Timeline\n * Classes and components that provide a timeline\n */\n/**\n * @docs-group-description Viewport\n * Classes and components for working with a Viewport.\n */\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.15.0",
|
|
4
4
|
"description": "A react component library of iTwin.js UI iModel components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./lib/imodel-components-react.d.ts",
|
|
@@ -44,21 +44,22 @@
|
|
|
44
44
|
"@itwin/itwinui-react": "^3.15.0",
|
|
45
45
|
"react": "^18.0.0",
|
|
46
46
|
"react-dom": "^18.0.0",
|
|
47
|
-
"@itwin/components-react": "5.
|
|
48
|
-
"@itwin/core-react": "5.
|
|
47
|
+
"@itwin/components-react": "5.15.0",
|
|
48
|
+
"@itwin/core-react": "5.15.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@itwin/appui-abstract": "
|
|
51
|
+
"@itwin/appui-abstract": "^5.1.0",
|
|
52
52
|
"@itwin/build-tools": "4.10.2",
|
|
53
|
-
"@itwin/core-bentley": "
|
|
54
|
-
"@itwin/core-common": "
|
|
55
|
-
"@itwin/core-frontend": "
|
|
56
|
-
"@itwin/core-geometry": "
|
|
57
|
-
"@itwin/core-orbitgt": "
|
|
58
|
-
"@itwin/core-quantity": "
|
|
53
|
+
"@itwin/core-bentley": "^5.1.0",
|
|
54
|
+
"@itwin/core-common": "^5.1.0",
|
|
55
|
+
"@itwin/core-frontend": "^5.1.0",
|
|
56
|
+
"@itwin/core-geometry": "^5.1.0",
|
|
57
|
+
"@itwin/core-orbitgt": "^5.1.0",
|
|
58
|
+
"@itwin/core-quantity": "^5.1.0",
|
|
59
|
+
"@itwin/ecschema-metadata": "^5.1.0",
|
|
59
60
|
"@itwin/eslint-plugin": "5.1.0",
|
|
60
|
-
"@itwin/itwinui-react": "^3.
|
|
61
|
-
"@itwin/webgl-compatibility": "
|
|
61
|
+
"@itwin/itwinui-react": "^3.19.4",
|
|
62
|
+
"@itwin/webgl-compatibility": "^5.1.0",
|
|
62
63
|
"@testing-library/dom": "^10.1.0",
|
|
63
64
|
"@testing-library/react": "^15.0.7",
|
|
64
65
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -84,8 +85,8 @@
|
|
|
84
85
|
"typescript": "~5.6.2",
|
|
85
86
|
"upath": "^2.0.1",
|
|
86
87
|
"vitest": "^3.0.6",
|
|
87
|
-
"@itwin/components-react": "5.
|
|
88
|
-
"@itwin/core-react": "5.
|
|
88
|
+
"@itwin/components-react": "5.15.0",
|
|
89
|
+
"@itwin/core-react": "5.15.0"
|
|
89
90
|
},
|
|
90
91
|
"dependencies": {
|
|
91
92
|
"@itwin/itwinui-icons-react": "^2.8.0",
|