@threekit-tools/treble 0.0.86 → 0.0.87
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/Accordion/index.d.ts +1 -0
- package/dist/components/AttributeValue/index.js +2 -0
- package/dist/components/PortalToArOverlay/index.d.ts +4 -1
- package/dist/components/PortalToElement/index.d.ts +1 -0
- package/dist/components/ProductLayout/index.d.ts +1 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/formComponents.d.ts +2 -2
- package/dist/hooks/useConfigurationLoader/index.js +11 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/store/index.d.ts +8 -29
- package/dist/store/index.js +10 -6
- package/dist/store/treble.d.ts +0 -1
- package/dist/store/treble.js +6 -7
- package/dist/types.d.ts +13 -3
- package/package.json +3 -2
|
@@ -4,6 +4,7 @@ interface AccordionItemProps extends React.FC {
|
|
|
4
4
|
label: string;
|
|
5
5
|
handleSelect: () => void;
|
|
6
6
|
onClick: () => void;
|
|
7
|
+
children?: React.ReactNode;
|
|
7
8
|
}
|
|
8
9
|
interface AccordionProps<T> {
|
|
9
10
|
children: React.FunctionComponentElement<T> | Array<React.FunctionComponentElement<T>>;
|
|
@@ -23,6 +23,8 @@ var AttributeValue = function (props) {
|
|
|
23
23
|
return null;
|
|
24
24
|
value = (_b = assetAttribute_1.values.find(function (el) { return el.assetId === assetAttribute_1.value.assetId; })) === null || _b === void 0 ? void 0 : _b.name;
|
|
25
25
|
}
|
|
26
|
+
else if (attributeData.type === types_1.ATTRIBUTE_TYPES.COLOR)
|
|
27
|
+
value = JSON.stringify(attributeData.value);
|
|
26
28
|
else
|
|
27
29
|
value = attributeData.value;
|
|
28
30
|
if (!attribute)
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { IProducts } from '../../types';
|
|
3
3
|
export interface ProductLayoutProps {
|
|
4
4
|
products: Record<string, IProducts>;
|
|
5
|
+
children?: React.ReactNode;
|
|
5
6
|
}
|
|
6
7
|
declare const ProductLayout: React.FC<ProductLayoutProps>;
|
|
7
8
|
export default ProductLayout;
|
|
@@ -4,7 +4,7 @@ export declare const FORM_COMPONENT_TYPES: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare const formComponents: {
|
|
6
6
|
[x: string]: {
|
|
7
|
-
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./
|
|
7
|
+
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./TextInput").ITextInput) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
8
8
|
} | {
|
|
9
9
|
[x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ export declare const formComponents: {
|
|
|
12
12
|
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
13
13
|
};
|
|
14
14
|
String: {
|
|
15
|
-
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./
|
|
15
|
+
[x: string]: ((props: import("./Cards").ICards) => JSX.Element | null) | ((props: import("./TextInput").ITextInput) => JSX.Element | null) | ((props: import("./Tiles").ITiles) => JSX.Element | null);
|
|
16
16
|
};
|
|
17
17
|
upload: {
|
|
18
18
|
[x: string]: (props: import("./Upload").IUpload) => JSX.Element | null;
|
|
@@ -41,6 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
42
|
var api_1 = __importDefault(require("../../api"));
|
|
43
43
|
var attributes_1 = require("../../store/attributes");
|
|
44
|
+
var treble_1 = require("../../store/treble");
|
|
44
45
|
var store_1 = require("../../store");
|
|
45
46
|
var useConfigurationLoader = function () {
|
|
46
47
|
var dispatch = (0, store_1.useThreekitDispatch)();
|
|
@@ -56,10 +57,19 @@ var useConfigurationLoader = function () {
|
|
|
56
57
|
configuration = _a.sent();
|
|
57
58
|
if (!configuration)
|
|
58
59
|
return [2];
|
|
60
|
+
if (!(configuration.data.productId === window.threekit.player.assetId)) return [3, 3];
|
|
59
61
|
return [4, dispatch((0, attributes_1.setConfiguration)(configuration.data.variant))];
|
|
60
62
|
case 2:
|
|
61
63
|
_a.sent();
|
|
62
|
-
return [
|
|
64
|
+
return [3, 5];
|
|
65
|
+
case 3: return [4, dispatch((0, treble_1.reloadPlayer)({
|
|
66
|
+
assetId: configuration.data.productId,
|
|
67
|
+
configuration: configuration.data.variant,
|
|
68
|
+
}))];
|
|
69
|
+
case 4:
|
|
70
|
+
_a.sent();
|
|
71
|
+
_a.label = 5;
|
|
72
|
+
case 5: return [2, Promise.resolve()];
|
|
63
73
|
}
|
|
64
74
|
});
|
|
65
75
|
}); };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ import Cards from './components/Cards';
|
|
|
23
23
|
import Dropdown from './components/Dropdown';
|
|
24
24
|
import Strips from './components/Strips';
|
|
25
25
|
import Swatch from './components/Swatch';
|
|
26
|
+
import TextInput from './components/TextInput';
|
|
26
27
|
import Tiles from './components/Tiles';
|
|
27
28
|
import TilesGroup from './components/TilesGroup';
|
|
28
29
|
import Upload from './components/Upload';
|
|
@@ -95,4 +96,4 @@ import WishlistIcon from './icons/Wishlist';
|
|
|
95
96
|
import ZoomInIcon from './icons/ZoomIn';
|
|
96
97
|
import ZoomOutIcon from './icons/ZoomOut';
|
|
97
98
|
import SpinnerIcon from './icons/Spinner';
|
|
98
|
-
export { useAttribute, useConfigurator, useConfigurationLoader, useFirstPlayerInteraction, useMetadata, useName, usePlayerLoadingStatus, usePrice, useThreekitInitStatus, useZoom, useSnapshot, useWishlist, useShare, usePlayerPortal, useProductCache, useNestedConfigurator, useLoadingProgress, usePlayer, ThreekitProvider, Player, Button, Cards, Dropdown, Strips, Swatch, Tiles, TilesGroup, Upload, Switch, ProductName, ProductDescription, AttributeTitle, AttributeValue, TotalPrice, Skeleton, message, Modal, Drawer, Accordion, Tabs, PortalToArOverlay, PortalToElement, AwaitThreekitLoad, FlatForm, Zoom, Snapshots, Wishlist, Share, TrebleApp, ProductLayout, PlayerLoadingCircular, PlayerLoadingSpinner, DraggableHint, TurntableAnimation, BreatheAnimation, AddIcon, ArrowLeftIcon, ArrowRightIcon, CameraIcon, CaretDownIcon, CaretUpIcon, CaretLeftIcon, CaretRightIcon, CartIcon, CheckmateIcon, ClipboardIcon, ColorPickerIcon, CopyIcon, DeleteIcon, DoubleCaretLeftIcon, DoubleCaretRightIcon, DownloadIcon, DraggableIcon, DragIcon, EditIcon, HeartIcon, ImageIcon, InfoIcon, MailIcon, MenuIcon, MoreIcon, NewWindowIcon, PauseIcon, PlayIcon, RedoIcon, RemoveIcon, RulerIcon, SearchIcon, SettingsIcon, ShareIcon, SwitchIcon, TagIcon, UndoIcon, WishlistIcon, ZoomInIcon, ZoomOutIcon, SpinnerIcon, };
|
|
99
|
+
export { useAttribute, useConfigurator, useConfigurationLoader, useFirstPlayerInteraction, useMetadata, useName, usePlayerLoadingStatus, usePrice, useThreekitInitStatus, useZoom, useSnapshot, useWishlist, useShare, usePlayerPortal, useProductCache, useNestedConfigurator, useLoadingProgress, usePlayer, ThreekitProvider, Player, Button, Cards, Dropdown, Strips, Swatch, TextInput, Tiles, TilesGroup, Upload, Switch, ProductName, ProductDescription, AttributeTitle, AttributeValue, TotalPrice, Skeleton, message, Modal, Drawer, Accordion, Tabs, PortalToArOverlay, PortalToElement, AwaitThreekitLoad, FlatForm, Zoom, Snapshots, Wishlist, Share, TrebleApp, ProductLayout, PlayerLoadingCircular, PlayerLoadingSpinner, DraggableHint, TurntableAnimation, BreatheAnimation, AddIcon, ArrowLeftIcon, ArrowRightIcon, CameraIcon, CaretDownIcon, CaretUpIcon, CaretLeftIcon, CaretRightIcon, CartIcon, CheckmateIcon, ClipboardIcon, ColorPickerIcon, CopyIcon, DeleteIcon, DoubleCaretLeftIcon, DoubleCaretRightIcon, DownloadIcon, DraggableIcon, DragIcon, EditIcon, HeartIcon, ImageIcon, InfoIcon, MailIcon, MenuIcon, MoreIcon, NewWindowIcon, PauseIcon, PlayIcon, RedoIcon, RemoveIcon, RulerIcon, SearchIcon, SettingsIcon, ShareIcon, SwitchIcon, TagIcon, UndoIcon, WishlistIcon, ZoomInIcon, ZoomOutIcon, SpinnerIcon, };
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ 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
|
-
exports.
|
|
7
|
-
exports.SpinnerIcon = exports.ZoomOutIcon = exports.ZoomInIcon = exports.WishlistIcon = exports.UndoIcon = exports.TagIcon = exports.SwitchIcon = exports.ShareIcon = exports.SettingsIcon = exports.SearchIcon = exports.RulerIcon = exports.RemoveIcon = exports.RedoIcon = exports.PlayIcon = exports.PauseIcon = exports.NewWindowIcon = exports.MoreIcon = exports.MenuIcon = exports.MailIcon = exports.InfoIcon = exports.ImageIcon = exports.HeartIcon = exports.EditIcon = exports.DragIcon = exports.DraggableIcon = exports.DownloadIcon = exports.DoubleCaretRightIcon = exports.DoubleCaretLeftIcon = exports.DeleteIcon = exports.CopyIcon = exports.ColorPickerIcon = exports.ClipboardIcon = exports.CheckmateIcon = exports.CartIcon = exports.CaretRightIcon = exports.CaretLeftIcon = exports.CaretUpIcon = exports.CaretDownIcon = exports.CameraIcon = exports.ArrowRightIcon = exports.ArrowLeftIcon = exports.AddIcon = exports.BreatheAnimation = exports.TurntableAnimation = exports.DraggableHint = exports.PlayerLoadingSpinner = exports.PlayerLoadingCircular = void 0;
|
|
6
|
+
exports.TrebleApp = exports.Share = exports.Wishlist = exports.Snapshots = exports.Zoom = exports.FlatForm = exports.AwaitThreekitLoad = exports.PortalToElement = exports.PortalToArOverlay = exports.Tabs = exports.Accordion = exports.Drawer = exports.Modal = exports.message = exports.Skeleton = exports.TotalPrice = exports.AttributeValue = exports.AttributeTitle = exports.ProductDescription = exports.ProductName = exports.Switch = exports.Upload = exports.TilesGroup = exports.Tiles = exports.TextInput = exports.Swatch = exports.Strips = exports.Dropdown = exports.Cards = exports.Button = exports.Player = exports.ThreekitProvider = exports.usePlayer = exports.useLoadingProgress = exports.useNestedConfigurator = exports.useProductCache = exports.usePlayerPortal = exports.useShare = exports.useWishlist = exports.useSnapshot = exports.useZoom = exports.useThreekitInitStatus = exports.usePrice = exports.usePlayerLoadingStatus = exports.useName = exports.useMetadata = exports.useFirstPlayerInteraction = exports.useConfigurationLoader = exports.useConfigurator = exports.useAttribute = void 0;
|
|
7
|
+
exports.SpinnerIcon = exports.ZoomOutIcon = exports.ZoomInIcon = exports.WishlistIcon = exports.UndoIcon = exports.TagIcon = exports.SwitchIcon = exports.ShareIcon = exports.SettingsIcon = exports.SearchIcon = exports.RulerIcon = exports.RemoveIcon = exports.RedoIcon = exports.PlayIcon = exports.PauseIcon = exports.NewWindowIcon = exports.MoreIcon = exports.MenuIcon = exports.MailIcon = exports.InfoIcon = exports.ImageIcon = exports.HeartIcon = exports.EditIcon = exports.DragIcon = exports.DraggableIcon = exports.DownloadIcon = exports.DoubleCaretRightIcon = exports.DoubleCaretLeftIcon = exports.DeleteIcon = exports.CopyIcon = exports.ColorPickerIcon = exports.ClipboardIcon = exports.CheckmateIcon = exports.CartIcon = exports.CaretRightIcon = exports.CaretLeftIcon = exports.CaretUpIcon = exports.CaretDownIcon = exports.CameraIcon = exports.ArrowRightIcon = exports.ArrowLeftIcon = exports.AddIcon = exports.BreatheAnimation = exports.TurntableAnimation = exports.DraggableHint = exports.PlayerLoadingSpinner = exports.PlayerLoadingCircular = exports.ProductLayout = void 0;
|
|
8
8
|
var useAttribute_1 = __importDefault(require("./hooks/useAttribute"));
|
|
9
9
|
exports.useAttribute = useAttribute_1.default;
|
|
10
10
|
var useConfigurator_1 = __importDefault(require("./hooks/useConfigurator"));
|
|
@@ -55,6 +55,8 @@ var Strips_1 = __importDefault(require("./components/Strips"));
|
|
|
55
55
|
exports.Strips = Strips_1.default;
|
|
56
56
|
var Swatch_1 = __importDefault(require("./components/Swatch"));
|
|
57
57
|
exports.Swatch = Swatch_1.default;
|
|
58
|
+
var TextInput_1 = __importDefault(require("./components/TextInput"));
|
|
59
|
+
exports.TextInput = TextInput_1.default;
|
|
58
60
|
var Tiles_1 = __importDefault(require("./components/Tiles"));
|
|
59
61
|
exports.Tiles = Tiles_1.default;
|
|
60
62
|
var TilesGroup_1 = __importDefault(require("./components/TilesGroup"));
|
package/dist/store/index.d.ts
CHANGED
|
@@ -7,28 +7,21 @@ declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
|
7
7
|
translations: import("./translations").TranslationsState;
|
|
8
8
|
wishlist: import("../Treble").WishlistArray;
|
|
9
9
|
price: import("./price").PriceState;
|
|
10
|
-
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<import("redux
|
|
10
|
+
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
|
|
11
11
|
treble: import("./treble").TrebleState;
|
|
12
12
|
product: import("./product").ProductState;
|
|
13
13
|
attributes: import("./attributes").AttributesState;
|
|
14
14
|
translations: import("./translations").TranslationsState;
|
|
15
15
|
wishlist: import("../Treble").WishlistArray;
|
|
16
16
|
price: import("./price").PriceState;
|
|
17
|
-
}, import("redux").AnyAction,
|
|
17
|
+
}, import("redux").AnyAction, undefined>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
|
|
18
18
|
treble: import("./treble").TrebleState;
|
|
19
19
|
product: import("./product").ProductState;
|
|
20
20
|
attributes: import("./attributes").AttributesState;
|
|
21
21
|
translations: import("./translations").TranslationsState;
|
|
22
22
|
wishlist: import("../Treble").WishlistArray;
|
|
23
23
|
price: import("./price").PriceState;
|
|
24
|
-
}, import("redux").AnyAction, undefined
|
|
25
|
-
treble: import("./treble").TrebleState;
|
|
26
|
-
product: import("./product").ProductState;
|
|
27
|
-
attributes: import("./attributes").AttributesState;
|
|
28
|
-
translations: import("./translations").TranslationsState;
|
|
29
|
-
wishlist: import("../Treble").WishlistArray;
|
|
30
|
-
price: import("./price").PriceState;
|
|
31
|
-
}, import("redux").Dispatch<import("redux").AnyAction>>>>;
|
|
24
|
+
}, import("redux").AnyAction, undefined>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
|
|
32
25
|
export declare const createStore: (reducer?: Record<string, Reducer>) => import("@reduxjs/toolkit").EnhancedStore<{
|
|
33
26
|
treble: import("./treble").TrebleState;
|
|
34
27
|
product: import("./product").ProductState;
|
|
@@ -36,44 +29,30 @@ export declare const createStore: (reducer?: Record<string, Reducer>) => import(
|
|
|
36
29
|
translations: import("./translations").TranslationsState;
|
|
37
30
|
wishlist: import("../Treble").WishlistArray;
|
|
38
31
|
price: import("./price").PriceState;
|
|
39
|
-
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<import("redux
|
|
40
|
-
treble: import("./treble").TrebleState;
|
|
41
|
-
product: import("./product").ProductState;
|
|
42
|
-
attributes: import("./attributes").AttributesState;
|
|
43
|
-
translations: import("./translations").TranslationsState;
|
|
44
|
-
wishlist: import("../Treble").WishlistArray;
|
|
45
|
-
price: import("./price").PriceState;
|
|
46
|
-
}, import("redux").AnyAction, null> | import("redux-thunk").ThunkMiddleware<{
|
|
32
|
+
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
|
|
47
33
|
treble: import("./treble").TrebleState;
|
|
48
34
|
product: import("./product").ProductState;
|
|
49
35
|
attributes: import("./attributes").AttributesState;
|
|
50
36
|
translations: import("./translations").TranslationsState;
|
|
51
37
|
wishlist: import("../Treble").WishlistArray;
|
|
52
38
|
price: import("./price").PriceState;
|
|
53
|
-
}, import("redux").AnyAction, undefined> | import("redux").
|
|
39
|
+
}, import("redux").AnyAction, undefined>]> | import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<{
|
|
54
40
|
treble: import("./treble").TrebleState;
|
|
55
41
|
product: import("./product").ProductState;
|
|
56
42
|
attributes: import("./attributes").AttributesState;
|
|
57
43
|
translations: import("./translations").TranslationsState;
|
|
58
44
|
wishlist: import("../Treble").WishlistArray;
|
|
59
45
|
price: import("./price").PriceState;
|
|
60
|
-
}, import("redux").Dispatch<import("redux").AnyAction
|
|
46
|
+
}, import("redux").AnyAction, undefined>, import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>]>>;
|
|
61
47
|
export declare type RootState = ReturnType<typeof store.getState>;
|
|
62
48
|
export declare type ThreekitDispatch = typeof store.dispatch;
|
|
63
|
-
export declare const useThreekitDispatch: () => import("
|
|
64
|
-
treble: import("./treble").TrebleState;
|
|
65
|
-
product: import("./product").ProductState;
|
|
66
|
-
attributes: import("./attributes").AttributesState;
|
|
67
|
-
translations: import("./translations").TranslationsState;
|
|
68
|
-
wishlist: import("../Treble").WishlistArray;
|
|
69
|
-
price: import("./price").PriceState;
|
|
70
|
-
}, null, import("redux").AnyAction> & import("@reduxjs/toolkit").ThunkDispatch<{
|
|
49
|
+
export declare const useThreekitDispatch: () => import("@reduxjs/toolkit").ThunkDispatch<{
|
|
71
50
|
treble: import("./treble").TrebleState;
|
|
72
51
|
product: import("./product").ProductState;
|
|
73
52
|
attributes: import("./attributes").AttributesState;
|
|
74
53
|
translations: import("./translations").TranslationsState;
|
|
75
54
|
wishlist: import("../Treble").WishlistArray;
|
|
76
55
|
price: import("./price").PriceState;
|
|
77
|
-
}, undefined, import("redux").AnyAction>;
|
|
56
|
+
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
|
78
57
|
export declare const useThreekitSelector: TypedUseSelectorHook<RootState>;
|
|
79
58
|
export default createStore;
|
package/dist/store/index.js
CHANGED
|
@@ -34,18 +34,22 @@ var store = (0, toolkit_1.configureStore)({
|
|
|
34
34
|
wishlist: wishlist_1.default,
|
|
35
35
|
price: price_1.default,
|
|
36
36
|
},
|
|
37
|
-
middleware:
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
middleware: function (getDefaultMiddleware) {
|
|
38
|
+
return constants_1.TREBLE_DEBUG
|
|
39
|
+
? getDefaultMiddleware().concat(redux_logger_1.default)
|
|
40
|
+
: getDefaultMiddleware();
|
|
41
|
+
},
|
|
40
42
|
});
|
|
41
43
|
var createStore = function (reducer) {
|
|
42
44
|
if (!reducer)
|
|
43
45
|
return store;
|
|
44
46
|
return (0, toolkit_1.configureStore)({
|
|
45
47
|
reducer: __assign(__assign({}, reducer), { treble: treble_1.default, product: product_1.default, attributes: attributes_1.default, translations: translations_1.default, wishlist: wishlist_1.default, price: price_1.default }),
|
|
46
|
-
middleware:
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
middleware: function (getDefaultMiddleware) {
|
|
49
|
+
return constants_1.TREBLE_DEBUG
|
|
50
|
+
? getDefaultMiddleware().concat(redux_logger_1.default)
|
|
51
|
+
: getDefaultMiddleware();
|
|
52
|
+
},
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
55
|
exports.createStore = createStore;
|
package/dist/store/treble.d.ts
CHANGED
package/dist/store/treble.js
CHANGED
|
@@ -167,11 +167,11 @@ var getPlayerInteraction = function (state) {
|
|
|
167
167
|
exports.getPlayerInteraction = getPlayerInteraction;
|
|
168
168
|
var initPlayer = function (config) {
|
|
169
169
|
return function (dispatch, getState) { return __awaiter(void 0, void 0, void 0, function () {
|
|
170
|
-
var el, authToken, assetId, stageId,
|
|
170
|
+
var el, authToken, assetId, stageId, playerConfig, initialConfiguration, player, configurator, orgId, ruleName;
|
|
171
171
|
return __generator(this, function (_a) {
|
|
172
172
|
switch (_a.label) {
|
|
173
173
|
case 0:
|
|
174
|
-
el = config.el, authToken = config.authToken, assetId = config.assetId, stageId = config.stageId,
|
|
174
|
+
el = config.el, authToken = config.authToken, assetId = config.assetId, stageId = config.stageId, playerConfig = config.playerConfig, initialConfiguration = config.initialConfiguration;
|
|
175
175
|
dispatch((0, exports.updateLoadingProgress)(0));
|
|
176
176
|
return [4, window.threekitPlayer(__assign(__assign({ el: el, authToken: authToken, stageId: stageId, assetId: assetId }, playerConfig), { initialConfiguration: initialConfiguration, onLoadingProgress: function (progress) {
|
|
177
177
|
var _a;
|
|
@@ -183,6 +183,8 @@ var initPlayer = function (config) {
|
|
|
183
183
|
return [4, player.getConfigurator()];
|
|
184
184
|
case 2:
|
|
185
185
|
configurator = _a.sent();
|
|
186
|
+
orgId = player.enableApi(types_1.PRIVATE_APIS.PLAYER).orgId;
|
|
187
|
+
connection_1.default.connect({ orgId: orgId });
|
|
186
188
|
if (window.threekit) {
|
|
187
189
|
window.threekit = Object.assign(window.threekit, {
|
|
188
190
|
player: player,
|
|
@@ -250,7 +252,7 @@ var initPlayer = function (config) {
|
|
|
250
252
|
exports.initPlayer = initPlayer;
|
|
251
253
|
var launch = function (launchConfig) {
|
|
252
254
|
return function (dispatch) { return __awaiter(void 0, void 0, void 0, function () {
|
|
253
|
-
var config, productId, credentials, productsRaw, products, threekitEnv, serverUrl, playerConfig, envCredentials, _a, assetIdRaw, stageId, configurationId, initialConfigurationRaw, assetId, threekitDomainRaw,
|
|
255
|
+
var config, productId, credentials, productsRaw, products, threekitEnv, serverUrl, playerConfig, envCredentials, _a, assetIdRaw, stageId, configurationId, initialConfigurationRaw, assetId, threekitDomainRaw, authToken, el, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration;
|
|
254
256
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
255
257
|
return __generator(this, function (_j) {
|
|
256
258
|
switch (_j.label) {
|
|
@@ -313,7 +315,7 @@ var launch = function (launchConfig) {
|
|
|
313
315
|
_a = products[productId][threekitEnv] || {}, assetIdRaw = _a.assetId, stageId = _a.stageId, configurationId = _a.configurationId, initialConfigurationRaw = _a.initialConfiguration;
|
|
314
316
|
assetId = (launchConfig === null || launchConfig === void 0 ? void 0 : launchConfig.assetId) || assetIdRaw;
|
|
315
317
|
threekitDomainRaw = envCredentials.threekitDomain || "".concat(threekitEnv, ".threekit.com");
|
|
316
|
-
|
|
318
|
+
authToken = envCredentials.publicToken;
|
|
317
319
|
if (playerConfig.elementId) {
|
|
318
320
|
el = document.getElementById(playerConfig.elementId);
|
|
319
321
|
if (el)
|
|
@@ -325,7 +327,6 @@ var launch = function (launchConfig) {
|
|
|
325
327
|
}
|
|
326
328
|
connection_1.default.connect({
|
|
327
329
|
authToken: authToken,
|
|
328
|
-
orgId: orgId,
|
|
329
330
|
assetId: assetId,
|
|
330
331
|
threekitDomain: threekitDomainRaw,
|
|
331
332
|
serverUrl: serverUrl,
|
|
@@ -361,7 +362,6 @@ var launch = function (launchConfig) {
|
|
|
361
362
|
_j.sent();
|
|
362
363
|
return [4, dispatch((0, exports.initPlayer)({
|
|
363
364
|
el: el,
|
|
364
|
-
orgId: orgId,
|
|
365
365
|
authToken: authToken,
|
|
366
366
|
stageId: stageId,
|
|
367
367
|
assetId: updatedAssetId,
|
|
@@ -446,7 +446,6 @@ var reloadPlayer = function (config) {
|
|
|
446
446
|
_a.label = 6;
|
|
447
447
|
case 6: return [4, dispatch((0, exports.initPlayer)({
|
|
448
448
|
el: el,
|
|
449
|
-
orgId: connectionObj.orgId,
|
|
450
449
|
authToken: connectionObj.authToken,
|
|
451
450
|
stageId: stageId,
|
|
452
451
|
assetId: assetId,
|
package/dist/types.d.ts
CHANGED
|
@@ -281,14 +281,24 @@ export interface IThreekitPlayer {
|
|
|
281
281
|
unload: () => Promise<string>;
|
|
282
282
|
}
|
|
283
283
|
export interface IThreekitPrivateConfigurator extends IThreekitConfigurator {
|
|
284
|
+
name: string;
|
|
285
|
+
metadata: IMetadata;
|
|
284
286
|
getAppliedConfiguration: (attributeName: string) => string;
|
|
285
287
|
getFullConfiguration: () => IConfiguration;
|
|
286
288
|
}
|
|
287
289
|
export interface IThreekitPrivatePlayer {
|
|
290
|
+
v: string;
|
|
291
|
+
id: string;
|
|
292
|
+
assetId: string;
|
|
293
|
+
stageId: undefined | string;
|
|
294
|
+
instanceId: string;
|
|
295
|
+
assetType: string;
|
|
296
|
+
orgId: string;
|
|
297
|
+
rect: DOMRect;
|
|
298
|
+
isFullscreen: boolean;
|
|
299
|
+
zoomDisabled: boolean;
|
|
288
300
|
getConfigurator: () => IThreekitPrivateConfigurator;
|
|
289
|
-
configurator:
|
|
290
|
-
getFullConfiguration: () => IConfiguration;
|
|
291
|
-
};
|
|
301
|
+
configurator: IThreekitPrivateConfigurator;
|
|
292
302
|
calculateLogs: () => Promise<Record<string, any>>;
|
|
293
303
|
getAssetInstance: (query: ISceneQueryNode | string) => Promise<string>;
|
|
294
304
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threekit-tools/treble",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.87",
|
|
4
4
|
"author": "Amaan Saeed",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"lint-staged": "lint-staged",
|
|
33
33
|
"check-format": "prettier -c ./src",
|
|
34
34
|
"format": "prettier --write ./src",
|
|
35
|
-
"test": "jest"
|
|
35
|
+
"test": "jest",
|
|
36
|
+
"deploy": "npm run build && npm publish"
|
|
36
37
|
},
|
|
37
38
|
"lint-staged": {
|
|
38
39
|
"./src/**/*.{css,less,scss,html,json,jsx,js,tsx,ts}": [
|