kitchen-simulator 1.1.1-test.6 → 1.1.1-test.60

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.
Files changed (136) hide show
  1. package/es/KitchenConfigurator.js +8 -15
  2. package/es/KitchenConfiguratorApp.js +11 -27
  3. package/es/actions/holes-actions.js +1 -1
  4. package/es/actions/items-actions.js +1 -1
  5. package/es/actions/lines-actions.js +1 -1
  6. package/es/actions/project-actions.js +1 -1
  7. package/es/actions/scene-actions.js +1 -1
  8. package/es/actions/vertices-actions.js +1 -1
  9. package/es/actions/viewer2d-actions.js +1 -1
  10. package/es/actions/viewer3d-actions.js +1 -1
  11. package/es/catalog/areas/area/planner-element.js +10 -7
  12. package/es/catalog/factories/wall-factory-3d.js +1 -1
  13. package/es/catalog/holes/export.js +13 -13
  14. package/es/catalog/lines/wall/planner-element.js +13 -10
  15. package/es/catalog/properties/property-checkbox.js +63 -18
  16. package/es/catalog/properties/property-enum.js +51 -9
  17. package/es/catalog/properties/property-lenght-measure.js +2 -2
  18. package/es/catalog/properties/property-length-measure.js +58 -9
  19. package/es/catalog/properties/property-length-measure_hole.js +2 -2
  20. package/es/catalog/utils/exporter.js +1 -1
  21. package/es/catalog/utils/item-loader.js +1 -1
  22. package/es/catalog/utils/mtl-loader.js +3 -2
  23. package/es/catalog/utils/obj-loader.js +3 -2
  24. package/es/class/area.js +1 -1
  25. package/es/class/group.js +3 -3
  26. package/es/class/hole.js +5 -6
  27. package/es/class/item.js +8 -10
  28. package/es/class/layer.js +2 -2
  29. package/es/class/project.js +4 -4
  30. package/es/components/content.js +1 -0
  31. package/es/components/disclaimer/disclaimer.js +66 -86
  32. package/es/components/style/form-number-input.js +31 -7
  33. package/es/components/style/form-select.js +56 -8
  34. package/es/components/style/form-slider.js +22 -6
  35. package/es/components/style/form-text-input.js +31 -12
  36. package/es/components/viewer2d/area.js +4 -4
  37. package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
  38. package/es/components/viewer2d/grids/grid-streak.js +0 -1
  39. package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -1
  40. package/es/components/viewer2d/item.js +3 -5
  41. package/es/components/viewer2d/line.js +2 -5
  42. package/es/components/viewer2d/ruler.js +2 -3
  43. package/es/components/viewer2d/rulerDist.js +1 -1
  44. package/es/components/viewer2d/scene.js +2 -2
  45. package/es/components/viewer2d/utils.js +37 -1
  46. package/es/components/viewer2d/viewer2d.js +10 -4
  47. package/es/components/viewer3d/libs/mtl-loader.js +2 -2
  48. package/es/components/viewer3d/libs/obj-loader.js +2 -2
  49. package/es/components/viewer3d/libs/orbit-controls.js +6 -5
  50. package/es/components/viewer3d/libs/pointer-lock-controls.js +5 -4
  51. package/es/components/viewer3d/ruler-utils/itemRect.js +1 -1
  52. package/es/components/viewer3d/ruler-utils/layer3D.js +2 -2
  53. package/es/components/viewer3d/ruler-utils/scene3D.js +2 -3
  54. package/es/components/viewer3d/scene-creator.js +1 -1
  55. package/es/components/viewer3d/viewer3d.js +12 -13
  56. package/es/index.js +20 -14
  57. package/es/models.js +4 -3
  58. package/es/plugins/keyboard.js +2 -2
  59. package/es/reducers/holes-reducer.js +1 -1
  60. package/es/reducers/items-reducer.js +2 -5
  61. package/es/reducers/lines-reducer.js +1 -1
  62. package/es/reducers/project-reducer.js +1 -1
  63. package/es/reducers/reducer.js +2 -2
  64. package/es/reducers/scene-reducer.js +1 -1
  65. package/es/reducers/user-reducer.js +1 -2
  66. package/es/reducers/vertices-reducer.js +1 -1
  67. package/es/reducers/viewer2d-reducer.js +2 -2
  68. package/es/reducers/viewer3d-reducer.js +2 -2
  69. package/es/utils/convert-units-lite.js +29 -0
  70. package/es/utils/geometry.js +4 -4
  71. package/es/utils/get-edges-of-subgraphs.js +2 -1
  72. package/es/utils/graph-cycles.js +2 -3
  73. package/es/utils/graph.js +2 -1
  74. package/es/utils/helper.js +1 -69
  75. package/es/utils/id-broker.js +2 -2
  76. package/es/utils/molding.js +34 -34
  77. package/lib/KitchenConfigurator.js +33 -40
  78. package/lib/KitchenConfiguratorApp.js +34 -49
  79. package/lib/catalog/areas/area/planner-element.js +12 -8
  80. package/lib/catalog/factories/wall-factory-3d.js +2 -2
  81. package/lib/catalog/holes/export.js +13 -13
  82. package/lib/catalog/lines/wall/planner-element.js +15 -11
  83. package/lib/catalog/properties/property-checkbox.js +64 -19
  84. package/lib/catalog/properties/property-enum.js +49 -7
  85. package/lib/catalog/properties/property-lenght-measure.js +3 -3
  86. package/lib/catalog/properties/property-length-measure.js +60 -11
  87. package/lib/catalog/properties/property-length-measure_hole.js +3 -3
  88. package/lib/catalog/utils/exporter.js +5 -6
  89. package/lib/catalog/utils/item-loader.js +20 -21
  90. package/lib/catalog/utils/mtl-loader.js +7 -3
  91. package/lib/catalog/utils/obj-loader.js +7 -3
  92. package/lib/class/item.js +13 -16
  93. package/lib/components/content.js +1 -0
  94. package/lib/components/disclaimer/disclaimer.js +66 -86
  95. package/lib/components/style/form-number-input.js +30 -6
  96. package/lib/components/style/form-select.js +54 -8
  97. package/lib/components/style/form-slider.js +22 -6
  98. package/lib/components/style/form-text-input.js +30 -12
  99. package/lib/components/viewer2d/area.js +5 -5
  100. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -1
  101. package/lib/components/viewer2d/grids/grid-streak.js +0 -1
  102. package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -1
  103. package/lib/components/viewer2d/item.js +7 -8
  104. package/lib/components/viewer2d/line.js +2 -5
  105. package/lib/components/viewer2d/ruler.js +6 -7
  106. package/lib/components/viewer2d/rulerDist.js +4 -4
  107. package/lib/components/viewer2d/scene.js +1 -1
  108. package/lib/components/viewer2d/utils.js +37 -0
  109. package/lib/components/viewer2d/viewer2d.js +25 -17
  110. package/lib/components/viewer3d/libs/mtl-loader.js +6 -2
  111. package/lib/components/viewer3d/libs/obj-loader.js +6 -2
  112. package/lib/components/viewer3d/libs/orbit-controls.js +10 -5
  113. package/lib/components/viewer3d/libs/pointer-lock-controls.js +9 -4
  114. package/lib/components/viewer3d/ruler-utils/itemRect.js +7 -7
  115. package/lib/components/viewer3d/ruler-utils/layer3D.js +32 -32
  116. package/lib/components/viewer3d/ruler-utils/scene3D.js +3 -4
  117. package/lib/components/viewer3d/scene-creator.js +24 -24
  118. package/lib/components/viewer3d/viewer3d.js +17 -17
  119. package/lib/index.js +22 -88
  120. package/lib/models.js +7 -7
  121. package/lib/reducers/user-reducer.js +0 -1
  122. package/lib/reducers/viewer2d-reducer.js +3 -4
  123. package/lib/reducers/viewer3d-reducer.js +3 -4
  124. package/lib/utils/convert-units-lite.js +35 -0
  125. package/lib/utils/geometry.js +9 -10
  126. package/lib/utils/get-edges-of-subgraphs.js +7 -1
  127. package/lib/utils/graph-cycles.js +9 -9
  128. package/lib/utils/graph.js +9 -3
  129. package/lib/utils/helper.js +7 -76
  130. package/lib/utils/id-broker.js +2 -2
  131. package/lib/utils/molding.js +52 -52
  132. package/package.json +34 -70
  133. package/es/analytics/ga4.js +0 -191
  134. package/es/analytics/posthog.js +0 -60
  135. package/lib/analytics/ga4.js +0 -197
  136. package/lib/analytics/posthog.js +0 -68
