@threekit-tools/treble 0.0.32 → 0.0.35
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/dist/components/TrebleApp/index.js +4 -2
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +4 -2
- package/dist/utils.js +22 -24
- package/package.json +1 -1
|
@@ -32,9 +32,11 @@ var productToComponentMap = {};
|
|
|
32
32
|
function TrebleApp(props) {
|
|
33
33
|
var _a;
|
|
34
34
|
var project = props.project, productId = props.productId, playerConfig = props.playerConfig, threekitEnv = props.threekitEnv, locale = props.locale, theme = props.theme;
|
|
35
|
-
var config = (0, utils_1.loadTrebleConfig)();
|
|
36
|
-
if (!((_a = config.treble) === null || _a === void 0 ? void 0 : _a.productsCtx))
|
|
35
|
+
var config = constants_1.IS_TREBLE_SCRIPTS ? (0, utils_1.loadTrebleConfig)() : {};
|
|
36
|
+
if (!((_a = config.treble) === null || _a === void 0 ? void 0 : _a.productsCtx)) {
|
|
37
|
+
console.error('Treble Config is not setup correctly');
|
|
37
38
|
return null;
|
|
39
|
+
}
|
|
38
40
|
if (!productComponents.length) {
|
|
39
41
|
config.treble.productsCtx.keys().forEach(function (fileName) {
|
|
40
42
|
var _a;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*****************************************************
|
|
2
|
-
*
|
|
2
|
+
* Treble Config
|
|
3
3
|
****************************************************/
|
|
4
4
|
export declare const DEFAULT_CLASS_NAME = "threekit-react";
|
|
5
5
|
export declare const CLASS_NAME_PREFIX = "tk";
|
|
@@ -9,6 +9,7 @@ export declare const LAYOUT_CLASS_NAME: string;
|
|
|
9
9
|
export declare const TOOL_CLASS_NAME: string;
|
|
10
10
|
export declare const DISPLAY_CLASS_NAME: string;
|
|
11
11
|
export declare const FORM_CLASS_NAME: string;
|
|
12
|
+
export declare const IS_TREBLE_SCRIPTS: boolean;
|
|
12
13
|
/*****************************************************
|
|
13
14
|
* Treble Products Workflow
|
|
14
15
|
****************************************************/
|
package/dist/constants.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*****************************************************
|
|
3
|
-
*
|
|
3
|
+
* Treble Config
|
|
4
4
|
****************************************************/
|
|
5
|
+
var _a;
|
|
5
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WISHLIST_LOCALSTORAGE_KEY = exports.SNAPSHOT_OUTPUTS = exports.SNAPSHOT_FORMATS = exports.METADATA_RESERVED = exports.ATTRIBUTES_RESERVED = exports.SORT_OPTIONS = exports.ATTRIBUTE_TYPES = exports.DEFAULT_PLAYER_CONFIG = exports.TK_PLAYER_ROOT_DIV = exports.TK_SAVED_CONFIG_PARAM_KEY = exports.TK_PRODUCT_ID_PARAM_KEY = exports.FORM_CLASS_NAME = exports.DISPLAY_CLASS_NAME = exports.TOOL_CLASS_NAME = exports.LAYOUT_CLASS_NAME = exports.WIDGET_CLASS_NAME = exports.INPUT_COMPONENT_CLASS_NAME = exports.CLASS_NAME_PREFIX = exports.DEFAULT_CLASS_NAME = void 0;
|
|
7
|
+
exports.WISHLIST_LOCALSTORAGE_KEY = exports.SNAPSHOT_OUTPUTS = exports.SNAPSHOT_FORMATS = exports.METADATA_RESERVED = exports.ATTRIBUTES_RESERVED = exports.SORT_OPTIONS = exports.ATTRIBUTE_TYPES = exports.DEFAULT_PLAYER_CONFIG = exports.TK_PLAYER_ROOT_DIV = exports.TK_SAVED_CONFIG_PARAM_KEY = exports.TK_PRODUCT_ID_PARAM_KEY = exports.IS_TREBLE_SCRIPTS = exports.FORM_CLASS_NAME = exports.DISPLAY_CLASS_NAME = exports.TOOL_CLASS_NAME = exports.LAYOUT_CLASS_NAME = exports.WIDGET_CLASS_NAME = exports.INPUT_COMPONENT_CLASS_NAME = exports.CLASS_NAME_PREFIX = exports.DEFAULT_CLASS_NAME = void 0;
|
|
7
8
|
exports.DEFAULT_CLASS_NAME = 'threekit-react';
|
|
8
9
|
exports.CLASS_NAME_PREFIX = 'tk';
|
|
9
10
|
exports.INPUT_COMPONENT_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-input");
|
|
@@ -12,6 +13,7 @@ exports.LAYOUT_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(ex
|
|
|
12
13
|
exports.TOOL_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-tool");
|
|
13
14
|
exports.DISPLAY_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-display");
|
|
14
15
|
exports.FORM_CLASS_NAME = "".concat(exports.DEFAULT_CLASS_NAME, " ").concat(exports.CLASS_NAME_PREFIX, "-form");
|
|
16
|
+
exports.IS_TREBLE_SCRIPTS = ((_a = process.env.TREBLE_SCRIPTS) === null || _a === void 0 ? void 0 : _a.toString()) === 'true';
|
|
15
17
|
/*****************************************************
|
|
16
18
|
* Treble Products Workflow
|
|
17
19
|
****************************************************/
|
package/dist/utils.js
CHANGED
|
@@ -351,30 +351,28 @@ var isUuid = function (str) {
|
|
|
351
351
|
exports.isUuid = isUuid;
|
|
352
352
|
var loadTrebleConfig = function () {
|
|
353
353
|
var config = {};
|
|
354
|
-
try {
|
|
355
|
-
var project = require('@app-root/threekit.config.js').default;
|
|
356
|
-
if (project)
|
|
357
|
-
config.project = project;
|
|
358
|
-
}
|
|
359
|
-
catch (e) {
|
|
360
|
-
console.log(e);
|
|
361
|
-
}
|
|
362
|
-
try {
|
|
363
|
-
var player = require('@app-root/.treble/player.config.js').default;
|
|
364
|
-
if (player)
|
|
365
|
-
config.player = player;
|
|
366
|
-
}
|
|
367
|
-
catch (e) {
|
|
368
|
-
console.log(e);
|
|
369
|
-
}
|
|
370
|
-
try {
|
|
371
|
-
var treble = require('@app-root/.treble/treble.config.js').default;
|
|
372
|
-
if (treble)
|
|
373
|
-
config.treble = treble;
|
|
374
|
-
}
|
|
375
|
-
catch (e) {
|
|
376
|
-
console.log(e);
|
|
377
|
-
}
|
|
378
354
|
return config;
|
|
379
355
|
};
|
|
380
356
|
exports.loadTrebleConfig = loadTrebleConfig;
|
|
357
|
+
// export const loadTrebleConfig = () => {
|
|
358
|
+
// let config: Partial<ITrebleConfig> = {};
|
|
359
|
+
// try {
|
|
360
|
+
// const project = require(`/threekit.config.js`).default;
|
|
361
|
+
// if (project) config.project = project;
|
|
362
|
+
// } catch (e) {
|
|
363
|
+
// console.log(e);
|
|
364
|
+
// }
|
|
365
|
+
// try {
|
|
366
|
+
// const player = require('/.treble/player.config.js').default;
|
|
367
|
+
// if (player) config.player = player;
|
|
368
|
+
// } catch (e) {
|
|
369
|
+
// console.log(e);
|
|
370
|
+
// }
|
|
371
|
+
// try {
|
|
372
|
+
// const treble = require('/.treble/treble.config.js').default;
|
|
373
|
+
// if (treble) config.treble = treble;
|
|
374
|
+
// } catch (e) {
|
|
375
|
+
// console.log(e);
|
|
376
|
+
// }
|
|
377
|
+
// return config;
|
|
378
|
+
// };
|