kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50
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/@history.js +2 -0
- package/es/AppContext.js +3 -0
- package/es/KitchenConfigurator.js +645 -0
- package/es/KitchenConfiguratorApp.js +480 -0
- package/es/actions/area-actions.js +14 -0
- package/es/actions/export.js +23 -0
- package/es/actions/groups-actions.js +89 -0
- package/es/actions/holes-actions.js +119 -0
- package/es/actions/items-actions.js +313 -0
- package/es/actions/lines-actions.js +81 -0
- package/es/actions/project-actions.js +281 -0
- package/es/actions/scene-actions.js +33 -0
- package/es/actions/vertices-actions.js +27 -0
- package/es/actions/viewer2d-actions.js +58 -0
- package/es/actions/viewer3d-actions.js +23 -0
- package/es/catalog/areas/area/planner-element.js +40 -0
- package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/es/catalog/areas/area/textures/grass.jpg +0 -0
- package/es/catalog/areas/area/textures/parquet.jpg +0 -0
- package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/es/catalog/areas/area/textures/tile1.jpg +0 -0
- package/es/catalog/catalog.js +277 -0
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/factories/area-factory-3d.js +181 -0
- package/es/catalog/factories/area-factory.js +81 -0
- package/es/catalog/factories/export.js +7 -0
- package/es/catalog/factories/wall-factory-3d.js +202 -0
- package/es/catalog/factories/wall-factory.js +268 -0
- package/es/catalog/holes/door-closet/planner-element.js +222 -0
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +315 -0
- package/es/catalog/holes/door-exterior/planner-element.js +215 -0
- package/es/catalog/holes/door-interior/planner-element.js +227 -0
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +503 -0
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
- package/es/catalog/holes/door-sliding/planner-element.js +225 -0
- package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
- package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
- package/es/catalog/holes/export.js +13 -0
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +166 -0
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +165 -0
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +276 -0
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +70 -0
- package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/morden.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/es/catalog/lines/wall/wall.png +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +116 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +97 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +101 -0
- package/es/catalog/properties/property-length-measure.js +134 -0
- package/es/catalog/properties/property-length-measure_hole.js +101 -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/FuseUtils.js +82 -0
- package/es/catalog/utils/exporter.js +148 -0
- package/es/catalog/utils/geom-utils.js +189 -0
- package/es/catalog/utils/item-loader.js +1521 -0
- package/es/catalog/utils/load-obj.js +91 -0
- package/es/catalog/utils/mtl-loader.js +358 -0
- package/es/catalog/utils/obj-loader.js +477 -0
- package/es/class/FuseUtils.js +82 -0
- package/es/class/area.js +145 -0
- package/es/class/export.js +24 -0
- package/es/class/group.js +440 -0
- package/es/class/guide.js +62 -0
- package/es/class/hole.js +929 -0
- package/es/class/item.js +1883 -0
- package/es/class/layer.js +667 -0
- package/es/class/line.js +1180 -0
- package/es/class/project.js +793 -0
- package/es/class/vertex.js +202 -0
- package/es/components/content.js +107 -0
- package/es/components/disclaimer/disclaimer.js +97 -0
- package/es/components/export.js +9 -0
- package/es/components/style/button.js +113 -0
- package/es/components/style/cancel-button.js +22 -0
- package/es/components/style/content-container.js +33 -0
- package/es/components/style/content-title.js +29 -0
- package/es/components/style/delete-button.js +25 -0
- package/es/components/style/export.js +31 -0
- package/es/components/style/form-block.js +24 -0
- package/es/components/style/form-color-input.js +27 -0
- package/es/components/style/form-label.js +26 -0
- package/es/components/style/form-number-input.js +213 -0
- package/es/components/style/form-number-input_2.js +206 -0
- package/es/components/style/form-select.js +68 -0
- package/es/components/style/form-slider.js +61 -0
- package/es/components/style/form-submit-button.js +26 -0
- package/es/components/style/form-text-input.js +95 -0
- package/es/components/viewer2d/area.js +81 -0
- package/es/components/viewer2d/export.js +31 -0
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-streak.js +37 -0
- package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
- package/es/components/viewer2d/grids/grids.js +35 -0
- package/es/components/viewer2d/group.js +53 -0
- package/es/components/viewer2d/item.js +513 -0
- package/es/components/viewer2d/layer.js +164 -0
- package/es/components/viewer2d/line.js +882 -0
- package/es/components/viewer2d/ruler.js +100 -0
- package/es/components/viewer2d/rulerDist.js +146 -0
- package/es/components/viewer2d/rulerX.js +151 -0
- package/es/components/viewer2d/rulerY.js +153 -0
- package/es/components/viewer2d/scene.js +140 -0
- package/es/components/viewer2d/snap.js +74 -0
- package/es/components/viewer2d/state.js +78 -0
- package/es/components/viewer2d/utils.js +198 -0
- package/es/components/viewer2d/vertex.js +65 -0
- package/es/components/viewer2d/viewer2d.js +1398 -0
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
- package/es/components/viewer3d/dcm.js +401 -0
- package/es/components/viewer3d/fbm.js +414 -0
- package/es/components/viewer3d/front3D.js +66 -0
- package/es/components/viewer3d/grid-creator.js +25 -0
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
- package/es/components/viewer3d/grids/grid-streak.js +27 -0
- package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
- package/es/components/viewer3d/libs/first-person-controls.js +67 -0
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
- package/es/components/viewer3d/libs/mtl-loader.js +357 -0
- package/es/components/viewer3d/libs/obj-loader.js +462 -0
- package/es/components/viewer3d/libs/orbit-controls.js +699 -0
- package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
- package/es/components/viewer3d/lrm.js +305 -0
- package/es/components/viewer3d/model.js +708 -0
- package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
- package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
- package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
- package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
- package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
- package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
- package/es/components/viewer3d/scene-creator.js +3608 -0
- package/es/components/viewer3d/three-memory-cleaner.js +51 -0
- package/es/components/viewer3d/viewer3d-first-person.js +315 -0
- package/es/components/viewer3d/viewer3d.js +2527 -0
- package/es/constants.js +636 -0
- package/es/index.js +16 -0
- package/es/models.js +510 -0
- package/es/plugins/SVGLoader.js +1412 -0
- package/es/plugins/autosave.js +33 -0
- package/es/plugins/console-debugger.js +37 -0
- package/es/plugins/export.js +9 -0
- package/es/plugins/keyboard.js +101 -0
- package/es/reducers/areas-reducer.js +12 -0
- package/es/reducers/export.js +25 -0
- package/es/reducers/groups-reducer.js +38 -0
- package/es/reducers/holes-reducer.js +62 -0
- package/es/reducers/items-reducer.js +140 -0
- package/es/reducers/lines-reducer.js +45 -0
- package/es/reducers/project-reducer.js +129 -0
- package/es/reducers/reducer.js +19 -0
- package/es/reducers/scene-reducer.js +28 -0
- package/es/reducers/user-reducer.js +40 -0
- package/es/reducers/vertices-reducer.js +19 -0
- package/es/reducers/viewer2d-reducer.js +75 -0
- package/es/reducers/viewer3d-reducer.js +56 -0
- package/es/shared-style.js +66 -0
- package/es/styles/export.js +5 -0
- package/es/styles/tabs.css +40 -0
- package/es/translator/en.js +104 -0
- package/es/translator/it.js +79 -0
- package/es/translator/ru.js +79 -0
- package/es/translator/translator.js +84 -0
- package/es/utils/browser.js +33 -0
- package/es/utils/email-validator.js +4 -0
- package/es/utils/export.js +25 -0
- package/es/utils/geometry.js +2420 -0
- package/es/utils/get-edges-of-subgraphs.js +27 -0
- package/es/utils/graph-cycles.js +237 -0
- package/es/utils/graph-inner-cycles.js +46 -0
- package/es/utils/graph.js +150 -0
- package/es/utils/helper.js +268 -0
- package/es/utils/history.js +29 -0
- package/es/utils/id-broker.js +19 -0
- package/es/utils/logger.js +8 -0
- package/es/utils/math.js +50 -0
- package/es/utils/molding.js +871 -0
- package/es/utils/name-generator.js +18 -0
- package/es/utils/objects-utils.js +50 -0
- package/es/utils/phone-validator.js +4 -0
- package/es/utils/process-black-list.js +18 -0
- package/es/utils/react-if.js +18 -0
- package/es/utils/snap-scene.js +99 -0
- package/es/utils/snap.js +237 -0
- package/es/utils/summarizeCart.js +24 -0
- package/es/utils/threeCSG.es6.js +498 -0
- package/es/version.js +2 -0
- package/lib/catalog/properties/property-string.js +55 -0
- package/lib/catalog/properties/property-toggle.js +46 -0
- package/lib/catalog/properties/shared-property-style.js +20 -0
- package/lib/catalog/utils/FuseUtils.js +88 -0
- package/lib/catalog/utils/exporter.js +155 -0
- package/lib/catalog/utils/geom-utils.js +205 -0
- package/lib/catalog/utils/item-loader.js +1533 -0
- package/lib/catalog/utils/load-obj.js +99 -0
- package/lib/catalog/utils/mtl-loader.js +363 -0
- package/lib/catalog/utils/obj-loader.js +482 -0
- package/lib/class/FuseUtils.js +88 -0
- package/lib/class/area.js +150 -0
- package/lib/class/export.js +96 -0
- package/lib/class/group.js +445 -0
- package/lib/class/guide.js +67 -0
- package/lib/class/hole.js +934 -0
- package/lib/class/item.js +1889 -0
- package/lib/class/layer.js +672 -0
- package/lib/class/line.js +1186 -0
- package/lib/class/project.js +799 -0
- package/lib/class/vertex.js +207 -0
- package/lib/components/content.js +116 -0
- package/lib/components/disclaimer/disclaimer.js +105 -0
- package/lib/components/export.js +33 -0
- package/lib/components/style/button.js +120 -0
- package/lib/components/style/cancel-button.js +29 -0
- package/lib/components/style/content-container.js +40 -0
- package/lib/components/style/content-title.js +37 -0
- package/lib/components/style/delete-button.js +34 -0
- package/lib/components/style/export.js +121 -0
- package/lib/components/style/form-block.js +31 -0
- package/lib/components/style/form-color-input.js +34 -0
- package/lib/components/style/form-label.js +33 -0
- package/lib/components/style/form-number-input.js +220 -0
- package/lib/components/style/form-number-input_2.js +213 -0
- package/lib/components/style/form-select.js +75 -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 +101 -0
- package/lib/components/viewer2d/area.js +88 -0
- package/lib/components/viewer2d/export.js +121 -0
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-streak.js +44 -0
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer2d/grids/grids.js +44 -0
- package/lib/components/viewer2d/group.js +62 -0
- package/lib/components/viewer2d/item.js +521 -0
- package/lib/components/viewer2d/layer.js +171 -0
- package/lib/components/viewer2d/line.js +892 -0
- package/lib/components/viewer2d/ruler.js +107 -0
- package/lib/components/viewer2d/rulerDist.js +153 -0
- package/lib/components/viewer2d/rulerX.js +158 -0
- package/lib/components/viewer2d/rulerY.js +160 -0
- package/lib/components/viewer2d/scene.js +147 -0
- package/lib/components/viewer2d/snap.js +83 -0
- package/lib/components/viewer2d/state.js +87 -0
- package/lib/components/viewer2d/utils.js +210 -0
- package/lib/components/viewer2d/vertex.js +74 -0
- package/lib/components/viewer2d/viewer2d.js +1405 -0
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
- package/lib/components/viewer3d/dcm.js +407 -0
- package/lib/components/viewer3d/fbm.js +420 -0
- package/lib/components/viewer3d/front3D.js +75 -0
- package/lib/components/viewer3d/grid-creator.js +34 -0
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
- package/lib/components/viewer3d/grids/grid-streak.js +35 -0
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
- package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
- package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
- package/lib/components/viewer3d/libs/obj-loader.js +468 -0
- package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
- package/lib/components/viewer3d/lrm.js +311 -0
- package/lib/components/viewer3d/model.js +714 -0
- package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
- package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
- package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
- package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
- package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
- package/lib/components/viewer3d/scene-creator.js +3642 -0
- package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
- package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
- package/lib/components/viewer3d/viewer3d.js +2532 -0
- package/lib/constants.js +645 -0
- package/lib/index.js +96 -0
- package/lib/models.js +517 -0
- package/lib/plugins/SVGLoader.js +1417 -0
- package/lib/plugins/autosave.js +39 -0
- package/lib/plugins/console-debugger.js +44 -0
- package/lib/plugins/export.js +33 -0
- package/lib/plugins/keyboard.js +107 -0
- package/lib/reducers/areas-reducer.js +18 -0
- package/lib/reducers/export.js +97 -0
- package/lib/reducers/groups-reducer.js +44 -0
- package/lib/reducers/holes-reducer.js +68 -0
- package/lib/reducers/items-reducer.js +146 -0
- package/lib/reducers/lines-reducer.js +51 -0
- package/lib/reducers/project-reducer.js +135 -0
- package/lib/reducers/reducer.js +26 -0
- package/lib/reducers/scene-reducer.js +34 -0
- package/lib/reducers/user-reducer.js +46 -0
- package/lib/reducers/vertices-reducer.js +25 -0
- package/lib/reducers/viewer2d-reducer.js +82 -0
- package/lib/reducers/viewer3d-reducer.js +63 -0
- package/lib/shared-style.js +72 -0
- package/lib/styles/export.js +13 -0
- package/lib/translator/en.js +110 -0
- package/lib/translator/it.js +85 -0
- package/lib/translator/ru.js +85 -0
- package/lib/translator/translator.js +90 -0
- package/lib/utils/browser.js +40 -0
- package/lib/utils/email-validator.js +10 -0
- package/lib/utils/export.js +56 -0
- package/lib/utils/geometry.js +2516 -0
- package/lib/utils/get-edges-of-subgraphs.js +34 -0
- package/lib/utils/graph-cycles.js +240 -0
- package/lib/utils/graph-inner-cycles.js +54 -0
- package/lib/utils/graph.js +157 -0
- package/lib/utils/helper.js +291 -0
- package/lib/utils/history.js +36 -0
- package/lib/utils/id-broker.js +25 -0
- package/lib/utils/logger.js +14 -0
- package/lib/utils/math.js +57 -0
- package/lib/utils/molding.js +895 -0
- package/lib/utils/name-generator.js +23 -0
- package/lib/utils/objects-utils.js +60 -0
- package/lib/utils/phone-validator.js +10 -0
- package/lib/utils/process-black-list.js +24 -0
- package/lib/utils/react-if.js +24 -0
- package/lib/utils/snap-scene.js +105 -0
- package/lib/utils/snap.js +249 -0
- package/lib/utils/summarizeCart.js +30 -0
- package/lib/utils/threeCSG.es6.js +503 -0
- package/lib/version.js +8 -0
- package/package.json +3 -3
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
7
|
+
import { HDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureLoader.js';
|
|
8
|
+
import { ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT, ANIMATE_STEP_MAX, DECIMAL_PLACES_2, HDR_URLS, MODE_ELEVATION_VIEW } from "../constants";
|
|
9
|
+
import * as Three from 'three';
|
|
10
|
+
import { returnReplaceableDeepSearchType } from "./../components/viewer2d/utils";
|
|
11
|
+
import convert from 'convert-units';
|
|
12
|
+
import { formatNumber } from "./math";
|
|
13
|
+
export var textureCube = new HDRCubeTextureLoader().setPath('/catalog/envMap/').load(HDR_URLS, function () {
|
|
14
|
+
textureCube.magFilter = Three.LinearFilter;
|
|
15
|
+
textureCube.needsUpdate = true;
|
|
16
|
+
});
|
|
17
|
+
export var base64Decode = function base64Decode(targetStr) {
|
|
18
|
+
if (!targetStr) return null;
|
|
19
|
+
try {
|
|
20
|
+
// If URL-encoded, decode first
|
|
21
|
+
var base64Str = targetStr.includes('%') ? decodeURIComponent(targetStr) : targetStr;
|
|
22
|
+
var binaryStr = atob(base64Str);
|
|
23
|
+
// Convert binary string to UTF-8 string
|
|
24
|
+
return decodeURIComponent(binaryStr.split('').map(function (_char) {
|
|
25
|
+
return "%".concat(_char.charCodeAt(0).toString(16).padStart(2, '0'));
|
|
26
|
+
}).join(''));
|
|
27
|
+
} catch (e) {
|
|
28
|
+
console.log('Invalid Base64 or UTF-8 string: ', e);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export var refineProductForSummaryPdf = function refineProductForSummaryPdf(refinedProductList, catalog, categoryData, itemSKU, suffix, item, product, measurementUnit, count) {
|
|
33
|
+
var _doorColor;
|
|
34
|
+
var review;
|
|
35
|
+
var doorColor = item.doorStyle;
|
|
36
|
+
if (doorColor.size) {
|
|
37
|
+
doorColor = doorColor.toJS();
|
|
38
|
+
}
|
|
39
|
+
var doorStyleName = (_doorColor = doorColor) === null || _doorColor === void 0 ? void 0 : _doorColor.name;
|
|
40
|
+
if (catalog !== undefined) {
|
|
41
|
+
var _doorColor2, _doorColor4;
|
|
42
|
+
if (!((_doorColor2 = doorColor) !== null && _doorColor2 !== void 0 && _doorColor2.install)) {
|
|
43
|
+
categoryData.data.doorStyles.items.forEach(function (category) {
|
|
44
|
+
category.items.forEach(function (element) {
|
|
45
|
+
if (element.items.filter(function (it) {
|
|
46
|
+
var _doorColor3;
|
|
47
|
+
return it.id === ((_doorColor3 = doorColor) === null || _doorColor3 === void 0 ? void 0 : _doorColor3.id);
|
|
48
|
+
})) {
|
|
49
|
+
doorColor = _objectSpread(_objectSpread({}, doorColor), {}, {
|
|
50
|
+
install: category.name
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
review = catalog.elements[item.type];
|
|
57
|
+
if (!review) {
|
|
58
|
+
review = catalog.elements[returnReplaceableDeepSearchType(item.type)];
|
|
59
|
+
}
|
|
60
|
+
if (((_doorColor4 = doorColor) === null || _doorColor4 === void 0 || (_doorColor4 = _doorColor4.install) === null || _doorColor4 === void 0 ? void 0 : _doorColor4.toLowerCase()) === 'pre-assembled') {
|
|
61
|
+
itemSKU += '-assembled';
|
|
62
|
+
} else {
|
|
63
|
+
itemSKU += '-rta';
|
|
64
|
+
}
|
|
65
|
+
var refinedData = {
|
|
66
|
+
thumbnail: review.img,
|
|
67
|
+
sku: itemSKU,
|
|
68
|
+
sizeInfo: {
|
|
69
|
+
width: Math.round(convert(review.info.sizeinfo.width).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
70
|
+
depth: Math.round(convert(review.info.sizeinfo.depth).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
71
|
+
height: Math.round(convert(review.info.sizeinfo.height).from('in').to(measurementUnit._unit) * 100) / 100,
|
|
72
|
+
_unit: measurementUnit._unit
|
|
73
|
+
},
|
|
74
|
+
doorstyle: doorStyleName,
|
|
75
|
+
installation: suffix,
|
|
76
|
+
subTotal: product && product.discounted_price ? product && Number(product.discounted_price * (count || 1)) : 0
|
|
77
|
+
};
|
|
78
|
+
var index = (refinedProductList || []).findIndex(function (row) {
|
|
79
|
+
return row.sku === itemSKU;
|
|
80
|
+
});
|
|
81
|
+
if (index !== -1) {
|
|
82
|
+
refinedProductList[index] = refinedData;
|
|
83
|
+
} else {
|
|
84
|
+
refinedProductList.push(refinedData);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export var refineMoldingForSummaryPdf = function refineMoldingForSummaryPdf(refinedProductList, molding, product, newSKU) {
|
|
89
|
+
if (molding) {
|
|
90
|
+
var review = {
|
|
91
|
+
img: molding.thumbnail,
|
|
92
|
+
name: molding.name,
|
|
93
|
+
count: molding.count
|
|
94
|
+
};
|
|
95
|
+
var subTotalPrice = product && product.discounted_price ? formatNumber(product.discounted_price * review.count, DECIMAL_PLACES_2) : 0;
|
|
96
|
+
var refinedData = {
|
|
97
|
+
id: newSKU,
|
|
98
|
+
thumbnail: review.img,
|
|
99
|
+
sku: review.name,
|
|
100
|
+
sizeInfo: null,
|
|
101
|
+
subTotal: Number(subTotalPrice)
|
|
102
|
+
};
|
|
103
|
+
var index = (refinedProductList || []).findIndex(function (row) {
|
|
104
|
+
return row.sku === newSKU;
|
|
105
|
+
});
|
|
106
|
+
if (index !== -1) {
|
|
107
|
+
refinedProductList[index] = refinedData;
|
|
108
|
+
} else {
|
|
109
|
+
refinedProductList.push(refinedData);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
export function applyEdges(object) {
|
|
114
|
+
if (object && object.isMesh && !(object instanceof Three.LineSegments)) {
|
|
115
|
+
var parent = object.parent;
|
|
116
|
+
if (!isEmpty(parent)) {
|
|
117
|
+
if (object.name.match('interior_drawer') || object.name.match('interior') || object.name.match('soul')) {
|
|
118
|
+
parent.remove(object);
|
|
119
|
+
} else {
|
|
120
|
+
// Create a replacement
|
|
121
|
+
var edges = new Three.EdgesGeometry(object.geometry, 10);
|
|
122
|
+
var lineMaterial = new Three.LineBasicMaterial({
|
|
123
|
+
color: 0x000000,
|
|
124
|
+
depthTest: true,
|
|
125
|
+
depthFunc: Three.LessEqualDepth,
|
|
126
|
+
depthWrite: false
|
|
127
|
+
});
|
|
128
|
+
var line = new Three.LineSegments(edges, lineMaterial);
|
|
129
|
+
line.position.copy(object.position);
|
|
130
|
+
line.scale.copy(object.scale);
|
|
131
|
+
line.rotation.copy(object.rotation);
|
|
132
|
+
line.name = object.name;
|
|
133
|
+
|
|
134
|
+
// Replace in parent
|
|
135
|
+
parent.remove(object);
|
|
136
|
+
parent.add(line);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export function replaceMeshesWithLineSegments(object) {
|
|
142
|
+
if (object && object.children.length > 0) {
|
|
143
|
+
for (var i = object.children.length - 1; i >= 0; i--) {
|
|
144
|
+
var child = object.children[i];
|
|
145
|
+
// Recursively process children first
|
|
146
|
+
replaceMeshesWithLineSegments(child);
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
//
|
|
150
|
+
// Check if the child is a THREE.Mesh
|
|
151
|
+
applyEdges(object);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export var isEmpty = function isEmpty(value) {
|
|
155
|
+
return value === undefined || value === null || typeof value === 'array' && value.length === 0 || _typeof(value) === 'object' && Object.keys(value).length === 0 || typeof value === 'string' && value.trim().length === 0;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// animate the Opening or Closing Door action
|
|
159
|
+
export var animateDoor = function animateDoor(offsetData, doorObj, open_doors, item, isCorner, mode) {
|
|
160
|
+
var offset = new Three.Vector3(offsetData.x, offsetData.y, offsetData === null || offsetData === void 0 ? void 0 : offsetData.z);
|
|
161
|
+
doorObj.translateOnAxis(offset, 1);
|
|
162
|
+
var rotation = doorObj.name.match(/\d_(door[^LR1-9]*)(_[LR])?(_[1-9])?$/)[2] === '_L' ? -ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT : ANIMATE_OBJECT_OPEN_DOOR_ROTATION_UNIT;
|
|
163
|
+
var isflip = item.properties.flip_doorhandle;
|
|
164
|
+
rotation = isflip ? -rotation : rotation;
|
|
165
|
+
if (isCorner == 1) {
|
|
166
|
+
if (!doorObj.name.includes('base_end')) {
|
|
167
|
+
rotation *= 2;
|
|
168
|
+
}
|
|
169
|
+
var tmp = doorObj.children[0].children.filter(function (item) {
|
|
170
|
+
return item.children.length != 0;
|
|
171
|
+
});
|
|
172
|
+
if (tmp.length != 0) {
|
|
173
|
+
rotation = open_doors ? -rotation : rotation;
|
|
174
|
+
} else {
|
|
175
|
+
rotation = open_doors ? rotation : -rotation;
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
rotation = open_doors ? rotation : -rotation;
|
|
179
|
+
}
|
|
180
|
+
if (mode === 'Opened2D') rotation *= ANIMATE_STEP_MAX; // Check whether the object's door is opened in 2D.
|
|
181
|
+
doorObj.rotateY(rotation);
|
|
182
|
+
doorObj.translateOnAxis(offset, -1);
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// Opening or Closing the drawer action
|
|
186
|
+
export var translateDrawer = function translateDrawer(item, drawerObj, open_doors, mode) {
|
|
187
|
+
var animate_translate_unit = convert(item.properties.depth._length).from(item.properties.depth._unit).to('cm') * (1 / 2) / ANIMATE_STEP_MAX * 0.01;
|
|
188
|
+
// Check whether the object's drawer is opened in 2D.
|
|
189
|
+
if (mode === 'Opened2D') animate_translate_unit *= ANIMATE_STEP_MAX;
|
|
190
|
+
drawerObj.translateZ(open_doors ? -animate_translate_unit : animate_translate_unit);
|
|
191
|
+
};
|
|
192
|
+
export var getPath = function getPath() {
|
|
193
|
+
return window.location.pathname;
|
|
194
|
+
};
|
|
195
|
+
export var getPathInfo = function getPathInfo(num) {
|
|
196
|
+
var paths = window.location.pathname.split('/');
|
|
197
|
+
if (paths.length >= num + 1) {
|
|
198
|
+
return paths[num];
|
|
199
|
+
} else {
|
|
200
|
+
return paths[num - 1 >= 0 ? num - 1 : 0];
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// determine if elevation mode or not
|
|
205
|
+
export function isElevationView(mode) {
|
|
206
|
+
if (mode === MODE_ELEVATION_VIEW) return true;else return false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// calculate camera rect in elevation mode
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* @param {number} width width of elevation view - canvas
|
|
213
|
+
* @param {number} height height of elevation view - canvas
|
|
214
|
+
* @param {number} ceilHeight ceiling Height
|
|
215
|
+
* @param {number} lineLength wall's length
|
|
216
|
+
* @returns {object}
|
|
217
|
+
*/
|
|
218
|
+
|
|
219
|
+
//** elevation view (canvas) **//
|
|
220
|
+
|
|
221
|
+
//// h /////////////////////// width //////////////////////// h ////
|
|
222
|
+
//// e //// **c***************lineLength*************c** //// e ////
|
|
223
|
+
//// i //// **e e** //// i ////
|
|
224
|
+
//// g //// **i i** //// g ////
|
|
225
|
+
//// h //// **l***************lineLength*************l** //// h ////
|
|
226
|
+
//// t /////////////////////// width //////////////////////// t ////
|
|
227
|
+
export function handleCamRect(width, height, ceilHeight, lineLength) {
|
|
228
|
+
var scale = Math.min(width * 0.6 / lineLength, height * 0.6 / ceilHeight); // scale is min value
|
|
229
|
+
var cameraRect = {
|
|
230
|
+
width: width / scale,
|
|
231
|
+
height: height / scale
|
|
232
|
+
};
|
|
233
|
+
return cameraRect;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
*
|
|
238
|
+
* @param {*} layer
|
|
239
|
+
* @param {*} ceilHeight
|
|
240
|
+
* @param {*} ceilUnit
|
|
241
|
+
* @returns true ceilingHeight is bigger than totalHeight(item's height + altitude), otherwise false
|
|
242
|
+
*/
|
|
243
|
+
export function isCeilLimitation(layer, ceilHeight, ceilUnit) {
|
|
244
|
+
var items = layer.getIn(['layers', layer.selectedLayer, 'items']);
|
|
245
|
+
return items.some(function (item) {
|
|
246
|
+
var height = item.properties.getIn(['height', '_length']);
|
|
247
|
+
var heightUnit = item.properties.getIn(['height', '_unit']);
|
|
248
|
+
var altitude = item.properties.getIn(['altitude', '_length']);
|
|
249
|
+
var altitudeUnit = item.properties.getIn(['altitude', '_unit']);
|
|
250
|
+
var totalHeight = convert(height).from(heightUnit).to(ceilUnit._unit) + convert(altitude).from(altitudeUnit).to(ceilUnit._unit);
|
|
251
|
+
return totalHeight > ceilHeight;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
export function isValidNumber(n) {
|
|
255
|
+
return !isNaN(n) && isFinite(n);
|
|
256
|
+
}
|
|
257
|
+
export function toPlainObject(maybeImmutable) {
|
|
258
|
+
if (maybeImmutable && typeof maybeImmutable.toJS === 'function') {
|
|
259
|
+
return maybeImmutable.toJS();
|
|
260
|
+
}
|
|
261
|
+
return maybeImmutable; // already a plain JS object
|
|
262
|
+
}
|
|
263
|
+
export function isImmutable(maybeImmutable) {
|
|
264
|
+
return !!(maybeImmutable && typeof maybeImmutable.toJS === 'function');
|
|
265
|
+
}
|
|
266
|
+
export function debugUtil() {
|
|
267
|
+
return new Date();
|
|
268
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Map } from 'immutable';
|
|
2
|
+
import diff from 'immutablediff';
|
|
3
|
+
import patch from 'immutablepatch';
|
|
4
|
+
export var historyPush = function historyPush(historyStructure, item) {
|
|
5
|
+
if (historyStructure.last) {
|
|
6
|
+
if (historyStructure.last.hashCode() !== item.hashCode()) {
|
|
7
|
+
var toPush = new Map({
|
|
8
|
+
time: Date.now(),
|
|
9
|
+
diff: diff(historyStructure.last, item)
|
|
10
|
+
});
|
|
11
|
+
historyStructure = historyStructure.set('last', item).set('list', historyStructure.list.push(toPush));
|
|
12
|
+
}
|
|
13
|
+
} else {
|
|
14
|
+
historyStructure = historyStructure.set('last', item);
|
|
15
|
+
}
|
|
16
|
+
return historyStructure;
|
|
17
|
+
};
|
|
18
|
+
export var historyPop = function historyPop(historyStructure) {
|
|
19
|
+
if (historyStructure.last) {
|
|
20
|
+
if (historyStructure.list.size) {
|
|
21
|
+
var last = historyStructure.first;
|
|
22
|
+
for (var x = 0; x < historyStructure.list.size - 1; x++) {
|
|
23
|
+
last = patch(last, historyStructure.list.get(x).get('diff'));
|
|
24
|
+
}
|
|
25
|
+
historyStructure = historyStructure.set('last', last).set('list', historyStructure.list.pop());
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return historyStructure;
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
7
|
+
import { nanoid } from 'nanoid';
|
|
8
|
+
export var IDBroker = /*#__PURE__*/function () {
|
|
9
|
+
function IDBroker() {
|
|
10
|
+
_classCallCheck(this, IDBroker);
|
|
11
|
+
}
|
|
12
|
+
return _createClass(IDBroker, null, [{
|
|
13
|
+
key: "acquireID",
|
|
14
|
+
value: function acquireID() {
|
|
15
|
+
return nanoid();
|
|
16
|
+
}
|
|
17
|
+
}]);
|
|
18
|
+
}();
|
|
19
|
+
export default IDBroker;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function LogLine(state, layerID, lineID) {
|
|
2
|
+
var layer = state.getIn(['scene', 'layers', layerID]);
|
|
3
|
+
var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
|
|
4
|
+
var vertex0 = layer.vertices.get(line.vertices.get(0));
|
|
5
|
+
var vertex1 = layer.vertices.get(line.vertices.get(1));
|
|
6
|
+
console.log('updateDrawingLine: vertex0', vertex0.x, vertex0.y);
|
|
7
|
+
console.log('updateDrawingLine: vertex1', vertex1.x, vertex1.y);
|
|
8
|
+
}
|
package/es/utils/math.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @description Return float fixed to desired precision
|
|
2
|
+
* @param {number} num Float to fix
|
|
3
|
+
* @param {number} precision Desired precision, or 6 if not specified
|
|
4
|
+
* @return {number}
|
|
5
|
+
*/
|
|
6
|
+
export function toFixedFloat(num) {
|
|
7
|
+
var precision = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
|
|
8
|
+
if (num && precision) {
|
|
9
|
+
return parseFloat(parseFloat(num).toFixed(precision));
|
|
10
|
+
}
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** @description Return absolute value of a number
|
|
15
|
+
* @param {number} n Number of wich get value without sign
|
|
16
|
+
* @return {number}
|
|
17
|
+
*/
|
|
18
|
+
export var fAbs = function fAbs(n) {
|
|
19
|
+
return Math.abs(n);
|
|
20
|
+
// let x = n;
|
|
21
|
+
// x < 0 && (x = ~x + 1);
|
|
22
|
+
// return x;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @description Multiply two matrices
|
|
26
|
+
* @param {Array} m1 Matrix 1
|
|
27
|
+
* @param {Array} m2 Matrix 2
|
|
28
|
+
* @return {Array}
|
|
29
|
+
*/
|
|
30
|
+
export var multiplyMatrices = function multiplyMatrices(m1, m2) {
|
|
31
|
+
var result = [];
|
|
32
|
+
for (var i = 0; i < m1.length; i++) {
|
|
33
|
+
result[i] = [];
|
|
34
|
+
for (var j = 0; j < m2[0].length; j++) {
|
|
35
|
+
var sum = 0;
|
|
36
|
+
for (var k = 0; k < m1[0].length; k++) {
|
|
37
|
+
sum += m1[i][k] * m2[k][j];
|
|
38
|
+
}
|
|
39
|
+
result[i][j] = sum;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
export var formatNumber = function formatNumber(value, digits) {
|
|
45
|
+
if (value == null || isNaN(Number(value))) return value; // guard for null/undefined/non-numeric
|
|
46
|
+
return Number(value).toFixed(digits);
|
|
47
|
+
};
|
|
48
|
+
export var isNonZeroText = function isNonZeroText(text) {
|
|
49
|
+
return parseFloat(text) !== 0;
|
|
50
|
+
};
|