@itwin/imodel-components-react 4.11.0 → 4.12.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 +6 -1
- package/lib/cjs/imodel-components-react/UiIModelComponents.json +150 -0
- package/lib/cjs/imodel-components-react/useTranslation.d.ts +4 -7
- package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +1 -1
- package/lib/cjs/imodel-components-react/useTranslation.js +39 -7
- package/lib/cjs/imodel-components-react/useTranslation.js.map +1 -1
- package/lib/esm/imodel-components-react/UiIModelComponents.json +150 -0
- package/lib/esm/imodel-components-react/useTranslation.d.ts +4 -7
- package/lib/esm/imodel-components-react/useTranslation.d.ts.map +1 -1
- package/lib/esm/imodel-components-react/useTranslation.js +14 -5
- package/lib/esm/imodel-components-react/useTranslation.js.map +1 -1
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/imodel-components-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 05 Apr 2024 09:55:35 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.12.0
|
|
6
|
+
Fri, 05 Apr 2024 09:55:35 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 4.11.0
|
|
6
11
|
Thu, 21 Mar 2024 16:38:04 GMT
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timeline": {
|
|
3
|
+
"expand": "Expand",
|
|
4
|
+
"minimize": "Minimize",
|
|
5
|
+
"repeat": "Repeat",
|
|
6
|
+
"slow": "Speed: slow",
|
|
7
|
+
"medium": "Speed: medium",
|
|
8
|
+
"fast": "Speed: fast",
|
|
9
|
+
"play": "Play",
|
|
10
|
+
"pause": "Pause",
|
|
11
|
+
"backward": "Backward",
|
|
12
|
+
"forward": "Forward",
|
|
13
|
+
"step": "Step"
|
|
14
|
+
},
|
|
15
|
+
"solartimeline": {
|
|
16
|
+
"settings": "Settings",
|
|
17
|
+
"speed": "Speed",
|
|
18
|
+
"dateTime": "Date & time"
|
|
19
|
+
},
|
|
20
|
+
"solarsettings": {
|
|
21
|
+
"shadowcolor": "Shadow color"
|
|
22
|
+
},
|
|
23
|
+
"errors": {
|
|
24
|
+
"unable-to-parse-quantity": "Unable to parse string into quantity"
|
|
25
|
+
},
|
|
26
|
+
"cube": {
|
|
27
|
+
"front": "Front",
|
|
28
|
+
"back": "Back",
|
|
29
|
+
"top": "Top",
|
|
30
|
+
"bottom": "Bottom",
|
|
31
|
+
"left": "Left",
|
|
32
|
+
"right": "Right"
|
|
33
|
+
},
|
|
34
|
+
"drawing": {
|
|
35
|
+
"unrotate": "Un-Rotate",
|
|
36
|
+
"rotateStyle": "Toggle background-rotate"
|
|
37
|
+
},
|
|
38
|
+
"color": {
|
|
39
|
+
"close": "Close",
|
|
40
|
+
"hue": "Hue",
|
|
41
|
+
"saturation": "Saturation",
|
|
42
|
+
"toggleColorPopup": "Toggle Color Picker Popup",
|
|
43
|
+
"transparency": "Transparency"
|
|
44
|
+
},
|
|
45
|
+
"QuantityInput": {
|
|
46
|
+
"ParseError": "Parse Error, status=",
|
|
47
|
+
"NoParserDefined": "No Parser Defined!"
|
|
48
|
+
},
|
|
49
|
+
"QuantityFormat": {
|
|
50
|
+
"none": "None",
|
|
51
|
+
"dash": "Dash",
|
|
52
|
+
"space": "Space",
|
|
53
|
+
"decimal": "Decimal",
|
|
54
|
+
"scientific": "Scientific",
|
|
55
|
+
"station": "Station",
|
|
56
|
+
"fractional": "Fractional",
|
|
57
|
+
"labels": {
|
|
58
|
+
"compositeSpacer": "Composite Spacer",
|
|
59
|
+
"formatted": "Formatted",
|
|
60
|
+
"precision": "Precision",
|
|
61
|
+
"type": "Type",
|
|
62
|
+
"appendUnitLabel": "Append Unit Label",
|
|
63
|
+
"labelSeparator": "Label Separator",
|
|
64
|
+
"signOptionLabel": "Sign Option",
|
|
65
|
+
"stationOffsetLabel": "Station Offset",
|
|
66
|
+
"stationSeparatorLabel": "Station Separator",
|
|
67
|
+
"decimalSeparatorLabel": "Decimal Separator",
|
|
68
|
+
"showTrailZerosLabel": "Show Trail Zeros",
|
|
69
|
+
"keepSingleZeroLabel": "Keep Single Zero",
|
|
70
|
+
"zeroEmptyLabel": "Zero Empty",
|
|
71
|
+
"moreLabel": "More",
|
|
72
|
+
"lessLabel": "Less",
|
|
73
|
+
"keepDecimalPointLabel": "Keep Decimal Point",
|
|
74
|
+
"fractionDashLabel": "Fraction Dash",
|
|
75
|
+
"scientificTypeLabel": "Scientific Type",
|
|
76
|
+
"useThousandSeparatorLabel": "Use Thousand Separator",
|
|
77
|
+
"thousandSeparatorLabel": "Thousand Separator",
|
|
78
|
+
"value": "Value"
|
|
79
|
+
},
|
|
80
|
+
"fraction_precision": {
|
|
81
|
+
"whole": "Whole",
|
|
82
|
+
"half": "1/2",
|
|
83
|
+
"quarter": "1/4",
|
|
84
|
+
"eighth": "1/8",
|
|
85
|
+
"sixteenth": "1/16",
|
|
86
|
+
"over32": "1/32",
|
|
87
|
+
"over64": "1/64",
|
|
88
|
+
"over128": "1/128",
|
|
89
|
+
"over256": "1/256"
|
|
90
|
+
},
|
|
91
|
+
"station_size": {
|
|
92
|
+
"two": "0+00",
|
|
93
|
+
"three": "0+000"
|
|
94
|
+
},
|
|
95
|
+
"station_separator": {
|
|
96
|
+
"plus": "+",
|
|
97
|
+
"minus": "-",
|
|
98
|
+
"blank": "Blank",
|
|
99
|
+
"caret": "^"
|
|
100
|
+
},
|
|
101
|
+
"decimal_precision": {
|
|
102
|
+
"zero": "1",
|
|
103
|
+
"one": "0.1",
|
|
104
|
+
"two": "0.01",
|
|
105
|
+
"three": "0.001",
|
|
106
|
+
"four": "0.0001",
|
|
107
|
+
"five": "0.00001",
|
|
108
|
+
"six": "0.0000001",
|
|
109
|
+
"seven": "0.0000001",
|
|
110
|
+
"eight": "0.00000001",
|
|
111
|
+
"nine": "0.000000001",
|
|
112
|
+
"ten": "0.0000000001",
|
|
113
|
+
"eleven": "0.00000000001",
|
|
114
|
+
"twelve": "0.000000000001"
|
|
115
|
+
},
|
|
116
|
+
"sign_option": {
|
|
117
|
+
"noSign": "No Sign",
|
|
118
|
+
"onlyNegative": "Only Negative",
|
|
119
|
+
"signAlways": "Always",
|
|
120
|
+
"negativeParentheses": "Negative Parentheses"
|
|
121
|
+
},
|
|
122
|
+
"thousand_separator": {
|
|
123
|
+
"comma": "Comma",
|
|
124
|
+
"point": "Point"
|
|
125
|
+
},
|
|
126
|
+
"decimal_separator": {
|
|
127
|
+
"comma": "Comma",
|
|
128
|
+
"point": "Point"
|
|
129
|
+
},
|
|
130
|
+
"scientific-type": {
|
|
131
|
+
"normalized": "Normalized",
|
|
132
|
+
"zero-normalized": "Zero Normalized"
|
|
133
|
+
},
|
|
134
|
+
"popupButton": {
|
|
135
|
+
"setFormat": "Set Format"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"BearingQuantityType": {
|
|
139
|
+
"label": "Bearing",
|
|
140
|
+
"description": "Bearing",
|
|
141
|
+
"bearingGap": {
|
|
142
|
+
"label": "Add Direction Gap"
|
|
143
|
+
},
|
|
144
|
+
"bearingAngleDirection": {
|
|
145
|
+
"label": "Angle Direction",
|
|
146
|
+
"clockwise": "Clockwise",
|
|
147
|
+
"counter-clockwise": "Counter-Clockwise"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
translate: (key: string) => string;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Returns a translation function.
|
|
1
|
+
/** Returns a translation function.
|
|
6
2
|
* @internal
|
|
7
3
|
*/
|
|
8
|
-
export declare function useTranslation():
|
|
9
|
-
|
|
4
|
+
export declare function useTranslation(): {
|
|
5
|
+
translate: (key: string) => string;
|
|
6
|
+
};
|
|
10
7
|
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,cAAc;;EAY7B"}
|
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useTranslation = void 0;
|
|
2
27
|
/*---------------------------------------------------------------------------------------------
|
|
3
28
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
29
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
30
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
|
|
7
|
-
|
|
31
|
+
const defaults = __importStar(require("./UiIModelComponents.json"));
|
|
32
|
+
const React = __importStar(require("react"));
|
|
33
|
+
const core_react_1 = require("@itwin/core-react");
|
|
8
34
|
const UiIModelComponents_1 = require("./UiIModelComponents");
|
|
9
|
-
/**
|
|
10
|
-
* Returns a translation function.
|
|
35
|
+
/** Returns a translation function.
|
|
11
36
|
* @internal
|
|
12
37
|
*/
|
|
13
38
|
function useTranslation() {
|
|
14
|
-
const
|
|
39
|
+
const fallback = React.useCallback((key) => {
|
|
40
|
+
if (!UiIModelComponents_1.UiIModelComponents.initialized) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
15
43
|
return UiIModelComponents_1.UiIModelComponents.translate(key);
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
44
|
+
}, []);
|
|
45
|
+
return (0, core_react_1.usePackageTranslation)({
|
|
46
|
+
namespace: UiIModelComponents_1.UiIModelComponents.localizationNamespace,
|
|
47
|
+
fallback,
|
|
48
|
+
defaults,
|
|
49
|
+
});
|
|
18
50
|
}
|
|
19
51
|
exports.useTranslation = useTranslation;
|
|
20
52
|
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG,oEAAsD;AACtD,6CAA+B;AAC/B,kDAA0D;AAC1D,6DAA0D;AAE1D;;GAEG;AACH,SAAgB,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,uCAAkB,CAAC,WAAW,EAAE;YACnC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,uCAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,IAAA,kCAAqB,EAAC;QAC3B,SAAS,EAAE,uCAAkB,CAAC,qBAAqB;QACnD,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAZD,wCAYC","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 defaults from \"./UiIModelComponents.json\";\nimport * as React from \"react\";\nimport { usePackageTranslation } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"./UiIModelComponents\";\n\n/** Returns a translation function.\n * @internal\n */\nexport function useTranslation() {\n const fallback = React.useCallback((key: string) => {\n if (!UiIModelComponents.initialized) {\n return undefined;\n }\n return UiIModelComponents.translate(key);\n }, []);\n return usePackageTranslation({\n namespace: UiIModelComponents.localizationNamespace,\n fallback,\n defaults,\n });\n}\n"]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"timeline": {
|
|
3
|
+
"expand": "Expand",
|
|
4
|
+
"minimize": "Minimize",
|
|
5
|
+
"repeat": "Repeat",
|
|
6
|
+
"slow": "Speed: slow",
|
|
7
|
+
"medium": "Speed: medium",
|
|
8
|
+
"fast": "Speed: fast",
|
|
9
|
+
"play": "Play",
|
|
10
|
+
"pause": "Pause",
|
|
11
|
+
"backward": "Backward",
|
|
12
|
+
"forward": "Forward",
|
|
13
|
+
"step": "Step"
|
|
14
|
+
},
|
|
15
|
+
"solartimeline": {
|
|
16
|
+
"settings": "Settings",
|
|
17
|
+
"speed": "Speed",
|
|
18
|
+
"dateTime": "Date & time"
|
|
19
|
+
},
|
|
20
|
+
"solarsettings": {
|
|
21
|
+
"shadowcolor": "Shadow color"
|
|
22
|
+
},
|
|
23
|
+
"errors": {
|
|
24
|
+
"unable-to-parse-quantity": "Unable to parse string into quantity"
|
|
25
|
+
},
|
|
26
|
+
"cube": {
|
|
27
|
+
"front": "Front",
|
|
28
|
+
"back": "Back",
|
|
29
|
+
"top": "Top",
|
|
30
|
+
"bottom": "Bottom",
|
|
31
|
+
"left": "Left",
|
|
32
|
+
"right": "Right"
|
|
33
|
+
},
|
|
34
|
+
"drawing": {
|
|
35
|
+
"unrotate": "Un-Rotate",
|
|
36
|
+
"rotateStyle": "Toggle background-rotate"
|
|
37
|
+
},
|
|
38
|
+
"color": {
|
|
39
|
+
"close": "Close",
|
|
40
|
+
"hue": "Hue",
|
|
41
|
+
"saturation": "Saturation",
|
|
42
|
+
"toggleColorPopup": "Toggle Color Picker Popup",
|
|
43
|
+
"transparency": "Transparency"
|
|
44
|
+
},
|
|
45
|
+
"QuantityInput": {
|
|
46
|
+
"ParseError": "Parse Error, status=",
|
|
47
|
+
"NoParserDefined": "No Parser Defined!"
|
|
48
|
+
},
|
|
49
|
+
"QuantityFormat": {
|
|
50
|
+
"none": "None",
|
|
51
|
+
"dash": "Dash",
|
|
52
|
+
"space": "Space",
|
|
53
|
+
"decimal": "Decimal",
|
|
54
|
+
"scientific": "Scientific",
|
|
55
|
+
"station": "Station",
|
|
56
|
+
"fractional": "Fractional",
|
|
57
|
+
"labels": {
|
|
58
|
+
"compositeSpacer": "Composite Spacer",
|
|
59
|
+
"formatted": "Formatted",
|
|
60
|
+
"precision": "Precision",
|
|
61
|
+
"type": "Type",
|
|
62
|
+
"appendUnitLabel": "Append Unit Label",
|
|
63
|
+
"labelSeparator": "Label Separator",
|
|
64
|
+
"signOptionLabel": "Sign Option",
|
|
65
|
+
"stationOffsetLabel": "Station Offset",
|
|
66
|
+
"stationSeparatorLabel": "Station Separator",
|
|
67
|
+
"decimalSeparatorLabel": "Decimal Separator",
|
|
68
|
+
"showTrailZerosLabel": "Show Trail Zeros",
|
|
69
|
+
"keepSingleZeroLabel": "Keep Single Zero",
|
|
70
|
+
"zeroEmptyLabel": "Zero Empty",
|
|
71
|
+
"moreLabel": "More",
|
|
72
|
+
"lessLabel": "Less",
|
|
73
|
+
"keepDecimalPointLabel": "Keep Decimal Point",
|
|
74
|
+
"fractionDashLabel": "Fraction Dash",
|
|
75
|
+
"scientificTypeLabel": "Scientific Type",
|
|
76
|
+
"useThousandSeparatorLabel": "Use Thousand Separator",
|
|
77
|
+
"thousandSeparatorLabel": "Thousand Separator",
|
|
78
|
+
"value": "Value"
|
|
79
|
+
},
|
|
80
|
+
"fraction_precision": {
|
|
81
|
+
"whole": "Whole",
|
|
82
|
+
"half": "1/2",
|
|
83
|
+
"quarter": "1/4",
|
|
84
|
+
"eighth": "1/8",
|
|
85
|
+
"sixteenth": "1/16",
|
|
86
|
+
"over32": "1/32",
|
|
87
|
+
"over64": "1/64",
|
|
88
|
+
"over128": "1/128",
|
|
89
|
+
"over256": "1/256"
|
|
90
|
+
},
|
|
91
|
+
"station_size": {
|
|
92
|
+
"two": "0+00",
|
|
93
|
+
"three": "0+000"
|
|
94
|
+
},
|
|
95
|
+
"station_separator": {
|
|
96
|
+
"plus": "+",
|
|
97
|
+
"minus": "-",
|
|
98
|
+
"blank": "Blank",
|
|
99
|
+
"caret": "^"
|
|
100
|
+
},
|
|
101
|
+
"decimal_precision": {
|
|
102
|
+
"zero": "1",
|
|
103
|
+
"one": "0.1",
|
|
104
|
+
"two": "0.01",
|
|
105
|
+
"three": "0.001",
|
|
106
|
+
"four": "0.0001",
|
|
107
|
+
"five": "0.00001",
|
|
108
|
+
"six": "0.0000001",
|
|
109
|
+
"seven": "0.0000001",
|
|
110
|
+
"eight": "0.00000001",
|
|
111
|
+
"nine": "0.000000001",
|
|
112
|
+
"ten": "0.0000000001",
|
|
113
|
+
"eleven": "0.00000000001",
|
|
114
|
+
"twelve": "0.000000000001"
|
|
115
|
+
},
|
|
116
|
+
"sign_option": {
|
|
117
|
+
"noSign": "No Sign",
|
|
118
|
+
"onlyNegative": "Only Negative",
|
|
119
|
+
"signAlways": "Always",
|
|
120
|
+
"negativeParentheses": "Negative Parentheses"
|
|
121
|
+
},
|
|
122
|
+
"thousand_separator": {
|
|
123
|
+
"comma": "Comma",
|
|
124
|
+
"point": "Point"
|
|
125
|
+
},
|
|
126
|
+
"decimal_separator": {
|
|
127
|
+
"comma": "Comma",
|
|
128
|
+
"point": "Point"
|
|
129
|
+
},
|
|
130
|
+
"scientific-type": {
|
|
131
|
+
"normalized": "Normalized",
|
|
132
|
+
"zero-normalized": "Zero Normalized"
|
|
133
|
+
},
|
|
134
|
+
"popupButton": {
|
|
135
|
+
"setFormat": "Set Format"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"BearingQuantityType": {
|
|
139
|
+
"label": "Bearing",
|
|
140
|
+
"description": "Bearing",
|
|
141
|
+
"bearingGap": {
|
|
142
|
+
"label": "Add Direction Gap"
|
|
143
|
+
},
|
|
144
|
+
"bearingAngleDirection": {
|
|
145
|
+
"label": "Angle Direction",
|
|
146
|
+
"clockwise": "Clockwise",
|
|
147
|
+
"counter-clockwise": "Counter-Clockwise"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
translate: (key: string) => string;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Returns a translation function.
|
|
1
|
+
/** Returns a translation function.
|
|
6
2
|
* @internal
|
|
7
3
|
*/
|
|
8
|
-
export declare function useTranslation():
|
|
9
|
-
|
|
4
|
+
export declare function useTranslation(): {
|
|
5
|
+
translate: (key: string) => string;
|
|
6
|
+
};
|
|
10
7
|
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,cAAc;;EAY7B"}
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as defaults from "./UiIModelComponents.json";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { usePackageTranslation } from "@itwin/core-react";
|
|
5
8
|
import { UiIModelComponents } from "./UiIModelComponents";
|
|
6
|
-
/**
|
|
7
|
-
* Returns a translation function.
|
|
9
|
+
/** Returns a translation function.
|
|
8
10
|
* @internal
|
|
9
11
|
*/
|
|
10
12
|
export function useTranslation() {
|
|
11
|
-
const
|
|
13
|
+
const fallback = React.useCallback((key) => {
|
|
14
|
+
if (!UiIModelComponents.initialized) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
12
17
|
return UiIModelComponents.translate(key);
|
|
13
|
-
};
|
|
14
|
-
return {
|
|
18
|
+
}, []);
|
|
19
|
+
return usePackageTranslation({
|
|
20
|
+
namespace: UiIModelComponents.localizationNamespace,
|
|
21
|
+
fallback,
|
|
22
|
+
defaults,
|
|
23
|
+
});
|
|
15
24
|
}
|
|
16
25
|
//# sourceMappingURL=useTranslation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.
|
|
1
|
+
{"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE;YACnC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,qBAAqB,CAAC;QAC3B,SAAS,EAAE,kBAAkB,CAAC,qBAAqB;QACnD,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,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 defaults from \"./UiIModelComponents.json\";\nimport * as React from \"react\";\nimport { usePackageTranslation } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"./UiIModelComponents\";\n\n/** Returns a translation function.\n * @internal\n */\nexport function useTranslation() {\n const fallback = React.useCallback((key: string) => {\n if (!UiIModelComponents.initialized) {\n return undefined;\n }\n return UiIModelComponents.translate(key);\n }, []);\n return usePackageTranslation({\n namespace: UiIModelComponents.localizationNamespace,\n fallback,\n defaults,\n });\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/imodel-components-react",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "iTwin.js UI IModel Components",
|
|
5
5
|
"main": "lib/cjs/imodel-components-react.js",
|
|
6
6
|
"module": "lib/esm/imodel-components-react.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@itwin/appui-abstract": "^3.7.0 || ^4.0.0",
|
|
26
|
-
"@itwin/components-react": "^4.
|
|
26
|
+
"@itwin/components-react": "^4.12.0",
|
|
27
27
|
"@itwin/core-bentley": "^3.7.0 || ^4.0.0",
|
|
28
28
|
"@itwin/core-common": "^3.7.0 || ^4.0.0",
|
|
29
29
|
"@itwin/core-frontend": "^3.7.0 || ^4.0.0",
|
|
30
30
|
"@itwin/core-geometry": "^3.7.0 || ^4.0.0",
|
|
31
31
|
"@itwin/core-quantity": "^3.7.0 || ^4.0.0",
|
|
32
|
-
"@itwin/core-react": "^4.
|
|
32
|
+
"@itwin/core-react": "^4.12.0",
|
|
33
33
|
"react": "^17.0.0 || ^18.0.0",
|
|
34
34
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
35
35
|
},
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"typemoq": "^2.1.0",
|
|
86
86
|
"typescript": "~5.0.2",
|
|
87
87
|
"upath": "^2.0.1",
|
|
88
|
-
"@itwin/components-react": "4.
|
|
89
|
-
"@itwin/core-react": "4.
|
|
88
|
+
"@itwin/components-react": "4.12.0",
|
|
89
|
+
"@itwin/core-react": "4.12.0"
|
|
90
90
|
},
|
|
91
91
|
"//dependencies": [
|
|
92
92
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|
|
@@ -121,8 +121,7 @@
|
|
|
121
121
|
"build:esm": "npm run -s copy:esm && tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
122
122
|
"copy:cjs": "cpx \"./src/**/*.*css\" ./lib/cjs",
|
|
123
123
|
"copy:esm": "cpx \"./src/**/*.*css\" ./lib/esm",
|
|
124
|
-
"copy:locale": "cpx
|
|
125
|
-
"pseudolocalize": "betools pseudolocalize --englishDir ./public/locales/en --out ./public/locales/en-PSEUDO",
|
|
124
|
+
"copy:locale": "cpx ./src/imodel-components-react/UiIModelComponents.json ./lib/public/locales/en",
|
|
126
125
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
127
126
|
"cover": "nyc npm -s test",
|
|
128
127
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|