@threekit-tools/treble 0.0.46 → 0.0.50

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 (41) hide show
  1. package/dist/Treble/Snapshots.js +0 -26
  2. package/dist/Treble/Treble.d.ts +2 -1
  3. package/dist/Treble/Treble.js +2 -2
  4. package/dist/Treble/Wishlist.d.ts +3 -2
  5. package/dist/Treble/Wishlist.js +12 -12
  6. package/dist/components/Accordion/index.d.ts +1 -1
  7. package/dist/components/Player/index.js +5 -3
  8. package/dist/components/Tabs/index.d.ts +4 -7
  9. package/dist/components/ThreekitProvider/index.d.ts +3 -1
  10. package/dist/components/ThreekitProvider/index.js +3 -3
  11. package/dist/components/TrebleApp/index.js +2 -2
  12. package/dist/components/containers/formInputContainer.d.ts +1 -1
  13. package/dist/hooks/useAttribute/index.js +3 -3
  14. package/dist/hooks/useConfigurator/index.js +3 -3
  15. package/dist/hooks/useMetadata/index.js +2 -2
  16. package/dist/hooks/useName/index.js +2 -2
  17. package/dist/hooks/usePlayerLoadingStatus/index.js +2 -2
  18. package/dist/hooks/usePlayerPortal/index.js +2 -3
  19. package/dist/hooks/usePrice/index.d.ts +1 -1
  20. package/dist/hooks/usePrice/index.js +2 -2
  21. package/dist/hooks/useShare/index.js +2 -2
  22. package/dist/hooks/useSnapshot/index.js +2 -2
  23. package/dist/hooks/useThreekitInitStatus/index.js +2 -2
  24. package/dist/hooks/useWishlist/index.js +8 -7
  25. package/dist/store/attributes.d.ts +20 -0
  26. package/dist/store/attributes.js +135 -0
  27. package/dist/store/index.d.ts +67 -7
  28. package/dist/store/index.js +36 -4
  29. package/dist/store/price.d.ts +32 -0
  30. package/dist/store/price.js +56 -0
  31. package/dist/store/product.d.ts +21 -0
  32. package/dist/store/product.js +46 -0
  33. package/dist/store/translations.d.ts +21 -0
  34. package/dist/store/translations.js +46 -0
  35. package/dist/store/treble.d.ts +41 -0
  36. package/dist/store/{threekit.js → treble.js} +53 -224
  37. package/dist/store/wishlist.d.ts +24 -0
  38. package/dist/store/wishlist.js +101 -0
  39. package/dist/threekit.d.ts +1 -1
  40. package/package.json +1 -1
  41. package/dist/store/threekit.d.ts +0 -68
@@ -129,32 +129,6 @@ var Snapshots = /** @class */ (function () {
129
129
  }, Promise.resolve(snapshots));
130
130
  };
