kitchen-simulator 5.0.0-test.12 → 5.0.0-test.14

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/src/_index.js ADDED
@@ -0,0 +1,32 @@
1
+ import Catalog from './catalog/catalog';
2
+ import Translator from './translator/translator';
3
+ import * as Models from './models';
4
+ import reducer from './reducers/reducer';
5
+ import _KitchenConfigurator from './_KitchenConfigurator';
6
+ import Plugins from './plugins/export';
7
+ import * as KitchenConfiguratorConstants from './constants';
8
+ import * as KitchenConfiguratorSharedStyle from './shared-style';
9
+ import KitchenConfiguratorComponents from './components/export';
10
+ import KitchenConfiguratorActions from './actions/export';
11
+ import KitchenConfiguratorReducers from './reducers/export';
12
+ import KitchenConfiguratorClasses from './class/export';
13
+ import ElementsFactories from './catalog/factories/export';
14
+ import KitchenConfiguratorUtils from './utils/export';
15
+ export {
16
+ Catalog,
17
+ Translator,
18
+ Models,
19
+ reducer,
20
+ _KitchenConfigurator,
21
+ Plugins,
22
+ KitchenConfiguratorConstants,
23
+ KitchenConfiguratorSharedStyle,
24
+ KitchenConfiguratorComponents,
25
+ KitchenConfiguratorActions,
26
+ KitchenConfiguratorReducers,
27
+ KitchenConfiguratorClasses,
28
+ ElementsFactories,
29
+ KitchenConfiguratorUtils
30
+ };
31
+
32
+ export { default } from './KitchenConfiguratorApp';
package/src/_renderer.jsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import KitchenConfiguratorApp from './KitchenConfiguratorApp.jsx'; // webpack alias points to ../src
3
- import mockProps from './mockProps.json';
4
- import mockCategoryData from './categoryData.json';
5
- import mockDataBundle from './dataBundle.json';
3
+ import mockProps from './mocks/mockProps.json';
4
+ import mockCategoryData from './mocks/categoryData.json';
5
+ import mockDataBundle from './mocks/dataBundle.json';
6
6
  import ReactDOM from 'react-dom';
7
7
 
8
8
  // --- renderer props ---
@@ -2,28 +2,10 @@ import Content from './content';
2
2
  import Viewer2DComponents from './viewer2d/export';
3
3
  import StyleComponents from './style/export';
4
4
 
5
- export {
6
- // ToolbarComponents,
7
- Content,
8
- // SidebarComponents,
9
- // FooterBarComponents,
10
- Viewer2DComponents,
11
- StyleComponents
12
- // HeaderComponents,
13
- // WizardStepComponents,
14
- // SignComponents,
15
- // MyProjectsComonents
16
- };
5
+ export { Content, Viewer2DComponents, StyleComponents };
17
6
 
18
7
  export default {
19
- // ToolbarComponents,
20
8
  Content,
21
- // SidebarComponents,
22
- // FooterBarComponents,
23
- // WizardStepComponents,
24
9
  Viewer2DComponents,
25
10
  StyleComponents
26
- // HeaderComponents,
27
- // SignComponents,
28
- // MyProjectsComonents
29
11
  };
@@ -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
@@ -1,3 +0,0 @@
1
- import * as history from 'history';
2
-
3
- export default history.createBrowserHistory();
@@ -1,94 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import ls from 'localstorage-slim';
3
- import {
4
- LOCAL_STORAGE_CUSTOMER_INFO,
5
- LOCAL_STORAGE_ORIGINAL_TOKEN,
6
- LOCAL_STORAGE_TOKEN_NAME,
7
- LOCAL_STORAGE_TOKEN_VALUE
8
- } from './constants.js';
9
- import { base64Decode } from './utils/helper.js';
10
-
11
- export const LOG_PREFIX = `[Cross Sign On]`;
12
- export const QUERY_PARAM_TOKEN = 'token';
13
- export const ENCODED_QUERY_PARAM_TOKEN = 'details';
14
-
15
- try {
16
- console.log(`${LOG_PREFIX} Clearing local storage`);
17
- ls.clear();
18
- } catch (e) {
19
- console.log(`${LOG_PREFIX} Error clearing local storage`, e);
20
- }
21
-
22
- function extractAccessTokenFromUrl() {
23
- try {
24
- const url = new URL(window.location.href);
25
- const token = url.searchParams.get(QUERY_PARAM_TOKEN);
26
- const encodedToken = url.searchParams.get(ENCODED_QUERY_PARAM_TOKEN);
27
-
28
- if (!token && !encodedToken) {
29
- console.log(`${LOG_PREFIX} No access token found in URL`);
30
- return undefined;
31
- }
32
-
33
- if (token) {
34
- ls.set(LOCAL_STORAGE_ORIGINAL_TOKEN, token);
35
- ls.set(LOCAL_STORAGE_TOKEN_VALUE, token);
36
- ls.set(LOCAL_STORAGE_TOKEN_NAME, 'token=');
37
- return token;
38
- }
39
-
40
- try {
41
- const decoded = base64Decode(encodedToken);
42
- const parsed = JSON.parse(decoded);
43
- ls.set(LOCAL_STORAGE_ORIGINAL_TOKEN, encodedToken);
44
- if (parsed.token) {
45
- ls.set(LOCAL_STORAGE_TOKEN_VALUE, parsed.token);
46
- }
47
- ls.set(LOCAL_STORAGE_TOKEN_NAME, 'details=');
48
-
49
- const customerInfo = {
50
- email: parsed.email,
51
- firstName: parsed.first_name,
52
- lastName: parsed.last_name
53
- };
54
- ls.set(LOCAL_STORAGE_CUSTOMER_INFO, customerInfo);
55
-
56
- return parsed;
57
- } catch (e) {
58
- return undefined;
59
- }
60
- } catch (e) {
61
- console.error(`${LOG_PREFIX} Error extracting access token from URL`, e);
62
- return undefined;
63
- }
64
- }
65
-
66
- function extractAccessTokenFromLocalStorage() {
67
- const token = ls.get(LOCAL_STORAGE_ORIGINAL_TOKEN);
68
- if (!token || typeof token !== 'string') return undefined;
69
- return token;
70
- }
71
-
72
- const CrossSignOn = ({ App }) => {
73
- const [accessToken, setAccessToken] = useState(() => {
74
- return extractAccessTokenFromUrl() || extractAccessTokenFromLocalStorage();
75
- });
76
-
77
- useEffect(() => {
78
- const handleTokenChange = () => {
79
- const newToken =
80
- extractAccessTokenFromUrl() || extractAccessTokenFromLocalStorage();
81
- setAccessToken(newToken);
82
- };
83
-
84
- window.addEventListener('token-changed', handleTokenChange);
85
-
86
- return () => {
87
- window.removeEventListener('token-changed', handleTokenChange);
88
- };
89
- }, []);
90
-
91
- return <App accessToken={accessToken} />;
92
- };
93
-
94
- export default CrossSignOn;