kitchen-simulator 4.1.7-react-18 → 5.0.0-react.18
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 +3 -0
- package/es/AppContext.js +1 -1
- package/es/LiteKitchenConfigurator.js +139 -103
- package/es/LiteRenderer.js +167 -127
- package/es/WorkSpace.js +854 -0
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/img/svg/bottombar/elevation.svg +12 -5
- package/es/catalog/catalog.js +21 -5
- package/es/catalog/factories/area-factory-3d.js +17 -17
- package/es/catalog/holes/window-clear/planner-element.js +2 -2
- package/es/catalog/properties/export.js +21 -0
- package/es/catalog/properties/property-checkbox.js +68 -0
- package/es/catalog/properties/property-color.js +39 -0
- package/es/catalog/properties/property-enum.js +50 -0
- package/es/catalog/properties/property-hidden.js +19 -0
- package/es/catalog/properties/property-lenght-measure.js +96 -0
- package/es/catalog/properties/property-length-measure.js +80 -0
- package/es/catalog/properties/property-length-measure_hole.js +96 -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/exporter.js +24 -11
- package/es/catalog/utils/item-loader.js +222 -213
- package/es/class/hole.js +0 -2
- package/es/class/item.js +89 -70
- package/es/class/layer.js +1 -1
- package/es/class/line.js +4 -8
- package/es/class/project.js +95 -80
- package/es/components/content.js +5 -92
- package/es/components/export.js +1 -1
- package/es/components/style/button.js +106 -0
- package/es/components/style/cancel-button.js +21 -0
- package/es/components/style/content-container.js +30 -0
- package/es/components/style/content-title.js +25 -0
- package/es/components/style/delete-button.js +24 -0
- package/es/components/style/export.js +28 -2
- package/es/components/style/form-block.js +20 -0
- package/es/components/style/form-color-input.js +26 -0
- package/es/components/style/form-label.js +22 -0
- package/es/components/style/form-number-input.js +52 -43
- package/es/components/style/form-number-input_2.js +238 -0
- package/es/components/style/form-select.js +19 -0
- package/es/components/style/form-slider.js +60 -0
- package/es/components/style/form-submit-button.js +25 -0
- package/es/components/style/form-text-input.js +69 -0
- package/es/components/viewer2d/grids/grid-streak.js +1 -1
- package/es/components/viewer2d/group.js +6 -10
- package/es/components/viewer2d/item.js +75 -272
- package/es/components/viewer2d/layer.js +1 -1
- package/es/components/viewer2d/line.js +19 -19
- package/es/components/viewer2d/ruler.js +5 -3
- package/es/components/viewer2d/rulerDist.js +8 -7
- package/es/components/viewer2d/rulerX.js +1 -2
- package/es/components/viewer2d/scene.js +44 -59
- package/es/components/viewer2d/utils.js +2 -2
- package/es/components/viewer2d/vertex.js +3 -2
- package/es/components/viewer2d/viewer2d.js +105 -131
- package/es/components/viewer3d/front3D.js +13 -1
- package/es/components/viewer3d/ruler-utils/scene3D.js +1 -1
- package/es/components/viewer3d/scene-creator.js +77 -39
- package/es/components/viewer3d/viewer3d-first-person.js +115 -119
- package/es/components/viewer3d/viewer3d.js +89 -127
- package/es/constants.js +7 -2
- package/es/index.html.ejs +264 -0
- package/es/index.js +589 -62
- package/es/models.js +13 -8
- package/es/plugins/SVGLoader.js +1414 -0
- package/es/plugins/console-debugger.js +34 -0
- package/es/plugins/export.js +7 -0
- package/es/plugins/keyboard.js +110 -0
- package/es/reducers/project-reducer.js +3 -0
- package/es/reducers/viewer2d-reducer.js +3 -1
- package/es/reducers/viewer3d-reducer.js +3 -1
- package/es/utils/geometry.js +77 -119
- package/es/utils/helper.js +38 -1
- package/es/utils/isolate-event-handler.js +831 -611
- package/es/utils/molding.js +457 -11
- package/package.json +7 -11
- package/es/analytics/ga4.js +0 -188
- package/es/analytics/posthog.js +0 -60
- package/es/devLiteRenderer.js +0 -542
- package/es/mocks/appliancePayload.json +0 -27
- package/es/mocks/cabinetPayload.json +0 -1914
- package/es/mocks/cabinetPayload2.json +0 -76
- package/es/mocks/dataBundle2.json +0 -4
- package/es/mocks/distancePayload.json +0 -6
- package/es/mocks/doorStylePayload2.json +0 -84
- package/es/mocks/furnishingPayload.json +0 -23
- package/es/mocks/itemCDSPayload.json +0 -27
- package/es/mocks/lightingPayload.json +0 -23
- package/es/mocks/mockProps.json +0 -43
- package/es/mocks/mockProps2.json +0 -9
- package/es/mocks/moldingPayload.json +0 -19
- package/es/mocks/projectItemsCatalog.json +0 -133
- package/es/mocks/rectangleShape.json +0 -238
- package/es/mocks/replaceCabinetPayload.json +0 -81
- package/es/mocks/roomShapePayload.json +0 -5
- package/es/useAppContext.js +0 -8
- package/lib/@history.js +0 -11
- package/lib/AppContext.js +0 -11
- package/lib/LiteKitchenConfigurator.js +0 -468
- package/lib/LiteRenderer.js +0 -330
- package/lib/actions/area-actions.js +0 -21
- package/lib/actions/export.js +0 -40
- package/lib/actions/groups-actions.js +0 -107
- package/lib/actions/holes-actions.js +0 -140
- package/lib/actions/items-actions.js +0 -367
- package/lib/actions/lines-actions.js +0 -98
- package/lib/actions/project-actions.js +0 -350
- package/lib/actions/scene-actions.js +0 -43
- package/lib/actions/vertices-actions.js +0 -35
- package/lib/actions/viewer2d-actions.js +0 -73
- package/lib/actions/viewer3d-actions.js +0 -32
- package/lib/analytics/ga4.js +0 -194
- package/lib/analytics/posthog.js +0 -68
- package/lib/assets/brown_photostudio_02_1k.hdr +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
- package/lib/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
- package/lib/assets/fonts/style.css +0 -177
- package/lib/assets/gltf/door_closet.bin +0 -0
- package/lib/assets/gltf/door_closet.fbx +0 -0
- package/lib/assets/gltf/door_closet.gltf +0 -1
- package/lib/assets/gltf/door_exterior.bin +0 -0
- package/lib/assets/gltf/door_exterior.fbx +0 -0
- package/lib/assets/gltf/door_exterior.gltf +0 -1
- package/lib/assets/gltf/door_interior.bin +0 -0
- package/lib/assets/gltf/door_interior.fbx +0 -0
- package/lib/assets/gltf/door_interior.gltf +0 -1
- package/lib/assets/gltf/door_sliding.fbx +0 -0
- package/lib/assets/gltf/door_sliding.gltf +0 -1
- package/lib/assets/gltf/doorway_framed.bin +0 -0
- package/lib/assets/gltf/doorway_framed.fbx +0 -0
- package/lib/assets/gltf/doorway_framed.gltf +0 -1
- package/lib/assets/gltf/window_clear.bin +0 -0
- package/lib/assets/gltf/window_clear.fbx +0 -0
- package/lib/assets/gltf/window_clear.gltf +0 -1
- package/lib/assets/gltf/window_cross.bin +0 -0
- package/lib/assets/gltf/window_cross.fbx +0 -0
- package/lib/assets/gltf/window_cross.gltf +0 -1
- package/lib/assets/gltf/window_double_hung.bin +0 -0
- package/lib/assets/gltf/window_double_hung.fbx +0 -0
- package/lib/assets/gltf/window_double_hung.gltf +0 -1
- package/lib/assets/gltf/window_vertical.bin +0 -0
- package/lib/assets/gltf/window_vertical.fbx +0 -0
- package/lib/assets/gltf/window_vertical.gltf +0 -1
- package/lib/assets/img/TKC_thumbnail.png +0 -0
- package/lib/assets/img/Toggle.png +0 -0
- package/lib/assets/img/loading/loading.gif +0 -0
- package/lib/assets/img/loading/loading_1.svg +0 -11
- package/lib/assets/img/loading_large.gif +0 -0
- package/lib/assets/img/png/door/closet.png +0 -0
- package/lib/assets/img/png/door/doorwaysframed.png +0 -0
- package/lib/assets/img/png/door/doorwaysframeles.png +0 -0
- package/lib/assets/img/png/door/doorwaysframeless.png +0 -0
- package/lib/assets/img/png/door/exterior.png +0 -0
- package/lib/assets/img/png/door/interior.png +0 -0
- package/lib/assets/img/png/door/sliding.png +0 -0
- package/lib/assets/img/png/helper/outcome.png +0 -0
- package/lib/assets/img/png/helper/video_preview_3d.png +0 -0
- package/lib/assets/img/png/helper/video_preview_start.png +0 -0
- package/lib/assets/img/project_img.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_blue_ico.svg +0 -55
- package/lib/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
- package/lib/assets/img/rta/rta_logo_box_lightblue.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_maroon.png +0 -0
- package/lib/assets/img/rta/rta_logo_box_white.png +0 -0
- package/lib/assets/img/rta_menu.png +0 -0
- package/lib/assets/img/step2.jpg +0 -0
- package/lib/assets/img/step3.jpg +0 -0
- package/lib/assets/img/step4.jpg +0 -0
- package/lib/assets/img/step5.jpg +0 -0
- package/lib/assets/img/step6.jpg +0 -0
- package/lib/assets/img/step7.jpg +0 -0
- package/lib/assets/img/step8.jpg +0 -0
- package/lib/assets/img/svg/2d_delete_object.svg +0 -33
- package/lib/assets/img/svg/2d_delete_object1.svg +0 -33
- package/lib/assets/img/svg/2d_lock_object.svg +0 -33
- package/lib/assets/img/svg/3d_item_move.svg +0 -106
- package/lib/assets/img/svg/3d_item_rotation.svg +0 -76
- package/lib/assets/img/svg/3d_item_warning_edit.svg +0 -77
- package/lib/assets/img/svg/3d_item_warning_info.svg +0 -81
- package/lib/assets/img/svg/accessories.svg +0 -4
- package/lib/assets/img/svg/angle_icon.svg +0 -39
- package/lib/assets/img/svg/blank_div.svg +0 -14
- package/lib/assets/img/svg/bottombar/2d3d_button.svg +0 -3
- package/lib/assets/img/svg/bottombar/2d3d_button_active.svg +0 -3
- package/lib/assets/img/svg/bottombar/2d3d_toggle.svg +0 -4
- package/lib/assets/img/svg/bottombar/2d3d_toggle_active.svg +0 -4
- package/lib/assets/img/svg/bottombar/arrow-down.svg +0 -3
- package/lib/assets/img/svg/bottombar/arrow-left.svg +0 -3
- package/lib/assets/img/svg/bottombar/arrow-minus.svg +0 -3
- package/lib/assets/img/svg/bottombar/arrow-plus.svg +0 -11
- package/lib/assets/img/svg/bottombar/arrow-right.svg +0 -3
- package/lib/assets/img/svg/bottombar/arrow-up.svg +0 -3
- package/lib/assets/img/svg/bottombar/collapse.svg +0 -3
- package/lib/assets/img/svg/bottombar/elevation-back.svg +0 -6
- package/lib/assets/img/svg/bottombar/elevation-front.svg +0 -6
- package/lib/assets/img/svg/bottombar/elevation-left.svg +0 -6
- package/lib/assets/img/svg/bottombar/elevation-right.svg +0 -7
- package/lib/assets/img/svg/bottombar/elevation.svg +0 -6
- package/lib/assets/img/svg/bottombar/expand.svg +0 -3
- package/lib/assets/img/svg/bottombar/help.svg +0 -72
- package/lib/assets/img/svg/bottombar/incm_toggle.svg +0 -39
- package/lib/assets/img/svg/bottombar/pan_1.svg +0 -57
- package/lib/assets/img/svg/bottombar/pan_2.svg +0 -27
- package/lib/assets/img/svg/bottombar/pan_3.svg +0 -27
- package/lib/assets/img/svg/bottombar/pan_4.svg +0 -27
- package/lib/assets/img/svg/bottombar/pan_5.svg +0 -27
- package/lib/assets/img/svg/bottombar/settings.svg +0 -23
- package/lib/assets/img/svg/bottombar/spin-down.svg +0 -76
- package/lib/assets/img/svg/bottombar/spin-left.svg +0 -75
- package/lib/assets/img/svg/bottombar/spin-right.svg +0 -75
- package/lib/assets/img/svg/bottombar/spin-up.svg +0 -76
- package/lib/assets/img/svg/bottombar/spin_1.svg +0 -48
- package/lib/assets/img/svg/bottombar/spin_2.svg +0 -31
- package/lib/assets/img/svg/bottombar/spin_3.svg +0 -31
- package/lib/assets/img/svg/bottombar/spin_4.svg +0 -31
- package/lib/assets/img/svg/bottombar/spin_5.svg +0 -31
- package/lib/assets/img/svg/bottombar/zoomin.svg +0 -29
- package/lib/assets/img/svg/bottombar/zoomout.svg +0 -26
- package/lib/assets/img/svg/check.svg +0 -10
- package/lib/assets/img/svg/close.svg +0 -11
- package/lib/assets/img/svg/color/Black.svg +0 -3
- package/lib/assets/img/svg/color/Blue.svg +0 -3
- package/lib/assets/img/svg/color/Brown.svg +0 -9
- package/lib/assets/img/svg/color/Cream.svg +0 -3
- package/lib/assets/img/svg/color/Dark.svg +0 -9
- package/lib/assets/img/svg/color/Gray.svg +0 -3
- package/lib/assets/img/svg/color/Green.svg +0 -3
- package/lib/assets/img/svg/color/Light.svg +0 -9
- package/lib/assets/img/svg/color/Medium.svg +0 -9
- package/lib/assets/img/svg/color/Unfinished.svg +0 -9
- package/lib/assets/img/svg/color/White.svg +0 -3
- package/lib/assets/img/svg/color/White.svg.bak +0 -3
- package/lib/assets/img/svg/color/stone2.jpg +0 -0
- package/lib/assets/img/svg/color/wood2.jpg +0 -0
- package/lib/assets/img/svg/copy.svg +0 -11
- package/lib/assets/img/svg/delete.svg +0 -3
- package/lib/assets/img/svg/detail.svg +0 -77
- package/lib/assets/img/svg/disclaimer/background.svg +0 -758
- package/lib/assets/img/svg/disclaimer/logo-dots.svg +0 -11
- package/lib/assets/img/svg/door/Closet.svg +0 -11
- package/lib/assets/img/svg/door/Exterior.svg +0 -5
- package/lib/assets/img/svg/door/Framed_dorway.svg +0 -5
- package/lib/assets/img/svg/door/Frameless_dorway.svg +0 -5
- package/lib/assets/img/svg/door/Interior.svg +0 -7
- package/lib/assets/img/svg/door/Sliding.svg +0 -5
- package/lib/assets/img/svg/doors_closet.svg +0 -47
- package/lib/assets/img/svg/doors_exterior.svg +0 -25
- package/lib/assets/img/svg/doors_interior.svg +0 -29
- package/lib/assets/img/svg/doors_patio.svg +0 -26
- package/lib/assets/img/svg/duplicate.svg +0 -11
- package/lib/assets/img/svg/duplicate_object_left.svg +0 -32
- package/lib/assets/img/svg/duplicate_object_right.svg +0 -32
- package/lib/assets/img/svg/filtersActive.svg +0 -19
- package/lib/assets/img/svg/firstsetting/L.svg +0 -3
- package/lib/assets/img/svg/firstsetting/L2.svg +0 -3
- package/lib/assets/img/svg/firstsetting/Open.svg +0 -3
- package/lib/assets/img/svg/firstsetting/Square.svg +0 -3
- package/lib/assets/img/svg/firstsetting/bar-active.svg +0 -9
- package/lib/assets/img/svg/firstsetting/bar-normal.svg +0 -3
- package/lib/assets/img/svg/firstsetting/bullet-current.svg +0 -3
- package/lib/assets/img/svg/firstsetting/bullet-done.svg +0 -3
- package/lib/assets/img/svg/firstsetting/bullet-not-done.svg +0 -3
- package/lib/assets/img/svg/firstsetting/check-active.svg +0 -3
- package/lib/assets/img/svg/firstsetting/check-normal.svg +0 -3
- package/lib/assets/img/svg/firstsetting/pencil.svg +0 -11
- package/lib/assets/img/svg/green_checkmark.svg +0 -27
- package/lib/assets/img/svg/headerbar/assist.svg +0 -3
- package/lib/assets/img/svg/headerbar/cart.svg +0 -3
- package/lib/assets/img/svg/headerbar/check.svg +0 -10
- package/lib/assets/img/svg/headerbar/consult_designer.svg +0 -45
- package/lib/assets/img/svg/headerbar/edit_name.svg +0 -26
- package/lib/assets/img/svg/headerbar/file-dollar.svg +0 -13
- package/lib/assets/img/svg/headerbar/hamburger_menu.svg +0 -32
- package/lib/assets/img/svg/headerbar/plus.svg +0 -11
- package/lib/assets/img/svg/headerbar/review_quote.svg +0 -44
- package/lib/assets/img/svg/headerbar/ruler-measure.svg +0 -11
- package/lib/assets/img/svg/headerbar/save.svg +0 -3
- package/lib/assets/img/svg/headerbar/setting.svg +0 -75
- package/lib/assets/img/svg/help/check.svg +0 -10
- package/lib/assets/img/svg/help/search.svg +0 -76
- package/lib/assets/img/svg/intro/1-start-with-floorplan-whole.svg +0 -27
- package/lib/assets/img/svg/intro/1-start-with-floorplan.svg +0 -26
- package/lib/assets/img/svg/intro/2-start-from-scratch-whole.svg +0 -28
- package/lib/assets/img/svg/intro/2-start-from-scratch.svg +0 -27
- package/lib/assets/img/svg/intro/3-retrieve-project-whole.svg +0 -19
- package/lib/assets/img/svg/intro/3-retrieve-project.svg +0 -18
- package/lib/assets/img/svg/invert.svg +0 -127
- package/lib/assets/img/svg/lefttoolbar/appliance-active.svg +0 -13
- package/lib/assets/img/svg/lefttoolbar/appliance.svg +0 -13
- package/lib/assets/img/svg/lefttoolbar/cabinet-active.svg +0 -10
- package/lib/assets/img/svg/lefttoolbar/cabinet-category.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/cabinet-one.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/cabinet.svg +0 -10
- package/lib/assets/img/svg/lefttoolbar/disigner_assistance.svg +0 -89
- package/lib/assets/img/svg/lefttoolbar/door-style-active.svg +0 -20
- package/lib/assets/img/svg/lefttoolbar/door-style.svg +0 -20
- package/lib/assets/img/svg/lefttoolbar/door.svg +0 -12
- package/lib/assets/img/svg/lefttoolbar/error_icon.svg +0 -81
- package/lib/assets/img/svg/lefttoolbar/finishing-active.svg +0 -13
- package/lib/assets/img/svg/lefttoolbar/finishing.svg +0 -13
- package/lib/assets/img/svg/lefttoolbar/reviewforquote-active.svg +0 -86
- package/lib/assets/img/svg/lefttoolbar/reviewforquote.svg +0 -12
- package/lib/assets/img/svg/lefttoolbar/room-shape-L.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/room-shape-active.svg +0 -18
- package/lib/assets/img/svg/lefttoolbar/room-shape-custom.svg +0 -12
- package/lib/assets/img/svg/lefttoolbar/room-shape-irregular.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/room-shape-open.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/room-shape-square.svg +0 -3
- package/lib/assets/img/svg/lefttoolbar/room-shape.svg +0 -18
- package/lib/assets/img/svg/lefttoolbar/search.svg +0 -76
- package/lib/assets/img/svg/lefttoolbar/view_more.svg +0 -86
- package/lib/assets/img/svg/lefttoolbar/warning_icon.svg +0 -81
- package/lib/assets/img/svg/lefttoolbar/window.svg +0 -12
- package/lib/assets/img/svg/logo.svg +0 -11
- package/lib/assets/img/svg/logo_with_text.svg +0 -25
- package/lib/assets/img/svg/menubar/login.svg +0 -84
- package/lib/assets/img/svg/menubar/my_projects.svg +0 -85
- package/lib/assets/img/svg/menubar/new_project.svg +0 -110
- package/lib/assets/img/svg/menubar/save_project.svg +0 -84
- package/lib/assets/img/svg/options.svg +0 -3
- package/lib/assets/img/svg/positioning.svg +0 -3
- package/lib/assets/img/svg/rotate.png +0 -0
- package/lib/assets/img/svg/rotate.svg +0 -17
- package/lib/assets/img/svg/rotate_object_clockwise.svg +0 -26
- package/lib/assets/img/svg/rotate_object_counterclockwise.svg +0 -26
- package/lib/assets/img/svg/toggleFilters.svg +0 -19
- package/lib/assets/img/svg/toolbar/add_appliances_active.svg +0 -64
- package/lib/assets/img/svg/toolbar/add_appliances_inactive.svg +0 -52
- package/lib/assets/img/svg/toolbar/add_button.svg +0 -36
- package/lib/assets/img/svg/toolbar/add_cabinets_active.svg +0 -59
- package/lib/assets/img/svg/toolbar/add_cabinets_inactive.svg +0 -49
- package/lib/assets/img/svg/toolbar/add_items_doors.svg +0 -25
- package/lib/assets/img/svg/toolbar/add_items_doorways.svg +0 -24
- package/lib/assets/img/svg/toolbar/add_items_refrigerator.svg +0 -32
- package/lib/assets/img/svg/toolbar/add_items_windows.svg +0 -28
- package/lib/assets/img/svg/toolbar/apply_button.svg +0 -38
- package/lib/assets/img/svg/toolbar/arrow-plus.svg +0 -11
- package/lib/assets/img/svg/toolbar/backsplash.svg +0 -8
- package/lib/assets/img/svg/toolbar/cancel_button.svg +0 -37
- package/lib/assets/img/svg/toolbar/consult_a_designer_button.svg +0 -47
- package/lib/assets/img/svg/toolbar/countertop.svg +0 -7
- package/lib/assets/img/svg/toolbar/dcm.png +0 -0
- package/lib/assets/img/svg/toolbar/dcm_off.svg +0 -12
- package/lib/assets/img/svg/toolbar/dcm_on.svg +0 -474
- package/lib/assets/img/svg/toolbar/delete_button.svg +0 -37
- package/lib/assets/img/svg/toolbar/download.svg +0 -77
- package/lib/assets/img/svg/toolbar/draw_custom_floor.svg +0 -31
- package/lib/assets/img/svg/toolbar/edit_button.svg +0 -75
- package/lib/assets/img/svg/toolbar/email_quote_button.svg +0 -44
- package/lib/assets/img/svg/toolbar/fbm.png +0 -0
- package/lib/assets/img/svg/toolbar/finishing_touches_active.svg +0 -54
- package/lib/assets/img/svg/toolbar/finishing_touches_inactive.svg +0 -42
- package/lib/assets/img/svg/toolbar/floorstyle.svg +0 -9
- package/lib/assets/img/svg/toolbar/fmb.png +0 -0
- package/lib/assets/img/svg/toolbar/fmb_off.svg +0 -12
- package/lib/assets/img/svg/toolbar/fmb_on.svg +0 -489
- package/lib/assets/img/svg/toolbar/furnishings_icon.svg +0 -6
- package/lib/assets/img/svg/toolbar/get_started_button.svg +0 -41
- package/lib/assets/img/svg/toolbar/handles.svg +0 -5
- package/lib/assets/img/svg/toolbar/lighting.svg +0 -7
- package/lib/assets/img/svg/toolbar/lrm.png +0 -0
- package/lib/assets/img/svg/toolbar/lrm_off.svg +0 -12
- package/lib/assets/img/svg/toolbar/lrm_on.svg +0 -470
- package/lib/assets/img/svg/toolbar/make_floorplan_active.svg +0 -66
- package/lib/assets/img/svg/toolbar/make_floorplan_inactive.svg +0 -52
- package/lib/assets/img/svg/toolbar/predefined_room_l_shaped.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_layout.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_long_narrow.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_pentagon.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_rectangle.svg +0 -20
- package/lib/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +0 -20
- package/lib/assets/img/svg/toolbar/redo_button.svg +0 -75
- package/lib/assets/img/svg/toolbar/redo_button1.svg +0 -75
- package/lib/assets/img/svg/toolbar/review_quote_active.svg +0 -14
- package/lib/assets/img/svg/toolbar/review_quote_inactive.svg +0 -44
- package/lib/assets/img/svg/toolbar/save_project_button.svg +0 -44
- package/lib/assets/img/svg/toolbar/select_doorstyle_active.svg +0 -67
- package/lib/assets/img/svg/toolbar/select_doorstyle_inactive.svg +0 -57
- package/lib/assets/img/svg/toolbar/shopping-cart.svg +0 -13
- package/lib/assets/img/svg/toolbar/style_change_button.svg +0 -47
- package/lib/assets/img/svg/toolbar/take_picture.svg +0 -75
- package/lib/assets/img/svg/toolbar/undo_button.svg +0 -76
- package/lib/assets/img/svg/toolbar/undo_button1.svg +0 -76
- package/lib/assets/img/svg/toolbar/use_button.svg +0 -37
- package/lib/assets/img/svg/toolbar/wall_color_icon.svg +0 -6
- package/lib/assets/img/svg/topbar/edit_active.svg +0 -10
- package/lib/assets/img/svg/topbar/edit_inactive.svg +0 -10
- package/lib/assets/img/svg/topbar/redo_active.svg +0 -42
- package/lib/assets/img/svg/topbar/redo_inactive.svg +0 -23
- package/lib/assets/img/svg/topbar/select_all_active.svg +0 -50
- package/lib/assets/img/svg/topbar/select_all_inactive.svg +0 -32
- package/lib/assets/img/svg/topbar/take_picture_active.svg +0 -51
- package/lib/assets/img/svg/topbar/take_picture_inactive.svg +0 -26
- package/lib/assets/img/svg/topbar/undo_active.svg +0 -42
- package/lib/assets/img/svg/topbar/undo_inactive.svg +0 -23
- package/lib/assets/img/svg/warning_info_2d.svg +0 -81
- package/lib/assets/img/svg/window/Clear.svg +0 -3
- package/lib/assets/img/svg/window/Cross.svg +0 -5
- package/lib/assets/img/svg/window/Double_hung.svg +0 -4
- package/lib/assets/img/svg/window/Vertical.svg +0 -4
- package/lib/assets/img/svg/windows_clear.svg +0 -23
- package/lib/assets/img/svg/windows_cross.svg +0 -28
- package/lib/assets/img/svg/windows_double_hung.svg +0 -24
- package/lib/assets/img/svg/windows_vertical.svg +0 -24
- package/lib/assets/img/svg/wizardstep/Custom.svg +0 -3
- package/lib/assets/img/svg/wizardstep/Dashed_line.svg +0 -3
- package/lib/assets/img/svg/wizardstep/L.svg +0 -3
- package/lib/assets/img/svg/wizardstep/L2.svg +0 -3
- package/lib/assets/img/svg/wizardstep/Open.svg +0 -3
- package/lib/assets/img/svg/wizardstep/Square.svg +0 -3
- package/lib/assets/img/svg/wizardstep/bar-active.svg +0 -9
- package/lib/assets/img/svg/wizardstep/bar-normal.svg +0 -3
- package/lib/assets/img/svg/wizardstep/bullet-current.svg +0 -3
- package/lib/assets/img/svg/wizardstep/bullet-done.svg +0 -3
- package/lib/assets/img/svg/wizardstep/bullet-not-done.svg +0 -3
- package/lib/assets/img/svg/wizardstep/check-active.svg +0 -3
- package/lib/assets/img/svg/wizardstep/check-normal.svg +0 -3
- package/lib/assets/img/svg/wizardstep/detail_view.svg +0 -87
- package/lib/assets/img/svg/wizardstep/pencil.svg +0 -11
- package/lib/assets/img/svg/wizardstep/tile_view.svg +0 -95
- package/lib/assets/img/texture/glass.jpg +0 -0
- package/lib/assets/img/texture/steel.jpg +0 -0
- package/lib/assets/img/texture/white1px.jpg +0 -0
- package/lib/assets/img/texture/wood.jpg +0 -0
- package/lib/assets/model/DCM.bin +0 -0
- package/lib/assets/model/DCM.fbx +0 -0
- package/lib/assets/model/DCM.gltf +0 -1
- package/lib/assets/model/FBM.bin +0 -0
- package/lib/assets/model/FBM.fbx +0 -0
- package/lib/assets/model/FBM.gltf +0 -1
- package/lib/assets/model/LRM.bin +0 -0
- package/lib/assets/model/LRM.fbx +0 -0
- package/lib/assets/model/LRM.gltf +0 -1
- package/lib/assets/rtastore_logo.png +0 -0
- package/lib/catalog/areas/area/planner-element.js +0 -53
- package/lib/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
- package/lib/catalog/areas/area/textures/grass.jpg +0 -0
- package/lib/catalog/areas/area/textures/parquet.jpg +0 -0
- package/lib/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
- package/lib/catalog/areas/area/textures/tile1.jpg +0 -0
- package/lib/catalog/back.png +0 -0
- package/lib/catalog/catalog.js +0 -256
- package/lib/catalog/doors.png +0 -0
- package/lib/catalog/doorways.png +0 -0
- package/lib/catalog/envMap/nx.hdr +0 -0
- package/lib/catalog/envMap/ny.hdr +0 -0
- package/lib/catalog/envMap/nz.hdr +0 -0
- package/lib/catalog/envMap/px.hdr +0 -0
- package/lib/catalog/envMap/py.hdr +0 -0
- package/lib/catalog/envMap/pz.hdr +0 -0
- package/lib/catalog/export.js +0 -1
- package/lib/catalog/factories/area-factory-3d.js +0 -191
- package/lib/catalog/factories/area-factory.js +0 -88
- package/lib/catalog/factories/export.js +0 -25
- package/lib/catalog/factories/wall-factory-3d.js +0 -212
- package/lib/catalog/factories/wall-factory.js +0 -279
- package/lib/catalog/holes/door-closet/planner-element.js +0 -232
- package/lib/catalog/holes/door-double/door_double.png +0 -0
- package/lib/catalog/holes/door-double/planner-element.js +0 -325
- package/lib/catalog/holes/door-exterior/planner-element.js +0 -225
- package/lib/catalog/holes/door-interior/planner-element.js +0 -237
- package/lib/catalog/holes/door-panic/panicDoor.png +0 -0
- package/lib/catalog/holes/door-panic/planner-element.js +0 -513
- package/lib/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/lib/catalog/holes/door-panic-double/planner-element.js +0 -473
- package/lib/catalog/holes/door-sliding/planner-element.js +0 -235
- package/lib/catalog/holes/doorway-framed/planner-element.js +0 -155
- package/lib/catalog/holes/doorway-frameless/planner-element.js +0 -114
- package/lib/catalog/holes/export.js +0 -97
- package/lib/catalog/holes/gate/gate.jpg +0 -0
- package/lib/catalog/holes/window-clear/planner-element.js +0 -176
- package/lib/catalog/holes/window-clear/texture.png +0 -0
- package/lib/catalog/holes/window-cross/planner-element.js +0 -175
- package/lib/catalog/holes/window-cross/texture.png +0 -0
- package/lib/catalog/holes/window-double-hung/planner-element.js +0 -313
- package/lib/catalog/holes/window-double-hung/texture.png +0 -0
- package/lib/catalog/holes/window-vertical/planner-element.js +0 -286
- package/lib/catalog/holes/window-vertical/texture.png +0 -0
- package/lib/catalog/lines/wall/planner-element.js +0 -87
- package/lib/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/lib/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/lib/catalog/lines/wall/textures/morden-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/morden.jpg +0 -0
- package/lib/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/painted.jpg +0 -0
- package/lib/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
- package/lib/catalog/lines/wall/textures/plaster.jpg +0 -0
- package/lib/catalog/lines/wall/wall.png +0 -0
- package/lib/catalog/molding/molding-dcm/planner-element.js +0 -33
- package/lib/catalog/molding/molding-dcm/texture.png +0 -0
- package/lib/catalog/molding/molding-fbm/planner-element.js +0 -33
- package/lib/catalog/molding/molding-fbm/texture.png +0 -0
- package/lib/catalog/molding/molding-lrm/planner-element.js +0 -33
- package/lib/catalog/molding/molding-lrm/texture.png +0 -0
- package/lib/catalog/utils/FuseUtils.js +0 -87
- package/lib/catalog/utils/exporter.js +0 -156
- package/lib/catalog/utils/geom-utils.js +0 -205
- package/lib/catalog/utils/item-loader.js +0 -1613
- package/lib/catalog/utils/load-obj.js +0 -99
- package/lib/catalog/utils/mtl-loader.js +0 -366
- package/lib/catalog/utils/obj-loader.js +0 -486
- package/lib/catalog/windows.png +0 -0
- package/lib/class/FuseUtils.js +0 -87
- package/lib/class/area.js +0 -148
- package/lib/class/export.js +0 -96
- package/lib/class/group.js +0 -438
- package/lib/class/guide.js +0 -64
- package/lib/class/hole.js +0 -932
- package/lib/class/item.js +0 -1866
- package/lib/class/layer.js +0 -670
- package/lib/class/line.js +0 -1242
- package/lib/class/project.js +0 -931
- package/lib/class/vertex.js +0 -205
- package/lib/components/content.js +0 -233
- package/lib/components/export.js +0 -27
- package/lib/components/style/export.js +0 -17
- package/lib/components/style/form-number-input.js +0 -192
- package/lib/components/viewer2d/area.js +0 -89
- package/lib/components/viewer2d/export.js +0 -121
- package/lib/components/viewer2d/grids/grid-horizontal-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-streak.js +0 -44
- package/lib/components/viewer2d/grids/grid-vertical-streak.js +0 -44
- package/lib/components/viewer2d/grids/grids.js +0 -40
- package/lib/components/viewer2d/group.js +0 -62
- package/lib/components/viewer2d/item.js +0 -449
- package/lib/components/viewer2d/layer.js +0 -172
- package/lib/components/viewer2d/line.js +0 -1007
- package/lib/components/viewer2d/ruler.js +0 -87
- package/lib/components/viewer2d/rulerDist.js +0 -123
- package/lib/components/viewer2d/rulerX.js +0 -152
- package/lib/components/viewer2d/rulerY.js +0 -153
- package/lib/components/viewer2d/scene.js +0 -132
- package/lib/components/viewer2d/snap.js +0 -84
- package/lib/components/viewer2d/state.js +0 -83
- package/lib/components/viewer2d/utils.js +0 -207
- package/lib/components/viewer2d/vertex.js +0 -75
- package/lib/components/viewer2d/viewer2d.js +0 -1509
- package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2591
- package/lib/components/viewer3d/dcm.js +0 -408
- package/lib/components/viewer3d/fbm.js +0 -421
- package/lib/components/viewer3d/front3D.js +0 -60
- package/lib/components/viewer3d/grid-creator.js +0 -35
- package/lib/components/viewer3d/grids/grid-horizontal-streak.js +0 -45
- package/lib/components/viewer3d/grids/grid-streak.js +0 -36
- package/lib/components/viewer3d/grids/grid-vertical-streak.js +0 -45
- package/lib/components/viewer3d/libs/first-person-controls.js +0 -74
- package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1287
- package/lib/components/viewer3d/libs/mtl-loader.js +0 -366
- package/lib/components/viewer3d/libs/obj-loader.js +0 -471
- package/lib/components/viewer3d/libs/orbit-controls.js +0 -706
- package/lib/components/viewer3d/libs/pointer-lock-controls.js +0 -53
- package/lib/components/viewer3d/lrm.js +0 -312
- package/lib/components/viewer3d/model.js +0 -714
- package/lib/components/viewer3d/pointer-lock-navigation.js +0 -122
- package/lib/components/viewer3d/ruler-utils/itemRect.js +0 -69
- package/lib/components/viewer3d/ruler-utils/layer3D.js +0 -503
- package/lib/components/viewer3d/ruler-utils/ruler3D.js +0 -232
- package/lib/components/viewer3d/ruler-utils/scene3D.js +0 -67
- package/lib/components/viewer3d/ruler-utils/state3D.js +0 -26
- package/lib/components/viewer3d/scene-creator.js +0 -3652
- package/lib/components/viewer3d/three-memory-cleaner.js +0 -60
- package/lib/components/viewer3d/viewer3d-first-person.js +0 -322
- package/lib/components/viewer3d/viewer3d.js +0 -2693
- package/lib/constants.js +0 -773
- package/lib/devLiteRenderer.js +0 -546
- package/lib/index.js +0 -108
- package/lib/mocks/appliancePayload.json +0 -27
- package/lib/mocks/cabinetPayload.json +0 -1914
- package/lib/mocks/cabinetPayload2.json +0 -76
- package/lib/mocks/dataBundle2.json +0 -4
- package/lib/mocks/distancePayload.json +0 -6
- package/lib/mocks/doorStylePayload2.json +0 -84
- package/lib/mocks/furnishingPayload.json +0 -23
- package/lib/mocks/itemCDSPayload.json +0 -27
- package/lib/mocks/lightingPayload.json +0 -23
- package/lib/mocks/mockProps.json +0 -43
- package/lib/mocks/mockProps2.json +0 -9
- package/lib/mocks/moldingPayload.json +0 -19
- package/lib/mocks/projectItemsCatalog.json +0 -133
- package/lib/mocks/rectangleShape.json +0 -238
- package/lib/mocks/replaceCabinetPayload.json +0 -81
- package/lib/mocks/roomShapePayload.json +0 -5
- package/lib/models.js +0 -514
- package/lib/reducers/areas-reducer.js +0 -19
- package/lib/reducers/export.js +0 -97
- package/lib/reducers/groups-reducer.js +0 -45
- package/lib/reducers/holes-reducer.js +0 -69
- package/lib/reducers/items-reducer.js +0 -147
- package/lib/reducers/lines-reducer.js +0 -52
- package/lib/reducers/project-reducer.js +0 -140
- package/lib/reducers/reducer.js +0 -26
- package/lib/reducers/scene-reducer.js +0 -35
- package/lib/reducers/user-reducer.js +0 -48
- package/lib/reducers/vertices-reducer.js +0 -26
- package/lib/reducers/viewer2d-reducer.js +0 -82
- package/lib/reducers/viewer3d-reducer.js +0 -63
- package/lib/shared-style.js +0 -72
- package/lib/translator/en.js +0 -111
- package/lib/translator/it.js +0 -86
- package/lib/translator/ru.js +0 -86
- package/lib/translator/translator.js +0 -87
- package/lib/useAppContext.js +0 -16
- package/lib/utils/browser.js +0 -40
- package/lib/utils/convert-units-lite.js +0 -35
- package/lib/utils/email-validator.js +0 -10
- package/lib/utils/export.js +0 -56
- package/lib/utils/geometry.js +0 -2751
- package/lib/utils/get-edges-of-subgraphs.js +0 -33
- package/lib/utils/graph-cycles.js +0 -239
- package/lib/utils/graph-inner-cycles.js +0 -54
- package/lib/utils/graph.js +0 -153
- package/lib/utils/helper.js +0 -425
- package/lib/utils/history.js +0 -36
- package/lib/utils/id-broker.js +0 -22
- package/lib/utils/isolate-event-handler.js +0 -1409
- package/lib/utils/logger.js +0 -14
- package/lib/utils/math.js +0 -57
- package/lib/utils/molding.js +0 -895
- package/lib/utils/name-generator.js +0 -21
- package/lib/utils/objects-utils.js +0 -62
- package/lib/utils/phone-validator.js +0 -10
- package/lib/utils/process-black-list.js +0 -22
- package/lib/utils/react-if.js +0 -25
- package/lib/utils/snap-scene.js +0 -101
- package/lib/utils/snap.js +0 -245
- package/lib/utils/summarizeCart.js +0 -30
- package/lib/utils/threeCSG.es6.js +0 -504
- package/lib/version.js +0 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
@@ -5,43 +6,74 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
5
6
|
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; }
|
|
6
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
8
|
import { Map } from 'immutable';
|
|
8
|
-
import { EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, MODE_IDLE, MODE_2D_PAN, EXTERNAL_EVENT_ADD_ITEM, ARRAY_3D_MODES, MODE_IDLE_3D, MODE_ELEVATION_VIEW, MODE_DRAWING_LINE, TOP, BOTTOM, LEFT, RIGHT, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, INTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, ATT_ITEM_POS, ATT_LINE_LENGTH, ATT_VERTEXT_ONE, ATT_VERTEXT_TWO, ATT_HOLE_OFFSET_A, ATT_HOLE_OFFSET_B, UNIT_CENTIMETER, UNIT_INCH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE, EXTERNAL_EVENT_CENTERING_2D, EXTERNAL_EVENT_DUPLICATE_ELEMENT, EXTERNAL_EVENT_DELETE_ELEMENT, ELEMENT_HOLE, ELEMENT_ITEM, ELEMENT_LINE, EXTERNAL_EVENT_REPLACE_CABINET, FINISHING_TYPE, EXTERNAL_EVENT_SET_FINISHING } from "../constants";
|
|
9
|
+
import { EXTERNAL_EVENT_ADD_WALL, EXTERNAL_EVENT_TOGGLE_TO_3D, EXTERNAL_EVENT_TOGGLE_TO_2D, EXTERNAL_EVENT_TOGGLE_TO_ELEVATION, EXTERNAL_EVENT_MOVE_PAN, MODE_IDLE, MODE_2D_PAN, EXTERNAL_EVENT_ADD_ITEM, ARRAY_3D_MODES, MODE_IDLE_3D, MODE_ELEVATION_VIEW, MODE_DRAWING_LINE, TOP, BOTTOM, LEFT, RIGHT, EXTERNAL_EVENT_NEW_PROJECT, EXTERNAL_EVENT_CHANGE_DOORSTYLE, EXTERNAL_EVENT_ADD_ROOM_SHAPE, EXTERNAL_EVENT_ZOOM_IN, EXTERNAL_EVENT_ZOOM_OUT, EXTERNAL_EVENT_UNDO, EXTERNAL_EVENT_REDO, EXTERNAL_EVENT_SET_MOLDING, EXTERNAL_EVENT_PROJECT_SETTING, PROJECT_SETTING_OPTION, EXTERNAL_EVENT_SYNC_SCENE, INTERNAL_EVENT_SYNC_SCENE, EXTERNAL_EVENT_UPDATE_ATTRIBUTE, ATT_ITEM_POS, ATT_LINE_LENGTH, ATT_VERTEXT_ONE, ATT_VERTEXT_TWO, ATT_HOLE_OFFSET_A, ATT_HOLE_OFFSET_B, UNIT_CENTIMETER, UNIT_INCH, EXTERNAL_EVENT_UPDATE_PROPERTY, PROP_FLIP_DOOR_HANDLE, PROP_OPEN_DOORS, EXTERNAL_EVENT_LOAD_PROJECT, INTERNAL_EVENT_ITEMS_CATALOG, EXTERNAL_EVENT_ADD_HOLE, EXTERNAL_EVENT_CENTERING_2D, EXTERNAL_EVENT_DUPLICATE_ELEMENT, EXTERNAL_EVENT_DELETE_ELEMENT, ELEMENT_HOLE, ELEMENT_ITEM, ELEMENT_LINE, EXTERNAL_EVENT_REPLACE_CABINET, FINISHING_TYPE, EXTERNAL_EVENT_SET_FINISHING, EXTERNAL_EVENT_ROTATE_PAN } from "../constants";
|
|
9
10
|
import { isEmpty, updateViwer2D, centering2D } from "./helper";
|
|
10
11
|
import exporter from "../catalog/utils/exporter";
|
|
11
12
|
import { render2DItem, render3DItem, render3DApplianceItem, render3DLightingItem } from "../catalog/utils/item-loader";
|
|
12
13
|
import { convert } from "./convert-units-lite";
|
|
13
14
|
import { GeometryUtils, MathUtils } from "./export";
|
|
14
15
|
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
15
|
-
import { SVGLoader } from 'three/addons/loaders/SVGLoader';
|
|
16
|
+
import { SVGLoader } from 'three/addons/loaders/SVGLoader.js';
|
|
17
|
+
import { getMoldingDataOfScene2 } from "./molding";
|
|
18
|
+
import { Scene, State } from "../models";
|
|
16
19
|
var PRECISION = 2;
|
|
20
|
+
|
|
21
|
+
// ---- compatibility: supports old + optimized props shapes ----
|
|
22
|
+
export function getPlannerStateFromProps(props) {
|
|
23
|
+
var _props$state;
|
|
24
|
+
// New optimized path
|
|
25
|
+
if (props !== null && props !== void 0 && props.extractedState) return props.extractedState;
|
|
26
|
+
|
|
27
|
+
// Old path
|
|
28
|
+
if (props !== null && props !== void 0 && (_props$state = props.state) !== null && _props$state !== void 0 && _props$state.get) {
|
|
29
|
+
var kc = props.state.get('KitchenConfigurator');
|
|
30
|
+
if (kc) return kc;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ---- caches: avoid re-fetch/re-parse costs (no behavior change) ----
|
|
36
|
+
var __jsonCache = new Map(); // url -> Promise<any>
|
|
37
|
+
var __svgCache = new Map(); // url -> Promise<svgData|null>
|
|
17
38
|
function loadJSON(_x) {
|
|
18
39
|
return _loadJSON.apply(this, arguments);
|
|
19
40
|
}
|
|
20
41
|
/********Parse TempPlaceholder from cabinetPayloadData **************/
|
|
21
42
|
function _loadJSON() {
|
|
22
|
-
_loadJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
_loadJSON = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(path) {
|
|
44
|
+
var p;
|
|
45
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
46
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
25
47
|
case 0:
|
|
26
|
-
|
|
48
|
+
if (path) {
|
|
49
|
+
_context3.next = 1;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return _context3.abrupt("return", null);
|
|
53
|
+
case 1:
|
|
54
|
+
if (!__jsonCache.has(path)) {
|
|
55
|
+
_context3.next = 2;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
return _context3.abrupt("return", __jsonCache.get(path));
|
|
59
|
+
case 2:
|
|
60
|
+
p = new Promise(function (resolve, reject) {
|
|
27
61
|
var xhr = new XMLHttpRequest();
|
|
28
62
|
xhr.onreadystatechange = function () {
|
|
29
63
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
30
|
-
if (xhr.status === 200)
|
|
31
|
-
resolve(JSON.parse(xhr.responseText));
|
|
32
|
-
} else {
|
|
33
|
-
reject(xhr);
|
|
34
|
-
}
|
|
64
|
+
if (xhr.status === 200) resolve(JSON.parse(xhr.responseText));else reject(xhr);
|
|
35
65
|
}
|
|
36
66
|
};
|
|
37
67
|
xhr.open('GET', path, true);
|
|
38
68
|
xhr.send();
|
|
39
|
-
})
|
|
40
|
-
|
|
69
|
+
});
|
|
70
|
+
__jsonCache.set(path, p);
|
|
71
|
+
return _context3.abrupt("return", p);
|
|
72
|
+
case 3:
|
|
41
73
|
case "end":
|
|
42
|
-
return
|
|
74
|
+
return _context3.stop();
|
|
43
75
|
}
|
|
44
|
-
},
|
|
76
|
+
}, _callee3);
|
|
45
77
|
}));
|
|
46
78
|
return _loadJSON.apply(this, arguments);
|
|
47
79
|
}
|
|
@@ -50,10 +82,10 @@ function parseTempPlaceholdersFromCabinetPayload(_x2) {
|
|
|
50
82
|
}
|
|
51
83
|
/***** Update cabinetPayloadData with updatedTempPlaceholders *****/
|
|
52
84
|
function _parseTempPlaceholdersFromCabinetPayload() {
|
|
53
|
-
_parseTempPlaceholdersFromCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
54
|
-
var link, keys, temp, i, _cabinetPayload$struc, _cabinetPayload$struc2,
|
|
55
|
-
return _regeneratorRuntime.wrap(function (
|
|
56
|
-
while (1) switch (
|
|
85
|
+
_parseTempPlaceholdersFromCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(cabinetPayload) {
|
|
86
|
+
var link, keys, temp, i, _cabinetPayload$struc, _cabinetPayload$struc2, tempPlaceholdersData, _loop3, tempData, doorKey, drawerKey, fixedKey, doorPHs, drawerPHs, has_single_door, fixedPHs, k, _cabinetPayload$struc3, _t2, _t3, _t4;
|
|
87
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
88
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
57
89
|
case 0:
|
|
58
90
|
link = '';
|
|
59
91
|
keys = Object.keys(cabinetPayload.structure_json);
|
|
@@ -61,335 +93,358 @@ function _parseTempPlaceholdersFromCabinetPayload() {
|
|
|
61
93
|
i = 0;
|
|
62
94
|
case 1:
|
|
63
95
|
if (!(i < keys.length)) {
|
|
64
|
-
|
|
96
|
+
_context5.next = 4;
|
|
65
97
|
break;
|
|
66
98
|
}
|
|
67
99
|
if (!((_cabinetPayload$struc = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc !== void 0 && (_cabinetPayload$struc = _cabinetPayload$struc.toString()) !== null && _cabinetPayload$struc !== void 0 && _cabinetPayload$struc.includes('.gltf') && (_cabinetPayload$struc2 = cabinetPayload.structure_json[keys[i]]) !== null && _cabinetPayload$struc2 !== void 0 && (_cabinetPayload$struc2 = _cabinetPayload$struc2.toString()) !== null && _cabinetPayload$struc2 !== void 0 && _cabinetPayload$struc2.startsWith('http'))) {
|
|
68
|
-
|
|
100
|
+
_context5.next = 3;
|
|
69
101
|
break;
|
|
70
102
|
}
|
|
71
103
|
link = cabinetPayload.structure_json[keys[i]];
|
|
72
104
|
_t2 = temp;
|
|
73
105
|
_t3 = keys[i];
|
|
74
|
-
|
|
106
|
+
_context5.next = 2;
|
|
75
107
|
return loadJSON(link);
|
|
76
108
|
case 2:
|
|
77
|
-
_t4 =
|
|
109
|
+
_t4 = _context5.sent;
|
|
78
110
|
_t2.push.call(_t2, {
|
|
79
111
|
name: _t3,
|
|
80
112
|
data: _t4
|
|
81
113
|
});
|
|
82
114
|
case 3:
|
|
83
115
|
i++;
|
|
84
|
-
|
|
116
|
+
_context5.next = 1;
|
|
85
117
|
break;
|
|
86
118
|
case 4:
|
|
87
|
-
el = cabinetPayload.structure_json.tempPlaceholders[0].id;
|
|
88
119
|
tempPlaceholdersData = [];
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
108
|
-
if (tempPlaceholders.length > 0) {
|
|
109
|
-
if (t.name === 'base') {
|
|
110
|
-
tempPlaceholders.map(function (element) {
|
|
111
|
-
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
112
|
-
if (sink_match && sink_match.length >= 2) {
|
|
113
|
-
var _process$env$API_URL, _cabinetPayload$struc3;
|
|
114
|
-
tempData['sink'] = tempData['sink'] || [];
|
|
115
|
-
tempData['sink'].push(element.name);
|
|
116
|
-
var sink_url = (_process$env$API_URL = process.env.API_URL) !== null && _process$env$API_URL !== void 0 ? _process$env$API_URL :
|
|
117
|
-
// server url from 3DTool env
|
|
118
|
-
import.meta.env.VITE_APP_API_URL + // server url from Host env
|
|
119
|
-
"/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
120
|
-
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc3 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc3 !== void 0 && (_cabinetPayload$struc3 = _cabinetPayload$struc3.tempPlaceholders[0]) !== null && _cabinetPayload$struc3 !== void 0 && _cabinetPayload$struc3.structure) cabinetPayload.structure_json.tempPlaceholders[0].structure.sink = sink_url;
|
|
121
|
-
} else if (temp.some(function (felement) {
|
|
122
|
-
return felement.name.includes('base_drawer');
|
|
123
|
-
}) && element.name.includes('interior_drawer')) {
|
|
124
|
-
var objCnt = temp.filter(function (felement) {
|
|
125
|
-
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
126
|
-
}).length;
|
|
127
|
-
var phCnt = tempPlaceholders.filter(function (felement) {
|
|
128
|
-
return felement.name.includes('interior');
|
|
129
|
-
}).length;
|
|
130
|
-
drawerPHs = phCnt;
|
|
131
|
-
if (objCnt === 1 || phCnt % objCnt !== 0) {
|
|
132
|
-
if (tempData['base_drawer_1'] === undefined) {
|
|
133
|
-
tempData['base_drawer_1'] = [];
|
|
134
|
-
}
|
|
135
|
-
tempData['base_drawer_1'].push(element.name);
|
|
136
|
-
drawerKey++;
|
|
137
|
-
} else if (objCnt > 1 && phCnt % objCnt === 0) {
|
|
138
|
-
if (tempData['base_drawer_' + (drawerKey % objCnt + 1)] === undefined) {
|
|
139
|
-
tempData['base_drawer_' + (drawerKey % objCnt + 1)] = [];
|
|
140
|
-
}
|
|
141
|
-
tempData['base_drawer_' + (drawerKey % objCnt + 1)].push(element.name);
|
|
142
|
-
drawerKey++;
|
|
143
|
-
}
|
|
144
|
-
} else if (temp.some(function (felement) {
|
|
145
|
-
return felement.name.includes('base_door');
|
|
146
|
-
}) && !element.name.includes('interior_drawer') && !element.name.includes('drawer') && element.name.includes('door')) {
|
|
147
|
-
var _objCnt = temp.filter(function (felement) {
|
|
148
|
-
return felement.name.includes('base_door');
|
|
149
|
-
}).length;
|
|
150
|
-
var _phCnt = tempPlaceholders.filter(function (felement) {
|
|
151
|
-
return !felement.name.includes('interior') && !felement.name.includes('drawer') && felement.name.includes('door');
|
|
152
|
-
}).length;
|
|
153
|
-
doorPHs = _phCnt;
|
|
154
|
-
if (_objCnt === 1 || _phCnt % _objCnt !== 0) {
|
|
155
|
-
if (tempData['base_door_1'] === undefined) {
|
|
156
|
-
tempData['base_door_1'] = [];
|
|
157
|
-
}
|
|
158
|
-
tempData['base_door_1'].push(element.name);
|
|
159
|
-
doorKey++;
|
|
160
|
-
} else if (_objCnt > 1) {
|
|
161
|
-
if (tempData['base_door_' + (doorKey % _objCnt + 1)] === undefined) {
|
|
162
|
-
tempData['base_door_' + (doorKey % _objCnt + 1)] = [];
|
|
163
|
-
}
|
|
164
|
-
tempData['base_door_' + (doorKey % _objCnt + 1)].push(element.name);
|
|
165
|
-
doorKey++;
|
|
166
|
-
}
|
|
167
|
-
} else if (temp.some(function (felement) {
|
|
168
|
-
return felement.name.includes('base_fixed_drawer_door');
|
|
169
|
-
}) && element.name.includes('_drawer_door_fixed')) {
|
|
170
|
-
var _objCnt2 = temp.filter(function (felement) {
|
|
171
|
-
return felement.name.includes('base_fixed_drawer_door');
|
|
172
|
-
}).length;
|
|
173
|
-
var _phCnt2 = tempPlaceholders.filter(function (felement) {
|
|
174
|
-
return felement.name.includes('_drawer_door_fixed');
|
|
175
|
-
}).length;
|
|
176
|
-
fixedPHs = _phCnt2;
|
|
177
|
-
if (_objCnt2 === 1 || _phCnt2 % _objCnt2 !== 0) {
|
|
178
|
-
if (tempData['base_fixed_drawer_door_1'] === undefined) {
|
|
179
|
-
tempData['base_fixed_drawer_door_1'] = [];
|
|
180
|
-
}
|
|
181
|
-
tempData['base_fixed_drawer_door_1'].push(element.name);
|
|
182
|
-
fixedKey++;
|
|
183
|
-
} else if (_objCnt2 > 1) {
|
|
184
|
-
if (tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] === undefined) {
|
|
185
|
-
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] = [];
|
|
186
|
-
}
|
|
187
|
-
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)].push(element.name);
|
|
188
|
-
fixedKey++;
|
|
120
|
+
_loop3 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop3(k) {
|
|
121
|
+
var el;
|
|
122
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
123
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
el = cabinetPayload.structure_json.tempPlaceholders[k].id;
|
|
126
|
+
tempData = {};
|
|
127
|
+
doorKey = 0;
|
|
128
|
+
drawerKey = 0;
|
|
129
|
+
fixedKey = 0;
|
|
130
|
+
doorPHs = 0;
|
|
131
|
+
drawerPHs = 0;
|
|
132
|
+
has_single_door = false;
|
|
133
|
+
fixedPHs = 0;
|
|
134
|
+
temp.forEach(function (t, index) {
|
|
135
|
+
var nodes = t.data.nodes;
|
|
136
|
+
if (nodes === undefined) {
|
|
137
|
+
nodes = [];
|
|
189
138
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
} else if (t.name.includes('base_drawer') && !t.name.includes('_door')) {
|
|
193
|
-
var objCnt = temp.filter(function (felement) {
|
|
194
|
-
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
195
|
-
}).length;
|
|
196
|
-
if (objCnt === 1 || drawerPHs % objCnt !== 0) {
|
|
197
|
-
if (tempData['base_drawer_door_1'] === undefined) tempData['base_drawer_door_1'] = [];
|
|
198
|
-
//get drawer door handle placeholders
|
|
199
|
-
var ph_temp = temp.find(function (felement) {
|
|
200
|
-
return felement.name === 'base_drawer_door_1';
|
|
201
|
-
});
|
|
202
|
-
if (ph_temp != undefined) {
|
|
203
|
-
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
204
|
-
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
205
|
-
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
139
|
+
var tempPlaceholders = nodes.filter(function (element) {
|
|
140
|
+
return element.name.startsWith('ph_');
|
|
206
141
|
});
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
return el === 'base_drawer_door_1/' + tempPlaceholders[0].name;
|
|
210
|
-
})) {
|
|
211
|
-
tempData['base_drawer_door_1'].push('base_drawer_1/' + tempPlaceholders[0].name);
|
|
212
|
-
//add drawer door handle placeholders
|
|
213
|
-
if (tempData['drawer_door_handle_1'] === undefined) tempData['drawer_door_handle_1'] = [];
|
|
214
|
-
if (ph_drawer_door_handle.length > 0) tempData['drawer_door_handle_1'].push('base_drawer_door_1/' + ph_drawer_door_handle[0].name);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
} else if (objCnt > 1 && drawerPHs > 0 && drawerPHs % objCnt === 0) {
|
|
219
|
-
if (tempData['base_drawer_door' + t.name.slice(-2)] === undefined) tempData['base_drawer_door' + t.name.slice(-2)] = [];
|
|
220
|
-
//get drawer door handle placeholders
|
|
221
|
-
var ph_temp = temp.find(function (felement) {
|
|
222
|
-
return felement.name === 'base_drawer_door' + t.name.slice(-2);
|
|
223
|
-
});
|
|
224
|
-
if (ph_temp != undefined) {
|
|
225
|
-
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
226
|
-
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
227
|
-
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
142
|
+
tempPlaceholders.sort(function (a, b) {
|
|
143
|
+
return a.name > b.name ? 1 : -1;
|
|
228
144
|
});
|
|
229
|
-
tempPlaceholders.
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
145
|
+
if (tempPlaceholders.length > 0) {
|
|
146
|
+
if (t.name === 'base') {
|
|
147
|
+
tempPlaceholders.map(function (element) {
|
|
148
|
+
var sink_match = element.name.match(/\d_(sink_[^LR12]*)(_[LR12])?$/);
|
|
149
|
+
if (sink_match && sink_match.length >= 2) {
|
|
150
|
+
var _process$env$API_URL, _cabinetPayload$struc4;
|
|
151
|
+
tempData['sink'] = tempData['sink'] || [];
|
|
152
|
+
tempData['sink'].push(element.name);
|
|
153
|
+
var sink_url = (_process$env$API_URL = process.env.API_URL) !== null && _process$env$API_URL !== void 0 ? _process$env$API_URL :
|
|
154
|
+
// server url from 3DTool env
|
|
155
|
+
import.meta.env.VITE_APP_API_URL + // server url from Host env
|
|
156
|
+
"/uploads/assets/default/".concat(sink_match[1], ".gltf");
|
|
157
|
+
if (cabinetPayload !== null && cabinetPayload !== void 0 && (_cabinetPayload$struc4 = cabinetPayload.structure_json) !== null && _cabinetPayload$struc4 !== void 0 && (_cabinetPayload$struc4 = _cabinetPayload$struc4.tempPlaceholders[k]) !== null && _cabinetPayload$struc4 !== void 0 && _cabinetPayload$struc4.structure) cabinetPayload.structure_json.tempPlaceholders[k].structure.sink = sink_url;
|
|
158
|
+
} else if (temp.some(function (felement) {
|
|
159
|
+
return felement.name.includes('base_drawer');
|
|
160
|
+
}) && element.name.includes('interior_drawer')) {
|
|
161
|
+
var objCnt = temp.filter(function (felement) {
|
|
162
|
+
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
163
|
+
}).length;
|
|
164
|
+
var phCnt = tempPlaceholders.filter(function (felement) {
|
|
165
|
+
return felement.name.includes('interior');
|
|
166
|
+
}).length;
|
|
167
|
+
drawerPHs = phCnt;
|
|
168
|
+
if (objCnt === 1 || phCnt % objCnt !== 0) {
|
|
169
|
+
if (tempData['base_drawer_1'] === undefined) {
|
|
170
|
+
tempData['base_drawer_1'] = [];
|
|
171
|
+
}
|
|
172
|
+
tempData['base_drawer_1'].push(element.name);
|
|
173
|
+
drawerKey++;
|
|
174
|
+
} else if (objCnt > 1 && phCnt % objCnt === 0) {
|
|
175
|
+
if (tempData['base_drawer_' + (drawerKey % objCnt + 1)] === undefined) {
|
|
176
|
+
tempData['base_drawer_' + (drawerKey % objCnt + 1)] = [];
|
|
177
|
+
}
|
|
178
|
+
tempData['base_drawer_' + (drawerKey % objCnt + 1)].push(element.name);
|
|
179
|
+
drawerKey++;
|
|
180
|
+
}
|
|
181
|
+
} else if (temp.some(function (felement) {
|
|
182
|
+
return felement.name.includes('base_door');
|
|
183
|
+
}) && !element.name.includes('interior_drawer') && !element.name.includes('drawer') && element.name.includes('door')) {
|
|
184
|
+
var _objCnt = temp.filter(function (felement) {
|
|
185
|
+
return felement.name.includes('base_door');
|
|
186
|
+
}).length;
|
|
187
|
+
var _phCnt = tempPlaceholders.filter(function (felement) {
|
|
188
|
+
return !felement.name.includes('interior') && !felement.name.includes('drawer') && felement.name.includes('door');
|
|
189
|
+
}).length;
|
|
190
|
+
doorPHs = _phCnt;
|
|
191
|
+
if (_objCnt === 1 || _phCnt % _objCnt !== 0) {
|
|
192
|
+
if (tempData['base_door_1'] === undefined) {
|
|
193
|
+
tempData['base_door_1'] = [];
|
|
194
|
+
}
|
|
195
|
+
tempData['base_door_1'].push(element.name);
|
|
196
|
+
doorKey++;
|
|
197
|
+
} else if (_objCnt > 1) {
|
|
198
|
+
if (tempData['base_door_' + (doorKey % _objCnt + 1)] === undefined) {
|
|
199
|
+
tempData['base_door_' + (doorKey % _objCnt + 1)] = [];
|
|
200
|
+
}
|
|
201
|
+
tempData['base_door_' + (doorKey % _objCnt + 1)].push(element.name);
|
|
202
|
+
doorKey++;
|
|
203
|
+
}
|
|
204
|
+
} else if (temp.some(function (felement) {
|
|
205
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
206
|
+
}) && element.name.includes('_drawer_door_fixed')) {
|
|
207
|
+
var _objCnt2 = temp.filter(function (felement) {
|
|
208
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
209
|
+
}).length;
|
|
210
|
+
var _phCnt2 = tempPlaceholders.filter(function (felement) {
|
|
211
|
+
return felement.name.includes('_drawer_door_fixed');
|
|
212
|
+
}).length;
|
|
213
|
+
fixedPHs = _phCnt2;
|
|
214
|
+
if (_objCnt2 === 1 || _phCnt2 % _objCnt2 !== 0) {
|
|
215
|
+
if (tempData['base_fixed_drawer_door_1'] === undefined) {
|
|
216
|
+
tempData['base_fixed_drawer_door_1'] = [];
|
|
217
|
+
}
|
|
218
|
+
tempData['base_fixed_drawer_door_1'].push(element.name);
|
|
219
|
+
fixedKey++;
|
|
220
|
+
} else if (_objCnt2 > 1) {
|
|
221
|
+
if (tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] === undefined) {
|
|
222
|
+
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)] = [];
|
|
223
|
+
}
|
|
224
|
+
tempData['base_fixed_drawer_door_' + (fixedKey % _objCnt2 + 1)].push(element.name);
|
|
225
|
+
fixedKey++;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
} else if (t.name.includes('base_drawer') && !t.name.includes('_door')) {
|
|
230
|
+
var objCnt = temp.filter(function (felement) {
|
|
231
|
+
return felement.name.includes('base_drawer') && !felement.name.includes('_door');
|
|
232
|
+
}).length;
|
|
233
|
+
if (objCnt === 1 || drawerPHs % objCnt !== 0) {
|
|
234
|
+
if (tempData['base_drawer_door_1'] === undefined) tempData['base_drawer_door_1'] = [];
|
|
235
|
+
//get drawer door handle placeholders
|
|
236
|
+
var ph_temp = temp.find(function (felement) {
|
|
237
|
+
return felement.name === 'base_drawer_door_1';
|
|
238
|
+
});
|
|
239
|
+
if (ph_temp != undefined) {
|
|
240
|
+
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
241
|
+
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
242
|
+
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
243
|
+
});
|
|
244
|
+
for (var w = 0; w < drawerPHs; w++) {
|
|
245
|
+
if (!tempData['base_drawer_door_1'].some(function (el) {
|
|
246
|
+
return el === 'base_drawer_door_1/' + tempPlaceholders[0].name;
|
|
247
|
+
})) {
|
|
248
|
+
tempData['base_drawer_door_1'].push('base_drawer_1/' + tempPlaceholders[0].name);
|
|
249
|
+
//add drawer door handle placeholders
|
|
250
|
+
if (tempData['drawer_door_handle_1'] === undefined) tempData['drawer_door_handle_1'] = [];
|
|
251
|
+
if (ph_drawer_door_handle.length > 0) tempData['drawer_door_handle_1'].push('base_drawer_door_1/' + ph_drawer_door_handle[0].name);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
} else if (objCnt > 1 && drawerPHs > 0 && drawerPHs % objCnt === 0) {
|
|
256
|
+
if (tempData['base_drawer_door' + t.name.slice(-2)] === undefined) tempData['base_drawer_door' + t.name.slice(-2)] = [];
|
|
257
|
+
//get drawer door handle placeholders
|
|
258
|
+
var ph_temp = temp.find(function (felement) {
|
|
259
|
+
return felement.name === 'base_drawer_door' + t.name.slice(-2);
|
|
260
|
+
});
|
|
261
|
+
if (ph_temp != undefined) {
|
|
262
|
+
var ph_drawer_door_handle = ph_temp.data.nodes;
|
|
263
|
+
ph_drawer_door_handle = ph_drawer_door_handle.filter(function (element) {
|
|
264
|
+
return element.name.startsWith('ph_') && element.name.includes('handle');
|
|
265
|
+
});
|
|
266
|
+
tempPlaceholders.forEach(function (element) {
|
|
267
|
+
if (!tempData['base_drawer_door' + t.name.slice(-2)].some(function (el) {
|
|
268
|
+
return el === t.name + '/' + element.name;
|
|
269
|
+
})) {
|
|
270
|
+
tempData['base_drawer_door' + t.name.slice(-2)].push(t.name + '/' + element.name);
|
|
271
|
+
//add drawer door handle placeholders
|
|
272
|
+
if (tempData['drawer_door_handle' + t.name.slice(-2)] === undefined) tempData['drawer_door_handle' + t.name.slice(-2)] = [];
|
|
273
|
+
if (ph_drawer_door_handle.length > 0) tempData['drawer_door_handle' + t.name.slice(-2)].push('base_drawer_door' + t.name.slice(-2) + '/' + ph_drawer_door_handle[0].name);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} else if (t.name.includes('base_door')) {
|
|
279
|
+
var _objCnt3 = temp.filter(function (felement) {
|
|
280
|
+
return felement.name.includes('base_door');
|
|
281
|
+
}).length;
|
|
282
|
+
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
283
|
+
return el.name.includes('handle');
|
|
284
|
+
});
|
|
285
|
+
if (tempPlaceholders.length > 0) if (_objCnt3 === 1 || doorPHs % _objCnt3 !== 0) {
|
|
286
|
+
if (tempData['door_handle_1'] === undefined) {
|
|
287
|
+
tempData['door_handle_1'] = [];
|
|
288
|
+
}
|
|
289
|
+
var _loop4 = function _loop4() {
|
|
290
|
+
var phname = tempPlaceholders[0].name;
|
|
291
|
+
var newph = undefined;
|
|
292
|
+
if (tempData['base_door_1'][_w].isLeftPlaceholder()) {
|
|
293
|
+
newph = tempPlaceholders.find(function (el) {
|
|
294
|
+
return el.name.isRightPlaceholder();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
if (tempData['base_door_1'][_w].isRightPlaceholder()) {
|
|
298
|
+
newph = tempPlaceholders.find(function (el) {
|
|
299
|
+
return el.name.isLeftPlaceholder();
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
if (newph != undefined) {
|
|
303
|
+
phname = newph.name;
|
|
304
|
+
}
|
|
305
|
+
if (doorPHs === 1 && tempPlaceholders.find(function (el) {
|
|
306
|
+
return el.name.isLeftPlaceholder();
|
|
307
|
+
}) != undefined && tempPlaceholders.find(function (el) {
|
|
308
|
+
return el.name.isRightPlaceholder();
|
|
309
|
+
}) != undefined) {
|
|
310
|
+
has_single_door = true;
|
|
311
|
+
}
|
|
312
|
+
if (!tempData['door_handle_1'].some(function (el) {
|
|
313
|
+
return el === 'door_handle_1/' + phname;
|
|
314
|
+
})) {
|
|
315
|
+
tempData['door_handle_1'].push('base_door_1/' + phname);
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
for (var _w = 0; _w < doorPHs; _w++) {
|
|
319
|
+
_loop4();
|
|
320
|
+
}
|
|
321
|
+
} else if (_objCnt3 > 1 && doorPHs > 0 && doorPHs % _objCnt3 === 0) {
|
|
322
|
+
if (tempData['door_handle' + t.name.slice(-2)] === undefined) tempData['door_handle' + t.name.slice(-2)] = [];
|
|
323
|
+
var phname = tempPlaceholders[0].name;
|
|
324
|
+
var newph = undefined;
|
|
325
|
+
var blAdd = true;
|
|
326
|
+
if (cabinetPayload.is_corner) {
|
|
327
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
328
|
+
newph = tempPlaceholders.find(function (el) {
|
|
329
|
+
return el.name.isLeftPlaceholder();
|
|
330
|
+
});
|
|
331
|
+
} else {
|
|
332
|
+
blAdd = false;
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
336
|
+
newph = tempPlaceholders.find(function (el) {
|
|
337
|
+
return el.name.isRightPlaceholder();
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
if (tempData['base_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
341
|
+
newph = tempPlaceholders.find(function (el) {
|
|
342
|
+
return el.name.isLeftPlaceholder();
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (blAdd) {
|
|
347
|
+
if (newph != undefined) {
|
|
348
|
+
phname = newph.name;
|
|
349
|
+
}
|
|
350
|
+
if (!tempData['door_handle' + t.name.slice(-2)].some(function (el) {
|
|
351
|
+
return el === t.name + '/' + phname;
|
|
352
|
+
})) {
|
|
353
|
+
tempData['door_handle' + t.name.slice(-2)].push(t.name + '/' + phname);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
} else if (t.name.includes('base_fixed_drawer_door')) {
|
|
358
|
+
var _objCnt4 = temp.filter(function (felement) {
|
|
359
|
+
return felement.name.includes('base_fixed_drawer_door');
|
|
360
|
+
}).length;
|
|
361
|
+
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
362
|
+
return el.name.includes('handle');
|
|
363
|
+
});
|
|
364
|
+
if (tempPlaceholders.length > 0) if (_objCnt4 === 1 || fixedPHs % _objCnt4 !== 0) {
|
|
365
|
+
if (tempData['fixed_drawer_door_handle_1'] === undefined) tempData['fixed_drawer_door_handle_1'] = [];
|
|
366
|
+
var _loop5 = function _loop5() {
|
|
367
|
+
var phname = tempPlaceholders[0].name;
|
|
368
|
+
var newph = undefined;
|
|
369
|
+
if (tempData['base_fixed_drawer_door_1'][_w2].isLeftPlaceholder()) {
|
|
370
|
+
newph = tempPlaceholders.find(function (el) {
|
|
371
|
+
return el.name.isRightPlaceholder();
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
if (tempData['base_fixed_drawer_door_1'][_w2].isRightPlaceholder()) {
|
|
375
|
+
newph = tempPlaceholders.find(function (el) {
|
|
376
|
+
return el.name.isLeftPlaceholder();
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
if (newph != undefined) {
|
|
380
|
+
phname = newph.name;
|
|
381
|
+
}
|
|
382
|
+
if (!tempData['fixed_drawer_door_handle_1'].some(function (el) {
|
|
383
|
+
return el === 'fixed_drawer_door_handle_1/' + phname;
|
|
384
|
+
})) {
|
|
385
|
+
tempData['fixed_drawer_door_handle_1'].push('base_fixed_drawer_door_1/' + phname);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
for (var _w2 = 0; _w2 < fixedPHs; _w2++) {
|
|
389
|
+
_loop5();
|
|
390
|
+
}
|
|
391
|
+
} else if (_objCnt4 > 1 && fixedPHs > 0 && fixedPHs % _objCnt4 === 0) {
|
|
392
|
+
if (tempData['fixed_drawer_door_handle' + t.name.slice(-2)] === undefined) {
|
|
393
|
+
tempData['fixed_drawer_door_handle' + t.name.slice(-2)] = [];
|
|
394
|
+
}
|
|
395
|
+
var _phname = tempPlaceholders[0].name;
|
|
396
|
+
var _newph = undefined;
|
|
397
|
+
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
398
|
+
_newph = tempPlaceholders.find(function (el) {
|
|
399
|
+
return el.name.isRightPlaceholder();
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
403
|
+
_newph = tempPlaceholders.find(function (el) {
|
|
404
|
+
return el.name.isLeftPlaceholder();
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
if (_newph != undefined) {
|
|
408
|
+
_phname = _newph.name;
|
|
409
|
+
}
|
|
410
|
+
if (!tempData['fixed_drawer_door_handle' + t.name.slice(-2)].some(function (el) {
|
|
411
|
+
return el === t.name + '/' + _phname;
|
|
412
|
+
})) {
|
|
413
|
+
tempData['fixed_drawer_door_handle' + t.name.slice(-2)].push(t.name + '/' + _phname);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
237
416
|
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
} else if (t.name.includes('base_door')) {
|
|
242
|
-
var _objCnt3 = temp.filter(function (felement) {
|
|
243
|
-
return felement.name.includes('base_door');
|
|
244
|
-
}).length;
|
|
245
|
-
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
246
|
-
return el.name.includes('handle');
|
|
247
|
-
});
|
|
248
|
-
if (tempPlaceholders.length > 0) if (_objCnt3 === 1 || doorPHs % _objCnt3 !== 0) {
|
|
249
|
-
if (tempData['door_handle_1'] === undefined) {
|
|
250
|
-
tempData['door_handle_1'] = [];
|
|
251
|
-
}
|
|
252
|
-
var _loop = function _loop() {
|
|
253
|
-
var phname = tempPlaceholders[0].name;
|
|
254
|
-
var newph = undefined;
|
|
255
|
-
if (tempData['base_door_1'][_w].isLeftPlaceholder()) {
|
|
256
|
-
newph = tempPlaceholders.find(function (el) {
|
|
257
|
-
return el.name.isRightPlaceholder();
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
if (tempData['base_door_1'][_w].isRightPlaceholder()) {
|
|
261
|
-
newph = tempPlaceholders.find(function (el) {
|
|
262
|
-
return el.name.isLeftPlaceholder();
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
if (newph != undefined) {
|
|
266
|
-
phname = newph.name;
|
|
267
|
-
}
|
|
268
|
-
if (doorPHs === 1 && tempPlaceholders.find(function (el) {
|
|
269
|
-
return el.name.isLeftPlaceholder();
|
|
270
|
-
}) != undefined && tempPlaceholders.find(function (el) {
|
|
271
|
-
return el.name.isRightPlaceholder();
|
|
272
|
-
}) != undefined) {
|
|
273
|
-
has_single_door = true;
|
|
274
|
-
}
|
|
275
|
-
if (!tempData['door_handle_1'].some(function (el) {
|
|
276
|
-
return el === 'door_handle_1/' + phname;
|
|
277
|
-
})) {
|
|
278
|
-
tempData['door_handle_1'].push('base_door_1/' + phname);
|
|
279
417
|
}
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if (cabinetPayload.is_corner) {
|
|
290
|
-
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
291
|
-
newph = tempPlaceholders.find(function (el) {
|
|
292
|
-
return el.name.isLeftPlaceholder();
|
|
293
|
-
});
|
|
294
|
-
} else {
|
|
295
|
-
blAdd = false;
|
|
296
|
-
}
|
|
297
|
-
} else {
|
|
298
|
-
if (tempData['base_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
299
|
-
newph = tempPlaceholders.find(function (el) {
|
|
300
|
-
return el.name.isRightPlaceholder();
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
if (tempData['base_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
304
|
-
newph = tempPlaceholders.find(function (el) {
|
|
305
|
-
return el.name.isLeftPlaceholder();
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
if (blAdd) {
|
|
310
|
-
if (newph != undefined) {
|
|
311
|
-
phname = newph.name;
|
|
312
|
-
}
|
|
313
|
-
if (!tempData['door_handle' + t.name.slice(-2)].some(function (el) {
|
|
314
|
-
return el === t.name + '/' + phname;
|
|
315
|
-
})) {
|
|
316
|
-
tempData['door_handle' + t.name.slice(-2)].push(t.name + '/' + phname);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
} else if (t.name.includes('base_fixed_drawer_door')) {
|
|
321
|
-
var _objCnt4 = temp.filter(function (felement) {
|
|
322
|
-
return felement.name.includes('base_fixed_drawer_door');
|
|
323
|
-
}).length;
|
|
324
|
-
tempPlaceholders = tempPlaceholders.filter(function (el) {
|
|
325
|
-
return el.name.includes('handle');
|
|
326
|
-
});
|
|
327
|
-
if (tempPlaceholders.length > 0) if (_objCnt4 === 1 || fixedPHs % _objCnt4 !== 0) {
|
|
328
|
-
if (tempData['fixed_drawer_door_handle_1'] === undefined) tempData['fixed_drawer_door_handle_1'] = [];
|
|
329
|
-
var _loop2 = function _loop2() {
|
|
330
|
-
var phname = tempPlaceholders[0].name;
|
|
331
|
-
var newph = undefined;
|
|
332
|
-
if (tempData['base_fixed_drawer_door_1'][_w2].isLeftPlaceholder()) {
|
|
333
|
-
newph = tempPlaceholders.find(function (el) {
|
|
334
|
-
return el.name.isRightPlaceholder();
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
if (tempData['base_fixed_drawer_door_1'][_w2].isRightPlaceholder()) {
|
|
338
|
-
newph = tempPlaceholders.find(function (el) {
|
|
339
|
-
return el.name.isLeftPlaceholder();
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
if (newph != undefined) {
|
|
343
|
-
phname = newph.name;
|
|
344
|
-
}
|
|
345
|
-
if (!tempData['fixed_drawer_door_handle_1'].some(function (el) {
|
|
346
|
-
return el === 'fixed_drawer_door_handle_1/' + phname;
|
|
347
|
-
})) {
|
|
348
|
-
tempData['fixed_drawer_door_handle_1'].push('base_fixed_drawer_door_1/' + phname);
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
for (var _w2 = 0; _w2 < fixedPHs; _w2++) {
|
|
352
|
-
_loop2();
|
|
353
|
-
}
|
|
354
|
-
} else if (_objCnt4 > 1 && fixedPHs > 0 && fixedPHs % _objCnt4 === 0) {
|
|
355
|
-
if (tempData['fixed_drawer_door_handle' + t.name.slice(-2)] === undefined) {
|
|
356
|
-
tempData['fixed_drawer_door_handle' + t.name.slice(-2)] = [];
|
|
357
|
-
}
|
|
358
|
-
var _phname = tempPlaceholders[0].name;
|
|
359
|
-
var _newph = undefined;
|
|
360
|
-
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isLeftPlaceholder()) {
|
|
361
|
-
_newph = tempPlaceholders.find(function (el) {
|
|
362
|
-
return el.name.isRightPlaceholder();
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
if (tempData['base_fixed_drawer_door' + t.name.slice(-2)][0].isRightPlaceholder()) {
|
|
366
|
-
_newph = tempPlaceholders.find(function (el) {
|
|
367
|
-
return el.name.isLeftPlaceholder();
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
if (_newph != undefined) {
|
|
371
|
-
_phname = _newph.name;
|
|
372
|
-
}
|
|
373
|
-
if (!tempData['fixed_drawer_door_handle' + t.name.slice(-2)].some(function (el) {
|
|
374
|
-
return el === t.name + '/' + _phname;
|
|
375
|
-
})) {
|
|
376
|
-
tempData['fixed_drawer_door_handle' + t.name.slice(-2)].push(t.name + '/' + _phname);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
418
|
+
});
|
|
419
|
+
tempPlaceholdersData.push({
|
|
420
|
+
id: parseInt(el, 10),
|
|
421
|
+
placeholders: tempData,
|
|
422
|
+
structure: cabinetPayload.structure_json.tempPlaceholders[k].structure
|
|
423
|
+
});
|
|
424
|
+
case 1:
|
|
425
|
+
case "end":
|
|
426
|
+
return _context4.stop();
|
|
379
427
|
}
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
tempPlaceholdersData.push({
|
|
383
|
-
id: parseInt(el, 10),
|
|
384
|
-
placeholders: tempData,
|
|
385
|
-
structure: cabinetPayload.structure_json.tempPlaceholders[0].structure
|
|
428
|
+
}, _loop3);
|
|
386
429
|
});
|
|
387
|
-
|
|
430
|
+
k = 0;
|
|
388
431
|
case 5:
|
|
432
|
+
if (!(k < (cabinetPayload === null || cabinetPayload === void 0 || (_cabinetPayload$struc3 = cabinetPayload.structure_json) === null || _cabinetPayload$struc3 === void 0 || (_cabinetPayload$struc3 = _cabinetPayload$struc3.tempPlaceholders) === null || _cabinetPayload$struc3 === void 0 ? void 0 : _cabinetPayload$struc3.length))) {
|
|
433
|
+
_context5.next = 7;
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
return _context5.delegateYield(_loop3(k), "t0", 6);
|
|
437
|
+
case 6:
|
|
438
|
+
k++;
|
|
439
|
+
_context5.next = 5;
|
|
440
|
+
break;
|
|
441
|
+
case 7:
|
|
442
|
+
return _context5.abrupt("return", tempPlaceholdersData);
|
|
443
|
+
case 8:
|
|
389
444
|
case "end":
|
|
390
|
-
return
|
|
445
|
+
return _context5.stop();
|
|
391
446
|
}
|
|
392
|
-
},
|
|
447
|
+
}, _callee4);
|
|
393
448
|
}));
|
|
394
449
|
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
395
450
|
}
|
|
@@ -397,79 +452,102 @@ function updateCabinetPayload(_x3) {
|
|
|
397
452
|
return _updateCabinetPayload.apply(this, arguments);
|
|
398
453
|
}
|
|
399
454
|
function _updateCabinetPayload() {
|
|
400
|
-
_updateCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
401
|
-
var
|
|
402
|
-
return _regeneratorRuntime.wrap(function (
|
|
403
|
-
while (1) switch (
|
|
455
|
+
_updateCabinetPayload = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(cabinetPayload) {
|
|
456
|
+
var cabinetPayloadKeys, i, _cabinetPayload$cabin, _cabinetPayload$cabin2;
|
|
457
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
458
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
404
459
|
case 0:
|
|
405
|
-
tempPlaceholders = [];
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
tempPlaceholders = _context4.sent;
|
|
460
|
+
// let tempPlaceholders = [];
|
|
461
|
+
// tempPlaceholders = await parseTempPlaceholdersFromCabinetPayload(
|
|
462
|
+
// cabinetPayload
|
|
463
|
+
// );
|
|
410
464
|
cabinetPayloadKeys = Object.keys(cabinetPayload);
|
|
411
465
|
for (i = 0; i < cabinetPayloadKeys.length; i++) {
|
|
412
466
|
if (cabinetPayloadKeys[i] === 'structure_json') {
|
|
413
|
-
cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] = tempPlaceholders[0].placeholders;
|
|
414
|
-
|
|
467
|
+
cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] = (_cabinetPayload$cabin = (_cabinetPayload$cabin2 = cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'][0]) === null || _cabinetPayload$cabin2 === void 0 ? void 0 : _cabinetPayload$cabin2.placeholders) !== null && _cabinetPayload$cabin !== void 0 ? _cabinetPayload$cabin : [];
|
|
468
|
+
|
|
469
|
+
// cabinetPayload[cabinetPayloadKeys[i]]['placeholders'] =
|
|
470
|
+
// tempPlaceholders[0].placeholders;
|
|
471
|
+
// cabinetPayload[cabinetPayloadKeys[i]]['tempPlaceholders'] =
|
|
472
|
+
// tempPlaceholders;
|
|
415
473
|
}
|
|
416
474
|
}
|
|
417
|
-
return
|
|
418
|
-
case
|
|
475
|
+
return _context6.abrupt("return", cabinetPayload);
|
|
476
|
+
case 1:
|
|
419
477
|
case "end":
|
|
420
|
-
return
|
|
478
|
+
return _context6.stop();
|
|
421
479
|
}
|
|
422
|
-
},
|
|
480
|
+
}, _callee5);
|
|
423
481
|
}));
|
|
424
482
|
return _updateCabinetPayload.apply(this, arguments);
|
|
425
483
|
}
|
|
426
484
|
var loadSVGsByItem = /*#__PURE__*/function () {
|
|
427
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
428
|
-
var
|
|
429
|
-
return _regeneratorRuntime.wrap(function (
|
|
430
|
-
while (1) switch (
|
|
485
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(item) {
|
|
486
|
+
var url, p;
|
|
487
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
488
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
431
489
|
case 0:
|
|
432
|
-
if (item.outline) {
|
|
433
|
-
|
|
490
|
+
if (item !== null && item !== void 0 && item.outline) {
|
|
491
|
+
_context2.next = 1;
|
|
434
492
|
break;
|
|
435
493
|
}
|
|
436
|
-
return
|
|
494
|
+
return _context2.abrupt("return", null);
|
|
437
495
|
case 1:
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
cache: 'no-store'
|
|
442
|
-
});
|
|
443
|
-
case 2:
|
|
444
|
-
response = _context.sent;
|
|
445
|
-
_context.next = 3;
|
|
446
|
-
return response.text();
|
|
447
|
-
case 3:
|
|
448
|
-
svgText = _context.sent;
|
|
449
|
-
loader = new SVGLoader();
|
|
450
|
-
parsed = loader.parse(svgText);
|
|
451
|
-
if (!isEmpty(parsed.paths)) {
|
|
452
|
-
_context.next = 4;
|
|
496
|
+
url = item.outline;
|
|
497
|
+
if (!__svgCache.has(url)) {
|
|
498
|
+
_context2.next = 2;
|
|
453
499
|
break;
|
|
454
500
|
}
|
|
455
|
-
return
|
|
456
|
-
case
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
501
|
+
return _context2.abrupt("return", __svgCache.get(url));
|
|
502
|
+
case 2:
|
|
503
|
+
p = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
504
|
+
var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
|
|
505
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
506
|
+
while (1) switch (_context.prev = _context.next) {
|
|
507
|
+
case 0:
|
|
508
|
+
_context.prev = 0;
|
|
509
|
+
_context.next = 1;
|
|
510
|
+
return fetch(url, {
|
|
511
|
+
cache: 'force-cache'
|
|
512
|
+
});
|
|
513
|
+
case 1:
|
|
514
|
+
response = _context.sent;
|
|
515
|
+
_context.next = 2;
|
|
516
|
+
return response.text();
|
|
517
|
+
case 2:
|
|
518
|
+
svgText = _context.sent;
|
|
519
|
+
loader = new SVGLoader();
|
|
520
|
+
parsed = loader.parse(svgText);
|
|
521
|
+
if (!isEmpty(parsed.paths)) {
|
|
522
|
+
_context.next = 3;
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
return _context.abrupt("return", null);
|
|
526
|
+
case 3:
|
|
527
|
+
return _context.abrupt("return", {
|
|
528
|
+
paths: parsed.paths,
|
|
529
|
+
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,
|
|
530
|
+
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,
|
|
531
|
+
reverse: !parseFloat(parsed.xml.getAttribute('height'))
|
|
532
|
+
});
|
|
533
|
+
case 4:
|
|
534
|
+
_context.prev = 4;
|
|
535
|
+
_t = _context["catch"](0);
|
|
536
|
+
console.error('Failed to load SVG:', url, _t);
|
|
537
|
+
return _context.abrupt("return", null);
|
|
538
|
+
case 5:
|
|
539
|
+
case "end":
|
|
540
|
+
return _context.stop();
|
|
541
|
+
}
|
|
542
|
+
}, _callee, null, [[0, 4]]);
|
|
543
|
+
}))();
|
|
544
|
+
__svgCache.set(url, p);
|
|
545
|
+
return _context2.abrupt("return", p);
|
|
546
|
+
case 3:
|
|
469
547
|
case "end":
|
|
470
|
-
return
|
|
548
|
+
return _context2.stop();
|
|
471
549
|
}
|
|
472
|
-
},
|
|
550
|
+
}, _callee2);
|
|
473
551
|
}));
|
|
474
552
|
return function loadSVGsByItem(_x4) {
|
|
475
553
|
return _ref.apply(this, arguments);
|
|
@@ -479,64 +557,121 @@ function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
|
479
557
|
return _addItemToCatalog.apply(this, arguments);
|
|
480
558
|
} // Get attributs of current selected element
|
|
481
559
|
function _addItemToCatalog() {
|
|
482
|
-
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
483
|
-
var
|
|
484
|
-
var elementJs,
|
|
485
|
-
return _regeneratorRuntime.wrap(function (
|
|
486
|
-
while (1) switch (
|
|
560
|
+
_addItemToCatalog = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(element, state, catalogInstance, projectActions) {
|
|
561
|
+
var _elementJs, _elementJs3;
|
|
562
|
+
var elementJs, outlineSVGData, _state$getIn, _elementJs$structure_, _elementJs$structure_2, _elementJs$structure_3, cds, _cds$find, _elementJs2, currentCdsId, cdsIdx, ttph, updatedStructureJson, catalogElements, catalogElementKeys, catalogItem, k, _catalogElements$cata, tempPlaceholderArray, _catalogItem$structur, newTempPlaceholderArray, mergedTempPlaceholder;
|
|
563
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
564
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
487
565
|
case 0:
|
|
488
|
-
if (!isEmpty(
|
|
489
|
-
|
|
566
|
+
if (!isEmpty(element === null || element === void 0 ? void 0 : element.name)) {
|
|
567
|
+
_context7.next = 1;
|
|
490
568
|
break;
|
|
491
569
|
}
|
|
492
|
-
return
|
|
570
|
+
return _context7.abrupt("return");
|
|
493
571
|
case 1:
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return loadSVGsByItem(element);
|
|
572
|
+
// clone element
|
|
573
|
+
elementJs = Object.assign({}, element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
574
|
+
_context7.next = 2;
|
|
575
|
+
return loadSVGsByItem(elementJs);
|
|
499
576
|
case 2:
|
|
500
|
-
outlineSVGData =
|
|
501
|
-
if (!(((
|
|
502
|
-
|
|
577
|
+
outlineSVGData = _context7.sent;
|
|
578
|
+
if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
|
|
579
|
+
_context7.next = 4;
|
|
503
580
|
break;
|
|
504
581
|
}
|
|
582
|
+
// move the tempPlaceholder of current door style to first of tempPlaceholders array
|
|
583
|
+
cds = (_state$getIn = state.getIn(['scene', 'layers', 'layer-1', 'doorStyle'])) === null || _state$getIn === void 0 ? void 0 : _state$getIn.cds;
|
|
584
|
+
if (cds) {
|
|
585
|
+
currentCdsId = (_cds$find = cds.find(function (c) {
|
|
586
|
+
return c.itemID === elementJs.itemID;
|
|
587
|
+
})) === null || _cds$find === void 0 ? void 0 : _cds$find.cabinet_door_style_id;
|
|
588
|
+
cdsIdx = (_elementJs2 = elementJs) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.structure_json) === null || _elementJs2 === void 0 || (_elementJs2 = _elementJs2.tempPlaceholders) === null || _elementJs2 === void 0 ? void 0 : _elementJs2.findIndex(function (tph) {
|
|
589
|
+
return tph.id === currentCdsId;
|
|
590
|
+
}); // swap
|
|
591
|
+
if (currentCdsId && cdsIdx >= 0) {
|
|
592
|
+
ttph = elementJs.structure_json.tempPlaceholders[0];
|
|
593
|
+
elementJs.structure_json.tempPlaceholders[0] = elementJs.structure_json.tempPlaceholders[cdsIdx];
|
|
594
|
+
elementJs.structure_json.tempPlaceholders[cdsIdx] = ttph;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
505
597
|
// make placeholders of element and tempPlaceholder
|
|
506
|
-
updatedStructureJson = _objectSpread(_objectSpread({},
|
|
507
|
-
|
|
508
|
-
|
|
598
|
+
updatedStructureJson = _objectSpread(_objectSpread({}, elementJs.structure_json), (_elementJs$structure_ = (_elementJs$structure_2 = elementJs.structure_json) === null || _elementJs$structure_2 === void 0 || (_elementJs$structure_2 = _elementJs$structure_2.tempPlaceholders[0]) === null || _elementJs$structure_2 === void 0 ? void 0 : _elementJs$structure_2.structure) !== null && _elementJs$structure_ !== void 0 ? _elementJs$structure_ : {});
|
|
599
|
+
elementJs.structure_json = updatedStructureJson;
|
|
600
|
+
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
509
601
|
cds: {
|
|
510
|
-
data: [_objectSpread({},
|
|
511
|
-
itemID:
|
|
602
|
+
data: [_objectSpread({}, elementJs.customer_property)],
|
|
603
|
+
itemID: elementJs.itemID
|
|
512
604
|
}
|
|
513
605
|
});
|
|
514
|
-
if (isEmpty((
|
|
515
|
-
|
|
606
|
+
if (isEmpty((_elementJs$structure_3 = elementJs.structure_json) === null || _elementJs$structure_3 === void 0 ? void 0 : _elementJs$structure_3.tempPlaceholders)) {
|
|
607
|
+
_context7.next = 4;
|
|
516
608
|
break;
|
|
517
609
|
}
|
|
518
|
-
|
|
519
|
-
return updateCabinetPayload(
|
|
610
|
+
_context7.next = 3;
|
|
611
|
+
return updateCabinetPayload(elementJs);
|
|
520
612
|
case 3:
|
|
521
|
-
elementJs =
|
|
613
|
+
elementJs = _context7.sent;
|
|
522
614
|
case 4:
|
|
523
615
|
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
524
616
|
outlineSVGData: outlineSVGData,
|
|
525
|
-
type:
|
|
617
|
+
type: elementJs.type,
|
|
526
618
|
render2DItem: render2DItem
|
|
527
619
|
});
|
|
528
|
-
if (
|
|
620
|
+
if (elementJs.type === 'appliance' || elementJs.type === 'furnishing') elementJs.render3DItem = render3DApplianceItem;else if (elementJs.type === 'lighting') elementJs.render3DItem = render3DLightingItem;else elementJs.render3DItem = render3DItem;
|
|
621
|
+
|
|
622
|
+
/***** join new tempPlaceholder to the old element - start *****/
|
|
623
|
+
// get catalog item by itemID
|
|
624
|
+
catalogElements = state.getIn(['catalog', 'elements']).toJS();
|
|
625
|
+
catalogElementKeys = Object.keys(catalogElements);
|
|
626
|
+
catalogItem = null;
|
|
627
|
+
k = 0;
|
|
628
|
+
case 5:
|
|
629
|
+
if (!(k < catalogElementKeys.length)) {
|
|
630
|
+
_context7.next = 7;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
if (!(((_catalogElements$cata = catalogElements[catalogElementKeys[k]]) === null || _catalogElements$cata === void 0 ? void 0 : _catalogElements$cata.itemID) === elementJs.itemID)) {
|
|
634
|
+
_context7.next = 6;
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
catalogItem = catalogElements[catalogElementKeys[k]];
|
|
638
|
+
return _context7.abrupt("continue", 7);
|
|
639
|
+
case 6:
|
|
640
|
+
k++;
|
|
641
|
+
_context7.next = 5;
|
|
642
|
+
break;
|
|
643
|
+
case 7:
|
|
644
|
+
// get old tempPlaceholder array from catalog item
|
|
645
|
+
tempPlaceholderArray = null;
|
|
646
|
+
if (!isEmpty(catalogItem)) {
|
|
647
|
+
tempPlaceholderArray = (_catalogItem$structur = catalogItem.structure_json) === null || _catalogItem$structur === void 0 ? void 0 : _catalogItem$structur.tempPlaceholders;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// join new tempPlaceholder array to old one
|
|
651
|
+
newTempPlaceholderArray = [];
|
|
652
|
+
(_elementJs3 = elementJs) === null || _elementJs3 === void 0 || (_elementJs3 = _elementJs3.structure_json) === null || _elementJs3 === void 0 || (_elementJs3 = _elementJs3.tempPlaceholders) === null || _elementJs3 === void 0 || _elementJs3.forEach(function (tph) {
|
|
653
|
+
var _tempPlaceholderArray;
|
|
654
|
+
if (!((_tempPlaceholderArray = tempPlaceholderArray) !== null && _tempPlaceholderArray !== void 0 && _tempPlaceholderArray.some(function (otph) {
|
|
655
|
+
return otph.id === tph.id;
|
|
656
|
+
}))) newTempPlaceholderArray.push(tph);
|
|
657
|
+
});
|
|
658
|
+
mergedTempPlaceholder = null;
|
|
659
|
+
if (isEmpty(tempPlaceholderArray)) mergedTempPlaceholder = newTempPlaceholderArray;else if (isEmpty(newTempPlaceholderArray)) mergedTempPlaceholder = tempPlaceholderArray;else mergedTempPlaceholder = [].concat(_toConsumableArray(tempPlaceholderArray), newTempPlaceholderArray);
|
|
660
|
+
|
|
661
|
+
// rplace new array to the elementJS
|
|
662
|
+
if (!isEmpty(mergedTempPlaceholder)) elementJs.structure_json.tempPlaceholders = mergedTempPlaceholder;
|
|
663
|
+
/***** join new tempPlaceholder to the old element - end *****/
|
|
664
|
+
|
|
529
665
|
elementJs = exporter(elementJs);
|
|
530
666
|
if (catalogInstance !== null && catalogInstance !== void 0 && catalogInstance.validateElement(elementJs)) {
|
|
531
667
|
catalogInstance.registerElement(elementJs);
|
|
532
668
|
projectActions.addElementToCatalog(elementJs);
|
|
533
669
|
}
|
|
534
|
-
|
|
535
|
-
case 5:
|
|
670
|
+
case 8:
|
|
536
671
|
case "end":
|
|
537
|
-
return
|
|
672
|
+
return _context7.stop();
|
|
538
673
|
}
|
|
539
|
-
},
|
|
674
|
+
}, _callee6);
|
|
540
675
|
}));
|
|
541
676
|
return _addItemToCatalog.apply(this, arguments);
|
|
542
677
|
}
|
|
@@ -669,6 +804,8 @@ function initPropData(element, catalog) {
|
|
|
669
804
|
function updateAttributeOfSelectedElement(element, attrPayload, state, layer, catalog, projectActions) {
|
|
670
805
|
var _attributesFormData;
|
|
671
806
|
var callback = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
|
|
807
|
+
var layerID = state.scene.selectedLayer;
|
|
808
|
+
var layerUnit = state.getIn(['scene', 'layers', layerID, 'unit']);
|
|
672
809
|
var attributesFormData = initAttrData(element, layer, state);
|
|
673
810
|
var value = attrPayload.value;
|
|
674
811
|
var attributeName = attrPayload.attributeName;
|
|
@@ -676,28 +813,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
676
813
|
if (attributeName === ATT_ITEM_POS) {
|
|
677
814
|
// calculate the new position of movement
|
|
678
815
|
var rotRad = (value.directionAng + element.rotation) / 180 * Math.PI;
|
|
679
|
-
var newX = element.x + convert((value.oldDistance - value.newDistance) * Math.cos(rotRad)).from(
|
|
680
|
-
var newY = element.y + convert((value.oldDistance - value.newDistance) * Math.sin(rotRad)).from(
|
|
681
|
-
// const reversedDirection =
|
|
682
|
-
// value.directionAng === LEFT_DIST_ANG
|
|
683
|
-
// ? RIGHT_DIST_ANG
|
|
684
|
-
// : value.directionAng === RIGHT_DIST_ANG
|
|
685
|
-
// ? LEFT_DIST_ANG
|
|
686
|
-
// : value.directionAng === BACK_DIST_ANG
|
|
687
|
-
// ? FRONT_DIST_ANG
|
|
688
|
-
// : BACK_DIST_ANG;
|
|
689
|
-
// let dist = convert(
|
|
690
|
-
// element.distArray?.find(v => v[1] === reversedDirection)
|
|
691
|
-
// ? element.distArray?.find(v => v[1] === reversedDirection)[0]
|
|
692
|
-
// : 0
|
|
693
|
-
// )
|
|
694
|
-
// .from('cm')
|
|
695
|
-
// .to('in');
|
|
696
|
-
// if (dist + (value.oldDistance - value.newDistance) <= 0 || value.newDistance < 0) {
|
|
697
|
-
// // confirm "The item will be placed outside the floor plan. Are you sure?"
|
|
698
|
-
// setPopupOpen(true);
|
|
699
|
-
// return;
|
|
700
|
-
// }
|
|
816
|
+
var newX = element.x + convert((value.oldDistance - value.newDistance) * Math.cos(rotRad)).from(layerUnit).to('cm');
|
|
817
|
+
var newY = element.y + convert((value.oldDistance - value.newDistance) * Math.sin(rotRad)).from(layerUnit).to('cm');
|
|
701
818
|
value = {
|
|
702
819
|
x: newX,
|
|
703
820
|
y: newY
|
|
@@ -706,8 +823,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
706
823
|
var att = attributesFormData.has(attributeName) ? attributesFormData.get(attributeName) : element[attributeName];
|
|
707
824
|
if (att) value = att.merge({
|
|
708
825
|
_length: value,
|
|
709
|
-
_unit:
|
|
710
|
-
length: convert(value).from(
|
|
826
|
+
_unit: layerUnit,
|
|
827
|
+
length: convert(value).from(layerUnit).to(UNIT_CENTIMETER)
|
|
711
828
|
});
|
|
712
829
|
}
|
|
713
830
|
// make the new attrivutes
|
|
@@ -721,11 +838,11 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
721
838
|
attributesFormData = attributesFormData.set('y', yVal);
|
|
722
839
|
} else {
|
|
723
840
|
attributesFormData = attributesFormData.set(attributeName, value);
|
|
724
|
-
// update the distances from wall
|
|
725
|
-
var _GeometryUtils$calcDi = GeometryUtils.calcDistancesFromItemToWalls(attributesFormData, layer, catalog),
|
|
726
|
-
PointArray = _GeometryUtils$calcDi.PointArray;
|
|
727
|
-
attributesFormData = attributesFormData.set('distArray', PointArray);
|
|
728
841
|
}
|
|
842
|
+
// update the distances from wall
|
|
843
|
+
var _GeometryUtils$calcDi = GeometryUtils.calcDistancesFromItemToWalls(attributesFormData, layer),
|
|
844
|
+
PointArray = _GeometryUtils$calcDi.PointArray;
|
|
845
|
+
attributesFormData = attributesFormData.set('distArray', PointArray);
|
|
729
846
|
break;
|
|
730
847
|
}
|
|
731
848
|
case 'lines':
|
|
@@ -785,8 +902,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
785
902
|
var xp = (lengthValue + halfWidthLength) * Math.cos(alpha) + x0;
|
|
786
903
|
var yp = (lengthValue + halfWidthLength) * Math.sin(alpha) + y0;
|
|
787
904
|
var offset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, xp, yp);
|
|
788
|
-
/*
|
|
789
|
-
if (x0 > x1) offset = 1 - offset;
|
|
905
|
+
/*
|
|
906
|
+
if (x0 > x1) offset = 1 - offset;
|
|
790
907
|
*/
|
|
791
908
|
var endAt = MathUtils.toFixedFloat(lineLength - lineLength * offset - halfWidthLength, PRECISION);
|
|
792
909
|
var offsetUnit = attributesFormData.getIn(['offsetB', '_unit']);
|
|
@@ -823,8 +940,8 @@ function updateAttributeOfSelectedElement(element, attrPayload, state, layer, ca
|
|
|
823
940
|
var _xp = _x0 - (_lengthValue + _halfWidthLength) * Math.cos(_alpha);
|
|
824
941
|
var _yp = _y2 - (_lengthValue + _halfWidthLength) * Math.sin(_alpha);
|
|
825
942
|
var _offset = GeometryUtils.pointPositionOnLineSegment(_x9, _y, _x0, _y2, _xp, _yp);
|
|
826
|
-
/*
|
|
827
|
-
if (x0 > x1) offset = 1 - offset;
|
|
943
|
+
/*
|
|
944
|
+
if (x0 > x1) offset = 1 - offset;
|
|
828
945
|
*/
|
|
829
946
|
var startAt = MathUtils.toFixedFloat(_lineLength * _offset - _halfWidthLength, PRECISION);
|
|
830
947
|
var _offsetUnit = attributesFormData.getIn(['offsetA', '_unit']);
|
|
@@ -942,11 +1059,11 @@ function loadMoldingSvg(_x1) {
|
|
|
942
1059
|
return _loadMoldingSvg.apply(this, arguments);
|
|
943
1060
|
}
|
|
944
1061
|
function _loadMoldingSvg() {
|
|
945
|
-
_loadMoldingSvg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
946
|
-
return _regeneratorRuntime.wrap(function (
|
|
947
|
-
while (1) switch (
|
|
1062
|
+
_loadMoldingSvg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(molding) {
|
|
1063
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
1064
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
948
1065
|
case 0:
|
|
949
|
-
return
|
|
1066
|
+
return _context8.abrupt("return", new Promise(function (resolve, reject) {
|
|
950
1067
|
var url = molding === null || molding === void 0 ? void 0 : molding.shape_svg;
|
|
951
1068
|
if (!url) {
|
|
952
1069
|
// Skip if no SVG URL available
|
|
@@ -968,9 +1085,9 @@ function _loadMoldingSvg() {
|
|
|
968
1085
|
}));
|
|
969
1086
|
case 1:
|
|
970
1087
|
case "end":
|
|
971
|
-
return
|
|
1088
|
+
return _context8.stop();
|
|
972
1089
|
}
|
|
973
|
-
},
|
|
1090
|
+
}, _callee7);
|
|
974
1091
|
}));
|
|
975
1092
|
return _loadMoldingSvg.apply(this, arguments);
|
|
976
1093
|
}
|
|
@@ -999,86 +1116,161 @@ function setFinishing(props, state, payload) {
|
|
|
999
1116
|
break;
|
|
1000
1117
|
}
|
|
1001
1118
|
}
|
|
1002
|
-
function
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1119
|
+
function moveAndRotatePan2D3D(eventType, props, payload, state) {
|
|
1120
|
+
if (eventType === EXTERNAL_EVENT_MOVE_PAN) {
|
|
1121
|
+
var moveType = payload.moveType,
|
|
1122
|
+
moveValue = payload.moveValue;
|
|
1123
|
+
var value = state.getIn(['viewer2D']).toJS();
|
|
1124
|
+
if (state.mode === MODE_IDLE) {
|
|
1125
|
+
switch (moveType) {
|
|
1126
|
+
case TOP:
|
|
1127
|
+
value.f -= moveValue;
|
|
1128
|
+
break;
|
|
1129
|
+
case BOTTOM:
|
|
1130
|
+
value.f += moveValue;
|
|
1131
|
+
break;
|
|
1132
|
+
case RIGHT:
|
|
1133
|
+
value.e += moveValue;
|
|
1134
|
+
break;
|
|
1135
|
+
case LEFT:
|
|
1136
|
+
value.e -= moveValue;
|
|
1137
|
+
break;
|
|
1138
|
+
}
|
|
1139
|
+
updateViwer2D(value, props.viewer2DActions);
|
|
1140
|
+
} else if (state.mode === MODE_IDLE_3D) {
|
|
1141
|
+
switch (moveType) {
|
|
1142
|
+
case TOP:
|
|
1143
|
+
window.interval = setTimeout(function () {
|
|
1144
|
+
window.tDKeyDown({
|
|
1145
|
+
keyCode: 38
|
|
1146
|
+
});
|
|
1147
|
+
}, 50);
|
|
1148
|
+
break;
|
|
1149
|
+
case BOTTOM:
|
|
1150
|
+
window.interval = setTimeout(function () {
|
|
1151
|
+
window.tDKeyDown({
|
|
1152
|
+
keyCode: 40
|
|
1153
|
+
});
|
|
1154
|
+
}, 50);
|
|
1155
|
+
break;
|
|
1156
|
+
case RIGHT:
|
|
1157
|
+
window.interval = setTimeout(function () {
|
|
1158
|
+
window.tDKeyDown({
|
|
1159
|
+
keyCode: 37
|
|
1160
|
+
});
|
|
1161
|
+
}, 50);
|
|
1162
|
+
break;
|
|
1163
|
+
case LEFT:
|
|
1164
|
+
window.interval = setTimeout(function () {
|
|
1165
|
+
window.tDKeyDown({
|
|
1166
|
+
keyCode: 39
|
|
1167
|
+
});
|
|
1168
|
+
}, 50);
|
|
1169
|
+
break;
|
|
1170
|
+
}
|
|
1020
1171
|
}
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
switch (
|
|
1172
|
+
} else if (eventType === EXTERNAL_EVENT_ROTATE_PAN) {
|
|
1173
|
+
var rotateType = payload.rotateType;
|
|
1174
|
+
switch (rotateType) {
|
|
1024
1175
|
case TOP:
|
|
1025
1176
|
window.interval = setTimeout(function () {
|
|
1026
|
-
window.
|
|
1027
|
-
keyCode:
|
|
1177
|
+
window.SPKeyDown({
|
|
1178
|
+
keyCode: 87
|
|
1028
1179
|
});
|
|
1029
1180
|
}, 50);
|
|
1030
1181
|
break;
|
|
1031
1182
|
case BOTTOM:
|
|
1032
1183
|
window.interval = setTimeout(function () {
|
|
1033
|
-
window.
|
|
1034
|
-
keyCode:
|
|
1184
|
+
window.SPKeyDown({
|
|
1185
|
+
keyCode: 83
|
|
1035
1186
|
});
|
|
1036
1187
|
}, 50);
|
|
1037
1188
|
break;
|
|
1038
1189
|
case RIGHT:
|
|
1039
1190
|
window.interval = setTimeout(function () {
|
|
1040
|
-
window.
|
|
1041
|
-
keyCode:
|
|
1191
|
+
window.SPKeyDown({
|
|
1192
|
+
keyCode: 68
|
|
1042
1193
|
});
|
|
1043
1194
|
}, 50);
|
|
1044
1195
|
break;
|
|
1045
1196
|
case LEFT:
|
|
1046
1197
|
window.interval = setTimeout(function () {
|
|
1047
|
-
window.
|
|
1048
|
-
keyCode:
|
|
1198
|
+
window.SPKeyDown({
|
|
1199
|
+
keyCode: 65
|
|
1049
1200
|
});
|
|
1050
1201
|
}, 50);
|
|
1051
1202
|
break;
|
|
1052
1203
|
}
|
|
1053
1204
|
}
|
|
1054
1205
|
}
|
|
1206
|
+
function mergeSameElements(projectItemsCatalog) {
|
|
1207
|
+
var result = [];
|
|
1208
|
+
var _loop = function _loop(i) {
|
|
1209
|
+
var idx = result.findIndex(function (v) {
|
|
1210
|
+
return v.itemID === projectItemsCatalog[i].itemID;
|
|
1211
|
+
});
|
|
1212
|
+
if (idx < 0) result.push(projectItemsCatalog[i]);else {
|
|
1213
|
+
var _loop2 = function _loop2(j) {
|
|
1214
|
+
var _result$idx$structure, _result$idx$structure2;
|
|
1215
|
+
var idx2 = (_result$idx$structure = result[idx].structure_json) === null || _result$idx$structure === void 0 || (_result$idx$structure = _result$idx$structure.tempPlaceholders) === null || _result$idx$structure === void 0 ? void 0 : _result$idx$structure.findIndex(function (v) {
|
|
1216
|
+
return v.id === projectItemsCatalog[i].structure_json.tempPlaceholders[j].id;
|
|
1217
|
+
});
|
|
1218
|
+
if (idx2 < 0) (_result$idx$structure2 = result[idx].structure_json) === null || _result$idx$structure2 === void 0 || (_result$idx$structure2 = _result$idx$structure2.tempPlaceholders) === null || _result$idx$structure2 === void 0 || _result$idx$structure2.push(projectItemsCatalog[i].structure_json.tempPlaceholders[j]);else result[idx].structure_json.tempPlaceholders[idx2] = projectItemsCatalog[i].structure_json.tempPlaceholders[j];
|
|
1219
|
+
};
|
|
1220
|
+
for (var j = 0; j < ((_projectItemsCatalog$ = projectItemsCatalog[i].structure_json) === null || _projectItemsCatalog$ === void 0 || (_projectItemsCatalog$ = _projectItemsCatalog$.tempPlaceholders) === null || _projectItemsCatalog$ === void 0 ? void 0 : _projectItemsCatalog$.length); j++) {
|
|
1221
|
+
var _projectItemsCatalog$;
|
|
1222
|
+
_loop2(j);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
};
|
|
1226
|
+
for (var i = 0; i < (projectItemsCatalog === null || projectItemsCatalog === void 0 ? void 0 : projectItemsCatalog.length); i++) {
|
|
1227
|
+
_loop(i);
|
|
1228
|
+
}
|
|
1229
|
+
return result;
|
|
1230
|
+
}
|
|
1055
1231
|
export function handleExternalEvent(_x10) {
|
|
1056
1232
|
return _handleExternalEvent.apply(this, arguments);
|
|
1057
1233
|
}
|
|
1058
1234
|
function _handleExternalEvent() {
|
|
1059
|
-
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1235
|
+
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(props) {
|
|
1060
1236
|
var _evt$payload3, _evt$payload4;
|
|
1061
|
-
var evt, state, _evt$payload, cdsItems, itemKeys,
|
|
1062
|
-
return _regeneratorRuntime.wrap(function (
|
|
1063
|
-
while (1) switch (
|
|
1237
|
+
var evt, state, layerId, layer, _evt$payload, cdsItems, itemKeys, _loop6, i, newScene, _props$onInternalEven, sLineCnt, element, _state$viewer2D, _evt$payload$initialP, mouseX, mouseY, v2d, vPosX, vPosY, layerID, defaulTitle, _Object$keys, _evt$payload5, doorStyle, itemCDS, isAll, _layerId, _cdsItems, allItems, selectedItemId, _itemKeys, _loop7, _i2, _props$onInternalEven2, _evt$payload6, roomShapeType, width, height, _doorStyle, value, _value, _evt$payload7, moldingInfo, isGlobal, distElement, _distElement, _evt$payload8, option, _value2, _layerId2, _layer, _layer$getIn, selectedLines, selectedHoles, selectedItems, _i4, _i5, _i6, _evt$payload9, _evt$payload0, _evt$payload1, _evt$payload10, _layerID, _layer2, orginalItemInfo, originalItem, originalItemPos, replaceItem, _props$onInternalEven3, sceneData, currentTexture, _t5, _t6;
|
|
1238
|
+
return _regeneratorRuntime.wrap(function (_context11) {
|
|
1239
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1064
1240
|
case 0:
|
|
1065
|
-
// console.log('***external event****', props);
|
|
1241
|
+
// console.log('***external event****', props.externalEvent);
|
|
1066
1242
|
evt = props.externalEvent;
|
|
1067
|
-
state = props
|
|
1243
|
+
state = getPlannerStateFromProps(props);
|
|
1244
|
+
if (state) {
|
|
1245
|
+
_context11.next = 1;
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
1248
|
+
return _context11.abrupt("return");
|
|
1249
|
+
case 1:
|
|
1250
|
+
layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1251
|
+
layer = state.getIn(['scene', 'layers', layerId]);
|
|
1068
1252
|
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
1069
|
-
|
|
1253
|
+
_context11.next = _t5 === EXTERNAL_EVENT_LOAD_PROJECT ? 2 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_3D ? 7 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_2D ? 8 : _t5 === EXTERNAL_EVENT_TOGGLE_TO_ELEVATION ? 9 : _t5 === EXTERNAL_EVENT_ADD_WALL ? 10 : _t5 === EXTERNAL_EVENT_ADD_ITEM ? 11 : _t5 === EXTERNAL_EVENT_ADD_HOLE ? 14 : _t5 === EXTERNAL_EVENT_ROTATE_PAN ? 15 : _t5 === EXTERNAL_EVENT_MOVE_PAN ? 15 : _t5 === EXTERNAL_EVENT_NEW_PROJECT ? 16 : _t5 === EXTERNAL_EVENT_CHANGE_DOORSTYLE ? 17 : _t5 === EXTERNAL_EVENT_ADD_ROOM_SHAPE ? 21 : _t5 === EXTERNAL_EVENT_ZOOM_IN ? 22 : _t5 === EXTERNAL_EVENT_ZOOM_OUT ? 23 : _t5 === EXTERNAL_EVENT_CENTERING_2D ? 24 : _t5 === EXTERNAL_EVENT_UNDO ? 25 : _t5 === EXTERNAL_EVENT_REDO ? 26 : _t5 === EXTERNAL_EVENT_SET_MOLDING ? 27 : _t5 === EXTERNAL_EVENT_DUPLICATE_ELEMENT ? 29 : _t5 === EXTERNAL_EVENT_DELETE_ELEMENT ? 30 : _t5 === EXTERNAL_EVENT_PROJECT_SETTING ? 31 : _t5 === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? 40 : _t5 === EXTERNAL_EVENT_UPDATE_PROPERTY ? 40 : _t5 === EXTERNAL_EVENT_REPLACE_CABINET ? 41 : _t5 === EXTERNAL_EVENT_SET_FINISHING ? 43 : _t5 === EXTERNAL_EVENT_SYNC_SCENE ? 44 : 45;
|
|
1070
1254
|
break;
|
|
1071
|
-
case
|
|
1255
|
+
case 2:
|
|
1256
|
+
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1257
|
+
_context11.next = 6;
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1072
1260
|
// prepare item data request
|
|
1073
1261
|
cdsItems = [];
|
|
1074
1262
|
itemKeys = Object.keys(evt === null || evt === void 0 || (_evt$payload = evt.payload) === null || _evt$payload === void 0 || (_evt$payload = _evt$payload.layers['layer-1']) === null || _evt$payload === void 0 ? void 0 : _evt$payload.items) || [];
|
|
1075
|
-
|
|
1076
|
-
var _evt$payload2, _it$doorStyle2;
|
|
1263
|
+
_loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
|
|
1264
|
+
var _evt$payload2, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
|
|
1077
1265
|
var it;
|
|
1078
|
-
return _regeneratorRuntime.wrap(function (
|
|
1079
|
-
while (1) switch (
|
|
1266
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1267
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
1080
1268
|
case 0:
|
|
1081
|
-
it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]];
|
|
1269
|
+
it = evt === null || evt === void 0 || (_evt$payload2 = evt.payload) === null || _evt$payload2 === void 0 || (_evt$payload2 = _evt$payload2.layers['layer-1']) === null || _evt$payload2 === void 0 ? void 0 : _evt$payload2.items[itemKeys[i]]; //////// check altitude of item property and change length from _length (convert length from 'in' fo 'cm')
|
|
1270
|
+
if (it !== null && it !== void 0 && (_it$properties = it.properties) !== null && _it$properties !== void 0 && (_it$properties = _it$properties.altitude) !== null && _it$properties !== void 0 && _it$properties.length && it !== null && it !== void 0 && (_it$properties2 = it.properties) !== null && _it$properties2 !== void 0 && (_it$properties2 = _it$properties2.altitude) !== null && _it$properties2 !== void 0 && _it$properties2._unit && it !== null && it !== void 0 && (_it$properties3 = it.properties) !== null && _it$properties3 !== void 0 && (_it$properties3 = _it$properties3.altitude) !== null && _it$properties3 !== void 0 && _it$properties3._length && it.properties.altitude.length !== convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm')) {
|
|
1271
|
+
it.properties.altitude.length = convert(it.properties.altitude._length).from(it.properties.altitude._unit).to('cm');
|
|
1272
|
+
}
|
|
1273
|
+
/////////
|
|
1082
1274
|
if (!cdsItems.some(function (v) {
|
|
1083
1275
|
var _it$doorStyle;
|
|
1084
1276
|
return it.itemID === v.itemID && it.name === v.name && ((_it$doorStyle = it.doorStyle) === null || _it$doorStyle === void 0 || (_it$doorStyle = _it$doorStyle.doorStyles) === null || _it$doorStyle === void 0 ? void 0 : _it$doorStyle.cabinet_door_style_id) === v.cdsId;
|
|
@@ -1093,22 +1285,26 @@ function _handleExternalEvent() {
|
|
|
1093
1285
|
});
|
|
1094
1286
|
case 1:
|
|
1095
1287
|
case "end":
|
|
1096
|
-
return
|
|
1288
|
+
return _context0.stop();
|
|
1097
1289
|
}
|
|
1098
|
-
},
|
|
1290
|
+
}, _loop6);
|
|
1099
1291
|
});
|
|
1100
1292
|
i = 0;
|
|
1101
|
-
case
|
|
1293
|
+
case 3:
|
|
1102
1294
|
if (!(i < itemKeys.length)) {
|
|
1103
|
-
|
|
1295
|
+
_context11.next = 5;
|
|
1104
1296
|
break;
|
|
1105
1297
|
}
|
|
1106
|
-
return
|
|
1107
|
-
case
|
|
1298
|
+
return _context11.delegateYield(_loop6(), "t0", 4);
|
|
1299
|
+
case 4:
|
|
1108
1300
|
i++;
|
|
1109
|
-
|
|
1301
|
+
_context11.next = 3;
|
|
1110
1302
|
break;
|
|
1111
|
-
case
|
|
1303
|
+
case 5:
|
|
1304
|
+
newScene = new Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1305
|
+
state = new State({
|
|
1306
|
+
scene: newScene.toJS()
|
|
1307
|
+
});
|
|
1112
1308
|
// request item catalog data to host app
|
|
1113
1309
|
if (cdsItems.length > 0) {
|
|
1114
1310
|
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
@@ -1117,62 +1313,65 @@ function _handleExternalEvent() {
|
|
|
1117
1313
|
cdsItems: cdsItems
|
|
1118
1314
|
}
|
|
1119
1315
|
}, /*#__PURE__*/function () {
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
return _regeneratorRuntime.wrap(function (
|
|
1123
|
-
while (1) switch (
|
|
1316
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(result) {
|
|
1317
|
+
var rt, _i;
|
|
1318
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
1319
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1124
1320
|
case 0:
|
|
1321
|
+
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
1125
1322
|
_i = 0;
|
|
1126
1323
|
case 1:
|
|
1127
|
-
if (!(_i < (
|
|
1128
|
-
|
|
1324
|
+
if (!(_i < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1325
|
+
_context9.next = 3;
|
|
1129
1326
|
break;
|
|
1130
1327
|
}
|
|
1131
|
-
|
|
1132
|
-
return addItemToCatalog(
|
|
1328
|
+
_context9.next = 2;
|
|
1329
|
+
return addItemToCatalog(rt[_i], state, props.catalog, props.projectActions);
|
|
1133
1330
|
case 2:
|
|
1134
1331
|
_i++;
|
|
1135
|
-
|
|
1332
|
+
_context9.next = 1;
|
|
1136
1333
|
break;
|
|
1137
1334
|
case 3:
|
|
1138
1335
|
props.projectActions.loadProject(evt.payload);
|
|
1139
1336
|
case 4:
|
|
1140
1337
|
case "end":
|
|
1141
|
-
return
|
|
1338
|
+
return _context9.stop();
|
|
1142
1339
|
}
|
|
1143
|
-
},
|
|
1340
|
+
}, _callee8);
|
|
1144
1341
|
}));
|
|
1145
1342
|
return function (_x11) {
|
|
1146
|
-
return
|
|
1343
|
+
return _ref3.apply(this, arguments);
|
|
1147
1344
|
};
|
|
1148
1345
|
}());
|
|
1149
|
-
}
|
|
1150
|
-
return _context1.abrupt("continue", 35);
|
|
1151
|
-
case 5:
|
|
1152
|
-
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1153
|
-
return _context1.abrupt("continue", 35);
|
|
1346
|
+
} else props.projectActions.loadProject(evt.payload);
|
|
1154
1347
|
case 6:
|
|
1155
|
-
|
|
1156
|
-
return _context1.abrupt("continue", 35);
|
|
1348
|
+
return _context11.abrupt("continue", 45);
|
|
1157
1349
|
case 7:
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
return
|
|
1350
|
+
props.projectActions.unselectAll();
|
|
1351
|
+
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1352
|
+
return _context11.abrupt("continue", 45);
|
|
1161
1353
|
case 8:
|
|
1354
|
+
props.projectActions.setMode(MODE_IDLE);
|
|
1355
|
+
return _context11.abrupt("continue", 45);
|
|
1356
|
+
case 9:
|
|
1357
|
+
sLineCnt = layer.selected.lines.size;
|
|
1358
|
+
if (sLineCnt > 0) props.projectActions.setMode(MODE_ELEVATION_VIEW);
|
|
1359
|
+
return _context11.abrupt("continue", 45);
|
|
1360
|
+
case 10:
|
|
1162
1361
|
if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1163
1362
|
props.projectActions.setMode(MODE_IDLE);
|
|
1164
1363
|
props.linesActions.selectToolDrawingLine('wall');
|
|
1165
1364
|
}
|
|
1166
|
-
return
|
|
1167
|
-
case
|
|
1365
|
+
return _context11.abrupt("continue", 45);
|
|
1366
|
+
case 11:
|
|
1168
1367
|
if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1169
|
-
|
|
1368
|
+
_context11.next = 13;
|
|
1170
1369
|
break;
|
|
1171
1370
|
}
|
|
1172
1371
|
element = evt.payload;
|
|
1173
|
-
|
|
1372
|
+
_context11.next = 12;
|
|
1174
1373
|
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1175
|
-
case
|
|
1374
|
+
case 12:
|
|
1176
1375
|
// start drawing item
|
|
1177
1376
|
if (ARRAY_3D_MODES.includes(state.mode)) {
|
|
1178
1377
|
// in 3d view
|
|
@@ -1193,38 +1392,38 @@ function _handleExternalEvent() {
|
|
|
1193
1392
|
}
|
|
1194
1393
|
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1195
1394
|
props.projectActions.setIsCabinetDrawing(true);
|
|
1196
|
-
case 11:
|
|
1197
|
-
return _context1.abrupt("continue", 35);
|
|
1198
|
-
case 12:
|
|
1199
|
-
ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName);
|
|
1200
|
-
return _context1.abrupt("continue", 35);
|
|
1201
1395
|
case 13:
|
|
1202
|
-
|
|
1203
|
-
return _context1.abrupt("continue", 35);
|
|
1396
|
+
return _context11.abrupt("continue", 45);
|
|
1204
1397
|
case 14:
|
|
1398
|
+
ARRAY_3D_MODES.includes(state.mode) ? props.holesActions.selectToolDrawingHole3D(evt === null || evt === void 0 || (_evt$payload3 = evt.payload) === null || _evt$payload3 === void 0 ? void 0 : _evt$payload3.holeName) : props.holesActions.selectToolDrawingHole(evt === null || evt === void 0 || (_evt$payload4 = evt.payload) === null || _evt$payload4 === void 0 ? void 0 : _evt$payload4.holeName);
|
|
1399
|
+
return _context11.abrupt("continue", 45);
|
|
1400
|
+
case 15:
|
|
1401
|
+
moveAndRotatePan2D3D(evt.type, props, evt.payload, state);
|
|
1402
|
+
return _context11.abrupt("continue", 45);
|
|
1403
|
+
case 16:
|
|
1205
1404
|
defaulTitle = 'Untitle';
|
|
1206
1405
|
props.projectActions.newProject();
|
|
1207
1406
|
props.projectActions.rename(defaulTitle);
|
|
1208
|
-
return
|
|
1209
|
-
case
|
|
1407
|
+
return _context11.abrupt("continue", 45);
|
|
1408
|
+
case 17:
|
|
1210
1409
|
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1211
|
-
|
|
1410
|
+
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1212
1411
|
_cdsItems = [];
|
|
1213
|
-
allItems = state.getIn(['scene', 'layers',
|
|
1214
|
-
selectedItemId = state.getIn(['scene', 'layers',
|
|
1412
|
+
allItems = state.getIn(['scene', 'layers', _layerId, 'items']).toJS();
|
|
1413
|
+
selectedItemId = state.getIn(['scene', 'layers', _layerId]).selected.items.toJS()[0];
|
|
1215
1414
|
_itemKeys = isAll ? (_Object$keys = Object.keys(allItems)) !== null && _Object$keys !== void 0 ? _Object$keys : [] : [selectedItemId];
|
|
1216
|
-
|
|
1415
|
+
_loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
|
|
1217
1416
|
var _itemCDS$find;
|
|
1218
1417
|
var item, cdsId;
|
|
1219
|
-
return _regeneratorRuntime.wrap(function (
|
|
1220
|
-
while (1) switch (
|
|
1418
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1419
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1221
1420
|
case 0:
|
|
1222
1421
|
item = allItems[_itemKeys[_i2]];
|
|
1223
1422
|
cdsId = (_itemCDS$find = itemCDS.find(function (itCDS) {
|
|
1224
1423
|
return itCDS.itemID === item.itemID;
|
|
1225
1424
|
})) === null || _itemCDS$find === void 0 ? void 0 : _itemCDS$find.cabinet_door_style_id;
|
|
1226
1425
|
if (cdsId && !_cdsItems.some(function (v) {
|
|
1227
|
-
return
|
|
1426
|
+
return item.itemID === v.itemID && item.name === v.name && cdsId === v.cdsId;
|
|
1228
1427
|
})) _cdsItems.push({
|
|
1229
1428
|
itemID: item.itemID,
|
|
1230
1429
|
prototype: item.prototype,
|
|
@@ -1236,22 +1435,22 @@ function _handleExternalEvent() {
|
|
|
1236
1435
|
});
|
|
1237
1436
|
case 1:
|
|
1238
1437
|
case "end":
|
|
1239
|
-
return
|
|
1438
|
+
return _context10.stop();
|
|
1240
1439
|
}
|
|
1241
|
-
},
|
|
1440
|
+
}, _loop7);
|
|
1242
1441
|
});
|
|
1243
1442
|
_i2 = 0;
|
|
1244
|
-
case
|
|
1443
|
+
case 18:
|
|
1245
1444
|
if (!(_i2 < _itemKeys.length)) {
|
|
1246
|
-
|
|
1445
|
+
_context11.next = 20;
|
|
1247
1446
|
break;
|
|
1248
1447
|
}
|
|
1249
|
-
return
|
|
1250
|
-
case
|
|
1448
|
+
return _context11.delegateYield(_loop7(), "t1", 19);
|
|
1449
|
+
case 19:
|
|
1251
1450
|
_i2++;
|
|
1252
|
-
|
|
1451
|
+
_context11.next = 18;
|
|
1253
1452
|
break;
|
|
1254
|
-
case
|
|
1453
|
+
case 20:
|
|
1255
1454
|
// request item catalog data to host app
|
|
1256
1455
|
if (_cdsItems.length > 0) {
|
|
1257
1456
|
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
@@ -1260,112 +1459,129 @@ function _handleExternalEvent() {
|
|
|
1260
1459
|
cdsItems: _cdsItems
|
|
1261
1460
|
}
|
|
1262
1461
|
}, /*#__PURE__*/function () {
|
|
1263
|
-
var
|
|
1264
|
-
var
|
|
1265
|
-
return _regeneratorRuntime.wrap(function (
|
|
1266
|
-
while (1) switch (
|
|
1462
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(result) {
|
|
1463
|
+
var rt, _i3;
|
|
1464
|
+
return _regeneratorRuntime.wrap(function (_context1) {
|
|
1465
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
1267
1466
|
case 0:
|
|
1467
|
+
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
1268
1468
|
_i3 = 0;
|
|
1269
1469
|
case 1:
|
|
1270
|
-
if (!(_i3 < (
|
|
1271
|
-
|
|
1470
|
+
if (!(_i3 < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1471
|
+
_context1.next = 3;
|
|
1272
1472
|
break;
|
|
1273
1473
|
}
|
|
1274
|
-
|
|
1275
|
-
return addItemToCatalog(
|
|
1474
|
+
_context1.next = 2;
|
|
1475
|
+
return addItemToCatalog(rt[_i3], state, props.catalog, props.projectActions);
|
|
1276
1476
|
case 2:
|
|
1277
1477
|
_i3++;
|
|
1278
|
-
|
|
1478
|
+
_context1.next = 1;
|
|
1279
1479
|
break;
|
|
1280
1480
|
case 3:
|
|
1281
1481
|
props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1282
1482
|
case 4:
|
|
1283
1483
|
case "end":
|
|
1284
|
-
return
|
|
1484
|
+
return _context1.stop();
|
|
1285
1485
|
}
|
|
1286
|
-
},
|
|
1486
|
+
}, _callee9);
|
|
1287
1487
|
}));
|
|
1288
1488
|
return function (_x12) {
|
|
1289
|
-
return
|
|
1489
|
+
return _ref4.apply(this, arguments);
|
|
1290
1490
|
};
|
|
1291
1491
|
}());
|
|
1292
1492
|
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1293
|
-
return
|
|
1294
|
-
case
|
|
1493
|
+
return _context11.abrupt("continue", 45);
|
|
1494
|
+
case 21:
|
|
1295
1495
|
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, _doorStyle = _evt$payload6.doorStyle;
|
|
1296
1496
|
props.projectActions.createRoomWithShape(roomShapeType, width, height, _doorStyle);
|
|
1297
|
-
return
|
|
1298
|
-
case
|
|
1497
|
+
return _context11.abrupt("continue", 45);
|
|
1498
|
+
case 22:
|
|
1299
1499
|
value = state.getIn(['viewer2D']).toJS();
|
|
1300
1500
|
value.a += 0.1;
|
|
1301
1501
|
value.d += 0.1;
|
|
1302
1502
|
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1303
1503
|
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1304
1504
|
updateViwer2D(value, props.viewer2DActions);
|
|
1305
|
-
return
|
|
1306
|
-
case
|
|
1505
|
+
return _context11.abrupt("continue", 45);
|
|
1506
|
+
case 23:
|
|
1307
1507
|
_value = state.getIn(['viewer2D']).toJS();
|
|
1308
1508
|
_value.a -= 0.1;
|
|
1309
1509
|
_value.d -= 0.1;
|
|
1310
1510
|
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1311
1511
|
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1312
1512
|
updateViwer2D(_value, props.viewer2DActions);
|
|
1313
|
-
return
|
|
1314
|
-
case
|
|
1513
|
+
return _context11.abrupt("continue", 45);
|
|
1514
|
+
case 24:
|
|
1315
1515
|
centering2D(state, props.viewer2DActions);
|
|
1316
|
-
return
|
|
1317
|
-
case
|
|
1516
|
+
return _context11.abrupt("continue", 45);
|
|
1517
|
+
case 25:
|
|
1318
1518
|
props.projectActions.undo();
|
|
1319
|
-
return
|
|
1320
|
-
case
|
|
1519
|
+
return _context11.abrupt("continue", 45);
|
|
1520
|
+
case 26:
|
|
1321
1521
|
props.projectActions.redo();
|
|
1322
|
-
return
|
|
1323
|
-
case
|
|
1522
|
+
return _context11.abrupt("continue", 45);
|
|
1523
|
+
case 27:
|
|
1324
1524
|
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1325
|
-
|
|
1525
|
+
_context11.next = 28;
|
|
1326
1526
|
return loadMoldingSvg(moldingInfo);
|
|
1327
|
-
case
|
|
1527
|
+
case 28:
|
|
1328
1528
|
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1329
|
-
return
|
|
1330
|
-
case
|
|
1529
|
+
return _context11.abrupt("continue", 45);
|
|
1530
|
+
case 29:
|
|
1331
1531
|
distElement = getElement(evt.payload, state);
|
|
1332
1532
|
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1333
|
-
return
|
|
1334
|
-
case
|
|
1533
|
+
return _context11.abrupt("continue", 45);
|
|
1534
|
+
case 30:
|
|
1335
1535
|
_distElement = getElement(evt.payload, state);
|
|
1336
1536
|
if (_distElement) props.projectActions.remove(_distElement);
|
|
1337
|
-
return
|
|
1338
|
-
case 29:
|
|
1339
|
-
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1340
|
-
if (option === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT) {
|
|
1341
|
-
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1342
|
-
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1343
|
-
} else if (option === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE) {
|
|
1344
|
-
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1345
|
-
} else if (option === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE) {
|
|
1346
|
-
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1347
|
-
} else if (option === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE) {
|
|
1348
|
-
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1349
|
-
} else if (option === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE) {
|
|
1350
|
-
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1351
|
-
}
|
|
1352
|
-
return _context1.abrupt("continue", 35);
|
|
1353
|
-
case 30:
|
|
1354
|
-
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1355
|
-
layer = state.getIn(['scene', 'layers', _layerId]);
|
|
1356
|
-
_layer$getIn = layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1357
|
-
for (_i4 = 0; _i4 < selectedLines.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, state, layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1358
|
-
for (_i5 = 0; _i5 < selectedHoles.size; _i5++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, state, layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1359
|
-
for (_i6 = 0; _i6 < selectedItems.size; _i6++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, state, layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1360
|
-
return _context1.abrupt("continue", 35);
|
|
1537
|
+
return _context11.abrupt("continue", 45);
|
|
1361
1538
|
case 31:
|
|
1539
|
+
_evt$payload8 = evt.payload, option = _evt$payload8.option, _value2 = _evt$payload8.value;
|
|
1540
|
+
_t6 = option;
|
|
1541
|
+
_context11.next = _t6 === PROJECT_SETTING_OPTION.CHANGE_MEASUREMENT_UNIT ? 32 : _t6 === PROJECT_SETTING_OPTION.UPDATE_CEIL_HEIGHT ? 33 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_LENGTH_MEASURE ? 34 : _t6 === PROJECT_SETTING_OPTION.CHANGE_BASE_CABINET_MEASURE ? 35 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WALL_CABINET_MEASURE ? 36 : _t6 === PROJECT_SETTING_OPTION.CHANGE_WINDOW_DOOR_MEASURE ? 37 : 38;
|
|
1542
|
+
break;
|
|
1543
|
+
case 32:
|
|
1544
|
+
props.viewer2DActions.updateCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1545
|
+
props.viewer2DActions.updateCeilHeightUnit(_value2);
|
|
1546
|
+
props.viewer3DActions.update3DCeilHeightUnit(_value2);
|
|
1547
|
+
props.viewer3DActions.update3DCeilHeight(convert(layer.ceilHeight).from(layer.unit).to(_value2));
|
|
1548
|
+
return _context11.abrupt("continue", 39);
|
|
1549
|
+
case 33:
|
|
1550
|
+
props.viewer2DActions.updateCeilHeight(_value2);
|
|
1551
|
+
props.viewer3DActions.update3DCeilHeight(_value2);
|
|
1552
|
+
return _context11.abrupt("continue", 39);
|
|
1553
|
+
case 34:
|
|
1554
|
+
props.viewer2DActions.changeWallLengthMeasure(_value2);
|
|
1555
|
+
return _context11.abrupt("continue", 39);
|
|
1556
|
+
case 35:
|
|
1557
|
+
props.viewer2DActions.changeBaseCabinetMeasure(_value2);
|
|
1558
|
+
return _context11.abrupt("continue", 39);
|
|
1559
|
+
case 36:
|
|
1560
|
+
props.viewer2DActions.changeWallCabinetMeasure(_value2);
|
|
1561
|
+
return _context11.abrupt("continue", 39);
|
|
1562
|
+
case 37:
|
|
1563
|
+
props.viewer2DActions.changeWindowDoorMeasure(_value2);
|
|
1564
|
+
return _context11.abrupt("continue", 39);
|
|
1565
|
+
case 38:
|
|
1566
|
+
return _context11.abrupt("continue", 39);
|
|
1567
|
+
case 39:
|
|
1568
|
+
return _context11.abrupt("continue", 45);
|
|
1569
|
+
case 40:
|
|
1570
|
+
_layerId2 = state.getIn(['scene', 'selectedLayer']);
|
|
1571
|
+
_layer = state.getIn(['scene', 'layers', _layerId2]);
|
|
1572
|
+
_layer$getIn = _layer.getIn(['selected']), selectedLines = _layer$getIn.lines, selectedHoles = _layer$getIn.holes, selectedItems = _layer$getIn.items;
|
|
1573
|
+
for (_i4 = 0; _i4 < selectedLines.size; _i4++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['lines', selectedLines.get(_i4)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1574
|
+
for (_i5 = 0; _i5 < selectedHoles.size; _i5++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['holes', selectedHoles.get(_i5)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1575
|
+
for (_i6 = 0; _i6 < selectedItems.size; _i6++) (evt === null || evt === void 0 ? void 0 : evt.type) === EXTERNAL_EVENT_UPDATE_ATTRIBUTE ? updateAttributeOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, state, _layer, props.catalog, props.projectActions, evt.callback) : updatePropertyOfSelectedElement(_layer.getIn(['items', selectedItems.get(_i6)]), evt.payload, props.catalog, props.projectActions, evt.callback);
|
|
1576
|
+
return _context11.abrupt("continue", 45);
|
|
1577
|
+
case 41:
|
|
1362
1578
|
_layerID = state.scene.selectedLayer;
|
|
1363
|
-
|
|
1579
|
+
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1364
1580
|
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1365
|
-
originalItem =
|
|
1366
|
-
|
|
1581
|
+
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1582
|
+
_context11.next = 42;
|
|
1367
1583
|
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1368
|
-
case
|
|
1584
|
+
case 42:
|
|
1369
1585
|
originalItemPos = {
|
|
1370
1586
|
rotation: originalItem.rotation,
|
|
1371
1587
|
selectedItemId: originalItem.id,
|
|
@@ -1380,23 +1596,27 @@ function _handleExternalEvent() {
|
|
|
1380
1596
|
}
|
|
1381
1597
|
};
|
|
1382
1598
|
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1383
|
-
return
|
|
1384
|
-
case
|
|
1599
|
+
return _context11.abrupt("continue", 45);
|
|
1600
|
+
case 43:
|
|
1385
1601
|
setFinishing(props, state, evt.payload);
|
|
1386
|
-
|
|
1602
|
+
return _context11.abrupt("continue", 45);
|
|
1603
|
+
case 44:
|
|
1604
|
+
sceneData = state.scene.toJS(); // get molding data for "ReviewForQuote"
|
|
1605
|
+
currentTexture = layer.doorStyle !== null || layer.doorStyle !== undefined ? layer.doorStyle : props.state.doorStyle.toJS();
|
|
1606
|
+
sceneData.layers[layerId].moldingData = getMoldingDataOfScene2(layer, props.catalog, currentTexture);
|
|
1387
1607
|
// send scene object from 3DTool to HostApp using internalEvent
|
|
1388
1608
|
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
1389
1609
|
type: INTERNAL_EVENT_SYNC_SCENE,
|
|
1390
1610
|
value: {
|
|
1391
|
-
scene:
|
|
1611
|
+
scene: sceneData
|
|
1392
1612
|
}
|
|
1393
1613
|
});
|
|
1394
|
-
return
|
|
1395
|
-
case
|
|
1614
|
+
return _context11.abrupt("continue", 45);
|
|
1615
|
+
case 45:
|
|
1396
1616
|
case "end":
|
|
1397
|
-
return
|
|
1617
|
+
return _context11.stop();
|
|
1398
1618
|
}
|
|
1399
|
-
},
|
|
1619
|
+
}, _callee0);
|
|
1400
1620
|
}));
|
|
1401
1621
|
return _handleExternalEvent.apply(this, arguments);
|
|
1402
1622
|
}
|