kitchen-simulator 4.0.1-react-18 → 4.0.1
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/README.md +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +156 -108
- package/es/LiteRenderer.js +159 -130
- package/es/actions/export.js +25 -12
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +100 -0
- package/es/catalog/properties/property-length-measure.js +84 -0
- package/es/catalog/properties/property-length-measure_hole.js +100 -0
- package/es/catalog/properties/property-number.js +48 -0
- package/es/catalog/properties/property-read-only.js +26 -0
- package/es/catalog/properties/property-string.js +48 -0
- package/es/catalog/properties/property-toggle.js +39 -0
- package/es/catalog/properties/shared-property-style.js +14 -0
- package/es/catalog/utils/exporter.js +1 -0
- package/es/catalog/utils/item-loader.js +17 -12
- package/es/class/hole.js +0 -2
- package/es/class/item.js +95 -69
- package/es/class/line.js +4 -8
- package/es/class/project.js +91 -80
- package/es/components/content.js +5 -2
- package/es/components/export.js +4 -6
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +11 -22
- package/es/components/style/form-number-input_2.js +200 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/group.js +5 -4
- package/es/components/viewer2d/item.js +339 -299
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +17 -47
- package/es/components/viewer2d/ruler.js +5 -3
- package/es/components/viewer2d/rulerDist.js +8 -7
- package/es/components/viewer2d/rulerX.js +3 -0
- package/es/components/viewer2d/rulerY.js +3 -0
- package/es/components/viewer2d/scene.js +4 -1
- package/es/components/viewer2d/state.js +1 -1
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/viewer2d.js +51 -84
- package/es/components/viewer3d/scene-creator.js +51 -15
- package/es/components/viewer3d/viewer3d-first-person.js +8 -0
- package/es/components/viewer3d/viewer3d.js +80 -88
- package/es/constants.js +6 -2
- package/es/devLiteRenderer.js +491 -150
- package/es/index.js +567 -25
- package/es/models.js +2 -1
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +0 -2
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/utils/geometry.js +52 -96
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +781 -577
- package/es/utils/molding.js +457 -11
- package/lib/AppContext.js +1 -1
- package/lib/LiteKitchenConfigurator.js +155 -108
- package/lib/LiteRenderer.js +158 -130
- package/lib/actions/export.js +35 -39
- package/lib/assets/gltf/door_sliding.bin +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/catalog.js +20 -4
- package/lib/catalog/holes/window-clear/planner-element.js +2 -2
- package/lib/catalog/properties/export.js +81 -0
- package/lib/catalog/properties/property-checkbox.js +76 -0
- package/lib/catalog/properties/property-color.js +47 -0
- package/lib/catalog/properties/property-enum.js +58 -0
- package/lib/catalog/properties/property-hidden.js +27 -0
- package/lib/catalog/properties/property-lenght-measure.js +108 -0
- package/lib/catalog/properties/property-length-measure.js +92 -0
- package/lib/catalog/properties/property-length-measure_hole.js +108 -0
- package/lib/catalog/properties/property-number.js +56 -0
- package/lib/catalog/properties/property-read-only.js +34 -0
- package/lib/catalog/properties/property-string.js +56 -0
- package/lib/catalog/properties/property-toggle.js +47 -0
- package/lib/catalog/properties/shared-property-style.js +21 -0
- package/lib/catalog/utils/exporter.js +1 -0
- package/lib/catalog/utils/item-loader.js +17 -12
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +93 -67
- package/lib/class/line.js +3 -7
- package/lib/class/project.js +91 -80
- package/lib/components/content.js +5 -2
- package/lib/components/export.js +6 -26
- package/lib/components/style/button.js +115 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +38 -0
- package/lib/components/style/content-title.js +35 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +105 -1
- package/lib/components/style/form-block.js +28 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +30 -0
- package/lib/components/style/form-number-input.js +11 -22
- package/lib/components/style/form-number-input_2.js +209 -0
- package/lib/components/style/form-select.js +29 -0
- package/lib/components/style/form-slider.js +68 -0
- package/lib/components/style/form-submit-button.js +35 -0
- package/lib/components/style/form-text-input.js +78 -0
- package/lib/components/viewer2d/group.js +5 -4
- package/lib/components/viewer2d/item.js +337 -297
- package/lib/components/viewer2d/layer.js +1 -1
- package/lib/components/viewer2d/line.js +17 -47
- package/lib/components/viewer2d/ruler.js +4 -2
- package/lib/components/viewer2d/rulerDist.js +8 -7
- package/lib/components/viewer2d/rulerX.js +3 -0
- package/lib/components/viewer2d/rulerY.js +3 -0
- package/lib/components/viewer2d/scene.js +4 -1
- package/lib/components/viewer2d/state.js +1 -1
- package/lib/components/viewer2d/utils.js +2 -2
- package/lib/components/viewer2d/viewer2d.js +49 -81
- package/lib/components/viewer3d/scene-creator.js +49 -13
- package/lib/components/viewer3d/viewer3d-first-person.js +8 -0
- package/lib/components/viewer3d/viewer3d.js +77 -84
- package/lib/constants.js +11 -7
- package/lib/devLiteRenderer.js +489 -148
- package/lib/index.js +567 -25
- package/lib/models.js +2 -1
- package/lib/plugins/SVGLoader.js +1419 -0
- package/lib/plugins/console-debugger.js +0 -2
- package/lib/styles/export.js +13 -0
- package/lib/styles/tabs.css +40 -0
- package/lib/utils/geometry.js +52 -96
- package/lib/utils/helper.js +40 -1
- package/lib/utils/isolate-event-handler.js +781 -576
- package/lib/utils/molding.js +458 -9
- package/package.json +21 -16
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/useAppContext.js +0 -16
package/es/LiteRenderer.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -7,76 +6,57 @@ import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
|
7
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
8
7
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
9
8
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
10
|
-
var _excluded = ["width", "height", "configData", "
|
|
11
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
|
+
var _excluded = ["width", "height", "configData", "externalEvent", "onInternalEvent", "onError"];
|
|
12
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
15
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
16
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
-
|
|
17
|
+
// LiteRenderer.jsx
|
|
18
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
17
19
|
import PropTypes from 'prop-types';
|
|
18
20
|
import { Provider } from 'react-redux';
|
|
19
21
|
import { createStore } from 'redux';
|
|
22
|
+
import { Map } from 'immutable';
|
|
23
|
+
import * as Sentry from '@sentry/react';
|
|
24
|
+
import * as THREE from 'three';
|
|
20
25
|
import * as Models from "./models";
|
|
21
26
|
import { State } from "./models";
|
|
22
27
|
import PlannerReducer from "./reducers/reducer";
|
|
28
|
+
import AppContext from "./AppContext";
|
|
23
29
|
import Catalog from "./catalog/catalog";
|
|
24
30
|
import * as Areas from "./catalog/areas/area/planner-element";
|
|
25
31
|
import * as Lines from "./catalog/lines/wall/planner-element";
|
|
26
32
|
import * as Holes from "./catalog/holes/export";
|
|
27
33
|
import { ConsoleDebugger, Keyboard } from "./plugins/export";
|
|
28
|
-
import { Map } from 'immutable';
|
|
29
|
-
import * as Sentry from '@sentry/react';
|
|
30
|
-
import * as THREE from 'three';
|
|
31
34
|
import LiteKitchenConfigurator from "./LiteKitchenConfigurator";
|
|
32
|
-
|
|
35
|
+
var isBrowser = typeof window !== 'undefined';
|
|
36
|
+
if (isBrowser) window.THREE = THREE;
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
//define reducer
|
|
46
|
-
var reducer = function reducer(state, action) {
|
|
47
|
-
state = state || AppState;
|
|
48
|
-
state = state.update('KitchenConfigurator', function (plannerState) {
|
|
49
|
-
return PlannerReducer(plannerState, action);
|
|
38
|
+
// ---- Keep prior Sentry behavior but ensure it only initializes once ----
|
|
39
|
+
var __sentryInited = false;
|
|
40
|
+
function ensureSentryInit() {
|
|
41
|
+
if (!isBrowser) return;
|
|
42
|
+
// assumes isProduction exists in your build just like today
|
|
43
|
+
if (!isProduction) return;
|
|
44
|
+
if (__sentryInited) return;
|
|
45
|
+
__sentryInited = true;
|
|
46
|
+
Sentry.init({
|
|
47
|
+
dsn: process.env.SENTRY_DSN,
|
|
48
|
+
environment: process.env.SENTRY_ENVIRONMENT
|
|
50
49
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"export": true,
|
|
62
|
-
// export history of actions in a file
|
|
63
|
-
"import": 'custom',
|
|
64
|
-
// import history of actions from a file
|
|
65
|
-
jump: true,
|
|
66
|
-
// jump back and forth (time travelling)
|
|
67
|
-
skip: true,
|
|
68
|
-
// skip (cancel) actions
|
|
69
|
-
reorder: true,
|
|
70
|
-
// drag and drop actions in the history list
|
|
71
|
-
dispatch: true,
|
|
72
|
-
// dispatch custom actions or action creators
|
|
73
|
-
test: true // generate tests for the selected actions
|
|
74
|
-
},
|
|
75
|
-
maxAge: 999999
|
|
76
|
-
}) : function (f) {
|
|
77
|
-
return f;
|
|
78
|
-
});
|
|
79
|
-
var plugins = [Keyboard(), ConsoleDebugger()];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ---------------- error helpers ----------------
|
|
53
|
+
function safeJson(v) {
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse(JSON.stringify(v));
|
|
56
|
+
} catch (_unused) {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
80
60
|
function serializeError(err) {
|
|
81
61
|
try {
|
|
82
62
|
if (!err) return {
|
|
@@ -93,19 +73,12 @@ function serializeError(err) {
|
|
|
93
73
|
message: String(err),
|
|
94
74
|
raw: safeJson(err)
|
|
95
75
|
};
|
|
96
|
-
} catch (
|
|
76
|
+
} catch (_unused2) {
|
|
97
77
|
return {
|
|
98
78
|
message: 'Error serializing error'
|
|
99
79
|
};
|
|
100
80
|
}
|
|
101
81
|
}
|
|
102
|
-
function safeJson(v) {
|
|
103
|
-
try {
|
|
104
|
-
return JSON.parse(JSON.stringify(v));
|
|
105
|
-
} catch (_unused2) {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
82
|
|
|
110
83
|
/* ---------- Error Boundary that pushes into buffer ---------- */
|
|
111
84
|
var ToolErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -133,35 +106,139 @@ var ToolErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
133
106
|
}
|
|
134
107
|
}]);
|
|
135
108
|
}(React.Component);
|
|
109
|
+
ToolErrorBoundary.propTypes = {
|
|
110
|
+
pushError: PropTypes.func.isRequired,
|
|
111
|
+
children: PropTypes.any
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// ----------------- catalog init -----------------
|
|
115
|
+
function initCatalogOnce(catalog) {
|
|
116
|
+
if (!catalog) return;
|
|
117
|
+
if (catalog.__ksInitialized) return;
|
|
118
|
+
for (var x in Areas) catalog.registerElement(Areas[x]);
|
|
119
|
+
for (var _x in Lines) catalog.registerElement(Lines[_x]);
|
|
120
|
+
for (var _x2 in Holes) catalog.registerElement(Holes[_x2]);
|
|
121
|
+
catalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
|
|
122
|
+
catalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
|
|
123
|
+
catalog.__ksInitialized = true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ----------------- store factory -----------------
|
|
127
|
+
function createInstanceStore() {
|
|
128
|
+
var AppState = Map({
|
|
129
|
+
KitchenConfigurator: new State()
|
|
130
|
+
});
|
|
131
|
+
var reducer = function reducer(state, action) {
|
|
132
|
+
state = state || AppState;
|
|
133
|
+
return state.update('KitchenConfigurator', function (plannerState) {
|
|
134
|
+
return PlannerReducer(plannerState, action);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
var enhancer = !isProduction && isBrowser && window.devToolsExtension ? window.devToolsExtension({
|
|
138
|
+
features: {
|
|
139
|
+
pause: true,
|
|
140
|
+
lock: true,
|
|
141
|
+
persist: true,
|
|
142
|
+
"export": true,
|
|
143
|
+
"import": 'custom',
|
|
144
|
+
jump: true,
|
|
145
|
+
skip: true,
|
|
146
|
+
reorder: true,
|
|
147
|
+
dispatch: true,
|
|
148
|
+
test: true
|
|
149
|
+
},
|
|
150
|
+
maxAge: 999999
|
|
151
|
+
}) : function (f) {
|
|
152
|
+
return f;
|
|
153
|
+
};
|
|
154
|
+
return createStore(reducer, null, enhancer);
|
|
155
|
+
}
|
|
156
|
+
function createPlugins() {
|
|
157
|
+
return [Keyboard(), ConsoleDebugger()];
|
|
158
|
+
}
|
|
136
159
|
export default function LiteRenderer(props) {
|
|
160
|
+
ensureSentryInit();
|
|
137
161
|
var width = props.width,
|
|
138
162
|
height = props.height,
|
|
139
163
|
configData = props.configData,
|
|
140
|
-
options = props.options,
|
|
141
|
-
user = props.user,
|
|
142
|
-
auth = props.auth,
|
|
143
|
-
featureFlags = props.featureFlags,
|
|
144
|
-
sentry = props.sentry,
|
|
145
|
-
analytics = props.analytics,
|
|
146
164
|
externalEvent = props.externalEvent,
|
|
147
165
|
onInternalEvent = props.onInternalEvent,
|
|
148
166
|
onError = props.onError,
|
|
149
167
|
passThrough = _objectWithoutProperties(props, _excluded);
|
|
150
168
|
|
|
169
|
+
// ✅ instance-scoped store (no module singleton)
|
|
170
|
+
var storeRef = useRef(null);
|
|
171
|
+
if (!storeRef.current) storeRef.current = createInstanceStore();
|
|
172
|
+
|
|
173
|
+
// ✅ instance-scoped catalog (no module singleton)
|
|
174
|
+
var catalogRef = useRef(null);
|
|
175
|
+
if (!catalogRef.current) {
|
|
176
|
+
catalogRef.current = new Catalog();
|
|
177
|
+
initCatalogOnce(catalogRef.current);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ✅ stable plugins array
|
|
181
|
+
var plugins = useMemo(function () {
|
|
182
|
+
return createPlugins();
|
|
183
|
+
}, []);
|
|
184
|
+
|
|
185
|
+
// ✅ plugin lifecycle: supports cleanup if plugin returns function
|
|
186
|
+
var pluginCleanupsRef = useRef([]);
|
|
187
|
+
useEffect(function () {
|
|
188
|
+
var store = storeRef.current;
|
|
189
|
+
var stateExtractor = function stateExtractor(state) {
|
|
190
|
+
return state.get('KitchenConfigurator');
|
|
191
|
+
};
|
|
192
|
+
var cleanups = [];
|
|
193
|
+
var _iterator = _createForOfIteratorHelper(plugins),
|
|
194
|
+
_step;
|
|
195
|
+
try {
|
|
196
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
197
|
+
var p = _step.value;
|
|
198
|
+
try {
|
|
199
|
+
var maybeCleanup = p === null || p === void 0 ? void 0 : p(store, stateExtractor);
|
|
200
|
+
if (typeof maybeCleanup === 'function') cleanups.push(maybeCleanup);
|
|
201
|
+
} catch (_unused4) {
|
|
202
|
+
// keep prior behavior: do not crash
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} catch (err) {
|
|
206
|
+
_iterator.e(err);
|
|
207
|
+
} finally {
|
|
208
|
+
_iterator.f();
|
|
209
|
+
}
|
|
210
|
+
pluginCleanupsRef.current = cleanups;
|
|
211
|
+
return function () {
|
|
212
|
+
var _iterator2 = _createForOfIteratorHelper(pluginCleanupsRef.current),
|
|
213
|
+
_step2;
|
|
214
|
+
try {
|
|
215
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
216
|
+
var fn = _step2.value;
|
|
217
|
+
try {
|
|
218
|
+
fn();
|
|
219
|
+
} catch (_unused3) {}
|
|
220
|
+
}
|
|
221
|
+
} catch (err) {
|
|
222
|
+
_iterator2.e(err);
|
|
223
|
+
} finally {
|
|
224
|
+
_iterator2.f();
|
|
225
|
+
}
|
|
226
|
+
pluginCleanupsRef.current = [];
|
|
227
|
+
};
|
|
228
|
+
}, [plugins]);
|
|
229
|
+
|
|
151
230
|
/* ---------- track last external event ---------- */
|
|
152
231
|
var lastExternalEventRef = useRef(null);
|
|
153
232
|
useEffect(function () {
|
|
154
|
-
if (externalEvent)
|
|
155
|
-
lastExternalEventRef.current = externalEvent;
|
|
156
|
-
}
|
|
233
|
+
if (externalEvent) lastExternalEventRef.current = externalEvent;
|
|
157
234
|
}, [externalEvent]);
|
|
158
235
|
|
|
159
236
|
/* ---------- error buffer + last emitted bundle ---------- */
|
|
160
|
-
var errorsBufferRef = useRef([]);
|
|
237
|
+
var errorsBufferRef = useRef([]);
|
|
161
238
|
var lastEmittedRef = useRef({
|
|
162
239
|
externalEvent: null,
|
|
163
240
|
errors: []
|
|
164
|
-
});
|
|
241
|
+
});
|
|
165
242
|
var flushTimerRef = useRef(null);
|
|
166
243
|
var emit = useCallback(function (external, errors) {
|
|
167
244
|
var payload = {
|
|
@@ -170,13 +247,11 @@ export default function LiteRenderer(props) {
|
|
|
170
247
|
};
|
|
171
248
|
try {
|
|
172
249
|
onError === null || onError === void 0 || onError(payload);
|
|
173
|
-
} catch (
|
|
250
|
+
} catch (_unused5) {}
|
|
174
251
|
// eslint-disable-next-line no-console
|
|
175
252
|
console.debug('[LiteRenderer:onError]', payload);
|
|
176
253
|
lastEmittedRef.current = payload;
|
|
177
254
|
}, [onError]);
|
|
178
|
-
|
|
179
|
-
// batch short bursts (e.g., multiple async errors in same tick)
|
|
180
255
|
var scheduleFlush = useCallback(function () {
|
|
181
256
|
if (flushTimerRef.current) return;
|
|
182
257
|
flushTimerRef.current = setTimeout(function () {
|
|
@@ -185,7 +260,7 @@ export default function LiteRenderer(props) {
|
|
|
185
260
|
if (!errors.length) return;
|
|
186
261
|
errorsBufferRef.current = [];
|
|
187
262
|
emit(lastExternalEventRef.current, errors);
|
|
188
|
-
}, 0);
|
|
263
|
+
}, 0);
|
|
189
264
|
}, [emit]);
|
|
190
265
|
var pushError = useCallback(function (errPayload) {
|
|
191
266
|
errorsBufferRef.current.push(_objectSpread({
|
|
@@ -196,6 +271,7 @@ export default function LiteRenderer(props) {
|
|
|
196
271
|
|
|
197
272
|
/* ---------- global runtime + async error capture ---------- */
|
|
198
273
|
useEffect(function () {
|
|
274
|
+
if (!isBrowser) return;
|
|
199
275
|
var onWindowError = function onWindowError(event) {
|
|
200
276
|
pushError({
|
|
201
277
|
type: 'runtime-error',
|
|
@@ -227,64 +303,20 @@ export default function LiteRenderer(props) {
|
|
|
227
303
|
var prev = prevExternalEventRef.current;
|
|
228
304
|
if (prev === externalEvent) return;
|
|
229
305
|
prevExternalEventRef.current = externalEvent;
|
|
230
|
-
|
|
231
|
-
// if we already emitted something before, re-send it with the new event context
|
|
232
306
|
var last = lastEmittedRef.current;
|
|
233
307
|
if (last && last.errors && last.errors.length) {
|
|
234
308
|
emit(lastExternalEventRef.current, last.errors);
|
|
235
309
|
}
|
|
236
310
|
}, [externalEvent, emit]);
|
|
237
|
-
var
|
|
238
|
-
logoImg =
|
|
239
|
-
companyUrl =
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
243
|
-
var x, _x, _x2;
|
|
244
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
245
|
-
while (1) switch (_context.prev = _context.next) {
|
|
246
|
-
case 0:
|
|
247
|
-
for (x in Areas) MyCatalog.registerElement(Areas[x]);
|
|
248
|
-
for (_x in Lines) MyCatalog.registerElement(Lines[_x]);
|
|
249
|
-
for (_x2 in Holes) MyCatalog.registerElement(Holes[_x2]);
|
|
250
|
-
MyCatalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
|
|
251
|
-
MyCatalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
|
|
252
|
-
case 1:
|
|
253
|
-
case "end":
|
|
254
|
-
return _context.stop();
|
|
255
|
-
}
|
|
256
|
-
}, _callee);
|
|
257
|
-
}));
|
|
258
|
-
return function initMyCatalog() {
|
|
259
|
-
return _ref.apply(this, arguments);
|
|
260
|
-
};
|
|
261
|
-
}();
|
|
262
|
-
var initCatalog = /*#__PURE__*/function () {
|
|
263
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
264
|
-
return _regeneratorRuntime.wrap(function (_context2) {
|
|
265
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
266
|
-
case 0:
|
|
267
|
-
_context2.next = 1;
|
|
268
|
-
return initMyCatalog();
|
|
269
|
-
case 1:
|
|
270
|
-
case "end":
|
|
271
|
-
return _context2.stop();
|
|
272
|
-
}
|
|
273
|
-
}, _callee2);
|
|
274
|
-
}));
|
|
275
|
-
return function initCatalog() {
|
|
276
|
-
return _ref2.apply(this, arguments);
|
|
277
|
-
};
|
|
278
|
-
}();
|
|
279
|
-
initCatalog();
|
|
280
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
281
|
-
}, [id]);
|
|
282
|
-
return /*#__PURE__*/React.createElement(Provider, {
|
|
283
|
-
store: store
|
|
311
|
+
var _ref = configData || {},
|
|
312
|
+
logoImg = _ref.logoImg,
|
|
313
|
+
companyUrl = _ref.companyUrl;
|
|
314
|
+
return /*#__PURE__*/React.createElement(AppContext.Provider, null, /*#__PURE__*/React.createElement(Provider, {
|
|
315
|
+
store: storeRef.current
|
|
284
316
|
}, /*#__PURE__*/React.createElement(ToolErrorBoundary, {
|
|
285
317
|
pushError: pushError
|
|
286
318
|
}, /*#__PURE__*/React.createElement(LiteKitchenConfigurator, _extends({
|
|
287
|
-
catalog:
|
|
319
|
+
catalog: catalogRef.current,
|
|
288
320
|
width: width,
|
|
289
321
|
height: height,
|
|
290
322
|
logoImage: logoImg,
|
|
@@ -296,11 +328,8 @@ export default function LiteRenderer(props) {
|
|
|
296
328
|
configData: configData,
|
|
297
329
|
externalEvent: externalEvent,
|
|
298
330
|
onInternalEvent: onInternalEvent
|
|
299
|
-
}, passThrough))));
|
|
331
|
+
}, passThrough)))));
|
|
300
332
|
}
|
|
301
|
-
|
|
302
|
-
/* ============================== prop types ============================== */
|
|
303
|
-
|
|
304
333
|
LiteRenderer.propTypes = {
|
|
305
334
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
306
335
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
package/es/actions/export.js
CHANGED
|
@@ -8,16 +8,29 @@ import * as verticesActions from "./vertices-actions";
|
|
|
8
8
|
import * as itemsActions from "./items-actions";
|
|
9
9
|
import * as areaActions from "./area-actions";
|
|
10
10
|
import * as groupsActions from "./groups-actions";
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
projectActions,
|
|
14
|
+
viewer2DActions,
|
|
15
|
+
viewer3DActions,
|
|
16
|
+
linesActions,
|
|
17
|
+
holesActions,
|
|
18
|
+
sceneActions,
|
|
19
|
+
verticesActions,
|
|
20
|
+
itemsActions,
|
|
21
|
+
areaActions,
|
|
22
|
+
groupsActions
|
|
23
|
+
};
|
|
24
|
+
|
|
12
25
|
export default {
|
|
13
|
-
projectActions
|
|
14
|
-
viewer2DActions
|
|
15
|
-
viewer3DActions
|
|
16
|
-
linesActions
|
|
17
|
-
holesActions
|
|
18
|
-
sceneActions
|
|
19
|
-
verticesActions
|
|
20
|
-
itemsActions
|
|
21
|
-
areaActions
|
|
22
|
-
groupsActions
|
|
23
|
-
};
|
|
26
|
+
projectActions,
|
|
27
|
+
viewer2DActions,
|
|
28
|
+
viewer3DActions,
|
|
29
|
+
linesActions,
|
|
30
|
+
holesActions,
|
|
31
|
+
sceneActions,
|
|
32
|
+
verticesActions,
|
|
33
|
+
itemsActions,
|
|
34
|
+
areaActions,
|
|
35
|
+
groupsActions
|
|
36
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
<svg width="
|
|
2
|
-
<path
|
|
3
|
-
<path d="
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="M8
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_1516_100789)">
|
|
3
|
+
<path d="M4.25 6L2 7.125L8 10.125L14 7.125L11.75 6" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M2 10.125L8 13.125L14 10.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M8 7.125V1.875" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M5.75 4.125L8 1.875L10.25 4.125" stroke="rgba(58, 11, 128, 1)" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1516_100789">
|
|
10
|
+
<rect width="16" height="16" fill="white"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
6
13
|
</svg>
|
package/es/catalog/catalog.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import {
|
|
4
|
+
import { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly } from "./properties/export";
|
|
5
|
+
import { UNIT_CENTIMETER, UNIT_INCH } from "../constants";
|
|
5
6
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
6
7
|
var Catalog = /*#__PURE__*/function () {
|
|
7
8
|
function Catalog() {
|
|
@@ -18,6 +19,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
18
19
|
};
|
|
19
20
|
this.propertyTypes = {};
|
|
20
21
|
this.unit = unit;
|
|
22
|
+
this.registerMultiplePropertyType([['color', PropertyColor, PropertyColor], ['enum', PropertyEnum, PropertyEnum], ['string', PropertyString, PropertyString], ['number', PropertyNumber, PropertyNumber], ['length-measure', PropertyLengthMeasure, PropertyLengthMeasure], ['toggle', PropertyToggle, PropertyToggle], ['checkbox', PropertyCheckbox, PropertyCheckbox], ['hidden', PropertyHidden, PropertyHidden], ['read-only', PropertyReadOnly, PropertyReadOnly]]);
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -83,6 +85,20 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @description Register multiple elements
|
|
90
|
+
* @param {array} [elementArray] Array of elements
|
|
91
|
+
* @return {void}
|
|
92
|
+
*/
|
|
93
|
+
}, {
|
|
94
|
+
key: "registerMultipleElements",
|
|
95
|
+
value: function registerMultipleElements(elementArray) {
|
|
96
|
+
var _this = this;
|
|
97
|
+
elementArray.forEach(function (el) {
|
|
98
|
+
return _this.registerElement(el);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
86
102
|
/**
|
|
87
103
|
* @description Register a new property
|
|
88
104
|
* @param {string} type Type of property
|
|
@@ -108,9 +124,9 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
108
124
|
}, {
|
|
109
125
|
key: "registerMultiplePropertyType",
|
|
110
126
|
value: function registerMultiplePropertyType(propertyTypeArray) {
|
|
111
|
-
var
|
|
127
|
+
var _this2 = this;
|
|
112
128
|
propertyTypeArray.forEach(function (el) {
|
|
113
|
-
return
|
|
129
|
+
return _this2.registerPropertyType.apply(_this2, _toConsumableArray(el));
|
|
114
130
|
});
|
|
115
131
|
}
|
|
116
132
|
|
|
@@ -163,7 +179,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
163
179
|
}, {
|
|
164
180
|
key: "registerCategory",
|
|
165
181
|
value: function registerCategory(name, label, childs) {
|
|
166
|
-
var
|
|
182
|
+
var _this3 = this;
|
|
167
183
|
if (this.validateCategory(name, label)) {
|
|
168
184
|
this.categories[name] = {
|
|
169
185
|
name: name,
|
|
@@ -174,7 +190,7 @@ var Catalog = /*#__PURE__*/function () {
|
|
|
174
190
|
this.categories.root.categories.push(this.categories[name]);
|
|
175
191
|
if (childs && childs.length) {
|
|
176
192
|
childs.forEach(function (el) {
|
|
177
|
-
return
|
|
193
|
+
return _this3.addToCategory(name, el);
|
|
178
194
|
});
|
|
179
195
|
}
|
|
180
196
|
return this.categories[name];
|
|
@@ -4,12 +4,12 @@ import { loadGLTF, scaleObject } from "../../utils/load-obj";
|
|
|
4
4
|
import { OBJTYPE_MESH } from "../../../constants";
|
|
5
5
|
var cached3DWindow = null;
|
|
6
6
|
export default {
|
|
7
|
-
name: '
|
|
7
|
+
name: 'Window',
|
|
8
8
|
prototype: 'holes',
|
|
9
9
|
info: {
|
|
10
10
|
title: 'Clear',
|
|
11
11
|
tag: ['window'],
|
|
12
|
-
description: '
|
|
12
|
+
description: 'Window',
|
|
13
13
|
image: '/assets/img/svg/window/Clear.svg',
|
|
14
14
|
url: '/assets/gltf/window_clear.gltf'
|
|
15
15
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import PropertyColor from "./property-color";
|
|
2
|
+
import PropertyEnum from "./property-enum";
|
|
3
|
+
import PropertyString from "./property-string";
|
|
4
|
+
import PropertyNumber from "./property-number";
|
|
5
|
+
import PropertyLengthMeasure from "./property-length-measure";
|
|
6
|
+
import PropertyToggle from "./property-toggle";
|
|
7
|
+
import PropertyCheckbox from "./property-checkbox";
|
|
8
|
+
import PropertyHidden from "./property-hidden";
|
|
9
|
+
import PropertyReadOnly from "./property-read-only";
|
|
10
|
+
export { PropertyColor, PropertyEnum, PropertyString, PropertyNumber, PropertyLengthMeasure, PropertyToggle, PropertyCheckbox, PropertyHidden, PropertyReadOnly };
|
|
11
|
+
export default {
|
|
12
|
+
PropertyColor: PropertyColor,
|
|
13
|
+
PropertyEnum: PropertyEnum,
|
|
14
|
+
PropertyString: PropertyString,
|
|
15
|
+
PropertyNumber: PropertyNumber,
|
|
16
|
+
PropertyLengthMeasure: PropertyLengthMeasure,
|
|
17
|
+
PropertyToggle: PropertyToggle,
|
|
18
|
+
PropertyCheckbox: PropertyCheckbox,
|
|
19
|
+
PropertyHidden: PropertyHidden,
|
|
20
|
+
PropertyReadOnly: PropertyReadOnly
|
|
21
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { FormLabel } from "../../components/style/export";
|
|
9
|
+
import PropertyStyle from "./shared-property-style";
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { DEFAULT_FONT_FAMILY, SECONDARY_PURPLE_COLOR, TEXT_COLOR_NEUTRAL_0 } from "../../constants";
|
|
12
|
+
var FlipWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: 15px 0;\n justify-content: space-between;\n"])));
|
|
13
|
+
var FlipTitle = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 16px;\n font-weight: 600;\n line-height: 18px;\n text-align: left;\n"])), SECONDARY_PURPLE_COLOR, DEFAULT_FONT_FAMILY);
|
|
14
|
+
var FlipDescription = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-right: auto;\n color: ", ";\n font-family: ", ";\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n text-align: left;\n"])), TEXT_COLOR_NEUTRAL_0, DEFAULT_FONT_FAMILY);
|
|
15
|
+
var FlipInfoWrapper = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n"])));
|
|
16
|
+
var FlipToggle = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n cursor: pointer;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n"])));
|
|
17
|
+
var FlipToggleIcon = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n top: 0;\n position: absolute;\n ", "\n img {\n font-size: 1.4rem;\n box-sizing: border-box;\n border-radius: 50%;\n }\n"])), '' /* transition-duration: .3s; */);
|
|
18
|
+
export default function PropertyCheckbox(_ref) {
|
|
19
|
+
var value = _ref.value,
|
|
20
|
+
onUpdate = _ref.onUpdate,
|
|
21
|
+
configs = _ref.configs,
|
|
22
|
+
sourceElement = _ref.sourceElement,
|
|
23
|
+
internalState = _ref.internalState,
|
|
24
|
+
state = _ref.state;
|
|
25
|
+
var update = function update(val) {
|
|
26
|
+
if (configs.hook) {
|
|
27
|
+
return configs.hook(val, sourceElement, internalState, state).then(function (_val) {
|
|
28
|
+
return onUpdate(_val);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return onUpdate(val);
|
|
32
|
+
};
|
|
33
|
+
var activeStyle = value == 0 ? {
|
|
34
|
+
left: 0
|
|
35
|
+
} : {
|
|
36
|
+
right: 0
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement(FlipWrapper, null, /*#__PURE__*/React.createElement(FlipInfoWrapper, null, /*#__PURE__*/React.createElement(FlipTitle, null, configs.label), configs.description && /*#__PURE__*/React.createElement(FlipDescription, null, configs.description)), /*#__PURE__*/React.createElement(FlipToggle, {
|
|
39
|
+
style: {
|
|
40
|
+
color: 'black'
|
|
41
|
+
},
|
|
42
|
+
onClick: function onClick(e) {
|
|
43
|
+
return update(!value);
|
|
44
|
+
}
|
|
45
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
46
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_toggle_active.svg' : '2d3d_toggle.svg'),
|
|
47
|
+
style: {
|
|
48
|
+
width: '55px',
|
|
49
|
+
height: '30px'
|
|
50
|
+
}
|
|
51
|
+
}), /*#__PURE__*/React.createElement(FlipToggleIcon, {
|
|
52
|
+
style: _objectSpread({}, activeStyle)
|
|
53
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
54
|
+
src: "/assets/img/svg/bottombar/".concat(value != 0 ? '2d3d_button_active.svg' : '2d3d_button.svg'),
|
|
55
|
+
style: {
|
|
56
|
+
width: '30px',
|
|
57
|
+
height: '30px'
|
|
58
|
+
}
|
|
59
|
+
}))));
|
|
60
|
+
}
|
|
61
|
+
PropertyCheckbox.propTypes = {
|
|
62
|
+
value: PropTypes.any.isRequired,
|
|
63
|
+
onUpdate: PropTypes.func.isRequired,
|
|
64
|
+
configs: PropTypes.object.isRequired,
|
|
65
|
+
sourceElement: PropTypes.object,
|
|
66
|
+
internalState: PropTypes.object,
|
|
67
|
+
state: PropTypes.object.isRequired
|
|
68
|
+
};
|