@threekit-tools/treble 0.0.10-alpha.14 → 0.0.13

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.
Files changed (42) hide show
  1. package/README.md +163 -156
  2. package/dist/Treble/Snapshots.d.ts +28 -0
  3. package/dist/Treble/Snapshots.js +280 -0
  4. package/dist/Treble/Treble.d.ts +9 -27
  5. package/dist/Treble/Treble.js +34 -350
  6. package/dist/Treble/Wishlist.d.ts +18 -0
  7. package/dist/Treble/Wishlist.js +137 -0
  8. package/dist/Treble/index.d.ts +2 -0
  9. package/dist/Treble/index.js +2 -0
  10. package/dist/components/Accordion/accordion.styles.d.ts +5 -0
  11. package/dist/components/Accordion/accordion.styles.js +13 -0
  12. package/dist/components/Accordion/index.d.ts +14 -0
  13. package/dist/components/Accordion/index.js +63 -0
  14. package/dist/components/Cards/index.d.ts +2 -2
  15. package/dist/components/Drawer/index.js +0 -1
  16. package/dist/components/Dropdown/dropdown.styles.js +1 -3
  17. package/dist/components/Dropdown/index.d.ts +2 -2
  18. package/dist/components/FormComponentDescription/index.js +1 -1
  19. package/dist/components/Modal/index.js +3 -1
  20. package/dist/components/Share/index.d.ts +37 -0
  21. package/dist/components/Share/index.js +51 -0
  22. package/dist/components/Strips/index.d.ts +2 -2
  23. package/dist/components/Strips/index.js +1 -1
  24. package/dist/components/Swatch/index.d.ts +2 -2
  25. package/dist/components/Tabs/index.d.ts +14 -0
  26. package/dist/components/Tabs/index.js +53 -0
  27. package/dist/components/Tabs/tabs.styles.d.ts +8 -0
  28. package/dist/components/Tabs/tabs.styles.js +20 -0
  29. package/dist/components/ThreekitProvider/index.d.ts +11 -2
  30. package/dist/components/ThreekitProvider/index.js +3 -3
  31. package/dist/components/Tiles/index.d.ts +2 -2
  32. package/dist/components/TilesGroup/index.d.ts +2 -2
  33. package/dist/components/containers/formInputContainer.d.ts +1 -1
  34. package/dist/hooks/useShare/index.d.ts +3 -0
  35. package/dist/hooks/useShare/index.js +71 -0
  36. package/dist/hooks/useWishlist/index.d.ts +2 -3
  37. package/dist/index.d.ts +5 -1
  38. package/dist/index.js +9 -1
  39. package/dist/store/threekit.d.ts +5 -5
  40. package/dist/store/threekit.js +7 -6
  41. package/dist/threekit.d.ts +2 -0
  42. package/package.json +7 -5
@@ -269,7 +269,7 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
269
269
  // Threekit Player Init
270
270
  elementId,
271
271
  // cache,
272
- showConfigurator, initialConfigurationRaw, showLoadingThumbnail, showLoadingProgress, onLoadingProgress, showAR, showShare, locale, allowMobileVerticalOrbit, publishStage, threekitCredentials, threekitDomainRaw, assetId, authToken, orgId, stageId, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration, el, _b, player, translations, pricebook, _c, priceConfig, productName, wishlistData;
272
+ showConfigurator, initialConfigurationRaw, showLoadingThumbnail, showLoadingProgress, onLoadingProgress, showAR, showShare, locale, allowMobileVerticalOrbit, publishStage, display, threekitCredentials, threekitDomainRaw, assetId, authToken, orgId, stageId, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration, el, _b, player, translations, pricebook, _c, priceConfig, productName, wishlistData;
273
273
  var _d;
274
274
  var _e;
275
275
  return __generator(this, function (_f) {
@@ -277,7 +277,7 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
277
277
  case 0:
278
278
  if (window.threekit)
279
279
  return [2 /*return*/];
280
- _a = Object.assign(constants_1.DEFAULT_PLAYER_CONFIG, launchConfig), threekitEnv = _a.threekitEnv, configurationId = _a.configurationId, elementId = _a.elementId, showConfigurator = _a.showConfigurator, initialConfigurationRaw = _a.initialConfiguration, showLoadingThumbnail = _a.showLoadingThumbnail, showLoadingProgress = _a.showLoadingProgress, onLoadingProgress = _a.onLoadingProgress, showAR = _a.showAR, showShare = _a.showShare, locale = _a.locale, allowMobileVerticalOrbit = _a.allowMobileVerticalOrbit, publishStage = _a.publishStage;
280
+ _a = Object.assign(constants_1.DEFAULT_PLAYER_CONFIG, launchConfig), threekitEnv = _a.threekitEnv, configurationId = _a.configurationId, elementId = _a.elementId, showConfigurator = _a.showConfigurator, initialConfigurationRaw = _a.initialConfiguration, showLoadingThumbnail = _a.showLoadingThumbnail, showLoadingProgress = _a.showLoadingProgress, onLoadingProgress = _a.onLoadingProgress, showAR = _a.showAR, showShare = _a.showShare, locale = _a.locale, allowMobileVerticalOrbit = _a.allowMobileVerticalOrbit, publishStage = _a.publishStage, display = _a.display;
281
281
  threekitCredentials = launchConfig[threekitEnv || 'preview'];
282
282
  threekitDomainRaw = threekitCredentials.threekitDomain || "".concat(threekitEnv, ".threekit.com");
283
283
  assetId = threekitCredentials.assetId, authToken = threekitCredentials.publicToken, orgId = threekitCredentials.orgId, stageId = threekitCredentials.stageId;
@@ -337,6 +337,7 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
337
337
  locale: locale,
338
338
  allowMobileVerticalOrbit: allowMobileVerticalOrbit,
339
339
  publishStage: publishStage,
340
+ display: display,
340
341
  }),
