@threekit-tools/treble 0.0.30 → 0.0.34

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.
@@ -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;
@@ -1,5 +1,5 @@
1
1
  /*****************************************************
2
- * Dev-Kit Config
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
- * Dev-Kit Config
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
  ****************************************************/
@@ -10,10 +10,10 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
10
10
  }, import("redux").Dispatch<import("redux").AnyAction>>>>;
11
11
  export declare type RootState = ReturnType<typeof store.getState>;
12
12
  export declare type ThreekitDispatch = typeof store.dispatch;
13
- export declare const useThreekitDispatch: () => import("@reduxjs/toolkit").ThunkDispatch<{
13
+ export declare const useThreekitDispatch: () => import("redux").Dispatch<import("redux").AnyAction> & import("@reduxjs/toolkit").ThunkDispatch<{
14
14
  threekit: import("./threekit").ThreekitState;
15
15
  }, null, import("redux").AnyAction> & import("@reduxjs/toolkit").ThunkDispatch<{
16
16
  threekit: import("./threekit").ThreekitState;
17
- }, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
17
+ }, undefined, import("redux").AnyAction>;
18
18
  export declare const useThreekitSelector: TypedUseSelectorHook<RootState>;
19
19
  export default store;
package/dist/utils.js CHANGED
@@ -352,7 +352,7 @@ exports.isUuid = isUuid;
352
352
  var loadTrebleConfig = function () {
353
353
  var config = {};
354
354
  try {
355
- var project = require('@app-root/threekit.config.js').default;
355
+ var project = require("/threekit.config.js").default;
356
356
  if (project)
357
357
  config.project = project;
358
358
  }
@@ -360,7 +360,7 @@ var loadTrebleConfig = function () {
360
360
  console.log(e);
361
361
  }
362
362
  try {
363
- var player = require('@app-root/.treble/player.config.js').default;
363
+ var player = require('/.treble/player.config.js').default;
364
364
  if (player)
365
365
  config.player = player;
366
366
  }
@@ -368,7 +368,7 @@ var loadTrebleConfig = function () {
368
368
  console.log(e);
369
369
  }
370
370
  try {
371
- var treble = require('@app-root/.treble/treble.config.js').default;
371
+ var treble = require('/.treble/treble.config.js').default;
372
372
  if (treble)
373
373
  config.treble = treble;
374
374
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.30",
3
+ "version": "0.0.34",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -32,6 +32,10 @@
32
32
  "reselect": "^4.1.2",
33
33
  "styled-components": "^5.3.3"
34
34
  },
35
+ "peerDependencies": {
36
+ "react": "^17.0.2",
37
+ "react-dom": "^17.0.2"
38
+ },
35
39
  "devDependencies": {
36
40
  "@babel/core": "^7.15.8",
37
41
  "@storybook/addon-actions": "^6.3.12",
@@ -41,18 +45,16 @@
41
45
  "@storybook/addon-storysource": "^6.3.12",
42
46
  "@storybook/react": "^6.3.12",
43
47
  "@types/node": "^16.10.3",
44
- "@types/react": ">=17.0.27",
45
- "@types/react-dom": ">=17.0.9",
48
+ "@types/react": "^17.0.27",
49
+ "@types/react-dom": "^17.0.9",
46
50
  "@types/redux-logger": "^3.0.9",
47
51
  "@types/styled-components": "^5.1.15",
48
52
  "@types/webpack-env": "^1.16.3",
49
53
  "babel-loader": "^8.2.2",
50
- "react": ">=17.0.2",
51
- "react-dom": ">=17.0.2",
52
54
  "rimraf": "^3.0.2",
53
55
  "serve": "^12.0.1",
54
56
  "storybook-addon-styled-component-theme": "^2.0.0",
55
- "typescript": ">=4.4.4"
57
+ "typescript": "^4.4.4"
56
58
  },
57
59
  "gitHead": "2e16bcf98f81e16bb1768072fdb3968122e7966f"
58
60
  }