kitchen-simulator 5.0.0-test.10 → 5.0.0-test.13
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 +1 -1
- package/package.json +21 -14
- package/src/_renderer.jsx +42 -0
- package/src/catalog/areas/area/planner-element.jsx +1 -1
- package/src/catalog/lines/wall/planner-element.jsx +1 -1
- package/src/catalog/mycatalog.js +26 -0
- package/src/index.html.ejs +226 -0
- package/src/@history.js +0 -3
- /package/src/components/{export.js → _export.js} +0 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kitchen-simulator",
|
|
3
|
-
"version": "5.0.0-test.
|
|
3
|
+
"version": "5.0.0-test.13",
|
|
4
4
|
"description": "It is a kitchen simulator.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
|
|
7
5
|
"main": "src/index.js",
|
|
8
6
|
"module": "src/index.js",
|
|
9
7
|
"exports": {
|
|
@@ -16,8 +14,17 @@
|
|
|
16
14
|
},
|
|
17
15
|
|
|
18
16
|
"files": [
|
|
19
|
-
"src
|
|
20
|
-
"src
|
|
17
|
+
"src/_renderer.jsx",
|
|
18
|
+
"src/AppContext.js",
|
|
19
|
+
"src/constants.js",
|
|
20
|
+
"src/index.js",
|
|
21
|
+
"src/index.html.ejs",
|
|
22
|
+
"src/KitchenConfigurator.jsx",
|
|
23
|
+
"src/KitchenConfiguratorApp.jsx",
|
|
24
|
+
"src/models.js",
|
|
25
|
+
"src/shared-style.js",
|
|
26
|
+
"src/version.js",
|
|
27
|
+
|
|
21
28
|
"src/catalog",
|
|
22
29
|
"src/utils",
|
|
23
30
|
"src/actions",
|
|
@@ -29,7 +36,7 @@
|
|
|
29
36
|
"README.md",
|
|
30
37
|
"LICENSE",
|
|
31
38
|
|
|
32
|
-
"src/components/
|
|
39
|
+
"src/components/_export.js",
|
|
33
40
|
"src/components/atoms",
|
|
34
41
|
"src/components/button",
|
|
35
42
|
"src/components/molecules",
|
|
@@ -38,7 +45,8 @@
|
|
|
38
45
|
"src/components/viewer2d",
|
|
39
46
|
"src/components/viewer3d",
|
|
40
47
|
"src/components/content.jsx",
|
|
41
|
-
"src/components/catalog-view.jsx"
|
|
48
|
+
"src/components/catalog-view.jsx",
|
|
49
|
+
"src/components/project-configurator.jsx"
|
|
42
50
|
],
|
|
43
51
|
|
|
44
52
|
"sideEffects": [
|
|
@@ -48,14 +56,13 @@
|
|
|
48
56
|
],
|
|
49
57
|
|
|
50
58
|
"scripts": {
|
|
51
|
-
"start": "webpack-dev-server --config
|
|
52
|
-
"start9010": "webpack-dev-server --config
|
|
53
|
-
"start9020": "webpack-dev-server --config
|
|
54
|
-
"build
|
|
55
|
-
"
|
|
56
|
-
"clean": "rimraf demo/dist",
|
|
59
|
+
"start": "webpack-dev-server --config ./webpack.config.js --port 9000 --mode development",
|
|
60
|
+
"start9010": "webpack-dev-server --config ./webpack.config.js --port 9010 --mode development",
|
|
61
|
+
"start9020": "webpack-dev-server --config ./webpack.config.js --port 9020 --mode development",
|
|
62
|
+
"build": "npm run build-. && mkdir -p ./dist && cp -R ./src/catalog ./dist/ && cp -R ./src/assets ./dist/",
|
|
63
|
+
"clean": "rimraf ./dist",
|
|
57
64
|
"update-version-file": "const-version ./package.json ./src/version.js",
|
|
58
|
-
"version": "npm run update-version-file && npm run build && git add -A src/version.js && git add -A
|
|
65
|
+
"version": "npm run update-version-file && npm run build && git add -A src/version.js && git add -A ./dist",
|
|
59
66
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
60
67
|
"server": "node server.js",
|
|
61
68
|
"prepack": "npm run clean"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import KitchenConfiguratorApp from './KitchenConfiguratorApp.jsx'; // webpack alias points to ../src
|
|
3
|
+
import mockProps from './mocks/mockProps.json';
|
|
4
|
+
import mockCategoryData from './mocks/categoryData.json';
|
|
5
|
+
import mockDataBundle from './mocks/dataBundle.json';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
7
|
+
|
|
8
|
+
// --- renderer props ---
|
|
9
|
+
const options = { unit: 'in', enable3D: true };
|
|
10
|
+
|
|
11
|
+
const onSave = ({ payload }) => {
|
|
12
|
+
console.log('SAVE triggered:', payload.scene);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const onEvent = evt => {
|
|
16
|
+
console.log('EVENT:', evt.type, evt.payload);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const onError = err => {
|
|
20
|
+
console.error('ERROR:', err);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
document.getElementById('app').style.display = 'block';
|
|
24
|
+
|
|
25
|
+
ReactDOM.render(
|
|
26
|
+
<KitchenConfiguratorApp
|
|
27
|
+
width={1264}
|
|
28
|
+
height={1164}
|
|
29
|
+
projectElement={mockProps.projectElement}
|
|
30
|
+
categoryData={mockCategoryData}
|
|
31
|
+
dataBundle={mockDataBundle}
|
|
32
|
+
configData={mockProps.configData}
|
|
33
|
+
options={options}
|
|
34
|
+
logoImg="/assets/logo.png"
|
|
35
|
+
companyUrl="https://example.com"
|
|
36
|
+
toolbarButtons={[]}
|
|
37
|
+
onSave={onSave}
|
|
38
|
+
onEvent={onEvent}
|
|
39
|
+
onError={onError}
|
|
40
|
+
/>,
|
|
41
|
+
document.getElementById('app')
|
|
42
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Catalog } from '../index';
|
|
2
|
+
import * as Areas from './areas/**/planner-element.jsx';
|
|
3
|
+
import * as Lines from './lines/**/planner-element.jsx';
|
|
4
|
+
import * as Holes from './holes/**/planner-element.jsx';
|
|
5
|
+
|
|
6
|
+
let catalog = new Catalog();
|
|
7
|
+
// import * as Items from './Items/**/*.jsx';
|
|
8
|
+
for (let x in Areas) catalog.registerElement(Areas[x]);
|
|
9
|
+
for (let x in Lines) catalog.registerElement(Lines[x]);
|
|
10
|
+
for (let x in Holes) catalog.registerElement(Holes[x]);
|
|
11
|
+
// for (let x in Items) catalog.registerElement(Items[x]);
|
|
12
|
+
catalog.registerCategory('Windows', 'Windows', [
|
|
13
|
+
Holes.windowClear,
|
|
14
|
+
Holes.windowCross,
|
|
15
|
+
Holes.windowDoubleHung,
|
|
16
|
+
Holes.windowVertical
|
|
17
|
+
]);
|
|
18
|
+
catalog.registerCategory('Doors', 'Doors', [
|
|
19
|
+
Holes.doorInterior,
|
|
20
|
+
Holes.doorExterior,
|
|
21
|
+
Holes.doorCloset,
|
|
22
|
+
Holes.doorSliding,
|
|
23
|
+
Holes.doorwayFramed,
|
|
24
|
+
Holes.doorwayFrameless
|
|
25
|
+
]);
|
|
26
|
+
export default catalog;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="/assets/fonts/style.css" />
|
|
7
|
+
<link
|
|
8
|
+
rel="icon"
|
|
9
|
+
type="image/jpg"
|
|
10
|
+
href="/assets/img/rta/rta_logo_box_blue_ico.jpg"
|
|
11
|
+
id="favicon_icon_jpg"
|
|
12
|
+
/>
|
|
13
|
+
<link
|
|
14
|
+
rel="icon"
|
|
15
|
+
type="image/svg"
|
|
16
|
+
href="/assets/img/rta/rta_logo_box_blue_ico.svg"
|
|
17
|
+
id="favicon_icon_svg"
|
|
18
|
+
/>
|
|
19
|
+
<link
|
|
20
|
+
rel="shortcut icon"
|
|
21
|
+
type="image/jpg"
|
|
22
|
+
href="/assets/img/rta/rta_logo_box_blue_ico.jpg"
|
|
23
|
+
id="favicon_shortcut_jpg"
|
|
24
|
+
/>
|
|
25
|
+
<link
|
|
26
|
+
rel="shortcut icon"
|
|
27
|
+
type="image/svg"
|
|
28
|
+
href="/assets/img/rta/rta_logo_box_blue_ico.svg"
|
|
29
|
+
id="favicon_shortcut_svg"
|
|
30
|
+
/>
|
|
31
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
32
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
33
|
+
<link
|
|
34
|
+
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap"
|
|
35
|
+
rel="stylesheet"
|
|
36
|
+
/>
|
|
37
|
+
<style>
|
|
38
|
+
* {
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
html,
|
|
43
|
+
body,
|
|
44
|
+
#app {
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
padding: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
font-family: 'Milliard Book';
|
|
50
|
+
font-weight: normal;
|
|
51
|
+
position: absolute;
|
|
52
|
+
left: 0;
|
|
53
|
+
top: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#error {
|
|
57
|
+
position: relative;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
::-webkit-scrollbar {
|
|
61
|
+
width: 2px;
|
|
62
|
+
border-radius: 2px;
|
|
63
|
+
position: absolute;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
::-webkit-scrollbar-track-piece {
|
|
67
|
+
background-color: #fff;
|
|
68
|
+
border-radius: 1px;
|
|
69
|
+
position: absolute;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
::-webkit-scrollbar-thumb:vertical {
|
|
73
|
+
height: 30px;
|
|
74
|
+
background-color: rgb(193, 202, 228);
|
|
75
|
+
}
|
|
76
|
+
::-webkit-scrollbar-thumb {
|
|
77
|
+
background-color: rgb(220, 220, 220);
|
|
78
|
+
border-radius: 5px;
|
|
79
|
+
transition: all 0.3s;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
::-webkit-scrollbar-thumb:hover {
|
|
83
|
+
background-color: rgb(193, 202, 228);
|
|
84
|
+
border-radius: 5px;
|
|
85
|
+
transition: all 0.3s;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
88
|
+
<!-- Hotjar Tracking Code for New DIY -->
|
|
89
|
+
<script>
|
|
90
|
+
(function (h, o, t, j, a, r) {
|
|
91
|
+
h.hj =
|
|
92
|
+
h.hj ||
|
|
93
|
+
function () {
|
|
94
|
+
(h.hj.q = h.hj.q || []).push(arguments);
|
|
95
|
+
};
|
|
96
|
+
h._hjSettings = { hjid: 5088152, hjsv: 6 };
|
|
97
|
+
a = o.getElementsByTagName('head')[0];
|
|
98
|
+
r = o.createElement('script');
|
|
99
|
+
r.async = 1;
|
|
100
|
+
r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
|
|
101
|
+
a.appendChild(r);
|
|
102
|
+
})(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
|
|
103
|
+
</script>
|
|
104
|
+
</head>
|
|
105
|
+
|
|
106
|
+
<body>
|
|
107
|
+
<div id="app" style="display: none">
|
|
108
|
+
<div
|
|
109
|
+
style="
|
|
110
|
+
width: 100vw;
|
|
111
|
+
height: 100vh;
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
"
|
|
117
|
+
>
|
|
118
|
+
<img
|
|
119
|
+
id="kc_spinner"
|
|
120
|
+
style="height: 60px"
|
|
121
|
+
alt="Loading"
|
|
122
|
+
src="/assets/img/loading/loading.gif"
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
<div id="error" style="z-index: -1"></div>
|
|
127
|
+
<!-- Start of LiveChat (www.livechat.com) code -->
|
|
128
|
+
<script>
|
|
129
|
+
function injectThertastore() {
|
|
130
|
+
// --- LiveChat SCRIPT ---
|
|
131
|
+
const liveScript = document.createElement('script');
|
|
132
|
+
liveScript.innerHTML = `
|
|
133
|
+
window.__lc = window.__lc || {};
|
|
134
|
+
window.__lc.license = 3185312;
|
|
135
|
+
(function (n, t, c) {
|
|
136
|
+
function i(n) { return e._h ? e._h.apply(null, n) : e._q.push(n); }
|
|
137
|
+
var e = {
|
|
138
|
+
_q: [], _h: null, _v: '2.0',
|
|
139
|
+
on: function () { i(['on', c.call(arguments)]); },
|
|
140
|
+
once: function () { i(['once', c.call(arguments)]); },
|
|
141
|
+
off: function () { i(['off', c.call(arguments)]); },
|
|
142
|
+
get: function () {
|
|
143
|
+
if (!e._h)
|
|
144
|
+
throw new Error("[LiveChatWidget] You can't use getters before load.");
|
|
145
|
+
return i(['get', c.call(arguments)]);
|
|
146
|
+
},
|
|
147
|
+
call: function () { i(['call', c.call(arguments)]); },
|
|
148
|
+
init: function () {
|
|
149
|
+
var n = t.createElement('script');
|
|
150
|
+
n.async = true;
|
|
151
|
+
n.type = 'text/javascript';
|
|
152
|
+
n.src = 'https://cdn.livechatinc.com/tracking.js';
|
|
153
|
+
t.head.appendChild(n);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
!n.__lc.asyncInit && e.init();
|
|
157
|
+
n.LiveChatWidget = n.LiveChatWidget || e;
|
|
158
|
+
})(window, document, [].slice);
|
|
159
|
+
`;
|
|
160
|
+
document.body.appendChild(liveScript);
|
|
161
|
+
|
|
162
|
+
// --- LiveChat NOSCRIPT ---
|
|
163
|
+
const noscript = document.createElement('noscript');
|
|
164
|
+
noscript.innerHTML = `
|
|
165
|
+
<a href="https://www.livechat.com/chat-with/3185312/" rel="nofollow">
|
|
166
|
+
Chat with us
|
|
167
|
+
</a>, powered by
|
|
168
|
+
<a href="https://www.livechat.com/?welcome" rel="noopener nofollow" target="_blank">
|
|
169
|
+
LiveChat
|
|
170
|
+
</a>
|
|
171
|
+
`;
|
|
172
|
+
document.body.appendChild(noscript);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function injectPrimecabinetry() {
|
|
176
|
+
// --- Richpanel SCRIPT ---
|
|
177
|
+
const richpanelScript = document.createElement('script');
|
|
178
|
+
richpanelScript.innerHTML = `
|
|
179
|
+
window.richpanel||(window.richpanel=[]),window.richpanel.q=[],
|
|
180
|
+
mth=["track","debug","atr"],
|
|
181
|
+
sk=function(e){return function(){
|
|
182
|
+
a=Array.prototype.slice.call(arguments);
|
|
183
|
+
a.unshift(e);
|
|
184
|
+
window.richpanel.q.push(a)
|
|
185
|
+
}};
|
|
186
|
+
for(var i=0;mth.length>i;i++)window.richpanel[mth[i]]=sk(mth[i]);
|
|
187
|
+
window.richpanel.load=function(e){
|
|
188
|
+
var i=document,
|
|
189
|
+
n=i.getElementsByTagName("script")[0],
|
|
190
|
+
r=i.createElement("script");
|
|
191
|
+
r.type="text/javascript";
|
|
192
|
+
r.async=true;
|
|
193
|
+
r.src="https://cdn.richpanel.com/js/richpanel-root.js?appClientId=primecabinetry2965";
|
|
194
|
+
n.parentNode.insertBefore(r,n)
|
|
195
|
+
};
|
|
196
|
+
window.richpanel.ensure_rpuid="";
|
|
197
|
+
richpanel.load("primecabinetry2965");
|
|
198
|
+
`;
|
|
199
|
+
document.body.appendChild(richpanelScript);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// brand → injection function mapping
|
|
203
|
+
const brandInjectors = {
|
|
204
|
+
thertastore: injectThertastore,
|
|
205
|
+
primecabinetry: injectPrimecabinetry
|
|
206
|
+
// future brands go here
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
// extract brand from URL
|
|
210
|
+
const brand = window.location.pathname.split('/')[1];
|
|
211
|
+
|
|
212
|
+
// pick injector
|
|
213
|
+
const injector = brandInjectors[brand];
|
|
214
|
+
|
|
215
|
+
if (injector) {
|
|
216
|
+
injector();
|
|
217
|
+
} else {
|
|
218
|
+
console.warn(
|
|
219
|
+
`[Brand Injection] Unknown brand "${brand}". Defaulting to Thertastore.`
|
|
220
|
+
);
|
|
221
|
+
brandInjectors['thertastore']();
|
|
222
|
+
}
|
|
223
|
+
</script>
|
|
224
|
+
<!-- End of LiveChat code -->
|
|
225
|
+
</body>
|
|
226
|
+
</html>
|
package/src/@history.js
DELETED
|
File without changes
|