kitchen-simulator 4.0.0-queuedEvents → 4.0.0
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/es/LiteKitchenConfigurator.js +141 -288
- package/es/LiteRenderer.js +159 -398
- package/es/actions/items-actions.js +10 -6
- package/es/actions/lines-actions.js +3 -1
- package/es/actions/project-actions.js +15 -5
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/areas/area/planner-element.js +10 -5
- package/es/catalog/catalog.js +1 -4
- package/es/catalog/factories/area-factory-3d.js +2 -1
- package/es/catalog/factories/wall-factory-3d.js +2 -2
- package/es/catalog/factories/wall-factory.js +8 -8
- package/es/catalog/lines/wall/planner-element.js +18 -9
- package/es/catalog/utils/exporter.js +7 -3
- package/es/catalog/utils/item-loader.js +24 -14
- package/es/catalog/utils/mtl-loader.js +2 -2
- package/es/catalog/utils/obj-loader.js +2 -2
- package/es/class/hole.js +0 -2
- package/es/class/item.js +183 -184
- package/es/class/line.js +11 -3
- package/es/class/project.js +165 -48
- package/es/components/content.js +19 -6
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/item.js +84 -51
- package/es/components/viewer2d/line.js +315 -243
- package/es/components/viewer2d/ruler.js +20 -38
- package/es/components/viewer2d/rulerDist.js +48 -78
- package/es/components/viewer2d/utils.js +6 -0
- package/es/components/viewer2d/viewer2d.js +298 -220
- package/es/components/viewer3d/front3D.js +3 -2
- package/es/components/viewer3d/libs/mtl-loader.js +2 -2
- package/es/components/viewer3d/libs/obj-loader.js +2 -2
- package/es/components/viewer3d/libs/orbit-controls.js +3 -4
- package/es/components/viewer3d/libs/pointer-lock-controls.js +6 -7
- package/es/components/viewer3d/scene-creator.js +51 -15
- package/es/components/viewer3d/viewer3d.js +121 -82
- package/es/constants.js +111 -3
- package/es/devLiteRenderer.js +688 -31
- package/es/index.js +567 -87
- package/es/models.js +9 -5
- package/es/plugins/SVGLoader.js +7 -5
- package/es/plugins/console-debugger.js +0 -2
- package/es/plugins/keyboard.js +15 -6
- package/es/reducers/items-reducer.js +5 -5
- package/es/reducers/lines-reducer.js +1 -1
- package/es/reducers/project-reducer.js +5 -3
- package/es/shared-style.js +4 -4
- package/es/utils/geometry.js +163 -2
- package/es/utils/get-edges-of-subgraphs.js +1 -1
- package/es/utils/graph-cycles.js +1 -1
- package/es/utils/graph.js +1 -1
- package/es/utils/helper.js +105 -3
- package/es/utils/isolate-event-handler.js +1542 -164
- package/es/utils/molding.js +461 -11
- package/lib/LiteKitchenConfigurator.js +141 -289
- package/lib/LiteRenderer.js +159 -399
- package/lib/actions/items-actions.js +10 -6
- package/lib/actions/lines-actions.js +3 -1
- package/lib/actions/project-actions.js +15 -4
- package/lib/assets/img/svg/bottombar/elevation.svg +12 -5
- package/lib/catalog/areas/area/planner-element.js +11 -5
- package/lib/catalog/catalog.js +1 -4
- package/lib/catalog/factories/area-factory-3d.js +2 -1
- package/lib/catalog/factories/wall-factory-3d.js +2 -2
- package/lib/catalog/factories/wall-factory.js +8 -8
- package/lib/catalog/lines/wall/planner-element.js +19 -9
- package/lib/catalog/utils/exporter.js +7 -3
- package/lib/catalog/utils/item-loader.js +24 -14
- package/lib/catalog/utils/mtl-loader.js +9 -2
- package/lib/catalog/utils/obj-loader.js +10 -2
- package/lib/class/hole.js +0 -2
- package/lib/class/item.js +180 -181
- package/lib/class/line.js +9 -1
- package/lib/class/project.js +164 -47
- package/lib/components/content.js +19 -6
- package/lib/components/viewer2d/grids/grid-streak.js +1 -1
- package/lib/components/viewer2d/item.js +83 -50
- package/lib/components/viewer2d/line.js +315 -242
- package/lib/components/viewer2d/ruler.js +19 -37
- package/lib/components/viewer2d/rulerDist.js +48 -78
- package/lib/components/viewer2d/utils.js +7 -0
- package/lib/components/viewer2d/viewer2d.js +296 -219
- package/lib/components/viewer3d/front3D.js +3 -2
- package/lib/components/viewer3d/libs/mtl-loader.js +9 -2
- package/lib/components/viewer3d/libs/obj-loader.js +9 -2
- package/lib/components/viewer3d/libs/orbit-controls.js +11 -5
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +13 -7
- package/lib/components/viewer3d/scene-creator.js +49 -13
- package/lib/components/viewer3d/viewer3d.js +119 -80
- package/lib/constants.js +116 -7
- package/lib/devLiteRenderer.js +687 -30
- package/lib/index.js +567 -87
- package/lib/models.js +9 -5
- package/lib/plugins/SVGLoader.js +7 -5
- package/lib/plugins/console-debugger.js +0 -2
- package/lib/plugins/keyboard.js +15 -6
- package/lib/reducers/items-reducer.js +5 -5
- package/lib/reducers/lines-reducer.js +1 -1
- package/lib/reducers/project-reducer.js +4 -2
- package/lib/shared-style.js +4 -4
- package/lib/utils/geometry.js +164 -2
- package/lib/utils/get-edges-of-subgraphs.js +6 -1
- package/lib/utils/graph-cycles.js +7 -8
- package/lib/utils/graph.js +6 -1
- package/lib/utils/helper.js +108 -2
- package/lib/utils/isolate-event-handler.js +1538 -159
- package/lib/utils/molding.js +463 -9
- package/package.json +1 -1
- package/es/assets/Window.hdr +0 -2100
- package/es/assets/img/1.jpg +0 -0
- package/lib/assets/Window.hdr +0 -2100
- package/lib/assets/img/1.jpg +0 -0
package/lib/LiteRenderer.js
CHANGED
|
@@ -6,10 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = LiteRenderer;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -21,79 +18,53 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
21
18
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
19
|
var _reactRedux = require("react-redux");
|
|
23
20
|
var _redux = require("redux");
|
|
21
|
+
var _immutable = require("immutable");
|
|
22
|
+
var Sentry = _interopRequireWildcard(require("@sentry/react"));
|
|
23
|
+
var THREE = _interopRequireWildcard(require("three"));
|
|
24
24
|
var _models = _interopRequireWildcard(require("./models"));
|
|
25
25
|
var Models = _models;
|
|
26
26
|
var _reducer = _interopRequireDefault(require("./reducers/reducer"));
|
|
27
27
|
var _AppContext = _interopRequireDefault(require("./AppContext"));
|
|
28
28
|
var _catalog = _interopRequireDefault(require("./catalog/catalog"));
|
|
29
|
-
var _SVGLoader = require("three/addons/loaders/SVGLoader");
|
|
30
|
-
var _helper = require("./utils/helper");
|
|
31
|
-
var _constants = require("./constants");
|
|
32
29
|
var Areas = _interopRequireWildcard(require("./catalog/areas/area/planner-element"));
|
|
33
30
|
var Lines = _interopRequireWildcard(require("./catalog/lines/wall/planner-element"));
|
|
34
31
|
var Holes = _interopRequireWildcard(require("./catalog/holes/export"));
|
|
35
|
-
var _itemLoader = require("./catalog/utils/item-loader");
|
|
36
32
|
var _export2 = require("./plugins/export");
|
|
37
|
-
var _immutable = require("immutable");
|
|
38
|
-
var Sentry = _interopRequireWildcard(require("@sentry/react"));
|
|
39
|
-
var _projectActions = require("./actions/project-actions");
|
|
40
|
-
var _exporter = _interopRequireDefault(require("./catalog/utils/exporter"));
|
|
41
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
42
33
|
var _LiteKitchenConfigurator = _interopRequireDefault(require("./LiteKitchenConfigurator"));
|
|
43
|
-
var _excluded = ["width", "height", "
|
|
44
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var
|
|
34
|
+
var _excluded = ["width", "height", "configData", "externalEvent", "onInternalEvent", "onError"];
|
|
35
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
45
36
|
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; }
|
|
46
37
|
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) { (0, _defineProperty2["default"])(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; }
|
|
38
|
+
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; } } }; }
|
|
39
|
+
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; } }
|
|
40
|
+
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; }
|
|
47
41
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
48
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/* ============================== component ============================= */
|
|
52
|
-
var MyCatalog = new _catalog["default"]();
|
|
53
|
-
var AppState = (0, _immutable.Map)({
|
|
54
|
-
KitchenConfigurator: new _models.State()
|
|
55
|
-
});
|
|
56
|
-
console.log('Version: 378.45-202509_DIY-364-mbox-crash');
|
|
57
|
-
isProduction && Sentry.init({
|
|
58
|
-
dsn: process.env.SENTRY_DSN,
|
|
59
|
-
environment: process.env.SENTRY_ENVIRONMENT
|
|
60
|
-
});
|
|
42
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // LiteRenderer.jsx
|
|
43
|
+
var isBrowser = typeof window !== 'undefined';
|
|
44
|
+
if (isBrowser) window.THREE = THREE;
|
|
61
45
|
|
|
62
|
-
//
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
46
|
+
// ---- Keep prior Sentry behavior but ensure it only initializes once ----
|
|
47
|
+
var __sentryInited = false;
|
|
48
|
+
function ensureSentryInit() {
|
|
49
|
+
if (!isBrowser) return;
|
|
50
|
+
// assumes isProduction exists in your build just like today
|
|
51
|
+
if (!isProduction) return;
|
|
52
|
+
if (__sentryInited) return;
|
|
53
|
+
__sentryInited = true;
|
|
54
|
+
Sentry.init({
|
|
55
|
+
dsn: process.env.SENTRY_DSN,
|
|
56
|
+
environment: process.env.SENTRY_ENVIRONMENT
|
|
67
57
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"export": true,
|
|
79
|
-
// export history of actions in a file
|
|
80
|
-
"import": 'custom',
|
|
81
|
-
// import history of actions from a file
|
|
82
|
-
jump: true,
|
|
83
|
-
// jump back and forth (time travelling)
|
|
84
|
-
skip: true,
|
|
85
|
-
// skip (cancel) actions
|
|
86
|
-
reorder: true,
|
|
87
|
-
// drag and drop actions in the history list
|
|
88
|
-
dispatch: true,
|
|
89
|
-
// dispatch custom actions or action creators
|
|
90
|
-
test: true // generate tests for the selected actions
|
|
91
|
-
},
|
|
92
|
-
maxAge: 999999
|
|
93
|
-
}) : function (f) {
|
|
94
|
-
return f;
|
|
95
|
-
});
|
|
96
|
-
var plugins = [(0, _export2.Keyboard)(), (0, _export2.ConsoleDebugger)()];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ---------------- error helpers ----------------
|
|
61
|
+
function safeJson(v) {
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(JSON.stringify(v));
|
|
64
|
+
} catch (_unused) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
97
68
|
function serializeError(err) {
|
|
98
69
|
try {
|
|
99
70
|
if (!err) return {
|
|
@@ -110,19 +81,12 @@ function serializeError(err) {
|
|
|
110
81
|
message: String(err),
|
|
111
82
|
raw: safeJson(err)
|
|
112
83
|
};
|
|
113
|
-
} catch (
|
|
84
|
+
} catch (_unused2) {
|
|
114
85
|
return {
|
|
115
86
|
message: 'Error serializing error'
|
|
116
87
|
};
|
|
117
88
|
}
|
|
118
89
|
}
|
|
119
|
-
function safeJson(v) {
|
|
120
|
-
try {
|
|
121
|
-
return JSON.parse(JSON.stringify(v));
|
|
122
|
-
} catch (_unused2) {
|
|
123
|
-
return undefined;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
90
|
|
|
127
91
|
/* ---------- Error Boundary that pushes into buffer ---------- */
|
|
128
92
|
var ToolErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
@@ -150,38 +114,139 @@ var ToolErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
|
150
114
|
}
|
|
151
115
|
}]);
|
|
152
116
|
}(_react["default"].Component);
|
|
117
|
+
ToolErrorBoundary.propTypes = {
|
|
118
|
+
pushError: _propTypes["default"].func.isRequired,
|
|
119
|
+
children: _propTypes["default"].any
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// ----------------- catalog init -----------------
|
|
123
|
+
function initCatalogOnce(catalog) {
|
|
124
|
+
if (!catalog) return;
|
|
125
|
+
if (catalog.__ksInitialized) return;
|
|
126
|
+
for (var x in Areas) catalog.registerElement(Areas[x]);
|
|
127
|
+
for (var _x in Lines) catalog.registerElement(Lines[_x]);
|
|
128
|
+
for (var _x2 in Holes) catalog.registerElement(Holes[_x2]);
|
|
129
|
+
catalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
|
|
130
|
+
catalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
|
|
131
|
+
catalog.__ksInitialized = true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ----------------- store factory -----------------
|
|
135
|
+
function createInstanceStore() {
|
|
136
|
+
var AppState = (0, _immutable.Map)({
|
|
137
|
+
KitchenConfigurator: new _models.State()
|
|
138
|
+
});
|
|
139
|
+
var reducer = function reducer(state, action) {
|
|
140
|
+
state = state || AppState;
|
|
141
|
+
return state.update('KitchenConfigurator', function (plannerState) {
|
|
142
|
+
return (0, _reducer["default"])(plannerState, action);
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
var enhancer = !isProduction && isBrowser && window.devToolsExtension ? window.devToolsExtension({
|
|
146
|
+
features: {
|
|
147
|
+
pause: true,
|
|
148
|
+
lock: true,
|
|
149
|
+
persist: true,
|
|
150
|
+
"export": true,
|
|
151
|
+
"import": 'custom',
|
|
152
|
+
jump: true,
|
|
153
|
+
skip: true,
|
|
154
|
+
reorder: true,
|
|
155
|
+
dispatch: true,
|
|
156
|
+
test: true
|
|
157
|
+
},
|
|
158
|
+
maxAge: 999999
|
|
159
|
+
}) : function (f) {
|
|
160
|
+
return f;
|
|
161
|
+
};
|
|
162
|
+
return (0, _redux.createStore)(reducer, null, enhancer);
|
|
163
|
+
}
|
|
164
|
+
function createPlugins() {
|
|
165
|
+
return [(0, _export2.Keyboard)(), (0, _export2.ConsoleDebugger)()];
|
|
166
|
+
}
|
|
153
167
|
function LiteRenderer(props) {
|
|
168
|
+
ensureSentryInit();
|
|
154
169
|
var width = props.width,
|
|
155
170
|
height = props.height,
|
|
156
|
-
projectElement = props.projectElement,
|
|
157
|
-
categoryData = props.categoryData,
|
|
158
|
-
dataBundle = props.dataBundle,
|
|
159
171
|
configData = props.configData,
|
|
160
|
-
options = props.options,
|
|
161
|
-
user = props.user,
|
|
162
|
-
auth = props.auth,
|
|
163
|
-
featureFlags = props.featureFlags,
|
|
164
|
-
sentry = props.sentry,
|
|
165
|
-
analytics = props.analytics,
|
|
166
172
|
externalEvent = props.externalEvent,
|
|
167
|
-
|
|
173
|
+
onInternalEvent = props.onInternalEvent,
|
|
168
174
|
onError = props.onError,
|
|
169
175
|
passThrough = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
170
176
|
|
|
177
|
+
// ✅ instance-scoped store (no module singleton)
|
|
178
|
+
var storeRef = (0, _react.useRef)(null);
|
|
179
|
+
if (!storeRef.current) storeRef.current = createInstanceStore();
|
|
180
|
+
|
|
181
|
+
// ✅ instance-scoped catalog (no module singleton)
|
|
182
|
+
var catalogRef = (0, _react.useRef)(null);
|
|
183
|
+
if (!catalogRef.current) {
|
|
184
|
+
catalogRef.current = new _catalog["default"]();
|
|
185
|
+
initCatalogOnce(catalogRef.current);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// ✅ stable plugins array
|
|
189
|
+
var plugins = (0, _react.useMemo)(function () {
|
|
190
|
+
return createPlugins();
|
|
191
|
+
}, []);
|
|
192
|
+
|
|
193
|
+
// ✅ plugin lifecycle: supports cleanup if plugin returns function
|
|
194
|
+
var pluginCleanupsRef = (0, _react.useRef)([]);
|
|
195
|
+
(0, _react.useEffect)(function () {
|
|
196
|
+
var store = storeRef.current;
|
|
197
|
+
var stateExtractor = function stateExtractor(state) {
|
|
198
|
+
return state.get('KitchenConfigurator');
|
|
199
|
+
};
|
|
200
|
+
var cleanups = [];
|
|
201
|
+
var _iterator = _createForOfIteratorHelper(plugins),
|
|
202
|
+
_step;
|
|
203
|
+
try {
|
|
204
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
205
|
+
var p = _step.value;
|
|
206
|
+
try {
|
|
207
|
+
var maybeCleanup = p === null || p === void 0 ? void 0 : p(store, stateExtractor);
|
|
208
|
+
if (typeof maybeCleanup === 'function') cleanups.push(maybeCleanup);
|
|
209
|
+
} catch (_unused4) {
|
|
210
|
+
// keep prior behavior: do not crash
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
} catch (err) {
|
|
214
|
+
_iterator.e(err);
|
|
215
|
+
} finally {
|
|
216
|
+
_iterator.f();
|
|
217
|
+
}
|
|
218
|
+
pluginCleanupsRef.current = cleanups;
|
|
219
|
+
return function () {
|
|
220
|
+
var _iterator2 = _createForOfIteratorHelper(pluginCleanupsRef.current),
|
|
221
|
+
_step2;
|
|
222
|
+
try {
|
|
223
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
224
|
+
var fn = _step2.value;
|
|
225
|
+
try {
|
|
226
|
+
fn();
|
|
227
|
+
} catch (_unused3) {}
|
|
228
|
+
}
|
|
229
|
+
} catch (err) {
|
|
230
|
+
_iterator2.e(err);
|
|
231
|
+
} finally {
|
|
232
|
+
_iterator2.f();
|
|
233
|
+
}
|
|
234
|
+
pluginCleanupsRef.current = [];
|
|
235
|
+
};
|
|
236
|
+
}, [plugins]);
|
|
237
|
+
|
|
171
238
|
/* ---------- track last external event ---------- */
|
|
172
239
|
var lastExternalEventRef = (0, _react.useRef)(null);
|
|
173
240
|
(0, _react.useEffect)(function () {
|
|
174
|
-
if (externalEvent)
|
|
175
|
-
lastExternalEventRef.current = externalEvent;
|
|
176
|
-
}
|
|
241
|
+
if (externalEvent) lastExternalEventRef.current = externalEvent;
|
|
177
242
|
}, [externalEvent]);
|
|
178
243
|
|
|
179
244
|
/* ---------- error buffer + last emitted bundle ---------- */
|
|
180
|
-
var errorsBufferRef = (0, _react.useRef)([]);
|
|
245
|
+
var errorsBufferRef = (0, _react.useRef)([]);
|
|
181
246
|
var lastEmittedRef = (0, _react.useRef)({
|
|
182
247
|
externalEvent: null,
|
|
183
248
|
errors: []
|
|
184
|
-
});
|
|
249
|
+
});
|
|
185
250
|
var flushTimerRef = (0, _react.useRef)(null);
|
|
186
251
|
var emit = (0, _react.useCallback)(function (external, errors) {
|
|
187
252
|
var payload = {
|
|
@@ -190,13 +255,11 @@ function LiteRenderer(props) {
|
|
|
190
255
|
};
|
|
191
256
|
try {
|
|
192
257
|
onError === null || onError === void 0 || onError(payload);
|
|
193
|
-
} catch (
|
|
258
|
+
} catch (_unused5) {}
|
|
194
259
|
// eslint-disable-next-line no-console
|
|
195
260
|
console.debug('[LiteRenderer:onError]', payload);
|
|
196
261
|
lastEmittedRef.current = payload;
|
|
197
262
|
}, [onError]);
|
|
198
|
-
|
|
199
|
-
// batch short bursts (e.g., multiple async errors in same tick)
|
|
200
263
|
var scheduleFlush = (0, _react.useCallback)(function () {
|
|
201
264
|
if (flushTimerRef.current) return;
|
|
202
265
|
flushTimerRef.current = setTimeout(function () {
|
|
@@ -205,7 +268,7 @@ function LiteRenderer(props) {
|
|
|
205
268
|
if (!errors.length) return;
|
|
206
269
|
errorsBufferRef.current = [];
|
|
207
270
|
emit(lastExternalEventRef.current, errors);
|
|
208
|
-
}, 0);
|
|
271
|
+
}, 0);
|
|
209
272
|
}, [emit]);
|
|
210
273
|
var pushError = (0, _react.useCallback)(function (errPayload) {
|
|
211
274
|
errorsBufferRef.current.push(_objectSpread({
|
|
@@ -216,6 +279,7 @@ function LiteRenderer(props) {
|
|
|
216
279
|
|
|
217
280
|
/* ---------- global runtime + async error capture ---------- */
|
|
218
281
|
(0, _react.useEffect)(function () {
|
|
282
|
+
if (!isBrowser) return;
|
|
219
283
|
var onWindowError = function onWindowError(event) {
|
|
220
284
|
pushError({
|
|
221
285
|
type: 'runtime-error',
|
|
@@ -247,316 +311,20 @@ function LiteRenderer(props) {
|
|
|
247
311
|
var prev = prevExternalEventRef.current;
|
|
248
312
|
if (prev === externalEvent) return;
|
|
249
313
|
prevExternalEventRef.current = externalEvent;
|
|
250
|
-
|
|
251
|
-
// if we already emitted something before, re-send it with the new event context
|
|
252
314
|
var last = lastEmittedRef.current;
|
|
253
315
|
if (last && last.errors && last.errors.length) {
|
|
254
316
|
emit(lastExternalEventRef.current, last.errors);
|
|
255
317
|
}
|
|
256
318
|
}, [externalEvent, emit]);
|
|
257
|
-
var _ref =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
subgroups = _ref.subgroups;
|
|
261
|
-
var _ref2 = dataBundle || {},
|
|
262
|
-
_ref2$data = _ref2.data,
|
|
263
|
-
data = _ref2$data === void 0 ? [] : _ref2$data,
|
|
264
|
-
_ref2$appliances = _ref2.appliances,
|
|
265
|
-
appliances = _ref2$appliances === void 0 ? [] : _ref2$appliances,
|
|
266
|
-
_ref2$furnishing = _ref2.furnishing,
|
|
267
|
-
furnishing = _ref2$furnishing === void 0 ? [] : _ref2$furnishing,
|
|
268
|
-
_ref2$lighting = _ref2.lighting,
|
|
269
|
-
lighting = _ref2$lighting === void 0 ? [] : _ref2$lighting;
|
|
270
|
-
var _projectElement = (0, _slicedToArray2["default"])(projectElement, 1),
|
|
271
|
-
project_data = _projectElement[0].project_data;
|
|
272
|
-
var id = configData.id,
|
|
273
|
-
logoImg = configData.logoImg,
|
|
274
|
-
companyUrl = configData.companyUrl;
|
|
275
|
-
var _React$useState = _react["default"].useState([]),
|
|
276
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
277
|
-
outlineSVGData = _React$useState2[0],
|
|
278
|
-
setOutlineSVGData = _React$useState2[1];
|
|
279
|
-
var _React$useState3 = _react["default"].useState(false),
|
|
280
|
-
_React$useState4 = (0, _slicedToArray2["default"])(_React$useState3, 2),
|
|
281
|
-
catalogInitiated = _React$useState4[0],
|
|
282
|
-
setCatalogInitiated = _React$useState4[1];
|
|
283
|
-
(0, _react.useEffect)(function () {
|
|
284
|
-
var initMyCatalog = /*#__PURE__*/function () {
|
|
285
|
-
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
286
|
-
var x, _x, _x2;
|
|
287
|
-
return _regenerator["default"].wrap(function (_context) {
|
|
288
|
-
while (1) switch (_context.prev = _context.next) {
|
|
289
|
-
case 0:
|
|
290
|
-
for (x in Areas) MyCatalog.registerElement(Areas[x]);
|
|
291
|
-
for (_x in Lines) MyCatalog.registerElement(Lines[_x]);
|
|
292
|
-
for (_x2 in Holes) MyCatalog.registerElement(Holes[_x2]);
|
|
293
|
-
MyCatalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
|
|
294
|
-
MyCatalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
|
|
295
|
-
case 1:
|
|
296
|
-
case "end":
|
|
297
|
-
return _context.stop();
|
|
298
|
-
}
|
|
299
|
-
}, _callee);
|
|
300
|
-
}));
|
|
301
|
-
return function initMyCatalog() {
|
|
302
|
-
return _ref3.apply(this, arguments);
|
|
303
|
-
};
|
|
304
|
-
}();
|
|
305
|
-
var loadMoldings = /*#__PURE__*/function () {
|
|
306
|
-
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
307
|
-
var door_color_alias, subgroup_ids, door_color_alias_ids, doorStyleData, molding, toeMoldingData, cabinets, promises;
|
|
308
|
-
return _regenerator["default"].wrap(function (_context2) {
|
|
309
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
310
|
-
case 0:
|
|
311
|
-
door_color_alias = [];
|
|
312
|
-
subgroup_ids = catalogs.filter(function (item) {
|
|
313
|
-
return item.id == id;
|
|
314
|
-
})[0].manufacturer_subgroup_ids.split(',');
|
|
315
|
-
door_color_alias_ids = [];
|
|
316
|
-
subgroups.forEach(function (subgroup) {
|
|
317
|
-
if (subgroup_ids.some(function (id) {
|
|
318
|
-
return id == subgroup.id.toString();
|
|
319
|
-
})) {
|
|
320
|
-
subgroup.door_color_alias_ids.split(',').forEach(function (item) {
|
|
321
|
-
item != '' && door_color_alias_ids.push(item);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
});
|
|
325
|
-
colorAlias.forEach(function (color) {
|
|
326
|
-
return door_color_alias_ids.some(function (id) {
|
|
327
|
-
return id == color.id.toString();
|
|
328
|
-
}) && door_color_alias.push(color);
|
|
329
|
-
});
|
|
330
|
-
doorStyleData = categoryData.data.doorStyles.items;
|
|
331
|
-
categoryData.data.doorStyles.items = doorStyleData.treeStruct;
|
|
332
|
-
door_color_alias.forEach(function (dca) {
|
|
333
|
-
doorStyleData.doorColorData.forEach(function (dc) {
|
|
334
|
-
dc.door_style_id = parseInt(dc.door_style_id);
|
|
335
|
-
if (dc.id !== dca.door_color_id) return;
|
|
336
|
-
dc.name = dca.alias_name;
|
|
337
|
-
dc.color_sku_alias = dca.sku_alias_name;
|
|
338
|
-
doorStyleData.treeStruct.forEach(function (el) {
|
|
339
|
-
el.items.forEach(function (elem) {
|
|
340
|
-
return dc.door_style_id === elem.id && (dc.door_style_name = elem.name);
|
|
341
|
-
});
|
|
342
|
-
});
|
|
343
|
-
dca.alias_installation_type = (0, _helper.isEmpty)(dca.alias_installation_type) ? [] : dca.alias_installation_type.split(',').map(function (n) {
|
|
344
|
-
return parseInt(n);
|
|
345
|
-
});
|
|
346
|
-
categoryData.data.doorStyles.items.forEach(function (item) {
|
|
347
|
-
if (dca.alias_installation_type.some(function (ait) {
|
|
348
|
-
return ait === item.id;
|
|
349
|
-
})) item.items.forEach(function (ds) {
|
|
350
|
-
if (ds.name === dc.door_style_name) ds.items.push(dc);
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
});
|
|
355
|
-
molding = [];
|
|
356
|
-
toeMoldingData = [];
|
|
357
|
-
cabinets = categoryData.data.cabinets;
|
|
358
|
-
cabinets[cabinets.length - 1].items.forEach(function (index) {
|
|
359
|
-
if (index.name.toLowerCase().includes('molding')) {
|
|
360
|
-
index.items.forEach(function (item) {
|
|
361
|
-
return molding.push(item);
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
if (index.name.includes(_constants.TOE_KICK_MOLDING)) {
|
|
365
|
-
index.items.forEach(function (item) {
|
|
366
|
-
return toeMoldingData.push(item);
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
categoryData.data.toeMoldingData = toeMoldingData;
|
|
371
|
-
promises = molding.map(function (child) {
|
|
372
|
-
return new Promise(function (resolve, reject) {
|
|
373
|
-
var url = child === null || child === void 0 ? void 0 : child.shape_svg;
|
|
374
|
-
if (!url) return resolve();
|
|
375
|
-
var loader = new _SVGLoader.SVGLoader();
|
|
376
|
-
loader.load(url, function (data) {
|
|
377
|
-
var _data$xml$viewBox$ani, _data$xml, _data$xml$viewBox$ani2, _data$xml2;
|
|
378
|
-
child.data = {
|
|
379
|
-
paths: data.paths,
|
|
380
|
-
svg_width: (_data$xml$viewBox$ani = (_data$xml = data.xml) === null || _data$xml === void 0 || (_data$xml = _data$xml.viewBox) === null || _data$xml === void 0 || (_data$xml = _data$xml.animVal) === null || _data$xml === void 0 ? void 0 : _data$xml.width) !== null && _data$xml$viewBox$ani !== void 0 ? _data$xml$viewBox$ani : 0,
|
|
381
|
-
svg_height: (_data$xml$viewBox$ani2 = (_data$xml2 = data.xml) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.viewBox) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.animVal) === null || _data$xml2 === void 0 ? void 0 : _data$xml2.height) !== null && _data$xml$viewBox$ani2 !== void 0 ? _data$xml$viewBox$ani2 : 0
|
|
382
|
-
};
|
|
383
|
-
resolve();
|
|
384
|
-
}, null, function (error) {
|
|
385
|
-
console.error(error);
|
|
386
|
-
reject(error);
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
});
|
|
390
|
-
return _context2.abrupt("return", Promise.all(promises));
|
|
391
|
-
case 1:
|
|
392
|
-
case "end":
|
|
393
|
-
return _context2.stop();
|
|
394
|
-
}
|
|
395
|
-
}, _callee2);
|
|
396
|
-
}));
|
|
397
|
-
return function loadMoldings() {
|
|
398
|
-
return _ref4.apply(this, arguments);
|
|
399
|
-
};
|
|
400
|
-
}();
|
|
401
|
-
var loadSVGs = /*#__PURE__*/function () {
|
|
402
|
-
var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
403
|
-
var svgLoadPromises, outlineData;
|
|
404
|
-
return _regenerator["default"].wrap(function (_context4) {
|
|
405
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
406
|
-
case 0:
|
|
407
|
-
svgLoadPromises = data.map(/*#__PURE__*/function () {
|
|
408
|
-
var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(item) {
|
|
409
|
-
var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
|
|
410
|
-
return _regenerator["default"].wrap(function (_context3) {
|
|
411
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
412
|
-
case 0:
|
|
413
|
-
if (item.outline) {
|
|
414
|
-
_context3.next = 1;
|
|
415
|
-
break;
|
|
416
|
-
}
|
|
417
|
-
return _context3.abrupt("return", null);
|
|
418
|
-
case 1:
|
|
419
|
-
_context3.prev = 1;
|
|
420
|
-
_context3.next = 2;
|
|
421
|
-
return fetch(item.outline, {
|
|
422
|
-
cache: 'no-store'
|
|
423
|
-
});
|
|
424
|
-
case 2:
|
|
425
|
-
response = _context3.sent;
|
|
426
|
-
_context3.next = 3;
|
|
427
|
-
return response.text();
|
|
428
|
-
case 3:
|
|
429
|
-
svgText = _context3.sent;
|
|
430
|
-
loader = new _SVGLoader.SVGLoader();
|
|
431
|
-
parsed = loader.parse(svgText);
|
|
432
|
-
if (!(0, _helper.isEmpty)(parsed.paths)) {
|
|
433
|
-
_context3.next = 4;
|
|
434
|
-
break;
|
|
435
|
-
}
|
|
436
|
-
return _context3.abrupt("return", null);
|
|
437
|
-
case 4:
|
|
438
|
-
return _context3.abrupt("return", {
|
|
439
|
-
paths: parsed.paths,
|
|
440
|
-
svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
|
|
441
|
-
svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
|
|
442
|
-
reverse: !parseFloat(parsed.xml.getAttribute('height'))
|
|
443
|
-
});
|
|
444
|
-
case 5:
|
|
445
|
-
_context3.prev = 5;
|
|
446
|
-
_t = _context3["catch"](1);
|
|
447
|
-
console.error('Failed to load SVG:', item.outline, _t);
|
|
448
|
-
return _context3.abrupt("return", null);
|
|
449
|
-
case 6:
|
|
450
|
-
case "end":
|
|
451
|
-
return _context3.stop();
|
|
452
|
-
}
|
|
453
|
-
}, _callee3, null, [[1, 5]]);
|
|
454
|
-
}));
|
|
455
|
-
return function (_x3) {
|
|
456
|
-
return _ref6.apply(this, arguments);
|
|
457
|
-
};
|
|
458
|
-
}());
|
|
459
|
-
_context4.next = 1;
|
|
460
|
-
return Promise.all(svgLoadPromises);
|
|
461
|
-
case 1:
|
|
462
|
-
outlineData = _context4.sent;
|
|
463
|
-
setOutlineSVGData(outlineData);
|
|
464
|
-
case 2:
|
|
465
|
-
case "end":
|
|
466
|
-
return _context4.stop();
|
|
467
|
-
}
|
|
468
|
-
}, _callee4);
|
|
469
|
-
}));
|
|
470
|
-
return function loadSVGs() {
|
|
471
|
-
return _ref5.apply(this, arguments);
|
|
472
|
-
};
|
|
473
|
-
}();
|
|
474
|
-
var initCatalog = /*#__PURE__*/function () {
|
|
475
|
-
var _ref7 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
476
|
-
return _regenerator["default"].wrap(function (_context5) {
|
|
477
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
478
|
-
case 0:
|
|
479
|
-
setCatalogInitiated(false);
|
|
480
|
-
_context5.next = 1;
|
|
481
|
-
return initMyCatalog();
|
|
482
|
-
case 1:
|
|
483
|
-
_context5.next = 2;
|
|
484
|
-
return loadMoldings();
|
|
485
|
-
case 2:
|
|
486
|
-
_context5.next = 3;
|
|
487
|
-
return loadSVGs();
|
|
488
|
-
case 3:
|
|
489
|
-
setCatalogInitiated(true);
|
|
490
|
-
case 4:
|
|
491
|
-
case "end":
|
|
492
|
-
return _context5.stop();
|
|
493
|
-
}
|
|
494
|
-
}, _callee5);
|
|
495
|
-
}));
|
|
496
|
-
return function initCatalog() {
|
|
497
|
-
return _ref7.apply(this, arguments);
|
|
498
|
-
};
|
|
499
|
-
}();
|
|
500
|
-
initCatalog();
|
|
501
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
502
|
-
}, [categoryData, data, id, catalogs, colorAlias, subgroups]);
|
|
503
|
-
|
|
504
|
-
// Register items once SVGs are loaded
|
|
505
|
-
(0, _react.useEffect)(function () {
|
|
506
|
-
if (!outlineSVGData.length) return;
|
|
507
|
-
var Item = [];
|
|
508
|
-
data.forEach(function (obj, index) {
|
|
509
|
-
Item.push((0, _exporter["default"])(_objectSpread(_objectSpread({}, obj), {}, {
|
|
510
|
-
type: 'cabinet',
|
|
511
|
-
outlineSVGData: outlineSVGData[index],
|
|
512
|
-
render2DItem: _itemLoader.render2DItem,
|
|
513
|
-
render3DItem: _itemLoader.render3DItem
|
|
514
|
-
})));
|
|
515
|
-
});
|
|
516
|
-
appliances.forEach(function (obj) {
|
|
517
|
-
Item.push((0, _exporter["default"])(_objectSpread(_objectSpread({}, obj), {}, {
|
|
518
|
-
render2DItem: _itemLoader.render2DItem,
|
|
519
|
-
render3DItem: _itemLoader.render3DApplianceItem,
|
|
520
|
-
type: 'appliance'
|
|
521
|
-
})));
|
|
522
|
-
});
|
|
523
|
-
lighting.forEach(function (obj) {
|
|
524
|
-
Item.push((0, _exporter["default"])(_objectSpread(_objectSpread({}, obj), {}, {
|
|
525
|
-
type: 'lighting',
|
|
526
|
-
render2DItem: _itemLoader.render2DItem,
|
|
527
|
-
render3DItem: _itemLoader.render3DLightingItem
|
|
528
|
-
})));
|
|
529
|
-
});
|
|
530
|
-
furnishing.forEach(function (obj) {
|
|
531
|
-
Item.push((0, _exporter["default"])(_objectSpread(_objectSpread({}, obj), {}, {
|
|
532
|
-
type: 'furnishing',
|
|
533
|
-
render2DItem: _itemLoader.render2DItem,
|
|
534
|
-
render3DItem: _itemLoader.render3DApplianceItem
|
|
535
|
-
})));
|
|
536
|
-
});
|
|
537
|
-
for (var x in Item) MyCatalog.registerElement(Item[x]);
|
|
538
|
-
}, [outlineSVGData, data, appliances, furnishing, lighting]);
|
|
539
|
-
(0, _react.useEffect)(function () {
|
|
540
|
-
if (projectElement.length === 0) return;
|
|
541
|
-
if (!catalogInitiated) return;
|
|
542
|
-
sessionStorage.setItem('projectTitle', projectElement[0].title);
|
|
543
|
-
store.dispatch((0, _projectActions.rename)(projectElement[0].title));
|
|
544
|
-
sessionStorage.setItem('projectId', projectElement[0].id);
|
|
545
|
-
sessionStorage.setItem('email', projectElement[0].email);
|
|
546
|
-
sessionStorage.setItem('firstName', projectElement[0].firstName);
|
|
547
|
-
sessionStorage.setItem('lastName', projectElement[0].lastName);
|
|
548
|
-
sessionStorage.setItem('phone', projectElement[0].phone);
|
|
549
|
-
var jsonData;
|
|
550
|
-
jsonData = JSON.parse(projectElement[0].project_data);
|
|
551
|
-
jsonData.isLoadingCabinet = false;
|
|
552
|
-
store.dispatch((0, _projectActions.loadProject)(jsonData, categoryData));
|
|
553
|
-
}, [project_data, catalogInitiated]);
|
|
319
|
+
var _ref = configData || {},
|
|
320
|
+
logoImg = _ref.logoImg,
|
|
321
|
+
companyUrl = _ref.companyUrl;
|
|
554
322
|
return /*#__PURE__*/_react["default"].createElement(_AppContext["default"].Provider, null, /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
555
|
-
store:
|
|
323
|
+
store: storeRef.current
|
|
556
324
|
}, /*#__PURE__*/_react["default"].createElement(ToolErrorBoundary, {
|
|
557
325
|
pushError: pushError
|
|
558
326
|
}, /*#__PURE__*/_react["default"].createElement(_LiteKitchenConfigurator["default"], (0, _extends2["default"])({
|
|
559
|
-
catalog:
|
|
327
|
+
catalog: catalogRef.current,
|
|
560
328
|
width: width,
|
|
561
329
|
height: height,
|
|
562
330
|
logoImage: logoImg,
|
|
@@ -565,22 +333,14 @@ function LiteRenderer(props) {
|
|
|
565
333
|
stateExtractor: function stateExtractor(state) {
|
|
566
334
|
return state.get('KitchenConfigurator');
|
|
567
335
|
},
|
|
568
|
-
categoryData: categoryData,
|
|
569
|
-
data: data,
|
|
570
336
|
configData: configData,
|
|
571
337
|
externalEvent: externalEvent,
|
|
572
|
-
|
|
338
|
+
onInternalEvent: onInternalEvent
|
|
573
339
|
}, passThrough)))));
|
|
574
340
|
}
|
|
575
|
-
|
|
576
|
-
/* ============================== prop types ============================== */
|
|
577
|
-
|
|
578
341
|
LiteRenderer.propTypes = {
|
|
579
342
|
width: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
580
343
|
height: _propTypes["default"].oneOfType([_propTypes["default"].number, _propTypes["default"].string]),
|
|
581
|
-
projectElement: _propTypes["default"].arrayOf(_propTypes["default"].object),
|
|
582
|
-
categoryData: _propTypes["default"].any,
|
|
583
|
-
dataBundle: _propTypes["default"].any,
|
|
584
344
|
configData: _propTypes["default"].any,
|
|
585
345
|
catalog: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].instanceOf(Models.Catalog)]),
|
|
586
346
|
logoImg: _propTypes["default"].any,
|
|
@@ -594,7 +354,7 @@ LiteRenderer.propTypes = {
|
|
|
594
354
|
environment: _propTypes["default"].string
|
|
595
355
|
}),
|
|
596
356
|
externalEvent: _propTypes["default"].object,
|
|
597
|
-
|
|
357
|
+
onInternalEvent: _propTypes["default"].func,
|
|
598
358
|
onError: _propTypes["default"].func,
|
|
599
359
|
store: _propTypes["default"].object
|
|
600
360
|
};
|