@itwin/core-common 4.10.0-dev.18 → 4.10.0-dev.20
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 +8 -1
- package/lib/cjs/FeatureSymbology.d.ts +36 -5
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +127 -40
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +36 -5
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +127 -40
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @itwin/core-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 09 Oct 2024 20:23:41 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.9.4
|
|
6
|
+
Wed, 09 Oct 2024 20:22:04 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- fix regression related to classid
|
|
4
11
|
|
|
5
12
|
## 4.9.3
|
|
6
13
|
Thu, 03 Oct 2024 19:15:45 GMT
|
|
@@ -15,10 +15,14 @@ import { SubCategoryOverride } from "./SubCategoryOverride";
|
|
|
15
15
|
export interface FeatureAppearanceProps {
|
|
16
16
|
/** See [[FeatureAppearance.rgb]]. */
|
|
17
17
|
rgb?: RgbColorProps;
|
|
18
|
+
/** See [[FeatureAppearance.lineRgb]]. */
|
|
19
|
+
lineRgb?: RgbColorProps | false;
|
|
18
20
|
/** See [[FeatureAppearance.weight]]. */
|
|
19
21
|
weight?: number;
|
|
20
22
|
/** See [[FeatureAppearance.transparency]]. */
|
|
21
23
|
transparency?: number;
|
|
24
|
+
/** See [[FeatureAppearance.lineTransparency]]. */
|
|
25
|
+
lineTransparency?: number | false;
|
|
22
26
|
/** See [[FeatureAppearance.viewDependentTransparency]]. */
|
|
23
27
|
viewDependentTransparency?: true;
|
|
24
28
|
/** See [[FeatureAppearance.linePixels]]. */
|
|
@@ -32,18 +36,39 @@ export interface FeatureAppearanceProps {
|
|
|
32
36
|
}
|
|
33
37
|
/** Defines overrides for selected aspects of a [[Feature]]'s symbology.
|
|
34
38
|
* Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.
|
|
39
|
+
*
|
|
40
|
+
* The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.
|
|
41
|
+
* However, the color and transparency of "linear" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].
|
|
42
|
+
* Linear geometry consists of any of the following:
|
|
43
|
+
* - Curves and line strings;
|
|
44
|
+
* - Points and point strings; and
|
|
45
|
+
* - The outlines of planar regions.
|
|
46
|
+
* The edges of 3d surfaces like spheres are not considered linear geometry.
|
|
47
|
+
*
|
|
35
48
|
* @see [[FeatureOverrides]] to customize the appearance of multiple features.
|
|
36
49
|
* @public
|
|
37
50
|
*/
|
|
38
51
|
export declare class FeatureAppearance {
|
|
39
|
-
/** Overrides the feature's color.
|
|
52
|
+
/** Overrides the feature's color.
|
|
53
|
+
* If [[lineRgb]] is `undefined`, this color also applies to linear geometry.
|
|
54
|
+
*/
|
|
40
55
|
readonly rgb?: RgbColor;
|
|
56
|
+
/** If defined, overrides the color of linear geometry independently of [[rgb]].
|
|
57
|
+
* If `false`, linear geometry draws using its normal color; otherwise, it uses the specified color.
|
|
58
|
+
*/
|
|
59
|
+
readonly lineRgb?: RgbColor | false;
|
|
41
60
|
/** The width of lines and edges in pixels as an integer in [1, 31]. */
|
|
42
61
|
readonly weight?: number;
|
|
43
62
|
/** The transparency in the range [0, 1] where 0 indicates fully opaque and 1 indicates fully transparent.
|
|
63
|
+
* If [[lineTransparency]] is `undefined`, this transparency also applies to linear geometry.
|
|
44
64
|
* @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).
|
|
45
65
|
*/
|
|
46
66
|
readonly transparency?: number;
|
|
67
|
+
/** If defined, overrides the transparency of linear geometry independently of [[transparency]].
|
|
68
|
+
* If `false`, linear geometry draws using its normal transparency; otherwise, it uses the specified transparency.
|
|
69
|
+
* @see [[viewDependentTransparency]] for details on how this override interacts with the [DisplayStyle]($backend).
|
|
70
|
+
*/
|
|
71
|
+
readonly lineTransparency?: number | false;
|
|
47
72
|
/** The pixel pattern applied to lines and edges. */
|
|
48
73
|
readonly linePixels?: LinePixels;
|
|
49
74
|
/** If true, don't apply the [[RenderMaterial]] to the feature's surfaces. */
|
|
@@ -52,9 +77,9 @@ export declare class FeatureAppearance {
|
|
|
52
77
|
readonly nonLocatable?: true;
|
|
53
78
|
/** If true, the feature will be rendered using the [[Hilite.Settings]] defined by [Viewport.emphasisSettings]($frontend) to make it stand out. */
|
|
54
79
|
readonly emphasized?: true;
|
|
55
|
-
/** If true, then [[transparency]] will only be applied if [[ViewFlags.transparency]] is enabled and the current [[RenderMode]] supports transparency.
|
|
80
|
+
/** If true, then [[transparency]] and/or [[lineTransparency]] will only be applied if [[ViewFlags.transparency]] is enabled and the current [[RenderMode]] supports transparency.
|
|
56
81
|
* Default: false, meaning the transparency will be applied regardless of view flags or render mode.
|
|
57
|
-
* This property has no effect if
|
|
82
|
+
* This property has no effect if this appearance does not override transparency.
|
|
58
83
|
*/
|
|
59
84
|
readonly viewDependentTransparency?: true;
|
|
60
85
|
/** An appearance that overrides nothing. */
|
|
@@ -80,6 +105,14 @@ export declare class FeatureAppearance {
|
|
|
80
105
|
get overridesTransparency(): boolean;
|
|
81
106
|
get overridesLinePixels(): boolean;
|
|
82
107
|
get overridesWeight(): boolean;
|
|
108
|
+
/** Get the color that will be applied to linear geometry, or undefined if not overridden.
|
|
109
|
+
* This is the same as [[rgb]] if [[lineRgb]] is `undefined`.
|
|
110
|
+
*/
|
|
111
|
+
getLineRgb(): RgbColor | undefined;
|
|
112
|
+
/** Get the transparency that will be applied to linear geometry, or undefined if not overridden.
|
|
113
|
+
* This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.
|
|
114
|
+
*/
|
|
115
|
+
getLineTransparency(): number | undefined;
|
|
83
116
|
get overridesSymbology(): boolean;
|
|
84
117
|
get overridesNonLocatable(): boolean;
|
|
85
118
|
get isFullyTransparent(): boolean;
|
|
@@ -108,8 +141,6 @@ export declare class FeatureAppearance {
|
|
|
108
141
|
/** Produce a FeatureAppearance from the supplied appearance in which any aspect not defined by the base appearance is overridden by this appearance. */
|
|
109
142
|
extendAppearance(base: FeatureAppearance): FeatureAppearance;
|
|
110
143
|
protected constructor(props: FeatureAppearanceProps);
|
|
111
|
-
private rgbIsEqual;
|
|
112
|
-
private transparencyIsEqual;
|
|
113
144
|
}
|
|
114
145
|
/** Interface adopted by an object that can supply a [[FeatureAppearance]] given a low-level description of a [[Feature]].
|
|
115
146
|
* @see [[FeatureOverrides]] for the commonly-used implementation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSymbology.d.ts","sourceRoot":"","sources":["../../src/FeatureSymbology.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,IAAI,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAc5D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,wCAAwC;IACxC,MA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AAU,EAAE,iBAAiB,KAAK,iBAAiB,GAAG,yBAAyB,CAOhI;IAED;;;OAGG;IACH,SAAgB,KAAK,CAAC,KAAK,EAAE,yBAAyB,EAAE,MAAM,EAAE,yBAAyB,GAAG,yBAAyB,CASpH;CACF"}
|
|
@@ -22,29 +22,107 @@ function copyIdSetToUint32Set(dst, src) {
|
|
|
22
22
|
dst.addId(id);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
function propsMatchDefaults(props) {
|
|
26
|
+
return !props.rgb && !props.lineRgb
|
|
27
|
+
&& undefined === props.weight && undefined === props.linePixels
|
|
28
|
+
&& undefined === props.transparency && undefined === props.lineTransparency
|
|
29
|
+
&& !props.ignoresMaterial && !props.nonLocatable && !props.emphasized;
|
|
30
|
+
}
|
|
31
|
+
function equalRgb(a, b) {
|
|
32
|
+
if (a === b) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
else if (!a || !b) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return a.equals(b);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function equalLineRgb(a, b) {
|
|
43
|
+
if (a === b) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
else if (a instanceof RgbColor_1.RgbColor && b instanceof RgbColor_1.RgbColor) {
|
|
47
|
+
return equalRgb(a, b);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
(0, core_bentley_1.assert)(a === undefined || a === false);
|
|
51
|
+
(0, core_bentley_1.assert)(b === undefined || b === false);
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function equalTransparency(a, b) {
|
|
56
|
+
if (a === b) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
else if (undefined === a || undefined === b) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return Math.floor(a * 0xff) === Math.floor(b * 0xff);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function equalLineTransparency(a, b) {
|
|
67
|
+
if (a === b) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
else if (typeof a === "number" && typeof b === "number") {
|
|
71
|
+
return equalTransparency(a, b);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
(0, core_bentley_1.assert)(a === undefined || a === false);
|
|
75
|
+
(0, core_bentley_1.assert)(b === undefined || b === false);
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function transparencyFromJSON(transp) {
|
|
80
|
+
if (undefined === transp) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
transp = Math.max(0, Math.min(transp, 1));
|
|
84
|
+
// Fix up rounding errors...
|
|
85
|
+
const smallDelta = 0.0001;
|
|
86
|
+
if (1.0 - transp < smallDelta) {
|
|
87
|
+
transp = 1.0;
|
|
88
|
+
}
|
|
89
|
+
else if (transp < smallDelta) {
|
|
90
|
+
transp = 0.0;
|
|
91
|
+
}
|
|
92
|
+
return transp;
|
|
93
|
+
}
|
|
25
94
|
/** Defines overrides for selected aspects of a [[Feature]]'s symbology.
|
|
26
95
|
* Any member defined in the appearance overrides that aspect of symbology for all [[Feature]]s to which the appearance is applied.
|
|
96
|
+
*
|
|
97
|
+
* The [[rgb]] and [[transparency]] overrides, if defined, apply to all geometry by default.
|
|
98
|
+
* However, the color and transparency of "linear" geometry can optionally be controlled independently from the rest of the geometry via [[lineRgb]] and [[lineTransparency]].
|
|
99
|
+
* Linear geometry consists of any of the following:
|
|
100
|
+
* - Curves and line strings;
|
|
101
|
+
* - Points and point strings; and
|
|
102
|
+
* - The outlines of planar regions.
|
|
103
|
+
* The edges of 3d surfaces like spheres are not considered linear geometry.
|
|
104
|
+
*
|
|
27
105
|
* @see [[FeatureOverrides]] to customize the appearance of multiple features.
|
|
28
106
|
* @public
|
|
29
107
|
*/
|
|
30
108
|
class FeatureAppearance {
|
|
31
109
|
static fromJSON(props) {
|
|
32
|
-
if (
|
|
110
|
+
if (!props || propsMatchDefaults(props)) {
|
|
33
111
|
return this.defaults;
|
|
34
|
-
|
|
35
|
-
|
|
112
|
+
}
|
|
113
|
+
return new FeatureAppearance(props);
|
|
36
114
|
}
|
|
37
115
|
/** Create a FeatureAppearance that overrides only the RGB color.
|
|
38
116
|
* @note The transparency component of the ColorDef is ignored.
|
|
39
117
|
*/
|
|
40
118
|
static fromRgb(color) {
|
|
41
|
-
return
|
|
119
|
+
return new FeatureAppearance({ rgb: RgbColor_1.RgbColor.fromColorDef(color) });
|
|
42
120
|
}
|
|
43
121
|
/** Create a FeatureAppearance that overrides the RGB and transparency.
|
|
44
122
|
* The appearance's transparency is derived from the transparency component of the ColorDef.
|
|
45
123
|
*/
|
|
46
124
|
static fromRgba(color, viewDependentTransparency = false) {
|
|
47
|
-
return
|
|
125
|
+
return new FeatureAppearance({
|
|
48
126
|
rgb: RgbColor_1.RgbColor.fromColorDef(color),
|
|
49
127
|
transparency: color.colors.t / 255,
|
|
50
128
|
viewDependentTransparency: viewDependentTransparency ? true : undefined,
|
|
@@ -52,7 +130,7 @@ class FeatureAppearance {
|
|
|
52
130
|
}
|
|
53
131
|
/** Create a FeatureAppearance that overrides only the transparency */
|
|
54
132
|
static fromTransparency(transparencyValue, viewDependent = false) {
|
|
55
|
-
return
|
|
133
|
+
return new FeatureAppearance({
|
|
56
134
|
transparency: transparencyValue,
|
|
57
135
|
viewDependentTransparency: viewDependent ? true : undefined,
|
|
58
136
|
});
|
|
@@ -75,25 +153,44 @@ class FeatureAppearance {
|
|
|
75
153
|
get overridesTransparency() { return undefined !== this.transparency; }
|
|
76
154
|
get overridesLinePixels() { return undefined !== this.linePixels; }
|
|
77
155
|
get overridesWeight() { return undefined !== this.weight; }
|
|
156
|
+
/** Get the color that will be applied to linear geometry, or undefined if not overridden.
|
|
157
|
+
* This is the same as [[rgb]] if [[lineRgb]] is `undefined`.
|
|
158
|
+
*/
|
|
159
|
+
getLineRgb() {
|
|
160
|
+
return false !== this.lineRgb ? (this.lineRgb ?? this.rgb) : undefined;
|
|
161
|
+
}
|
|
162
|
+
/** Get the transparency that will be applied to linear geometry, or undefined if not overridden.
|
|
163
|
+
* This is the same as [[transparency]] if [[lineTransparency]] is `undefined`.
|
|
164
|
+
*/
|
|
165
|
+
getLineTransparency() {
|
|
166
|
+
return false !== this.lineTransparency ? (this.lineTransparency ?? this.transparency) : undefined;
|
|
167
|
+
}
|
|
78
168
|
get overridesSymbology() {
|
|
79
169
|
return this.overridesRgb || this.overridesTransparency || this.overridesWeight || this.overridesLinePixels || !!this.ignoresMaterial
|
|
80
|
-
|| this.emphasized || this.overridesNonLocatable
|
|
170
|
+
|| this.emphasized || this.overridesNonLocatable
|
|
171
|
+
|| undefined !== this.getLineRgb() || undefined !== this.getLineTransparency();
|
|
81
172
|
}
|
|
82
173
|
get overridesNonLocatable() { return undefined !== this.nonLocatable; }
|
|
83
|
-
get isFullyTransparent() {
|
|
174
|
+
get isFullyTransparent() {
|
|
175
|
+
const surf = this.transparency ?? 0;
|
|
176
|
+
const line = this.getLineTransparency() ?? 0;
|
|
177
|
+
return surf >= 1 && line >= 1;
|
|
178
|
+
}
|
|
84
179
|
/** Returns true if any aspect of the appearance is overridden (i.e., if any member is not undefined). */
|
|
85
180
|
get anyOverridden() { return this.overridesSymbology || this.overridesNonLocatable; }
|
|
86
181
|
equals(other) {
|
|
87
182
|
if (this === other)
|
|
88
183
|
return true;
|
|
89
|
-
return this.
|
|
184
|
+
return equalRgb(this.rgb, other.rgb)
|
|
90
185
|
&& this.weight === other.weight
|
|
91
|
-
&& this.
|
|
186
|
+
&& equalTransparency(this.transparency, other.transparency)
|
|
92
187
|
&& this.linePixels === other.linePixels
|
|
93
188
|
&& this.ignoresMaterial === other.ignoresMaterial
|
|
94
189
|
&& this.nonLocatable === other.nonLocatable
|
|
95
190
|
&& this.emphasized === other.emphasized
|
|
96
|
-
&& this.viewDependentTransparency === other.viewDependentTransparency
|
|
191
|
+
&& this.viewDependentTransparency === other.viewDependentTransparency
|
|
192
|
+
&& equalLineTransparency(this.lineTransparency, other.lineTransparency)
|
|
193
|
+
&& equalLineRgb(this.lineRgb, other.lineRgb);
|
|
97
194
|
}
|
|
98
195
|
toJSON() {
|
|
99
196
|
const props = {};
|
|
@@ -114,6 +211,13 @@ class FeatureAppearance {
|
|
|
114
211
|
props.nonLocatable = true;
|
|
115
212
|
if (true === this.emphasized)
|
|
116
213
|
props.emphasized = true;
|
|
214
|
+
if (undefined !== this.lineTransparency)
|
|
215
|
+
props.lineTransparency = this.lineTransparency;
|
|
216
|
+
if (this.lineRgb) {
|
|
217
|
+
props.lineRgb = this.lineRgb;
|
|
218
|
+
if (this.viewDependentTransparency)
|
|
219
|
+
props.viewDependentTransparency = true;
|
|
220
|
+
}
|
|
117
221
|
return props;
|
|
118
222
|
}
|
|
119
223
|
/** Convert this appearance to JSON, and override any properties explicitly specified by `changedProps` in the result.
|
|
@@ -160,47 +264,30 @@ class FeatureAppearance {
|
|
|
160
264
|
props.nonLocatable = true;
|
|
161
265
|
if (undefined === props.emphasized && this.emphasized)
|
|
162
266
|
props.emphasized = true;
|
|
163
|
-
if (
|
|
267
|
+
if (!props.lineRgb)
|
|
268
|
+
props.lineRgb = this.lineRgb;
|
|
269
|
+
if (undefined === props.lineTransparency)
|
|
270
|
+
props.lineTransparency = this.lineTransparency;
|
|
271
|
+
if (this.viewDependentTransparency && (undefined !== props.transparency || undefined !== props.lineTransparency))
|
|
164
272
|
props.viewDependentTransparency = true;
|
|
165
273
|
return FeatureAppearance.fromJSON(props);
|
|
166
274
|
}
|
|
167
275
|
constructor(props) {
|
|
168
276
|
this.rgb = undefined !== props.rgb ? RgbColor_1.RgbColor.fromJSON(props.rgb) : undefined;
|
|
277
|
+
this.lineRgb = typeof props.lineRgb === "object" ? RgbColor_1.RgbColor.fromJSON(props.lineRgb) : (false === props.lineRgb ? false : undefined);
|
|
278
|
+
this.transparency = transparencyFromJSON(props.transparency);
|
|
279
|
+
this.lineTransparency = typeof props.lineTransparency === "number" ? transparencyFromJSON(props.lineTransparency) : (false === props.lineTransparency ? false : undefined);
|
|
169
280
|
this.weight = props.weight;
|
|
170
|
-
this.transparency = props.transparency;
|
|
171
281
|
this.linePixels = props.linePixels;
|
|
172
282
|
this.ignoresMaterial = props.ignoresMaterial;
|
|
173
283
|
this.nonLocatable = props.nonLocatable;
|
|
174
284
|
this.emphasized = props.emphasized;
|
|
175
|
-
if (undefined !== this.weight)
|
|
285
|
+
if (undefined !== this.weight) {
|
|
176
286
|
this.weight = Math.max(1, Math.min(this.weight, 32));
|
|
177
|
-
if (undefined !== this.transparency) {
|
|
178
|
-
if (props.viewDependentTransparency)
|
|
179
|
-
this.viewDependentTransparency = true;
|
|
180
|
-
this.transparency = Math.max(0, Math.min(this.transparency, 1));
|
|
181
|
-
// Fix up rounding errors...
|
|
182
|
-
const smallDelta = 0.0001;
|
|
183
|
-
if (1.0 - this.transparency < smallDelta)
|
|
184
|
-
this.transparency = 1.0;
|
|
185
|
-
else if (this.transparency < smallDelta)
|
|
186
|
-
this.transparency = 0.0;
|
|
187
287
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
return undefined === rgb;
|
|
192
|
-
else if (undefined === rgb)
|
|
193
|
-
return false;
|
|
194
|
-
else
|
|
195
|
-
return this.rgb.equals(rgb);
|
|
196
|
-
}
|
|
197
|
-
transparencyIsEqual(transp) {
|
|
198
|
-
if (undefined === this.transparency)
|
|
199
|
-
return undefined === transp;
|
|
200
|
-
else if (undefined === transp)
|
|
201
|
-
return false;
|
|
202
|
-
else
|
|
203
|
-
return Math.floor(this.transparency * 0xff) === Math.floor(transp * 0xff);
|
|
288
|
+
if (props.viewDependentTransparency && (undefined !== this.transparency || undefined !== this.getLineTransparency())) {
|
|
289
|
+
this.viewDependentTransparency = true;
|
|
290
|
+
}
|
|
204
291
|
}
|
|
205
292
|
}
|
|
206
293
|
exports.FeatureAppearance = FeatureAppearance;
|