@threekit-tools/treble 0.0.94 → 0.0.95
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/Treble/Treble.js +1 -1
- package/dist/Treble/snapshots.d.ts +1 -1
- package/dist/Treble/snapshots.js +1 -1
- package/dist/Treble/wishlist.d.ts +1 -1
- package/dist/Treble/wishlist.js +1 -1
- package/dist/api/assets.js +1 -1
- package/dist/api/catalog.js +1 -1
- package/dist/api/configurations.js +1 -1
- package/dist/api/datatables.js +1 -1
- package/dist/api/orders.js +1 -1
- package/dist/api/price.js +1 -1
- package/dist/components/AttributeTitle/index.d.ts +2 -2
- package/dist/components/AttributeValue/index.d.ts +2 -2
- package/dist/components/BreatheAnimation/index.js +1 -1
- package/dist/components/Button/index.d.ts +3 -3
- package/dist/components/Cards/index.d.ts +3 -3
- package/dist/components/DevTools/index.d.ts +2 -2
- package/dist/components/DraggableHint/draggableIndicator.styles.d.ts +1 -1
- package/dist/components/DraggableHint/index.d.ts +2 -2
- package/dist/components/Dropdown/index.d.ts +3 -3
- package/dist/components/FlatForm/index.d.ts +2 -2
- package/dist/components/FormComponentDescription/index.d.ts +1 -1
- package/dist/components/FormComponentTitle/index.d.ts +1 -1
- package/dist/components/Player/index.d.ts +9 -9
- package/dist/components/PlayerLoadingCircular/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/index.d.ts +2 -2
- package/dist/components/PlayerLoadingSpinner/playerLoadingSpinner.styles.d.ts +1 -1
- package/dist/components/ProductDescription/index.d.ts +3 -3
- package/dist/components/ProductName/index.d.ts +3 -3
- package/dist/components/Share/index.d.ts +2 -2
- package/dist/components/Share/index.js +1 -1
- package/dist/components/Share/share.styles.d.ts +1 -1
- package/dist/components/Snapshots/index.d.ts +2 -2
- package/dist/components/Strips/index.d.ts +3 -3
- package/dist/components/Swatch/index.d.ts +3 -3
- package/dist/components/Switch/index.d.ts +3 -3
- package/dist/components/TextInput/index.d.ts +3 -3
- package/dist/components/ThreekitProvider/index.d.ts +1 -1
- package/dist/components/Tiles/index.d.ts +3 -3
- package/dist/components/TilesGroup/index.d.ts +3 -3
- package/dist/components/TotalPrice/index.d.ts +3 -3
- package/dist/components/TrebleApp/index.d.ts +3 -3
- package/dist/components/TurntableAnimation/index.js +1 -1
- package/dist/components/Upload/index.d.ts +3 -3
- package/dist/components/Upload/index.js +1 -1
- package/dist/components/UploadArea/index.d.ts +3 -3
- package/dist/components/UploadArea/index.js +1 -1
- package/dist/components/Wishlist/WishlistItem.d.ts +2 -2
- package/dist/components/Wishlist/index.d.ts +4 -4
- package/dist/components/Wishlist/index.js +1 -1
- package/dist/components/Zoom/index.d.ts +6 -6
- package/dist/components/containers/formInputContainer.d.ts +2 -2
- package/dist/components/formComponents.d.ts +6 -6
- package/dist/components/message/index.d.ts +1 -1
- package/dist/constants.d.ts +6 -6
- package/dist/hooks/useAttribute/index.d.ts +4 -4
- package/dist/hooks/useAttribute/index.js +1 -1
- package/dist/hooks/useConfigurationLoader/index.js +1 -1
- package/dist/hooks/useConfigurator/index.d.ts +3 -3
- package/dist/hooks/useDevTools/index.d.ts +1 -1
- package/dist/hooks/useNestedConfigurator/index.d.ts +2 -2
- package/dist/hooks/useNestedConfigurator/index.js +2 -2
- package/dist/hooks/usePlayer/index.d.ts +1 -1
- package/dist/hooks/usePlayerPortal/index.d.ts +1 -1
- package/dist/hooks/useProductCache/index.js +1 -1
- package/dist/hooks/useResetProduct/index.d.ts +1 -1
- package/dist/hooks/useResetProduct/index.js +1 -1
- package/dist/hooks/useRoomBuilder/RoomBuilderState.js +1 -1
- package/dist/hooks/useRoomBuilder/constants.js +2 -2
- package/dist/hooks/useRoomBuilder/themes.js +1 -1
- package/dist/hooks/useRoomBuilder/types.d.ts +7 -7
- package/dist/hooks/useRoomBuilder/types.js +5 -5
- package/dist/hooks/useRoomBuilder/validators.d.ts +1 -1
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +1 -1
- package/dist/hooks/useSingleAnimation/index.js +1 -1
- package/dist/hooks/useWishlist/index.d.ts +1 -1
- package/dist/hooks/useZoom/index.d.ts +1 -1
- package/dist/http/assets.d.ts +1 -1
- package/dist/http/orders.d.ts +1 -1
- package/dist/icons/Spinner.d.ts +2 -2
- package/dist/icons/types.d.ts +1 -1
- package/dist/store/attributes.d.ts +3 -3
- package/dist/store/attributes.js +1 -1
- package/dist/store/index.d.ts +33 -12
- package/dist/store/price.d.ts +1 -1
- package/dist/store/price.js +1 -1
- package/dist/store/product.d.ts +2 -2
- package/dist/store/product.js +1 -1
- package/dist/store/translations.d.ts +1 -1
- package/dist/store/translations.js +1 -1
- package/dist/store/treble.d.ts +1 -1
- package/dist/store/treble.js +1 -1
- package/dist/store/wishlist.d.ts +4 -22
- package/dist/store/wishlist.js +1 -1
- package/dist/types.d.ts +17 -17
- package/dist/types.js +9 -9
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +3 -3
- package/package.json +1 -1
package/dist/store/index.d.ts
CHANGED
|
@@ -1,58 +1,79 @@
|
|
|
1
1
|
import { TypedUseSelectorHook } from 'react-redux';
|
|
2
2
|
import { Reducer } from 'redux';
|
|
3
|
-
declare const store: import("@reduxjs/toolkit
|
|
3
|
+
declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
4
4
|
treble: import("./treble").TrebleState;
|
|
5
5
|
product: import("./product").ProductState;
|
|
6
6
|
attributes: import("./attributes").AttributesState;
|
|
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<
|
|
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, null> | 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
|
|
25
|
-
export declare const createStore: (reducer?: Record<string, Reducer>) => import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<{
|
|
24
|
+
}, import("redux").AnyAction, undefined> | import("redux").Middleware<{}, {
|
|
26
25
|
treble: import("./treble").TrebleState;
|
|
27
26
|
product: import("./product").ProductState;
|
|
28
27
|
attributes: import("./attributes").AttributesState;
|
|
29
28
|
translations: import("./translations").TranslationsState;
|
|
30
29
|
wishlist: import("../Treble").WishlistArray;
|
|
31
30
|
price: import("./price").PriceState;
|
|
32
|
-
}, import("redux").
|
|
31
|
+
}, import("redux").Dispatch<import("redux").AnyAction>>>>;
|
|
32
|
+
export declare const createStore: (reducer?: Record<string, Reducer>) => import("@reduxjs/toolkit").EnhancedStore<{
|
|
33
33
|
treble: import("./treble").TrebleState;
|
|
34
34
|
product: import("./product").ProductState;
|
|
35
35
|
attributes: import("./attributes").AttributesState;
|
|
36
36
|
translations: import("./translations").TranslationsState;
|
|
37
37
|
wishlist: import("../Treble").WishlistArray;
|
|
38
38
|
price: import("./price").PriceState;
|
|
39
|
-
}, import("redux").AnyAction
|
|
39
|
+
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<import("redux-thunk").ThunkMiddleware<{
|
|
40
40
|
treble: import("./treble").TrebleState;
|
|
41
41
|
product: import("./product").ProductState;
|
|
42
42
|
attributes: import("./attributes").AttributesState;
|
|
43
43
|
translations: import("./translations").TranslationsState;
|
|
44
44
|
wishlist: import("../Treble").WishlistArray;
|
|
45
45
|
price: import("./price").PriceState;
|
|
46
|
-
}, import("redux").AnyAction
|
|
47
|
-
export type RootState = ReturnType<typeof store.getState>;
|
|
48
|
-
export type ThreekitDispatch = typeof store.dispatch;
|
|
49
|
-
export declare const useThreekitDispatch: () => import("@reduxjs/toolkit").ThunkDispatch<{
|
|
46
|
+
}, import("redux").AnyAction, null> | import("redux-thunk").ThunkMiddleware<{
|
|
50
47
|
treble: import("./treble").TrebleState;
|
|
51
48
|
product: import("./product").ProductState;
|
|
52
49
|
attributes: import("./attributes").AttributesState;
|
|
53
50
|
translations: import("./translations").TranslationsState;
|
|
54
51
|
wishlist: import("../Treble").WishlistArray;
|
|
55
52
|
price: import("./price").PriceState;
|
|
56
|
-
},
|
|
53
|
+
}, import("redux").AnyAction, undefined> | import("redux").Middleware<{}, {
|
|
54
|
+
treble: import("./treble").TrebleState;
|
|
55
|
+
product: import("./product").ProductState;
|
|
56
|
+
attributes: import("./attributes").AttributesState;
|
|
57
|
+
translations: import("./translations").TranslationsState;
|
|
58
|
+
wishlist: import("../Treble").WishlistArray;
|
|
59
|
+
price: import("./price").PriceState;
|
|
60
|
+
}, import("redux").Dispatch<import("redux").AnyAction>>>>;
|
|
61
|
+
export declare type RootState = ReturnType<typeof store.getState>;
|
|
62
|
+
export declare type ThreekitDispatch = typeof store.dispatch;
|
|
63
|
+
export declare const useThreekitDispatch: () => import("redux").Dispatch<import("redux").AnyAction> & import("@reduxjs/toolkit").ThunkDispatch<{
|
|
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<{
|
|
71
|
+
treble: import("./treble").TrebleState;
|
|
72
|
+
product: import("./product").ProductState;
|
|
73
|
+
attributes: import("./attributes").AttributesState;
|
|
74
|
+
translations: import("./translations").TranslationsState;
|
|
75
|
+
wishlist: import("../Treble").WishlistArray;
|
|
76
|
+
price: import("./price").PriceState;
|
|
77
|
+
}, undefined, import("redux").AnyAction>;
|
|
57
78
|
export declare const useThreekitSelector: TypedUseSelectorHook<RootState>;
|
|
58
79
|
export default createStore;
|
package/dist/store/price.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface PriceState {
|
|
|
15
15
|
export declare const setPriceConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<IPriceConfig, string>;
|
|
16
16
|
export declare const setPrice: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
|
|
17
17
|
export declare const initPrice: () => (dispatch: ThreekitDispatch) => Promise<void>;
|
|
18
|
-
declare const reducer: import("redux").Reducer<PriceState>;
|
|
18
|
+
declare const reducer: import("redux").Reducer<PriceState, import("redux").AnyAction>;
|
|
19
19
|
export declare const getPrice: (state: RootState) => undefined | IPrice;
|
|
20
20
|
export declare const getPriceConfig: (state: RootState) => undefined | IPriceConfig;
|
|
21
21
|
export declare const updatePrice: () => (dispatch: ThreekitDispatch, getState: () => RootState) => void;
|
package/dist/store/price.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/store/product.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface LoadProductConfig {
|
|
|
16
16
|
export interface CachedProductState extends Pick<CachedProduct, 'id' | 'name' | 'label' | 'thumbnail'> {
|
|
17
17
|
data: string;
|
|
18
18
|
}
|
|
19
|
-
type IEnvConfig = Record<string, Partial<IProduct>>;
|
|
19
|
+
declare type IEnvConfig = Record<string, Partial<IProduct>>;
|
|
20
20
|
export interface IHydratedProducts extends Record<string, IEnvConfig> {
|
|
21
21
|
}
|
|
22
22
|
export interface ProductState {
|
|
@@ -36,7 +36,7 @@ export declare const removeFromCache: import("@reduxjs/toolkit").ActionCreatorWi
|
|
|
36
36
|
export declare const setActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
|
|
37
37
|
export declare const incrementActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
|
|
38
38
|
export declare const decrementActiveCacheIdx: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<undefined, string>;
|
|
39
|
-
declare const reducer: import("redux").Reducer<ProductState>;
|
|
39
|
+
declare const reducer: import("redux").Reducer<ProductState, import("redux").AnyAction>;
|
|
40
40
|
export declare const getProductId: (state: RootState) => undefined | string;
|
|
41
41
|
export declare const getName: (state: RootState) => undefined | string;
|
|
42
42
|
export declare const getMetadata: (state: RootState) => undefined | IMetadata;
|
package/dist/store/product.js
CHANGED
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (
|
|
28
|
+
while (_) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -7,7 +7,7 @@ export interface TranslationsState {
|
|
|
7
7
|
export declare const setLocale: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>;
|
|
8
8
|
export declare const setTranslationsMap: import("@reduxjs/toolkit").ActionCreatorWithPayload<ITranslationsMap, string>;
|
|
9
9
|
export declare const initTranslations: (locale?: string) => (dispatch: ThreekitDispatch) => Promise<void>;
|
|
10
|
-
declare const reducer: import("redux").Reducer<TranslationsState>;
|
|
10
|
+
declare const reducer: import("redux").Reducer<TranslationsState, import("redux").AnyAction>;
|
|
11
11
|
export declare const getLocale: (state: RootState) => undefined | string;
|
|
12
12
|
export declare const getTranslations: (state: RootState) => ITranslationsMap;
|
|
13
13
|
export declare const setTranslationForLocale: (locale: string | null) => (dispatch: ThreekitDispatch, getState: () => RootState) => void;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/store/treble.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare const setPlayerElement: import("@reduxjs/toolkit").ActionCreatorW
|
|
|
56
56
|
export declare const reloadTreble: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<TrebleState>, string>;
|
|
57
57
|
export declare const updateLoadingProgress: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
|
|
58
58
|
export declare const setPlayerInteraction: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
|
|
59
|
-
declare const reducer: import("redux").Reducer<TrebleState>;
|
|
59
|
+
declare const reducer: import("redux").Reducer<TrebleState, import("redux").AnyAction>;
|
|
60
60
|
export declare const getThreekitEnv: (state: RootState) => string;
|
|
61
61
|
export declare const isThreekitInitialized: (state: RootState) => boolean;
|
|
62
62
|
export declare const isFirstRenderComplete: (state: RootState) => boolean;
|
package/dist/store/treble.js
CHANGED
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (
|
|
28
|
+
while (_) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
package/dist/store/wishlist.d.ts
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import { RootState, ThreekitDispatch } from './index';
|
|
2
2
|
import { WishlistArray } from '../Treble';
|
|
3
3
|
import { ISaveConfiguration } from '../api/configurations';
|
|
4
|
-
export type WishlistState = WishlistArray;
|
|
5
|
-
export declare const refreshWishlist: import("@reduxjs/toolkit").AsyncThunk<import("../http/configurations").IConfigurationResponse[], void, {
|
|
6
|
-
|
|
7
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
8
|
-
extra?: unknown;
|
|
9
|
-
rejectValue?: unknown;
|
|
10
|
-
serializedErrorType?: unknown;
|
|
11
|
-
pendingMeta?: unknown;
|
|
12
|
-
fulfilledMeta?: unknown;
|
|
13
|
-
rejectedMeta?: unknown;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const addToWishlist: import("@reduxjs/toolkit").AsyncThunk<import("../http/configurations").IConfigurationResponse[], Omit<ISaveConfiguration, "configuration">, {
|
|
16
|
-
state?: unknown;
|
|
17
|
-
dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
|
|
18
|
-
extra?: unknown;
|
|
19
|
-
rejectValue?: unknown;
|
|
20
|
-
serializedErrorType?: unknown;
|
|
21
|
-
pendingMeta?: unknown;
|
|
22
|
-
fulfilledMeta?: unknown;
|
|
23
|
-
rejectedMeta?: unknown;
|
|
24
|
-
}>;
|
|
4
|
+
export declare type WishlistState = WishlistArray;
|
|
5
|
+
export declare const refreshWishlist: import("@reduxjs/toolkit").AsyncThunk<import("../http/configurations").IConfigurationResponse[], void, {}>;
|
|
6
|
+
export declare const addToWishlist: import("@reduxjs/toolkit").AsyncThunk<import("../http/configurations").IConfigurationResponse[], Omit<ISaveConfiguration, "configuration">, {}>;
|
|
25
7
|
export declare const clearWishlist: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[], import("../http/configurations").IConfigurationResponse[], "treble/wishlist/clear", never, never>;
|
|
26
8
|
export declare const removeFromWishlist: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[idx: number], import("../http/configurations").IConfigurationResponse[], "treble/wishlist/remove-item", never, never>;
|
|
27
|
-
declare const reducer: import("redux").Reducer<WishlistArray>;
|
|
9
|
+
declare const reducer: import("redux").Reducer<WishlistArray, import("redux").AnyAction>;
|
|
28
10
|
export declare const getWishlist: (state: RootState) => WishlistArray;
|
|
29
11
|
export declare const resumeFromWishlist: (idx: number) => (_: ThreekitDispatch, getState: () => RootState) => void;
|
|
30
12
|
export default reducer;
|
package/dist/store/wishlist.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/types.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare enum SNAPSHOT_OUTPUTS {
|
|
|
46
46
|
BLOB = "blob",
|
|
47
47
|
FILE = "file"
|
|
48
48
|
}
|
|
49
|
-
export type IMetadata = Record<string, string | number | null>;
|
|
49
|
+
export declare type IMetadata = Record<string, string | number | null>;
|
|
50
50
|
export interface ISceneQueryShared {
|
|
51
51
|
all?: boolean;
|
|
52
52
|
id?: string;
|
|
@@ -79,7 +79,7 @@ export interface ISceneQueryTransform extends ISceneQueryShared {
|
|
|
79
79
|
plug: PLUG_TYPES.TRANSFORM;
|
|
80
80
|
property: TRANSFORM_PROPERTY_TYPES;
|
|
81
81
|
}
|
|
82
|
-
export type ISceneQuery = ISceneQueryNode | ISceneQueryTransform | string;
|
|
82
|
+
export declare type ISceneQuery = ISceneQueryNode | ISceneQueryTransform | string;
|
|
83
83
|
export interface ISceneResult {
|
|
84
84
|
id: string;
|
|
85
85
|
name: string;
|
|
@@ -97,9 +97,9 @@ export interface IConfigurationColor {
|
|
|
97
97
|
g: number;
|
|
98
98
|
b: number;
|
|
99
99
|
}
|
|
100
|
-
export type IConfigurationAttribute = IConfigurationAsset | IConfigurationArray | IConfigurationColor | string | number | boolean | undefined;
|
|
101
|
-
export type IConfiguration = Record<string, IConfigurationAttribute>;
|
|
102
|
-
export type ISetConfiguration = Record<string, IConfigurationAttribute>;
|
|
100
|
+
export declare type IConfigurationAttribute = IConfigurationAsset | IConfigurationArray | IConfigurationColor | string | number | boolean | undefined;
|
|
101
|
+
export declare type IConfiguration = Record<string, IConfigurationAttribute>;
|
|
102
|
+
export declare type ISetConfiguration = Record<string, IConfigurationAttribute>;
|
|
103
103
|
interface IDisplayAttributeConfig {
|
|
104
104
|
includeHidden?: boolean;
|
|
105
105
|
}
|
|
@@ -135,9 +135,9 @@ export interface IAttributeAssetBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.A
|
|
|
135
135
|
disabledValues?: Array<string>;
|
|
136
136
|
values: Array<V>;
|
|
137
137
|
}
|
|
138
|
-
export type IDisplayAttributeAsset = IAttributeAssetBase<IDisplayAttributeAssetValue>;
|
|
139
|
-
export type IHydratedAttributeAsset = IAttributeAssetBase<IHydratedAttributeAssetValue>;
|
|
140
|
-
export type IAttributeAsset = IAttributeAssetBase<IConfigurationAssetValue>;
|
|
138
|
+
export declare type IDisplayAttributeAsset = IAttributeAssetBase<IDisplayAttributeAssetValue>;
|
|
139
|
+
export declare type IHydratedAttributeAsset = IAttributeAssetBase<IHydratedAttributeAssetValue>;
|
|
140
|
+
export declare type IAttributeAsset = IAttributeAssetBase<IConfigurationAssetValue>;
|
|
141
141
|
export interface IConfigurationArrayValue {
|
|
142
142
|
assetId: string;
|
|
143
143
|
name: string;
|
|
@@ -167,9 +167,9 @@ export interface IAttributeArrayBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.A
|
|
|
167
167
|
assetType: ASSET_TYPES;
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
export type IDisplayAttributeArray = IAttributeArrayBase<IDisplayAttributeArrayValue>;
|
|
171
|
-
export type IHydratedAttributeArray = IAttributeArrayBase<IHydratedAttributeArrayValue>;
|
|
172
|
-
export type IAttributeArray = IAttributeArrayBase<Pick<IConfigurationArrayValue, 'assetId'>>;
|
|
170
|
+
export declare type IDisplayAttributeArray = IAttributeArrayBase<IDisplayAttributeArrayValue>;
|
|
171
|
+
export declare type IHydratedAttributeArray = IAttributeArrayBase<IHydratedAttributeArrayValue>;
|
|
172
|
+
export declare type IAttributeArray = IAttributeArrayBase<Pick<IConfigurationArrayValue, 'assetId'>>;
|
|
173
173
|
export interface IDisplayAttributeStringValue {
|
|
174
174
|
label: string;
|
|
175
175
|
value: string;
|
|
@@ -185,9 +185,9 @@ export interface IAttributeStringBase<V> extends IAttributeBase<ATTRIBUTE_TYPES.
|
|
|
185
185
|
disabledValues?: Array<string>;
|
|
186
186
|
values: Array<V>;
|
|
187
187
|
}
|
|
188
|
-
export type IDisplayAttributeString = IAttributeStringBase<IDisplayAttributeStringValue>;
|
|
189
|
-
export type IHydratedAttributeString = IAttributeStringBase<IHydratedAttributeStringValue>;
|
|
190
|
-
export type IAttributeString = IAttributeStringBase<string>;
|
|
188
|
+
export declare type IDisplayAttributeString = IAttributeStringBase<IDisplayAttributeStringValue>;
|
|
189
|
+
export declare type IHydratedAttributeString = IAttributeStringBase<IHydratedAttributeStringValue>;
|
|
190
|
+
export declare type IAttributeString = IAttributeStringBase<string>;
|
|
191
191
|
export interface IAttributeColor extends IAttributeBase<ATTRIBUTE_TYPES.COLOR, IConfigurationColor> {
|
|
192
192
|
defaultValue: IConfigurationColor;
|
|
193
193
|
}
|
|
@@ -201,9 +201,9 @@ export interface IAttributeNumber extends IAttributeBase<ATTRIBUTE_TYPES.NUMBER,
|
|
|
201
201
|
export interface IAttributeBoolean extends IAttributeBase<ATTRIBUTE_TYPES.BOOLEAN, boolean> {
|
|
202
202
|
defaultValue: boolean;
|
|
203
203
|
}
|
|
204
|
-
export type IThreekitAttribute = IAttributeAsset | IAttributeArray | IAttributeColor | IAttributeString | IAttributeNumber | IAttributeBoolean;
|
|
205
|
-
export type IThreekitDisplayAttribute = IDisplayAttributeAsset | IDisplayAttributeArray | IDisplayAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
|
|
206
|
-
export type IHydratedAttribute = IHydratedAttributeAsset | IHydratedAttributeArray | IHydratedAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
|
|
204
|
+
export declare type IThreekitAttribute = IAttributeAsset | IAttributeArray | IAttributeColor | IAttributeString | IAttributeNumber | IAttributeBoolean;
|
|
205
|
+
export declare type IThreekitDisplayAttribute = IDisplayAttributeAsset | IDisplayAttributeArray | IDisplayAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
|
|
206
|
+
export declare type IHydratedAttribute = IHydratedAttributeAsset | IHydratedAttributeArray | IHydratedAttributeString | IAttributeColor | IAttributeNumber | IAttributeBoolean;
|
|
207
207
|
export interface ICoordinates {
|
|
208
208
|
x: number;
|
|
209
209
|
y: number;
|
package/dist/types.js
CHANGED
|
@@ -6,17 +6,17 @@ var SCENE_PHASES;
|
|
|
6
6
|
SCENE_PHASES["LOADED"] = "loaded";
|
|
7
7
|
SCENE_PHASES["PRELOADED"] = "preloaded";
|
|
8
8
|
SCENE_PHASES["RENDERED"] = "rendered";
|
|
9
|
-
})(SCENE_PHASES
|
|
9
|
+
})(SCENE_PHASES = exports.SCENE_PHASES || (exports.SCENE_PHASES = {}));
|
|
10
10
|
var PRIVATE_APIS;
|
|
11
11
|
(function (PRIVATE_APIS) {
|
|
12
12
|
PRIVATE_APIS["SCENE"] = "scene";
|
|
13
13
|
PRIVATE_APIS["PLAYER"] = "player";
|
|
14
|
-
})(PRIVATE_APIS
|
|
14
|
+
})(PRIVATE_APIS = exports.PRIVATE_APIS || (exports.PRIVATE_APIS = {}));
|
|
15
15
|
var DISPLAY_OPTIONS;
|
|
16
16
|
(function (DISPLAY_OPTIONS) {
|
|
17
17
|
DISPLAY_OPTIONS["WEBGL"] = "webgl";
|
|
18
18
|
DISPLAY_OPTIONS["IMAGE"] = "image";
|
|
19
|
-
})(DISPLAY_OPTIONS
|
|
19
|
+
})(DISPLAY_OPTIONS = exports.DISPLAY_OPTIONS || (exports.DISPLAY_OPTIONS = {}));
|
|
20
20
|
var ATTRIBUTE_TYPES;
|
|
21
21
|
(function (ATTRIBUTE_TYPES) {
|
|
22
22
|
ATTRIBUTE_TYPES["STRING"] = "String";
|
|
@@ -25,28 +25,28 @@ var ATTRIBUTE_TYPES;
|
|
|
25
25
|
ATTRIBUTE_TYPES["NUMBER"] = "Number";
|
|
26
26
|
ATTRIBUTE_TYPES["BOOLEAN"] = "Boolean";
|
|
27
27
|
ATTRIBUTE_TYPES["ARRAY"] = "Array";
|
|
28
|
-
})(ATTRIBUTE_TYPES
|
|
28
|
+
})(ATTRIBUTE_TYPES = exports.ATTRIBUTE_TYPES || (exports.ATTRIBUTE_TYPES = {}));
|
|
29
29
|
var ASSET_TYPES;
|
|
30
30
|
(function (ASSET_TYPES) {
|
|
31
31
|
ASSET_TYPES["UPLOAD"] = "upload";
|
|
32
32
|
ASSET_TYPES["ITEM"] = "item";
|
|
33
|
-
})(ASSET_TYPES
|
|
33
|
+
})(ASSET_TYPES = exports.ASSET_TYPES || (exports.ASSET_TYPES = {}));
|
|
34
34
|
var PLUG_TYPES;
|
|
35
35
|
(function (PLUG_TYPES) {
|
|
36
36
|
PLUG_TYPES["PROXY"] = "Proxy";
|
|
37
37
|
PLUG_TYPES["TRANSFORM"] = "Transform";
|
|
38
|
-
})(PLUG_TYPES
|
|
38
|
+
})(PLUG_TYPES = exports.PLUG_TYPES || (exports.PLUG_TYPES = {}));
|
|
39
39
|
var TRANSFORM_PROPERTY_TYPES;
|
|
40
40
|
(function (TRANSFORM_PROPERTY_TYPES) {
|
|
41
41
|
TRANSFORM_PROPERTY_TYPES["ROTATION"] = "rotation";
|
|
42
42
|
TRANSFORM_PROPERTY_TYPES["TRANSLATION"] = "translation";
|
|
43
43
|
TRANSFORM_PROPERTY_TYPES["SCALE"] = "scale";
|
|
44
|
-
})(TRANSFORM_PROPERTY_TYPES
|
|
44
|
+
})(TRANSFORM_PROPERTY_TYPES = exports.TRANSFORM_PROPERTY_TYPES || (exports.TRANSFORM_PROPERTY_TYPES = {}));
|
|
45
45
|
var SNAPSHOT_FORMATS;
|
|
46
46
|
(function (SNAPSHOT_FORMATS) {
|
|
47
47
|
SNAPSHOT_FORMATS["JPG"] = "jpg";
|
|
48
48
|
SNAPSHOT_FORMATS["PNG"] = "png";
|
|
49
|
-
})(SNAPSHOT_FORMATS
|
|
49
|
+
})(SNAPSHOT_FORMATS = exports.SNAPSHOT_FORMATS || (exports.SNAPSHOT_FORMATS = {}));
|
|
50
50
|
var SNAPSHOT_OUTPUTS;
|
|
51
51
|
(function (SNAPSHOT_OUTPUTS) {
|
|
52
52
|
SNAPSHOT_OUTPUTS["URL"] = "url";
|
|
@@ -54,4 +54,4 @@ var SNAPSHOT_OUTPUTS;
|
|
|
54
54
|
SNAPSHOT_OUTPUTS["DATA_URL"] = "dataUrl";
|
|
55
55
|
SNAPSHOT_OUTPUTS["BLOB"] = "blob";
|
|
56
56
|
SNAPSHOT_OUTPUTS["FILE"] = "file";
|
|
57
|
-
})(SNAPSHOT_OUTPUTS
|
|
57
|
+
})(SNAPSHOT_OUTPUTS = exports.SNAPSHOT_OUTPUTS || (exports.SNAPSHOT_OUTPUTS = {}));
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IThreekitCamera, IConfigurationColor, ICoordinates, IQuaternion, IThreekitDisplayAttribute, ISetConfiguration, IHydratedAttribute } from './types';
|
|
1
|
+
import { IThreekitCamera, IConfigurationColor, ICoordinates, IQuaternion, IThreekitDisplayAttribute, ISetConfiguration, IHydratedAttribute, IConfiguration } from './types';
|
|
2
2
|
import { ITrebleConfig, ATTRIBUTE_TYPES } from './types';
|
|
3
3
|
import { RawAttributeValue } from './hooks/useAttribute';
|
|
4
4
|
import { ITranslationsMap } from './http/assets';
|
|
@@ -48,7 +48,7 @@ export declare const downloadSnapshot: (snapshot: string, filename: string) => P
|
|
|
48
48
|
export declare const copyToClipboard: (data: string | Record<string, string | number | boolean>) => void;
|
|
49
49
|
export declare const easeInOutCubic: (val: number) => number;
|
|
50
50
|
export declare const metadataValueToObject: (data: string) => Record<string, string | number>;
|
|
51
|
-
export declare const hydrateAttribute: (data: [Record<string, IThreekitDisplayAttribute>, ITranslationsMap], optionSelectionHandler: (config: ISetConfiguration) => Promise<void
|
|
51
|
+
export declare const hydrateAttribute: (data: [Record<string, IThreekitDisplayAttribute>, ITranslationsMap], optionSelectionHandler: (config: ISetConfiguration) => Promise<void>, configuration?: IConfiguration) => Record<string, IHydratedAttribute>;
|
|
52
52
|
export declare const selectionToConfiguration: (value: RawAttributeValue, attributeType: ATTRIBUTE_TYPES) => string | number | boolean | File | IConfigurationColor | {
|
|
53
53
|
assetId: RawAttributeValue;
|
|
54
54
|
} | undefined;
|
package/dist/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -303,10 +303,10 @@ var metadataValueToObject = function (data) {
|
|
|
303
303
|
}, {});
|
|
304
304
|
};
|
|
305
305
|
exports.metadataValueToObject = metadataValueToObject;
|
|
306
|
-
var hydrateAttribute = function (data, optionSelectionHandler) {
|
|
306
|
+
var hydrateAttribute = function (data, optionSelectionHandler, configuration) {
|
|
307
307
|
var _a, _b;
|
|
308
308
|
var attributes = data[0], translations = data[1];
|
|
309
|
-
var resolvedConfig = (_b = (_a = window.threekit) === null || _a === void 0 ? void 0 : _a.configurator) === null || _b === void 0 ? void 0 : _b.getResolvedConfiguration();
|
|
309
|
+
var resolvedConfig = configuration !== null && configuration !== void 0 ? configuration : (_b = (_a = window.threekit) === null || _a === void 0 ? void 0 : _a.configurator) === null || _b === void 0 ? void 0 : _b.getResolvedConfiguration();
|
|
310
310
|
return Object.values(attributes).reduce(function (output, attribute) {
|
|
311
311
|
var _a;
|
|
312
312
|
var _b;
|