@threekit-tools/treble 0.0.43 → 0.0.44
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IConfigurationColor, IThreekitDisplayAttribute } from '../../threekit';
|
|
2
|
-
export declare type AttributeValue = string | number | IConfigurationColor;
|
|
2
|
+
export declare type AttributeValue = string | number | boolean | IConfigurationColor;
|
|
3
3
|
declare type UseAttributeError = [undefined, undefined];
|
|
4
4
|
declare type UseAttributeSuccess = [
|
|
5
5
|
IThreekitDisplayAttribute,
|
|
@@ -16,8 +16,6 @@ var useAttribute = function (attributeName) {
|
|
|
16
16
|
var handleChange = function (value) {
|
|
17
17
|
var _a;
|
|
18
18
|
var preppedValue = (0, utils_1.selectionToConfiguration)(value, attribute.type);
|
|
19
|
-
if (!preppedValue)
|
|
20
|
-
return;
|
|
21
19
|
dispatch((0, threekit_1.setConfiguration)((_a = {},
|
|
22
20
|
_a[attributeName] = preppedValue,
|
|
23
21
|
_a)));
|
package/dist/utils.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ export declare const metadataValueToObject: (data: string) => Record<string, str
|
|
|
53
53
|
*/
|
|
54
54
|
export declare const createThreekitScriptEl: (threekitDomain: string) => Promise<void>;
|
|
55
55
|
export declare const translateAttribute: (attributes: Array<IThreekitDisplayAttribute>, translations?: ITranslationMap | undefined, language?: string | undefined) => IThreekitDisplayAttribute;
|
|
56
|
-
export declare const selectionToConfiguration: (value: string | number | IConfigurationColor, attributeType: string) => string | number | IConfigurationColor | {
|
|
57
|
-
assetId: string | number | IConfigurationColor;
|
|
58
|
-
}
|
|
56
|
+
export declare const selectionToConfiguration: (value: string | number | boolean | IConfigurationColor, attributeType: string) => string | number | boolean | IConfigurationColor | {
|
|
57
|
+
assetId: string | number | boolean | IConfigurationColor;
|
|
58
|
+
};
|
|
59
59
|
export declare const filterFormAttributes: (attributes: Record<string, IThreekitDisplayAttribute>, attributeComponentProps: IAttributesComponentProps, includeReservedAttributes: boolean) => IThreekitDisplayAttribute[];
|
|
60
60
|
export declare const isUuid: (str?: string | undefined) => boolean;
|
|
61
61
|
export declare const loadTrebleConfig: () => Partial<ITrebleConfig>;
|
package/dist/utils.js
CHANGED
|
@@ -306,8 +306,6 @@ var translateAttribute = function (attributes, translations, language) {
|
|
|
306
306
|
};
|
|
307
307
|
exports.translateAttribute = translateAttribute;
|
|
308
308
|
var selectionToConfiguration = function (value, attributeType) {
|
|
309
|
-
if (!value)
|
|
310
|
-
return undefined;
|
|
311
309
|
switch (attributeType) {
|
|
312
310
|
case constants_1.ATTRIBUTE_TYPES.number:
|
|
313
311
|
case constants_1.ATTRIBUTE_TYPES.string:
|