131
131
  this.takeSnapshots = function (camerasList, snapshotsConfig) { return __awaiter(_this, void 0, void 0, function () {
132
- // function getSnapshot() {
133
- // return window.threekit.player.snapshotAsync({
134
- // size,
135
- // mimeType: `image/${SNAPSHOT_FORMATS[format]}`,
136
- // })
137
- // }
138
- // function getSnapshots(
139
- // cameras: Array<string | undefined>,
140
- // camerasMap: CamerasMap
141
- // ) {
142
- // let snapshots: Array<string> = []
143
- // return cameras.reduce((snapshotPromise, camera) => {
144
- // return snapshotPromise.then(
145
- // () =>
146
- // new Promise(async (resolve) => {
147
- // if (camera)
148
- // await window.threekit.configurator.setConfiguration({
149
- // [attributeName]: camerasMap[camera],
150
- // })
151
- // const snapshotStr = await getSnapshot()
152
- // snapshots.push(snapshotStr)
153
- // resolve(snapshots)
154
- // })
155
- // )
156
- // }, Promise.resolve(snapshots))
157
- // }
158
132
  function saveSnapshotToPlatform(snapshot, filename) {
159
133
  return __awaiter(this, void 0, void 0, function () {
160
134
  var files, response;
@@ -4,6 +4,7 @@ import { IWishlist } from './Wishlist';
4
4
  import Snapshots from './Snapshots';
5
5
  interface ITreble {
6
6
  player: IThreekitPlayer;
7
+ orgId: string;
7
8
  }
8
9
  export interface ISaveConfigurationConfig {
9
10
  customerId?: string;
@@ -16,7 +17,7 @@ declare class Treble {
16
17
  wishlist: IWishlist;
17
18
  private _snapshots;
18
19
  takeSnapshots: Snapshots['takeSnapshots'];
19
- constructor({ player }: ITreble);
20
+ constructor({ player, orgId }: ITreble);
20
21
  saveConfiguration: (config?: ISaveConfigurationConfig | undefined) => Promise<{
21
22
  resumableUrl: string;
22
23
  } & import("../http/configurations").IConfigurationResponse & {
@@ -48,7 +48,7 @@ var Snapshots_1 = __importDefault(require("./Snapshots"));
48
48
  var Treble = /** @class */ (function () {
49
49
  function Treble(_a) {
50
50
  var _this = this;
51
- var player = _a.player;
51
+ var player = _a.player, orgId = _a.orgId;
52
52
  this.saveConfiguration = function (config) { return __awaiter(_this, void 0, void 0, function () {
53
53
  var threekitDomain, _a, customerId, metadata, productVersion, files, response, params, url;
54
54
  var _b;
@@ -86,7 +86,7 @@ var Treble = /** @class */ (function () {
86
86
  // Threekit API
87
87
  this._api = api_1.default;
88
88
  this._player = player;
89
- this.wishlist = (0, Wishlist_1.default)();
89
+ this.wishlist = (0, Wishlist_1.default)(orgId);
90
90
  this._snapshots = new Snapshots_1.default();
91
91
  this.takeSnapshots = this._snapshots.takeSnapshots;
92
92
  // this._player = player.enableApi('player')
@@ -8,11 +8,12 @@ export interface IWishlist {
8
8
  clearWishlist(): Array<IConfigurationResponse>;
9
9
  }
10
10
  declare class Wishlist implements IWishlist {
11
- constructor();
11
+ _wishlistKey: string;
12
+ constructor(orgId: string);
12
13
  getWishlist: () => Promise<WishlistArray>;
13
14
  addItem: (config?: ISaveConfigurationConfig | undefined) => Promise<WishlistArray>;
14
15
  removeItemByIdx: (idx: number) => WishlistArray;
15
16
  clearWishlist: () => WishlistArray;
16
17
  }
17
- export default function createWishlist(): Wishlist;
18
+ export default function createWishlist(orgId: string): Wishlist;
18
19
  export {};
@@ -53,7 +53,7 @@ var connection_1 = __importDefault(require("../connection"));
53
53
  var constants_1 = require("../constants");
54
54
  var wishlistData;
55
55
  var Wishlist = /** @class */ (function () {
56
- function Wishlist() {
56
+ function Wishlist(orgId) {
57
57
  var _this = this;
58
58
  this.getWishlist = function () { return __awaiter(_this, void 0, void 0, function () {
59
59
  var threekitDomain, wishlistListStr, wishlistList, wishlistDataRaw;
@@ -63,7 +63,7 @@ var Wishlist = /** @class */ (function () {
63
63
  if (wishlistData)
64
64
  return [2 /*return*/, wishlistData];
65
65
  threekitDomain = connection_1.default.getConnection().threekitDomain;
66
- wishlistListStr = localStorage.getItem(constants_1.WISHLIST_LOCALSTORAGE_KEY);
66
+ wishlistListStr = localStorage.getItem(this._wishlistKey);
67
67
  wishlistList = JSON.parse(wishlistListStr || '[]');
68
68
  return [4 /*yield*/, Promise.all(wishlistList.map(function (el) { return api_1.default.configurations.fetch(el); }))];
69
69
  case 1:
@@ -87,20 +87,19 @@ var Wishlist = /** @class */ (function () {
87
87
  case 0:
88
88
  if (!wishlistData) {
89
89
  wishlistData = [];
90
- localStorage.setItem(constants_1.WISHLIST_LOCALSTORAGE_KEY, JSON.stringify([]));
90
+ localStorage.setItem(this._wishlistKey, JSON.stringify([]));
91
91
  }
92
92
  configPrepped = Object.assign({ snapshot: true }, config);
93
93
  return [4 /*yield*/, window.threekit.treble.saveConfiguration(configPrepped)];
94
94
  case 1:
95
95
  savedConfiguration = _a.sent();
96
- // const savedConfiguration = await this.saveConfiguration(configPrepped)
97
96
  if (!savedConfiguration)
98
97
  return [2 /*return*/, wishlistData];
99
98
  wishlistData = __spreadArray(__spreadArray([], wishlistData, true), [savedConfiguration], false);
100
- wishlistListStr = localStorage.getItem(constants_1.WISHLIST_LOCALSTORAGE_KEY);
99
+ wishlistListStr = localStorage.getItem(this._wishlistKey);
101
100
  wishlistList = JSON.parse(wishlistListStr || '[]');
102
101
  wishlistList.push(savedConfiguration.shortId);
103
- localStorage.setItem(constants_1.WISHLIST_LOCALSTORAGE_KEY, JSON.stringify(wishlistList));
102
+ localStorage.setItem(this._wishlistKey, JSON.stringify(wishlistList));
104
103
  return [2 /*return*/, this.getWishlist()];
105
104
  }
106
105
  });
@@ -108,7 +107,7 @@ var Wishlist = /** @class */ (function () {
108
107
  this.removeItemByIdx = function (idx) {
109
108
  if (!(wishlistData === null || wishlistData === void 0 ? void 0 : wishlistData.length)) {
110
109
  wishlistData = [];
111
- localStorage.setItem(constants_1.WISHLIST_LOCALSTORAGE_KEY, JSON.stringify([]));
110
+ localStorage.setItem(_this._wishlistKey, JSON.stringify([]));
112
111
  return wishlistData;
113
112
  }
114
113
  if (idx > (wishlistData === null || wishlistData === void 0 ? void 0 : wishlistData.length) - 1)
@@ -116,22 +115,23 @@ var Wishlist = /** @class */ (function () {
116
115
  var updatedWishlist = __spreadArray([], wishlistData, true);
117
116
  updatedWishlist.splice(idx, 1);
118
117
  wishlistData = updatedWishlist;
119
- var wishlistListStr = localStorage.getItem(constants_1.WISHLIST_LOCALSTORAGE_KEY);
118
+ var wishlistListStr = localStorage.getItem(_this._wishlistKey);
120
119
  var wishlistList = JSON.parse(wishlistListStr || '[]');
121
120
  wishlistList.splice(idx, 1);
122
- localStorage.setItem(constants_1.WISHLIST_LOCALSTORAGE_KEY, JSON.stringify(wishlistList));
121
+ localStorage.setItem(_this._wishlistKey, JSON.stringify(wishlistList));
123
122
  return wishlistData;
124
123
  };
125
124
  this.clearWishlist = function () {
126
125
  wishlistData = [];
127
- localStorage.setItem(constants_1.WISHLIST_LOCALSTORAGE_KEY, JSON.stringify([]));
126
+ localStorage.setItem(_this._wishlistKey, JSON.stringify([]));
128
127
  return wishlistData;
129
128
  };
129
+ this._wishlistKey = "".concat(constants_1.WISHLIST_LOCALSTORAGE_KEY, "_").concat(orgId);
130
130
  this.getWishlist();
131
131
  }
132
132
  return Wishlist;
133
133
  }());
134
- function createWishlist() {
135
- return new Wishlist();
134
+ function createWishlist(orgId) {
135
+ return new Wishlist(orgId);
136
136
  }
137
137
  exports.default = createWishlist;
@@ -6,7 +6,7 @@ interface AccordionItemProps extends React.FC {
6
6
  onClick: () => void;
7
7
  }
8
8
  interface AccordionProps<T> {
9
- children: React.FunctionComponentElement<T>;
9
+ children: React.FunctionComponentElement<T> | Array<React.FunctionComponentElement<T>>;
10
10
  }
11
11
  export declare const Accordion: {
12
12
  (props: AccordionProps<AccordionItemProps>): React.FunctionComponentElement<AccordionItemProps>[] | null;
@@ -35,18 +35,20 @@ var Player = function (props) {
35
35
  minHeight: '600px',
36
36
  width: '100%',
37
37
  }, props), height = _a.height, width = _a.width, minHeight = _a.minHeight, children = _a.children;
38
- var hasMoved = (0, react_1.useRef)(false);
39
38
  var _b = (0, usePlayerPortal_1.default)(), portalPlayerTo = _b[0], portalBack = _b[1];
39
+ var hasMoved = (0, react_1.useRef)(false);
40
40
  (0, react_1.useEffect)(function () {
41
41
  if (portalPlayerTo && !hasMoved.current) {
42
42
  portalPlayerTo(exports.PLAYER_DIV_ID);
43
43
  hasMoved.current = true;
44
44
  }
45
45
  return function () {
46
- if (portalBack)
46
+ if (portalBack) {
47
47
  portalBack();
48
+ hasMoved.current = false;
49
+ }
48
50
  };
49
- });
51
+ }, [portalPlayerTo]);
50
52
  return (react_1.default.createElement(player_styles_1.Wrapper, { height: height, width: width, minHeight: minHeight, className: className },
51
53
  react_1.default.createElement("div", { id: exports.PLAYER_DIV_ID }),
52
54
  children));
@@ -1,13 +1,10 @@
1
1
  import React from 'react';
2
- interface TabPaneProps extends React.FC {
2
+ interface ITabPaneProps {
3
3
  label: string;
4
4
  onClick: () => void;
5
5
  }
6
- interface TabsProps<T> {
7
- children: React.FunctionComponentElement<T>;
6
+ interface ITabs {
7
+ TabPane: React.FC<ITabPaneProps>;
8
8
  }
9
- export declare const Tabs: {
10
- ({ children }: TabsProps<TabPaneProps>): JSX.Element | null;
11
- TabPane: React.FC<{}>;
12
- };
9
+ export declare const Tabs: ITabs;
13
10
  export default Tabs;
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
- import { ILaunchConfig } from '../../store/threekit';
2
+ import { Reducer } from 'redux';
3
+ import { ILaunchConfig } from '../../store/treble';
3
4
  interface Theme {
4
5
  [key: string]: string | number;
5
6
  }
6
7
  export interface ThreekitProviderProps extends Partial<ILaunchConfig> {
7
8
  theme?: Theme;
9
+ reducer?: Record<string, Reducer>;
8
10
  children: React.ReactNode;
9
11
  }
10
12
  declare const ThreekitProvider: (props: ThreekitProviderProps) => JSX.Element;
@@ -24,7 +24,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var react_1 = __importStar(require("react"));
26
26
  var store_1 = __importStar(require("../../store"));
27
- var threekit_1 = require("../../store/threekit");
27
+ var treble_1 = require("../../store/treble");
28
28
  var react_redux_1 = require("react-redux");
29
29
  var styled_components_1 = require("styled-components");
30
30
  var theme_1 = __importDefault(require("../../theme"));
@@ -34,7 +34,7 @@ var App = function (props) {
34
34
  (0, react_1.useEffect)(function () {
35
35
  var init = function () {
36
36
  var playerConfig = props.playerConfig, project = props.project, locale = props.locale, threekitEnv = props.threekitEnv, eventHandlers = props.eventHandlers;
37
- dispatch((0, threekit_1.launch)({ playerConfig: playerConfig, project: project, locale: locale, threekitEnv: threekitEnv, eventHandlers: eventHandlers }));
37
+ dispatch((0, treble_1.launch)({ playerConfig: playerConfig, project: project, locale: locale, threekitEnv: threekitEnv, eventHandlers: eventHandlers }));
38
38
  };
39
39
  init();
40
40
  return;
@@ -42,7 +42,7 @@ var App = function (props) {
42
42
  return react_1.default.createElement(react_1.default.Fragment, null, props.children);
43
43
  };
44
44
  var ThreekitProvider = function (props) {
45
- return (react_1.default.createElement(react_redux_1.Provider, { store: store_1.default },
45
+ return (react_1.default.createElement(react_redux_1.Provider, { store: (0, store_1.default)(props.reducer) },
46
46
  react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme_1.default },
47
47
  react_1.default.createElement(GlobalStyles_styles_1.default, null),
48
48
  react_1.default.createElement(App, { locale: props.locale, project: props.project, playerConfig: props.playerConfig, threekitEnv: props.threekitEnv, eventHandlers: props.eventHandlers }, props.children))));
@@ -31,7 +31,7 @@ var productComponents = [];
31
31
  var productToComponentMap = {};
32
32
  function TrebleApp(props) {
33
33
  var _a;
34
- var project = props.project, productId = props.productId, playerConfig = props.playerConfig, threekitEnv = props.threekitEnv, locale = props.locale, theme = props.theme;
34
+ var project = props.project, productId = props.productId, playerConfig = props.playerConfig, threekitEnv = props.threekitEnv, locale = props.locale, theme = props.theme, eventHandlers = props.eventHandlers;
35
35
  var config = constants_1.IS_TREBLE_SCRIPTS ? (0, utils_1.loadTrebleConfig)() : {};
36
36
  if (!((_a = config.treble) === null || _a === void 0 ? void 0 : _a.productsCtx)) {
37
37
  console.error('Treble Config is not setup correctly');
@@ -75,7 +75,7 @@ function TrebleApp(props) {
75
75
  var preppedProject = Object.assign({}, project, {
76
76
  products: productsMap[id],
77
77
  });
78
- return (react_1.default.createElement(ThreekitProvider_1.default, { project: preppedProject, locale: locale, playerConfig: playerConfig, theme: theme, threekitEnv: threekitEnv },
78
+ return (react_1.default.createElement(ThreekitProvider_1.default, { project: preppedProject, locale: locale, playerConfig: playerConfig, theme: theme, threekitEnv: threekitEnv, eventHandlers: eventHandlers },
79
79
  react_1.default.createElement(Product, null)));
80
80
  }
81
81
  exports.default = TrebleApp;
@@ -45,7 +45,7 @@ interface IPrepAttributeConfig {
45
45
  sort?: string;
46
46
  }
47
47
  export declare const prepAttributeForComponent: (attribute: IThreekitDisplayAttribute, config: IPrepAttributeConfig) => {
48
- selected: string | number | import("../../threekit").IConfigurationColor | import("../../threekit").IConfigurationAsset;
48
+ selected: string | number | import("../../threekit").IConfigurationAsset | import("../../threekit").IConfigurationColor;
49
49
  options: IDisplayAttributeAssetValue[] | {
50
50
  name: string;
51
51
  label: string;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
4
+ var attributes_1 = require("../../store/attributes");
5
5
  var utils_1 = require("../../utils");
6
6
  var useAttribute = function (attributeName) {
7
7
  if (!attributeName)
8
8
  return [undefined, undefined];
9
9
  var dispatch = (0, store_1.useThreekitDispatch)();
10
- var attributes = (0, store_1.useThreekitSelector)(threekit_1.getAttributes);
10
+ var attributes = (0, store_1.useThreekitSelector)(attributes_1.getAttributes);
11
11
  if (!attributeName || !attributes)
12
12
  return [undefined, undefined];
13
13
  var attribute = attributes[attributeName];
@@ -16,7 +16,7 @@ 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
- dispatch((0, threekit_1.setConfiguration)((_a = {},
19
+ dispatch((0, attributes_1.setConfiguration)((_a = {},
20
20
  _a[attributeName] = preppedValue,
21
21
  _a)));
22
22
  };
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var threekit_1 = require("../../store/threekit");
3
+ var attributes_1 = require("../../store/attributes");
4
4
  var store_1 = require("../../store");
5
5
  var useConfigurator = function () {
6
6
  var dispatch = (0, store_1.useThreekitDispatch)();
7
- var attributes = (0, store_1.useThreekitSelector)(threekit_1.getAttributes);
7
+ var attributes = (0, store_1.useThreekitSelector)(attributes_1.getAttributes);
8
8
  if (!attributes)
9
9
  return [undefined, undefined];
10
10
  var handleChange = function (configuration) {
11
- return dispatch((0, threekit_1.setConfiguration)(configuration));
11
+ return dispatch((0, attributes_1.setConfiguration)(configuration));
12
12
  };
13
13
  return [attributes, handleChange];
14
14
  };
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
4
+ var product_1 = require("../../store/product");
5
5
  var useMetadata = function () {
6
- var metadata = (0, store_1.useThreekitSelector)(threekit_1.getMetadata);
6
+ var metadata = (0, store_1.useThreekitSelector)(product_1.getMetadata);
7
7
  return metadata;
8
8
  };
9
9
  exports.default = useMetadata;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
5
- var useName = function () { return (0, store_1.useThreekitSelector)(threekit_1.getName); };
4
+ var product_1 = require("../../store/product");
5
+ var useName = function () { return (0, store_1.useThreekitSelector)(product_1.getName); };
6
6
  exports.default = useName;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
4
+ var treble_1 = require("../../store/treble");
5
5
  var usePlayerLoadingStatus = function () {
6
- return (0, store_1.useThreekitSelector)(threekit_1.isPlayerLoading);
6
+ return (0, store_1.useThreekitSelector)(treble_1.isPlayerLoading);
7
7
  };
8
8
  exports.default = usePlayerLoadingStatus;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var react_1 = require("react");
4
4
  var react_redux_1 = require("react-redux");
5
- var threekit_1 = require("../../store/threekit");
5
+ var treble_1 = require("../../store/treble");
6
6
  var constants_1 = require("../../constants");
7
7
  var usePlayerPortal = function () {
8
8
  var htmlElements = (0, react_1.useRef)({
@@ -10,7 +10,7 @@ var usePlayerPortal = function () {
10
10
  playerLoader: null,
11
11
  playerWrapper: null,
12
12
  });
13
- var playerElementId = (0, react_redux_1.useSelector)(threekit_1.getPlayerElementId);
13
+ var playerElementId = (0, react_redux_1.useSelector)(treble_1.getPlayerElementId);
14
14
  if (!playerElementId)
15
15
  return [undefined, undefined];
16
16
  var portalPlayerTo = function (toEl) {
@@ -26,7 +26,6 @@ var usePlayerPortal = function () {
26
26
  htmlElements.current.playerWrapper.appendChild(htmlElements.current.player);
27
27
  };
28
28
  var returnPlayer = function () {
29
- constants_1.TK_PLAYER_LOADER_DIV;
30
29
  if (!htmlElements.current.player)
31
30
  htmlElements.current.player = document.getElementById(playerElementId);
32
31
  if (!htmlElements.current.playerLoader)
@@ -1,3 +1,3 @@
1
- import { IPrice } from '../../store/threekit';
1
+ import { IPrice } from '../../store/price';
2
2
  declare const usePrice: () => IPrice | undefined;
3
3
  export default usePrice;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
5
- var usePrice = function () { return (0, store_1.useThreekitSelector)(threekit_1.getPrice); };
4
+ var price_1 = require("../../store/price");
5
+ var usePrice = function () { return (0, store_1.useThreekitSelector)(price_1.getPrice); };
6
6
  exports.default = usePrice;
@@ -40,11 +40,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  var store_1 = require("../../store");
43
- var threekit_1 = require("../../store/threekit");
43
+ var treble_1 = require("../../store/treble");
44
44
  var message_1 = __importDefault(require("../../components/message"));
45
45
  var utils_1 = require("../../utils");
46
46
  var useShare = function () {
47
- var isLoaded = (0, store_1.useThreekitSelector)(threekit_1.isThreekitLoaded);
47
+ var isLoaded = (0, store_1.useThreekitSelector)(treble_1.isThreekitInitialized);
48
48
  if (!isLoaded)
49
49
  return undefined;
50
50
  var handleShare = function (msg) {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
4
+ var treble_1 = require("../../store/treble");
5
5
  var useSnapshot = function (cameras, config) {
6
- var isLoaded = (0, store_1.useThreekitSelector)(threekit_1.isThreekitLoaded);
6
+ var isLoaded = (0, store_1.useThreekitSelector)(treble_1.isThreekitInitialized);
7
7
  if (!isLoaded)
8
8
  return undefined;
9
9
  var takeSnapshot = function () {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var store_1 = require("../../store");
4
- var threekit_1 = require("../../store/threekit");
4
+ var treble_1 = require("../../store/treble");
5
5
  var useThreekitInitStatus = function () {
6
- return (0, store_1.useThreekitSelector)(threekit_1.isThreekitLoaded);
6
+ return (0, store_1.useThreekitSelector)(treble_1.isThreekitInitialized);
7
7
  };
8
8
  exports.default = useThreekitInitStatus;
@@ -3,25 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- var threekit_1 = require("../../store/threekit");
6
+ var wishlist_1 = require("../../store/wishlist");
7
+ var treble_1 = require("../../store/treble");
7
8
  var store_1 = require("../../store");
8
9
  var utils_1 = require("../../utils");
9
10
  var message_1 = __importDefault(require("../../components/message"));
10
11
  var useWishlist = function () {
11
12
  var dispatch = (0, store_1.useThreekitDispatch)();
12
- var isLoaded = (0, store_1.useThreekitSelector)(threekit_1.isThreekitLoaded);
13
- var wishlist = (0, store_1.useThreekitSelector)(threekit_1.getWishlist);
13
+ var isLoaded = (0, store_1.useThreekitSelector)(treble_1.isThreekitInitialized);
14
+ var wishlist = (0, store_1.useThreekitSelector)(wishlist_1.getWishlist);
14
15
  if (!isLoaded)
15
16
  return [undefined, undefined, undefined, undefined, undefined, undefined];
16
17
  var handleAddToWishlist = function (config) {
17
- return dispatch((0, threekit_1.addToWishlist)(config));
18
+ return dispatch((0, wishlist_1.addToWishlist)(config));
18
19
  };
19
20
  var handleRemoveFromWishlist = function (idx) {
20
- dispatch((0, threekit_1.removeFromWishlist)(idx));
21
+ dispatch((0, wishlist_1.removeFromWishlist)(idx));
21
22
  message_1.default.info('Item removed from wishlist');
22
23
  };
23
24
  var handleResumeItem = function (idx) {
24
- dispatch((0, threekit_1.resumeFromWishlist)(idx));
25
+ dispatch((0, wishlist_1.resumeFromWishlist)(idx));
25
26
  };
26
27
  var handleShareItem = function (idx) {
27
28
  var url = (0, utils_1.getResumableUrl)(wishlist[idx].shortId);
@@ -29,7 +30,7 @@ var useWishlist = function () {
29
30
  message_1.default.info('Link copied!');
30
31
  };
31
32
  var handleClearWishlist = function () {
32
- dispatch(threekit_1.clearWishlist);
33
+ dispatch(wishlist_1.clearWishlist);
33
34
  };
34
35
  return [
35
36
  wishlist,
@@ -0,0 +1,20 @@
1
+ import { RootState, ThreekitDispatch } from './index';
2
+ import { ISetConfiguration, IThreekitDisplayAttribute } from '../threekit';
3
+ /*****************************************************
4
+ * Types and Interfaces
5
+ ****************************************************/
6
+ export declare type AttributesState = Record<string, IThreekitDisplayAttribute>;
7
+ /*****************************************************
8
+ * Actions
9
+ ****************************************************/
10
+ export declare const setAttributes: import("@reduxjs/toolkit").ActionCreatorWithPayload<IThreekitDisplayAttribute[], string>;
11
+ /*****************************************************
12
+ * Slice
13
+ ****************************************************/
14
+ declare const reducer: import("redux").Reducer<AttributesState, import("redux").AnyAction>;
15
+ /*****************************************************
16
+ * Standard Selectors
17
+ ****************************************************/
18
+ export declare const getAttributes: (state: RootState) => undefined | Record<string, IThreekitDisplayAttribute>;
19
+ export declare const setConfiguration: (config: ISetConfiguration) => (dispatch: ThreekitDispatch) => Promise<void>;
20
+ export default reducer;