@threekit-tools/treble 0.0.14 → 0.0.15
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/FlatForm/index.d.ts +2 -1
- package/dist/components/FlatForm/index.js +5 -3
- package/dist/components/FormComponentTitle/formComponentTitle.styles.js +1 -1
- package/dist/components/PortalToElement/index.d.ts +1 -1
- package/dist/components/PortalToElement/index.js +4 -4
- package/dist/components/ProductDescription/description.styles.js +1 -1
- package/dist/components/ProductName/productName.styles.js +1 -1
- package/dist/components/containers/formInputContainer.d.ts +1 -1
- package/dist/hooks/useShare/index.d.ts +1 -1
- package/dist/hooks/useShare/index.js +2 -2
- package/dist/store/index.d.ts +2 -2
- package/dist/store/threekit.d.ts +3 -16
- package/dist/store/threekit.js +7 -9
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
interface FlatFormProps {
|
|
4
3
|
title?: string;
|
|
4
|
+
hideTitle?: boolean;
|
|
5
5
|
alignTitle?: string;
|
|
6
6
|
description?: string;
|
|
7
|
+
hideDescription?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
includeReservedAttributes: boolean;
|
|
9
10
|
}
|
|
@@ -27,16 +27,18 @@ var FlatForm = function (props) {
|
|
|
27
27
|
var _a = Object.assign({
|
|
28
28
|
alignTitle: 'center',
|
|
29
29
|
attributes: {},
|
|
30
|
+
hideTitle: false,
|
|
31
|
+
hideDescription: false,
|
|
30
32
|
includeReservedAttributes: false,
|
|
31
|
-
}, props), title = _a.title, alignTitle = _a.alignTitle, description = _a.description, attributes = _a.attributes, customClassName = _a.className, includeReservedAttributes = _a.includeReservedAttributes;
|
|
33
|
+
}, props), title = _a.title, hideTitle = _a.hideTitle, alignTitle = _a.alignTitle, description = _a.description, hideDescription = _a.hideDescription, attributes = _a.attributes, customClassName = _a.className, includeReservedAttributes = _a.includeReservedAttributes;
|
|
32
34
|
var attributesData = (0, useConfigurator_1.default)()[0];
|
|
33
35
|
if (!attributesData)
|
|
34
36
|
return null;
|
|
35
37
|
var filterAttributes = (0, utils_1.filterFormAttributes)(attributesData, attributes, includeReservedAttributes);
|
|
36
38
|
var cls = (0, utils_1.generateFormClassName)('flat-form', customClassName, title);
|
|
37
39
|
return (react_1.default.createElement(flatForm_styles_1.Wrapper, { className: cls },
|
|
38
|
-
react_1.default.createElement(ProductName_1.default, { align: alignTitle, title: title, className: customClassName }),
|
|
39
|
-
react_1.default.createElement(ProductDescription_1.default, { description: description, className: customClassName }),
|
|
40
|
+
hideTitle ? null : (react_1.default.createElement(ProductName_1.default, { align: alignTitle, title: title, className: customClassName })),
|
|
41
|
+
hideDescription ? null : (react_1.default.createElement(ProductDescription_1.default, { description: description, className: customClassName })),
|
|
40
42
|
filterAttributes.map(function (attr, i) {
|
|
41
43
|
var _a, _b, _c, _d, _e, _f;
|
|
42
44
|
var Component;
|
|
@@ -9,5 +9,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Wrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: 14px;\n font-size:
|
|
12
|
+
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: 14px;\n font-size: 18px;\n font-weight: 600;\n color: ", ";\n font-family: ", ";\n"], ["\n margin-bottom: 14px;\n font-size: 18px;\n font-weight: 600;\n color: ", ";\n font-family: ", ";\n"])), function (props) { return props.theme.headingColor; }, function (props) { return props.theme.fontFamily; });
|
|
13
13
|
var templateObject_1;
|
|
@@ -8,13 +8,13 @@ var react_1 = __importDefault(require("react"));
|
|
|
8
8
|
var react_dom_1 = require("react-dom");
|
|
9
9
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
10
10
|
var PortalToElement = function (props) {
|
|
11
|
-
var _a = Object.assign({ strict: false }, props), children = _a.children,
|
|
12
|
-
if (!
|
|
11
|
+
var _a = Object.assign({ strict: false }, props), children = _a.children, to = _a.to, strict = _a.strict;
|
|
12
|
+
if (!to) {
|
|
13
13
|
if (strict)
|
|
14
14
|
return null;
|
|
15
15
|
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
16
16
|
}
|
|
17
|
-
var htmlEl = document.getElementById(
|
|
17
|
+
var htmlEl = document.getElementById(to);
|
|
18
18
|
if (!htmlEl) {
|
|
19
19
|
if (strict)
|
|
20
20
|
return null;
|
|
@@ -27,7 +27,7 @@ exports.PortalToElement.propTypes = {
|
|
|
27
27
|
/**
|
|
28
28
|
* The id of the HTML element you want the content to be rendered in
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
to: prop_types_1.default.string,
|
|
31
31
|
/**
|
|
32
32
|
* Defines the behaviour if the HTML element is not found. If strict is
|
|
33
33
|
* set to `true` the content will not render, if set to `false` the
|
|
@@ -9,5 +9,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Wrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: 15px;\n color: #666;\n font-family: ", ";\n"], ["\n margin-bottom: 15px;\n color: #666;\n font-family: ", ";\n"])), function (props) { return props.theme.fontFamily; });
|
|
12
|
+
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: 15px;\n color: #666;\n font-size: 18px;\n font-family: ", ";\n"], ["\n margin-bottom: 15px;\n color: #666;\n font-size: 18px;\n font-family: ", ";\n"])), function (props) { return props.theme.fontFamily; });
|
|
13
13
|
var templateObject_1;
|
|
@@ -9,5 +9,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Wrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size:
|
|
12
|
+
exports.Wrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 32px;\n font-weight: 600;\n margin-bottom: 8px;\n text-align: ", ";\n font-family: ", ";\n"], ["\n font-size: 32px;\n font-weight: 600;\n margin-bottom: 8px;\n text-align: ", ";\n font-family: ", ";\n"])), function (props) { return props.align || 'left'; }, function (props) { return props.theme.fontFamily; });
|
|
13
13
|
var templateObject_1;
|
|
@@ -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").
|
|
48
|
+
selected: string | number | import("../../threekit").IConfigurationAsset | import("../../threekit").IConfigurationColor;
|
|
49
49
|
options: IDisplayAttributeAssetValue[] | {
|
|
50
50
|
name: string;
|
|
51
51
|
label: string;
|
|
@@ -57,11 +57,11 @@ var useShare = function () {
|
|
|
57
57
|
case 1:
|
|
58
58
|
configuration = _a.sent();
|
|
59
59
|
if (!configuration)
|
|
60
|
-
return [2 /*return
|
|
60
|
+
return [2 /*return*/, Promise.resolve(undefined)];
|
|
61
61
|
(0, utils_1.copyToClipboard)(configuration.resumableUrl);
|
|
62
62
|
if (msg === null || msg === void 0 ? void 0 : msg.length)
|
|
63
63
|
message_1.default.info(msg);
|
|
64
|
-
return [2 /*return
|
|
64
|
+
return [2 /*return*/, Promise.resolve((configuration === null || configuration === void 0 ? void 0 : configuration.resumableUrl) || undefined)];
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TypedUseSelectorHook } from 'react-redux';
|
|
2
2
|
declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
3
3
|
threekit: import("./threekit").ThreekitState;
|
|
4
|
-
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<import("redux
|
|
4
|
+
}, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<import("redux-thunk").ThunkMiddleware<{
|
|
5
5
|
threekit: import("./threekit").ThreekitState;
|
|
6
6
|
}, import("redux").AnyAction, null> | import("redux-thunk").ThunkMiddleware<{
|
|
7
7
|
threekit: import("./threekit").ThreekitState;
|
|
8
8
|
}, import("redux").AnyAction, undefined> | import("redux").Middleware<{}, {
|
|
9
9
|
threekit: import("./threekit").ThreekitState;
|
|
10
|
-
}, import("redux").Dispatch<import("redux").AnyAction>>>>;
|
|
10
|
+
}, import("redux").Dispatch<import("redux").AnyAction>> | import("redux").Middleware<{}, any, import("redux").Dispatch<import("redux").AnyAction>>>>;
|
|
11
11
|
export declare type RootState = ReturnType<typeof store.getState>;
|
|
12
12
|
export declare type ThreekitDispatch = typeof store.dispatch;
|
|
13
13
|
export declare const useThreekitDispatch: () => import("@reduxjs/toolkit").ThunkDispatch<{
|
package/dist/store/threekit.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RootState, ThreekitDispatch } from './index';
|
|
2
|
-
import {
|
|
2
|
+
import { ISetConfiguration, IThreekitDisplayAttribute, IMetadata, ThreekitInitConfig } from '../threekit';
|
|
3
3
|
import { ITranslationMap } from '../api/products';
|
|
4
4
|
import { ISaveConfigurationConfig, WishlistArray } from '../Treble';
|
|
5
5
|
/*****************************************************
|
|
@@ -8,30 +8,17 @@ import { ISaveConfigurationConfig, WishlistArray } from '../Treble';
|
|
|
8
8
|
export interface IThreekitCredentials {
|
|
9
9
|
publicToken: string;
|
|
10
10
|
assetId: string;
|
|
11
|
+
configurationId?: string;
|
|
11
12
|
orgId: string;
|
|
12
13
|
stageId?: string;
|
|
13
14
|
publishStage?: string;
|
|
14
15
|
threekitDomain?: string;
|
|
15
16
|
}
|
|
16
|
-
export interface ILaunchConfig {
|
|
17
|
+
export interface ILaunchConfig extends Omit<ThreekitInitConfig, 'el' | 'authToken' | 'orgId' | 'assetId' | 'stageId'> {
|
|
17
18
|
threekitEnv?: string;
|
|
18
19
|
preview: IThreekitCredentials;
|
|
19
20
|
'admin-fts': IThreekitCredentials;
|
|
20
|
-
configurationId?: string;
|
|
21
21
|
elementId?: string;
|
|
22
|
-
public: string;
|
|
23
|
-
cache?: string;
|
|
24
|
-
showConfigurator?: boolean;
|
|
25
|
-
initialConfiguration?: IConfiguration;
|
|
26
|
-
showLoadingThumbnail?: boolean;
|
|
27
|
-
showLoadingProgress?: boolean;
|
|
28
|
-
onLoadingProgress?: boolean;
|
|
29
|
-
showAR?: boolean;
|
|
30
|
-
showShare?: boolean;
|
|
31
|
-
locale?: string;
|
|
32
|
-
allowMobileVerticalOrbit?: boolean;
|
|
33
|
-
publishStage?: string;
|
|
34
|
-
display?: DISPLAY_OPTIONS;
|
|
35
22
|
language?: string | undefined;
|
|
36
23
|
}
|
|
37
24
|
interface IPriceConfig {
|
package/dist/store/threekit.js
CHANGED
|
@@ -87,7 +87,7 @@ var createPlayerLoaderEl = function (elementId) {
|
|
|
87
87
|
var initialState = {
|
|
88
88
|
// Player HTML element
|
|
89
89
|
playerElId: undefined,
|
|
90
|
-
// Name of the
|
|
90
|
+
// Name of the Initialized Item
|
|
91
91
|
name: undefined,
|
|
92
92
|
// Initialized item's metadata
|
|
93
93
|
metadata: undefined,
|
|
@@ -115,15 +115,15 @@ var _a = (0, toolkit_1.createSlice)({
|
|
|
115
115
|
setPlayerLoading: function (state, action) {
|
|
116
116
|
state.isPlayerLoading = action.payload;
|
|
117
117
|
},
|
|
118
|
-
//
|
|
118
|
+
// Initialized Item's Name
|
|
119
119
|
setPlayerElement: function (state, action) {
|
|
120
120
|
state.playerElId = action.payload;
|
|
121
121
|
},
|
|
122
|
-
//
|
|
122
|
+
// Initialized Item's Name
|
|
123
123
|
setName: function (state, action) {
|
|
124
124
|
state.name = action.payload;
|
|
125
125
|
},
|
|
126
|
-
//
|
|
126
|
+
// Initialized Item's Metadata
|
|
127
127
|
setMetadata: function (state, action) {
|
|
128
128
|
state.metadata = action.payload;
|
|
129
129
|
},
|
|
@@ -264,12 +264,10 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
|
|
|
264
264
|
var _a,
|
|
265
265
|
// Threekit Env specific credentials,
|
|
266
266
|
threekitEnv,
|
|
267
|
-
// User saved configuration
|
|
268
|
-
configurationId,
|
|
269
267
|
// Threekit Player Init
|
|
270
268
|
elementId,
|
|
271
269
|
// cache,
|
|
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;
|
|
270
|
+
showConfigurator, initialConfigurationRaw, showLoadingThumbnail, showLoadingProgress, onLoadingProgress, showAR, showShare, locale, allowMobileVerticalOrbit, publishStage, display, threekitCredentials, threekitDomainRaw, assetId, authToken, orgId, stageId, configurationId, threekitDomain, initialConfiguration, updatedAssetId, params, configId, configuration, el, _b, player, translations, pricebook, _c, priceConfig, productName, wishlistData;
|
|
273
271
|
var _d;
|
|
274
272
|
var _e;
|
|
275
273
|
return __generator(this, function (_f) {
|
|
@@ -277,10 +275,10 @@ var launch = function (launchConfig) { return function (dispatch) { return __awa
|
|
|
277
275
|
case 0:
|
|
278
276
|
if (window.threekit)
|
|
279
277
|
return [2 /*return*/];
|
|
280
|
-
_a = Object.assign(constants_1.DEFAULT_PLAYER_CONFIG, launchConfig), threekitEnv = _a.threekitEnv,
|
|
278
|
+
_a = Object.assign(constants_1.DEFAULT_PLAYER_CONFIG, launchConfig), threekitEnv = _a.threekitEnv, 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
279
|
threekitCredentials = launchConfig[threekitEnv || 'preview'];
|
|
282
280
|
threekitDomainRaw = threekitCredentials.threekitDomain || "".concat(threekitEnv, ".threekit.com");
|
|
283
|
-
assetId = threekitCredentials.assetId, authToken = threekitCredentials.publicToken, orgId = threekitCredentials.orgId, stageId = threekitCredentials.stageId;
|
|
281
|
+
assetId = threekitCredentials.assetId, authToken = threekitCredentials.publicToken, orgId = threekitCredentials.orgId, stageId = threekitCredentials.stageId, configurationId = threekitCredentials.configurationId;
|
|
284
282
|
// Connection
|
|
285
283
|
connection_1.default.connect({
|
|
286
284
|
authToken: authToken,
|