341
342
  api_1.default.products.fetchTranslations(),
342
343
  api_1.default.price.getPricebooksList(),
@@ -371,7 +372,7 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
371
372
  dispatch(setAttributes(window.threekit.configurator.getDisplayAttributes()));
372
373
  dispatch((0, exports.setThreekitLoaded)(true));
373
374
  dispatch(setPlayerLoading(false));
374
- return [4 /*yield*/, window.threekit.treble.getWishlist()];
375
+ return [4 /*yield*/, window.threekit.treble.wishlist.getWishlist()];
375
376
  case 6:
376
377
  wishlistData = _f.sent();
377
378
  dispatch(setWishlist(wishlistData));
@@ -403,7 +404,7 @@ var addToWishlist = function (config) { return function (dispatch) { return __aw
403
404
  var wishlistData;
404
405
  return __generator(this, function (_a) {
405
406
  switch (_a.label) {
406
- case 0: return [4 /*yield*/, window.threekit.treble.addToWishlist(config)];
407
+ case 0: return [4 /*yield*/, window.threekit.treble.wishlist.addItem(config)];
407
408
  case 1:
408
409
  wishlistData = _a.sent();
409
410
  dispatch(setWishlist(wishlistData));
@@ -413,7 +414,7 @@ var addToWishlist = function (config) { return function (dispatch) { return __aw
413
414
  }); }; };
414
415
  exports.addToWishlist = addToWishlist;
415
416
  var removeFromWishlist = function (idx) { return function (dispatch) {
416
- var wishlistData = window.threekit.treble.removeFromWishlist(idx);
417
+ var wishlistData = window.threekit.treble.wishlist.removeItemByIdx(idx);
417
418
  dispatch(setWishlist(wishlistData));
418
419
  }; };
419
420
  exports.removeFromWishlist = removeFromWishlist;
@@ -426,7 +427,7 @@ var resumeFromWishlist = function (idx) { return function (dispatch, getState) {
426
427
  }; };
427
428
  exports.resumeFromWishlist = resumeFromWishlist;
428
429
  var clearWishlist = function () { return function (dispatch) {
429
- var wishlistData = window.threekit.treble.clearWishlist();
430
+ var wishlistData = window.threekit.treble.wishlist.clearWishlist();
430
431
  dispatch(setWishlist(wishlistData));
431
432
  }; };
432
433
  exports.clearWishlist = clearWishlist;
@@ -1,6 +1,7 @@
1
1
  import Treble from './Treble';
2
2
  declare type SCENE_PHASES = 'LOADED' | 'PRELOADED' | 'RENDERED';
3
3
  declare type PRIVATE_APIS = 'scene' | 'player';
4
+ export declare type DISPLAY_OPTIONS = 'webgl' | 'image';
4
5
  declare type IAttributeTypes = 'String' | 'Asset' | 'Color' | 'Number';
5
6
  export declare type IMetadata = Record<string, string | number | null>;
6
7
  /***************************************************
@@ -215,6 +216,7 @@ export interface ThreekitInitConfig {
215
216
  locale?: string;
216
217
  allowMobileVerticalOrbit?: boolean;
217
218
  publishStage?: string;
219
+ display?: DISPLAY_OPTIONS;
218
220
  }
219
221
  /***************************************************
220
222
  * Global Declaration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.10-alpha.14+2329b27",
3
+ "version": "0.0.13",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -9,14 +9,17 @@
9
9
  "main": "dist/index.js",
10
10
  "module": "dist/index.js",
11
11
  "types": "dist/index.d.js",
12
+ "publishConfig": {
13
+ "directory": "dist"
14
+ },
12
15
  "scripts": {
13
16
  "start": "tsc --watch",
14
17
  "build": "tsc",
15
18
  "clean": "rimraf dist",
16
- "format": "prettier --write ./src",
17
19
  "storybook": "start-storybook -p 6006",
18
20
  "build-storybook": "build-storybook -o build",
19
- "publish": "npm publish"
21
+ "lint": "eslint ./src",
22
+ "format": "prettier --write ./src"
20
23
  },
21
24
  "dependencies": {
22
25
  "@reduxjs/toolkit": "^1.6.2",
@@ -41,7 +44,6 @@
41
44
  "@types/redux-logger": "^3.0.9",
42
45
  "@types/styled-components": "^5.1.15",
43
46
  "babel-loader": "^8.2.2",
44
- "prettier": "^2.4.1",
45
47
  "react": ">=17.0.2",
46
48
  "react-dom": ">=17.0.2",
47
49
  "rimraf": "^3.0.2",
@@ -49,5 +51,5 @@
49
51
  "storybook-addon-styled-component-theme": "^2.0.0",
50
52
  "typescript": ">=4.4.4"
51
53
  },
52
- "gitHead": "2329b277abaa1ff88e30d60d27bb2e83468a8e64"
54
+ "gitHead": "2e16bcf98f81e16bb1768072fdb3968122e7966f"
53
55
  }