@@ -1,197 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.GA = void 0;
7
- var _reactGa = _interopRequireDefault(require("react-ga4"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
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; }
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 _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
- // ---------- Helpers ----------
16
- function nowMs() {
17
- return Date.now();
18
- }
19
- function getClientName() {
20
- return sessionStorage.getItem('visualizerName');
21
- }
22
- function isDesktopUA() {
23
- // Lightweight heuristic; GA4 also provides device.category. This flag can help ad-hoc filtering.
24
- var ua = navigator.userAgent.toLowerCase();
25
- var isMobile = /mobi|android|iphone|ipad|ipod|windows phone/.test(ua);
26
- return !isMobile;
27
- }
28
-
29
- // ---------- Keys for storage ----------
30
- var SSN_KEYS = {
31
- sessionStartMs: 'ga4_session_start_ms',
32
- introChoiceMs: 'ga4_intro_choice_ms',
33
- firstCabinetPlaced: 'ga4_first_cabinet_placed',
34
- contextBooted: 'ga4_context_booted',
35
- enteredCanvasSent: 'ga4_entered_canvas_sent'
36
- };
37
-
38
- // ---------- Core GA wrapper ----------
39
- var GA = exports.GA = {
40
- init: function init(_ref) {
41
- var measurementId = _ref.measurementId;
42
- _reactGa["default"].initialize([{
43
- trackingId: measurementId
44
- }], {
45
- testMode: false
46
- });
47
- },
48
- resetSessionKeys: function resetSessionKeys() {
49
- Object.values(SSN_KEYS).forEach(function (key) {
50
- sessionStorage.removeItem(key);
51
- });
52
- },
53
- /**
54
- * Must be called ONCE per page load, *before* other events.
55
- * Sets user properties (project_entry, cross_auth) and sends an initial page_view with client_name.
56
- */
57
- bootSessionContext: function bootSessionContext(_ref2) {
58
- var projectEntry = _ref2.projectEntry,
59
- crossAuth = _ref2.crossAuth;
60
- try {
61
- var resolvedClient = getClientName();
62
-
63
- // Persist session start for timing metrics (if not already set for this tab)
64
- if (!sessionStorage.getItem(SSN_KEYS.sessionStartMs)) {
65
- sessionStorage.setItem(SSN_KEYS.sessionStartMs, String(nowMs()));
66
- }
67
-
68
- // Mark context as booted to avoid duplicate property sets on hot reloads
69
- if (!sessionStorage.getItem(SSN_KEYS.contextBooted)) {
70
- sessionStorage.setItem(SSN_KEYS.contextBooted, '1');
71
-
72
- // Set GA4 user_properties (user-scoped dimensions)
73
- _reactGa["default"].gtag('set', 'user_properties', {
74
- project_entry: projectEntry,
75
- // user scope dimension
76
- cross_auth: crossAuth // user scope dimension (boolean serialized)
77
- });
78
- }
79
-
80
- // Send first page_view hit enriched with event-scoped client_name
81
- _reactGa["default"].send({
82
- hitType: 'pageview',
83
- page: window.location.pathname + window.location.search,
84
- // @ts-expect-error react-ga4 passes along additional params into gtag
85
- client_name: resolvedClient
86
- });
87
- } catch (e) {
88
- // eslint-disable-next-line no-console
89
- console.warn('GA.bootSessionContext error', e);
90
- }
91
- },
92
- // Utility to derive cross_auth from URL (token or details query params)
93
- deriveCrossAuthFromUrl: function deriveCrossAuthFromUrl(search) {
94
- var sp = new URLSearchParams(search);
95
- return sp.has('token') || sp.has('details');
96
- },
97
- // Utility to derive project entry (best-effort). You can also pass explicitly from router logic.
98
- deriveProjectEntry: function deriveProjectEntry() {
99
- var projectId = sessionStorage.getItem('projectId');
100
-
101
- // If a project id exists, consider it "open_existing"; otherwise fallback to "new"
102
- if (projectId) return 'open_existing';
103
- return 'new';
104
- },
105
- // ---------- Event API ----------
106
- events: {
107
- /**
108
- * intro_choice(option) — records the user's entry choice.
109
- * Also stores a timestamp for later time_to_canvas calculation.
110
- */
111
- introChoice: function introChoice(option, extra) {
112
- var client_name = getClientName();
113
- sessionStorage.setItem(SSN_KEYS.introChoiceMs, String(nowMs()));
114
- _reactGa["default"].event('intro_choice', _objectSpread({
115
- client_name: client_name,
116
- option: option
117
- }, extra || {}));
118
- },
119
- /**
120
- * entered_canvas(time_to_canvas) — compute (now - intro_choice)
121
- */
122
- enteredCanvas: function enteredCanvas() {
123
- // fire only once per tab/session
124
- if (sessionStorage.getItem(SSN_KEYS.enteredCanvasSent)) return;
125
- var client_name = getClientName();
126
- var introMs = Number(sessionStorage.getItem(SSN_KEYS.introChoiceMs) || 0);
127
- var timeSec = introMs ? Math.max(0, Math.round((Date.now() - introMs) / 1000)) : undefined;
128
- _reactGa["default"].event('entered_canvas', _objectSpread({
129
- client_name: client_name
130
- }, typeof timeSec === 'number' ? {
131
- time_to_canvas: timeSec
132
- } : {}));
133
- sessionStorage.setItem(SSN_KEYS.enteredCanvasSent, '1'); // 👈 lock it
134
- },
135
- /**
136
- * cabinet_placed(time_to_first_cabinet) — send only for the *first* cabinet of the session.
137
- */
138
- cabinetPlaced: function cabinetPlaced() {
139
- var already = sessionStorage.getItem(SSN_KEYS.firstCabinetPlaced);
140
- var client_name = getClientName();
141
- var params = {
142
- client_name: client_name
143
- };
144
- if (!already) {
145
- var startMs = Number(sessionStorage.getItem(SSN_KEYS.sessionStartMs) || 0);
146
- var timeSec = startMs ? Math.max(0, Math.round((nowMs() - startMs) / 1000)) : undefined;
147
- if (typeof timeSec === 'number') params.time_to_first_cabinet = timeSec; // custom metric (seconds)
148
- sessionStorage.setItem(SSN_KEYS.firstCabinetPlaced, '1');
149
- }
150
- _reactGa["default"].event('cabinet_placed', params);
151
- },
152
- /**
153
- * door_changed(door_id)
154
- */
155
- doorChanged: function doorChanged(door_id) {
156
- var client_name = getClientName();
157
- _reactGa["default"].event('door_changed', {
158
- client_name: client_name,
159
- door_id: door_id
160
- });
161
- },
162
- /**
163
- * project_saved(project_id, save_method) — mark as conversion in GA UI.
164
- */
165
- projectSaved: function projectSaved(project_id, save_method) {
166
- var client_name = getClientName();
167
- _reactGa["default"].event('project_saved', {
168
- client_name: client_name,
169
- project_id: project_id,
170
- save_method: save_method
171
- });
172
- },
173
- /**
174
- * assistance_requested(method, project_id) — mark as conversion in GA UI.
175
- */
176
- assistanceRequested: function assistanceRequested(method, project_id) {
177
- var client_name = getClientName();
178
- _reactGa["default"].event('assistance_requested', {
179
- client_name: client_name,
180
- method: method,
181
- project_id: project_id
182
- });
183
- },
184
- /**
185
- * add_to_cart(project_id, sku_count, price_total) — mark as conversion in GA UI.
186
- */
187
- addToCart: function addToCart(project_id, sku_count, price_total) {
188
- var client_name = getClientName();
189
- _reactGa["default"].event('add_to_cart', {
190
- client_name: client_name,
191
- project_id: project_id,
192
- sku_count: sku_count,
193
- price_total: price_total
194
- });
195
- }
196
- }
197
- };
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PH = void 0;
7
- exports.bootSessionContext = bootSessionContext;
8
- exports.getSessionId = getSessionId;
9
- var _posthogJs = _interopRequireDefault(require("posthog-js"));
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
- // ---- session context ----
12
- function bootSessionContext() {
13
- var url = new URL(window.location.href);
14
- var client_name = sessionStorage.getItem('visualizerName');
15
- var project_entry = sessionStorage.getItem('projectId') ? 'open_existing' : 'new';
16
- var cross_auth = url.searchParams.has('token') || url.searchParams.has('details');
17
-
18
- // Persist context on the client/session
19
- _posthogJs["default"].register({
20
- client_name: client_name,
21
- project_entry: project_entry,
22
- cross_auth: cross_auth
23
- });
24
-
25
- // First-hit event for qualitative flow
26
- _posthogJs["default"].capture('session_started', {
27
- client_name: client_name,
28
- project_entry: project_entry,
29
- cross_auth: cross_auth
30
- });
31
- }
32
-
33
- // Optional: expose session id for replay linkage
34
- function getSessionId() {
35
- try {
36
- return _posthogJs["default"].get_session_id();
37
- } catch (_unused) {
38
- return null;
39
- }
40
- }
41
-
42
- // ---- event wrappers (mirror GA4 conversions) ----
43
- var PH = exports.PH = {
44
- projectSaved: function projectSaved(project_id) {
45
- _posthogJs["default"].capture('project_saved', {
46
- project_id: project_id,
47
- client_name: sessionStorage.getItem('visualizerName'),
48
- session_id: getSessionId()
49
- });
50
- },
51
- assistanceRequested: function assistanceRequested(method, project_id) {
52
- _posthogJs["default"].capture('assistance_requested', {
53
- method: method,
54
- project_id: project_id,
55
- client_name: sessionStorage.getItem('visualizerName'),
56
- session_id: getSessionId()
57
- });
58
- },
59
- addToCart: function addToCart(project_id, sku_count, price_total) {
60
- _posthogJs["default"].capture('add_to_cart', {
61
- project_id: project_id,
62
- sku_count: sku_count,
63
- price_total: price_total,
64
- client_name: sessionStorage.getItem('visualizerName'),
65
- session_id: getSessionId()
66
- });
67
- }
68
- };