kitchen-simulator 5.10.1-react.18 → 5.10.2-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/es/index.js +3 -627
- package/es/index.js.LICENSE.txt +45 -0
- package/es/index.js.map +1 -0
- package/package.json +9 -5
- package/es/@history.js +0 -2
- package/es/AppContext.js +0 -6
- package/es/LiteKitchenConfigurator.js +0 -474
- package/es/LiteRenderer.js +0 -363
- package/es/WorkSpace.js +0 -851
- package/es/actions/area-actions.js +0 -14
- package/es/actions/export.js +0 -23
- package/es/actions/groups-actions.js +0 -89
- package/es/actions/holes-actions.js +0 -119
- package/es/actions/items-actions.js +0 -316
- package/es/actions/lines-actions.js +0 -83
- package/es/actions/project-actions.js +0 -298
- package/es/actions/scene-actions.js +0 -33
- package/es/actions/vertices-actions.js +0 -27
- package/es/actions/viewer2d-actions.js +0 -58
- package/es/actions/viewer3d-actions.js +0 -23
- package/es/assets/brown_photostudio_02_1k.hdr +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Black Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Black.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Bold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Bold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Book Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Book.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraBold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraBold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraLight Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard ExtraLight.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Hairline Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Hairline.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Heavy Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Heavy.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Light Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Light.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Medium Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Medium.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard SemiBold Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard SemiBold.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Thin Italic.woff +0 -0
- package/es/assets/fonts/Rene Bieder Milliard Thin.woff +0 -0
- package/es/assets/fonts/style.css +0 -177
- package/es/assets/gltf/door_closet.bin +0 -0
- package/es/assets/gltf/door_closet.fbx +0 -0
- package/es/assets/gltf/door_closet.gltf +0 -1
- package/es/assets/gltf/door_exterior.bin +0 -0
- package/es/assets/gltf/door_exterior.fbx +0 -0
- package/es/assets/gltf/door_exterior.gltf +0 -1
- package/es/assets/gltf/door_interior.bin +0 -0
- package/es/assets/gltf/door_interior.fbx +0 -0
- package/es/assets/gltf/door_interior.gltf +0 -1
- package/es/assets/gltf/door_sliding.bin +0 -0
- package/es/assets/gltf/door_sliding.fbx +0 -0
- package/es/assets/gltf/door_sliding.gltf +0 -1
- package/es/assets/gltf/doorway_framed.bin +0 -0
- package/es/assets/gltf/doorway_framed.fbx +0 -0
- package/es/assets/gltf/doorway_framed.gltf +0 -1
- package/es/assets/gltf/window_clear.bin +0 -0
- package/es/assets/gltf/window_clear.fbx +0 -0
- package/es/assets/gltf/window_clear.gltf +0 -1
- package/es/assets/gltf/window_cross.bin +0 -0
- package/es/assets/gltf/window_cross.fbx +0 -0
- package/es/assets/gltf/window_cross.gltf +0 -1
- package/es/assets/gltf/window_double_hung.bin +0 -0
- package/es/assets/gltf/window_double_hung.fbx +0 -0
- package/es/assets/gltf/window_double_hung.gltf +0 -1
- package/es/assets/gltf/window_vertical.bin +0 -0
- package/es/assets/gltf/window_vertical.fbx +0 -0
- package/es/assets/gltf/window_vertical.gltf +0 -1
- package/es/assets/img/TKC_thumbnail.png +0 -0
- package/es/assets/img/Toggle.png +0 -0
- package/es/assets/img/loading/loading.gif +0 -0
- package/es/assets/img/loading/loading_1.svg +0 -11
- package/es/assets/img/loading_large.gif +0 -0
- package/es/assets/img/png/door/closet.png +0 -0
- package/es/assets/img/png/door/doorwaysframed.png +0 -0
- package/es/assets/img/png/door/doorwaysframeles.png +0 -0
- package/es/assets/img/png/door/doorwaysframeless.png +0 -0
- package/es/assets/img/png/door/exterior.png +0 -0
- package/es/assets/img/png/door/interior.png +0 -0
- package/es/assets/img/png/door/sliding.png +0 -0
- package/es/assets/img/png/helper/outcome.png +0 -0
- package/es/assets/img/png/helper/video_preview_3d.png +0 -0
- package/es/assets/img/png/helper/video_preview_start.png +0 -0
- package/es/assets/img/project_img.png +0 -0
- package/es/assets/img/rta/rta_logo_box_blue.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_blue_ico.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_blue_ico.svg +0 -55
- package/es/assets/img/rta/rta_logo_box_darkGray.jpg +0 -0
- package/es/assets/img/rta/rta_logo_box_lightblue.png +0 -0
- package/es/assets/img/rta/rta_logo_box_lightmaroon.png +0 -0
- package/es/assets/img/rta/rta_logo_box_maroon.png +0 -0
- package/es/assets/img/rta/rta_logo_box_white.png +0 -0
- package/es/assets/img/rta_menu.png +0 -0
- package/es/assets/img/step2.jpg +0 -0
- package/es/assets/img/step3.jpg +0 -0
- package/es/assets/img/step4.jpg +0 -0
- package/es/assets/img/step5.jpg +0 -0
- package/es/assets/img/step6.jpg +0 -0
- package/es/assets/img/step7.jpg +0 -0
- package/es/assets/img/step8.jpg +0 -0
- package/es/assets/img/svg/2d_delete_object.svg +0 -33
- package/es/assets/img/svg/2d_delete_object1.svg +0 -33
- package/es/assets/img/svg/2d_lock_object.svg +0 -33
- package/es/assets/img/svg/3d_item_move.svg +0 -106
- package/es/assets/img/svg/3d_item_rotation.svg +0 -76
- package/es/assets/img/svg/3d_item_warning_edit.svg +0 -77
- package/es/assets/img/svg/3d_item_warning_info.svg +0 -81
- package/es/assets/img/svg/accessories.svg +0 -4
- package/es/assets/img/svg/angle_icon.svg +0 -39
- package/es/assets/img/svg/blank_div.svg +0 -14
- package/es/assets/img/svg/bottombar/2d3d_button.svg +0 -3
- package/es/assets/img/svg/bottombar/2d3d_button_active.svg +0 -3
- package/es/assets/img/svg/bottombar/2d3d_toggle.svg +0 -4
- package/es/assets/img/svg/bottombar/2d3d_toggle_active.svg +0 -4
- package/es/assets/img/svg/bottombar/arrow-down.svg +0 -3
- package/es/assets/img/svg/bottombar/arrow-left.svg +0 -3
- package/es/assets/img/svg/bottombar/arrow-minus.svg +0 -3
- package/es/assets/img/svg/bottombar/arrow-plus.svg +0 -11
- package/es/assets/img/svg/bottombar/arrow-right.svg +0 -3
- package/es/assets/img/svg/bottombar/arrow-up.svg +0 -3
- package/es/assets/img/svg/bottombar/collapse.svg +0 -3
- package/es/assets/img/svg/bottombar/elevation-back.svg +0 -6
- package/es/assets/img/svg/bottombar/elevation-front.svg +0 -6
- package/es/assets/img/svg/bottombar/elevation-left.svg +0 -6
- package/es/assets/img/svg/bottombar/elevation-right.svg +0 -7
- package/es/assets/img/svg/bottombar/elevation.svg +0 -13
- package/es/assets/img/svg/bottombar/expand.svg +0 -3
- package/es/assets/img/svg/bottombar/help.svg +0 -72
- package/es/assets/img/svg/bottombar/incm_toggle.svg +0 -39
- package/es/assets/img/svg/bottombar/pan_1.svg +0 -57
- package/es/assets/img/svg/bottombar/pan_2.svg +0 -27
- package/es/assets/img/svg/bottombar/pan_3.svg +0 -27
- package/es/assets/img/svg/bottombar/pan_4.svg +0 -27
- package/es/assets/img/svg/bottombar/pan_5.svg +0 -27
- package/es/assets/img/svg/bottombar/settings.svg +0 -23
- package/es/assets/img/svg/bottombar/spin-down.svg +0 -76
- package/es/assets/img/svg/bottombar/spin-left.svg +0 -75
- package/es/assets/img/svg/bottombar/spin-right.svg +0 -75
- package/es/assets/img/svg/bottombar/spin-up.svg +0 -76
- package/es/assets/img/svg/bottombar/spin_1.svg +0 -48
- package/es/assets/img/svg/bottombar/spin_2.svg +0 -31
- package/es/assets/img/svg/bottombar/spin_3.svg +0 -31
- package/es/assets/img/svg/bottombar/spin_4.svg +0 -31
- package/es/assets/img/svg/bottombar/spin_5.svg +0 -31
- package/es/assets/img/svg/bottombar/zoomin.svg +0 -29
- package/es/assets/img/svg/bottombar/zoomout.svg +0 -26
- package/es/assets/img/svg/check.svg +0 -10
- package/es/assets/img/svg/close.svg +0 -11
- package/es/assets/img/svg/color/Black.svg +0 -3
- package/es/assets/img/svg/color/Blue.svg +0 -3
- package/es/assets/img/svg/color/Brown.svg +0 -9
- package/es/assets/img/svg/color/Cream.svg +0 -3
- package/es/assets/img/svg/color/Dark.svg +0 -9
- package/es/assets/img/svg/color/Gray.svg +0 -3
- package/es/assets/img/svg/color/Green.svg +0 -3
- package/es/assets/img/svg/color/Light.svg +0 -9
- package/es/assets/img/svg/color/Medium.svg +0 -9
- package/es/assets/img/svg/color/Unfinished.svg +0 -9
- package/es/assets/img/svg/color/White.svg +0 -3
- package/es/assets/img/svg/color/White.svg.bak +0 -3
- package/es/assets/img/svg/color/stone2.jpg +0 -0
- package/es/assets/img/svg/color/wood2.jpg +0 -0
- package/es/assets/img/svg/copy.svg +0 -11
- package/es/assets/img/svg/delete.svg +0 -3
- package/es/assets/img/svg/detail.svg +0 -77
- package/es/assets/img/svg/disclaimer/background.svg +0 -758
- package/es/assets/img/svg/disclaimer/logo-dots.svg +0 -11
- package/es/assets/img/svg/door/Closet.svg +0 -11
- package/es/assets/img/svg/door/Exterior.svg +0 -5
- package/es/assets/img/svg/door/Framed_dorway.svg +0 -5
- package/es/assets/img/svg/door/Frameless_dorway.svg +0 -5
- package/es/assets/img/svg/door/Interior.svg +0 -7
- package/es/assets/img/svg/door/Sliding.svg +0 -5
- package/es/assets/img/svg/doors_closet.svg +0 -47
- package/es/assets/img/svg/doors_exterior.svg +0 -25
- package/es/assets/img/svg/doors_interior.svg +0 -29
- package/es/assets/img/svg/doors_patio.svg +0 -26
- package/es/assets/img/svg/duplicate.svg +0 -11
- package/es/assets/img/svg/duplicate_object_left.svg +0 -32
- package/es/assets/img/svg/duplicate_object_right.svg +0 -32
- package/es/assets/img/svg/filtersActive.svg +0 -19
- package/es/assets/img/svg/firstsetting/L.svg +0 -3
- package/es/assets/img/svg/firstsetting/L2.svg +0 -3
- package/es/assets/img/svg/firstsetting/Open.svg +0 -3
- package/es/assets/img/svg/firstsetting/Square.svg +0 -3
- package/es/assets/img/svg/firstsetting/bar-active.svg +0 -9
- package/es/assets/img/svg/firstsetting/bar-normal.svg +0 -3
- package/es/assets/img/svg/firstsetting/bullet-current.svg +0 -3
- package/es/assets/img/svg/firstsetting/bullet-done.svg +0 -3
- package/es/assets/img/svg/firstsetting/bullet-not-done.svg +0 -3
- package/es/assets/img/svg/firstsetting/check-active.svg +0 -3
- package/es/assets/img/svg/firstsetting/check-normal.svg +0 -3
- package/es/assets/img/svg/firstsetting/pencil.svg +0 -11
- package/es/assets/img/svg/green_checkmark.svg +0 -27
- package/es/assets/img/svg/headerbar/assist.svg +0 -3
- package/es/assets/img/svg/headerbar/cart.svg +0 -3
- package/es/assets/img/svg/headerbar/check.svg +0 -10
- package/es/assets/img/svg/headerbar/consult_designer.svg +0 -45
- package/es/assets/img/svg/headerbar/edit_name.svg +0 -26
- package/es/assets/img/svg/headerbar/file-dollar.svg +0 -13
- package/es/assets/img/svg/headerbar/hamburger_menu.svg +0 -32
- package/es/assets/img/svg/headerbar/plus.svg +0 -11
- package/es/assets/img/svg/headerbar/review_quote.svg +0 -44
- package/es/assets/img/svg/headerbar/ruler-measure.svg +0 -11
- package/es/assets/img/svg/headerbar/save.svg +0 -3
- package/es/assets/img/svg/headerbar/setting.svg +0 -75
- package/es/assets/img/svg/help/check.svg +0 -10
- package/es/assets/img/svg/help/search.svg +0 -76
- package/es/assets/img/svg/intro/1-start-with-floorplan-whole.svg +0 -27
- package/es/assets/img/svg/intro/1-start-with-floorplan.svg +0 -26
- package/es/assets/img/svg/intro/2-start-from-scratch-whole.svg +0 -28
- package/es/assets/img/svg/intro/2-start-from-scratch.svg +0 -27
- package/es/assets/img/svg/intro/3-retrieve-project-whole.svg +0 -19
- package/es/assets/img/svg/intro/3-retrieve-project.svg +0 -18
- package/es/assets/img/svg/invert.svg +0 -127
- package/es/assets/img/svg/lefttoolbar/appliance-active.svg +0 -13
- package/es/assets/img/svg/lefttoolbar/appliance.svg +0 -13
- package/es/assets/img/svg/lefttoolbar/cabinet-active.svg +0 -10
- package/es/assets/img/svg/lefttoolbar/cabinet-category.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/cabinet-one.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/cabinet.svg +0 -10
- package/es/assets/img/svg/lefttoolbar/disigner_assistance.svg +0 -89
- package/es/assets/img/svg/lefttoolbar/door-style-active.svg +0 -20
- package/es/assets/img/svg/lefttoolbar/door-style.svg +0 -20
- package/es/assets/img/svg/lefttoolbar/door.svg +0 -12
- package/es/assets/img/svg/lefttoolbar/error_icon.svg +0 -81
- package/es/assets/img/svg/lefttoolbar/finishing-active.svg +0 -13
- package/es/assets/img/svg/lefttoolbar/finishing.svg +0 -13
- package/es/assets/img/svg/lefttoolbar/reviewforquote-active.svg +0 -86
- package/es/assets/img/svg/lefttoolbar/reviewforquote.svg +0 -12
- package/es/assets/img/svg/lefttoolbar/room-shape-L.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/room-shape-active.svg +0 -18
- package/es/assets/img/svg/lefttoolbar/room-shape-custom.svg +0 -12
- package/es/assets/img/svg/lefttoolbar/room-shape-irregular.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/room-shape-open.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/room-shape-square.svg +0 -3
- package/es/assets/img/svg/lefttoolbar/room-shape.svg +0 -18
- package/es/assets/img/svg/lefttoolbar/search.svg +0 -76
- package/es/assets/img/svg/lefttoolbar/view_more.svg +0 -86
- package/es/assets/img/svg/lefttoolbar/warning_icon.svg +0 -81
- package/es/assets/img/svg/lefttoolbar/window.svg +0 -12
- package/es/assets/img/svg/logo.svg +0 -11
- package/es/assets/img/svg/logo_with_text.svg +0 -25
- package/es/assets/img/svg/menubar/login.svg +0 -84
- package/es/assets/img/svg/menubar/my_projects.svg +0 -85
- package/es/assets/img/svg/menubar/new_project.svg +0 -110
- package/es/assets/img/svg/menubar/save_project.svg +0 -84
- package/es/assets/img/svg/options.svg +0 -3
- package/es/assets/img/svg/positioning.svg +0 -3
- package/es/assets/img/svg/rotate.png +0 -0
- package/es/assets/img/svg/rotate.svg +0 -17
- package/es/assets/img/svg/rotate_object_clockwise.svg +0 -26
- package/es/assets/img/svg/rotate_object_counterclockwise.svg +0 -26
- package/es/assets/img/svg/toggleFilters.svg +0 -19
- package/es/assets/img/svg/toolbar/add_appliances_active.svg +0 -64
- package/es/assets/img/svg/toolbar/add_appliances_inactive.svg +0 -52
- package/es/assets/img/svg/toolbar/add_button.svg +0 -36
- package/es/assets/img/svg/toolbar/add_cabinets_active.svg +0 -59
- package/es/assets/img/svg/toolbar/add_cabinets_inactive.svg +0 -49
- package/es/assets/img/svg/toolbar/add_items_doors.svg +0 -25
- package/es/assets/img/svg/toolbar/add_items_doorways.svg +0 -24
- package/es/assets/img/svg/toolbar/add_items_refrigerator.svg +0 -32
- package/es/assets/img/svg/toolbar/add_items_windows.svg +0 -28
- package/es/assets/img/svg/toolbar/apply_button.svg +0 -38
- package/es/assets/img/svg/toolbar/arrow-plus.svg +0 -11
- package/es/assets/img/svg/toolbar/backsplash.svg +0 -8
- package/es/assets/img/svg/toolbar/cancel_button.svg +0 -37
- package/es/assets/img/svg/toolbar/consult_a_designer_button.svg +0 -47
- package/es/assets/img/svg/toolbar/countertop.svg +0 -7
- package/es/assets/img/svg/toolbar/dcm.png +0 -0
- package/es/assets/img/svg/toolbar/dcm_off.svg +0 -12
- package/es/assets/img/svg/toolbar/dcm_on.svg +0 -474
- package/es/assets/img/svg/toolbar/delete_button.svg +0 -37
- package/es/assets/img/svg/toolbar/download.svg +0 -77
- package/es/assets/img/svg/toolbar/draw_custom_floor.svg +0 -31
- package/es/assets/img/svg/toolbar/edit_button.svg +0 -75
- package/es/assets/img/svg/toolbar/email_quote_button.svg +0 -44
- package/es/assets/img/svg/toolbar/fbm.png +0 -0
- package/es/assets/img/svg/toolbar/finishing_touches_active.svg +0 -54
- package/es/assets/img/svg/toolbar/finishing_touches_inactive.svg +0 -42
- package/es/assets/img/svg/toolbar/floorstyle.svg +0 -9
- package/es/assets/img/svg/toolbar/fmb.png +0 -0
- package/es/assets/img/svg/toolbar/fmb_off.svg +0 -12
- package/es/assets/img/svg/toolbar/fmb_on.svg +0 -489
- package/es/assets/img/svg/toolbar/furnishings_icon.svg +0 -6
- package/es/assets/img/svg/toolbar/get_started_button.svg +0 -41
- package/es/assets/img/svg/toolbar/handles.svg +0 -5
- package/es/assets/img/svg/toolbar/lighting.svg +0 -7
- package/es/assets/img/svg/toolbar/lrm.png +0 -0
- package/es/assets/img/svg/toolbar/lrm_off.svg +0 -12
- package/es/assets/img/svg/toolbar/lrm_on.svg +0 -470
- package/es/assets/img/svg/toolbar/make_floorplan_active.svg +0 -66
- package/es/assets/img/svg/toolbar/make_floorplan_inactive.svg +0 -52
- package/es/assets/img/svg/toolbar/predefined_room_l_shaped.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_layout.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_long_narrow.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_open_l_shape.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_open_pentagon.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_open_rectangle.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_open_rectangle_2.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_pentagon.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_rectangle.svg +0 -20
- package/es/assets/img/svg/toolbar/predefined_room_rectangle_with_alcove.svg +0 -20
- package/es/assets/img/svg/toolbar/redo_button.svg +0 -75
- package/es/assets/img/svg/toolbar/redo_button1.svg +0 -75
- package/es/assets/img/svg/toolbar/review_quote_active.svg +0 -14
- package/es/assets/img/svg/toolbar/review_quote_inactive.svg +0 -44
- package/es/assets/img/svg/toolbar/save_project_button.svg +0 -44
- package/es/assets/img/svg/toolbar/select_doorstyle_active.svg +0 -67
- package/es/assets/img/svg/toolbar/select_doorstyle_inactive.svg +0 -57
- package/es/assets/img/svg/toolbar/shopping-cart.svg +0 -13
- package/es/assets/img/svg/toolbar/style_change_button.svg +0 -47
- package/es/assets/img/svg/toolbar/take_picture.svg +0 -75
- package/es/assets/img/svg/toolbar/undo_button.svg +0 -76
- package/es/assets/img/svg/toolbar/undo_button1.svg +0 -76
- package/es/assets/img/svg/toolbar/use_button.svg +0 -37
- package/es/assets/img/svg/toolbar/wall_color_icon.svg +0 -6
- package/es/assets/img/svg/topbar/edit_active.svg +0 -10
- package/es/assets/img/svg/topbar/edit_inactive.svg +0 -10
- package/es/assets/img/svg/topbar/redo_active.svg +0 -42
- package/es/assets/img/svg/topbar/redo_inactive.svg +0 -23
- package/es/assets/img/svg/topbar/select_all_active.svg +0 -50
- package/es/assets/img/svg/topbar/select_all_inactive.svg +0 -32
- package/es/assets/img/svg/topbar/take_picture_active.svg +0 -51
- package/es/assets/img/svg/topbar/take_picture_inactive.svg +0 -26
- package/es/assets/img/svg/topbar/undo_active.svg +0 -42
- package/es/assets/img/svg/topbar/undo_inactive.svg +0 -23
- package/es/assets/img/svg/warning_info_2d.svg +0 -81
- package/es/assets/img/svg/window/Clear.svg +0 -3
- package/es/assets/img/svg/window/Cross.svg +0 -5
- package/es/assets/img/svg/window/Double_hung.svg +0 -4
- package/es/assets/img/svg/window/Vertical.svg +0 -4
- package/es/assets/img/svg/windows_clear.svg +0 -23
- package/es/assets/img/svg/windows_cross.svg +0 -28
- package/es/assets/img/svg/windows_double_hung.svg +0 -24
- package/es/assets/img/svg/windows_vertical.svg +0 -24
- package/es/assets/img/svg/wizardstep/Custom.svg +0 -3
- package/es/assets/img/svg/wizardstep/Dashed_line.svg +0 -3
- package/es/assets/img/svg/wizardstep/L.svg +0 -3
- package/es/assets/img/svg/wizardstep/L2.svg +0 -3
- package/es/assets/img/svg/wizardstep/Open.svg +0 -3
- package/es/assets/img/svg/wizardstep/Square.svg +0 -3
- package/es/assets/img/svg/wizardstep/bar-active.svg +0 -9
- package/es/assets/img/svg/wizardstep/bar-normal.svg +0 -3
- package/es/assets/img/svg/wizardstep/bullet-current.svg +0 -3
- package/es/assets/img/svg/wizardstep/bullet-done.svg +0 -3
- package/es/assets/img/svg/wizardstep/bullet-not-done.svg +0 -3
- package/es/assets/img/svg/wizardstep/check-active.svg +0 -3
- package/es/assets/img/svg/wizardstep/check-normal.svg +0 -3
- package/es/assets/img/svg/wizardstep/detail_view.svg +0 -87
- package/es/assets/img/svg/wizardstep/pencil.svg +0 -11
- package/es/assets/img/svg/wizardstep/tile_view.svg +0 -95
- package/es/assets/img/texture/glass.jpg +0 -0
- package/es/assets/img/texture/steel.jpg +0 -0
- package/es/assets/img/texture/white1px.jpg +0 -0
- package/es/assets/img/texture/wood.jpg +0 -0
- package/es/assets/model/DCM.bin +0 -0
- package/es/assets/model/DCM.fbx +0 -0
- package/es/assets/model/DCM.gltf +0 -1
- package/es/assets/model/FBM.bin +0 -0
- package/es/assets/model/FBM.fbx +0 -0
- package/es/assets/model/FBM.gltf +0 -1
- package/es/assets/model/LRM.bin +0 -0
- package/es/assets/model/LRM.fbx +0 -0
- package/es/assets/model/LRM.gltf +0 -1
- package/es/assets/rtastore_logo.png +0 -0
- package/es/catalog/areas/area/planner-element.js +0 -45
- package/es/catalog/back.png +0 -0
- package/es/catalog/catalog.js +0 -265
- package/es/catalog/doors.png +0 -0
- package/es/catalog/doorways.png +0 -0
- package/es/catalog/envMap/nx.hdr +0 -0
- package/es/catalog/envMap/ny.hdr +0 -0
- package/es/catalog/envMap/nz.hdr +0 -0
- package/es/catalog/envMap/px.hdr +0 -0
- package/es/catalog/envMap/py.hdr +0 -0
- package/es/catalog/envMap/pz.hdr +0 -0
- package/es/catalog/export.js +0 -0
- package/es/catalog/factories/area-factory-3d.js +0 -182
- package/es/catalog/factories/area-factory.js +0 -78
- package/es/catalog/factories/export.js +0 -7
- package/es/catalog/factories/wall-factory-3d.js +0 -202
- package/es/catalog/factories/wall-factory.js +0 -267
- package/es/catalog/holes/door-closet/planner-element.js +0 -222
- package/es/catalog/holes/door-double/door_double.png +0 -0
- package/es/catalog/holes/door-double/planner-element.js +0 -315
- package/es/catalog/holes/door-exterior/planner-element.js +0 -215
- package/es/catalog/holes/door-interior/planner-element.js +0 -227
- package/es/catalog/holes/door-panic/panicDoor.png +0 -0
- package/es/catalog/holes/door-panic/planner-element.js +0 -503
- package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
- package/es/catalog/holes/door-panic-double/planner-element.js +0 -463
- package/es/catalog/holes/door-sliding/planner-element.js +0 -225
- package/es/catalog/holes/doorway-framed/planner-element.js +0 -145
- package/es/catalog/holes/doorway-frameless/planner-element.js +0 -104
- package/es/catalog/holes/export.js +0 -13
- package/es/catalog/holes/gate/gate.jpg +0 -0
- package/es/catalog/holes/window-clear/planner-element.js +0 -166
- package/es/catalog/holes/window-clear/texture.png +0 -0
- package/es/catalog/holes/window-cross/planner-element.js +0 -165
- package/es/catalog/holes/window-cross/texture.png +0 -0
- package/es/catalog/holes/window-double-hung/planner-element.js +0 -303
- package/es/catalog/holes/window-double-hung/texture.png +0 -0
- package/es/catalog/holes/window-vertical/planner-element.js +0 -276
- package/es/catalog/holes/window-vertical/texture.png +0 -0
- package/es/catalog/lines/wall/planner-element.js +0 -79
- package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
- package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
- package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
- package/es/catalog/molding/molding-dcm/planner-element.js +0 -26
- package/es/catalog/molding/molding-dcm/texture.png +0 -0
- package/es/catalog/molding/molding-fbm/planner-element.js +0 -26
- package/es/catalog/molding/molding-fbm/texture.png +0 -0
- package/es/catalog/molding/molding-lrm/planner-element.js +0 -26
- package/es/catalog/molding/molding-lrm/texture.png +0 -0
- package/es/catalog/properties/export.js +0 -21
- package/es/catalog/properties/property-checkbox.js +0 -68
- package/es/catalog/properties/property-color.js +0 -39
- package/es/catalog/properties/property-enum.js +0 -50
- package/es/catalog/properties/property-hidden.js +0 -19
- package/es/catalog/properties/property-lenght-measure.js +0 -96
- package/es/catalog/properties/property-length-measure.js +0 -80
- package/es/catalog/properties/property-length-measure_hole.js +0 -96
- package/es/catalog/properties/property-number.js +0 -48
- package/es/catalog/properties/property-read-only.js +0 -26
- package/es/catalog/properties/property-string.js +0 -48
- package/es/catalog/properties/property-toggle.js +0 -39
- package/es/catalog/properties/shared-property-style.js +0 -14
- package/es/catalog/utils/FuseUtils.js +0 -79
- package/es/catalog/utils/exporter.js +0 -161
- package/es/catalog/utils/geom-utils.js +0 -189
- package/es/catalog/utils/item-loader.js +0 -1602
- package/es/catalog/utils/load-obj.js +0 -91
- package/es/catalog/utils/mtl-loader.js +0 -357
- package/es/catalog/utils/obj-loader.js +0 -476
- package/es/catalog/windows.png +0 -0
- package/es/class/FuseUtils.js +0 -79
- package/es/class/area.js +0 -141
- package/es/class/export.js +0 -24
- package/es/class/group.js +0 -431
- package/es/class/guide.js +0 -58
- package/es/class/hole.js +0 -924
- package/es/class/item.js +0 -1884
- package/es/class/layer.js +0 -663
- package/es/class/line.js +0 -1229
- package/es/class/project.js +0 -937
- package/es/class/vertex.js +0 -198
- package/es/components/content.js +0 -135
- package/es/components/export.js +0 -9
- package/es/components/style/button.js +0 -106
- package/es/components/style/cancel-button.js +0 -21
- package/es/components/style/content-container.js +0 -30
- package/es/components/style/content-title.js +0 -25
- package/es/components/style/delete-button.js +0 -24
- package/es/components/style/export.js +0 -31
- package/es/components/style/form-block.js +0 -20
- package/es/components/style/form-color-input.js +0 -26
- package/es/components/style/form-label.js +0 -22
- package/es/components/style/form-number-input.js +0 -192
- package/es/components/style/form-number-input_2.js +0 -238
- package/es/components/style/form-select.js +0 -19
- package/es/components/style/form-slider.js +0 -60
- package/es/components/style/form-submit-button.js +0 -25
- package/es/components/style/form-text-input.js +0 -69
- package/es/components/viewer2d/area.js +0 -81
- package/es/components/viewer2d/export.js +0 -31
- package/es/components/viewer2d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer2d/grids/grid-streak.js +0 -36
- package/es/components/viewer2d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer2d/grids/grids.js +0 -30
- package/es/components/viewer2d/group.js +0 -48
- package/es/components/viewer2d/item.js +0 -242
- package/es/components/viewer2d/layer.js +0 -164
- package/es/components/viewer2d/line.js +0 -997
- package/es/components/viewer2d/ruler.js +0 -84
- package/es/components/viewer2d/rulerDist.js +0 -102
- package/es/components/viewer2d/rulerX.js +0 -142
- package/es/components/viewer2d/rulerY.js +0 -144
- package/es/components/viewer2d/scene.js +0 -108
- package/es/components/viewer2d/snap.js +0 -74
- package/es/components/viewer2d/state.js +0 -73
- package/es/components/viewer2d/utils.js +0 -193
- package/es/components/viewer2d/vertex.js +0 -66
- package/es/components/viewer2d/viewer2d.js +0 -1405
- package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +0 -2585
- package/es/components/viewer3d/dcm.js +0 -401
- package/es/components/viewer3d/fbm.js +0 -414
- package/es/components/viewer3d/front3D.js +0 -62
- package/es/components/viewer3d/grid-creator.js +0 -25
- package/es/components/viewer3d/grids/grid-horizontal-streak.js +0 -36
- package/es/components/viewer3d/grids/grid-streak.js +0 -27
- package/es/components/viewer3d/grids/grid-vertical-streak.js +0 -36
- package/es/components/viewer3d/libs/first-person-controls.js +0 -67
- package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +0 -1281
- package/es/components/viewer3d/libs/mtl-loader.js +0 -357
- package/es/components/viewer3d/libs/obj-loader.js +0 -462
- package/es/components/viewer3d/libs/orbit-controls.js +0 -697
- package/es/components/viewer3d/libs/pointer-lock-controls.js +0 -44
- package/es/components/viewer3d/lrm.js +0 -305
- package/es/components/viewer3d/model.js +0 -708
- package/es/components/viewer3d/pointer-lock-navigation.js +0 -115
- package/es/components/viewer3d/ruler-utils/itemRect.js +0 -61
- package/es/components/viewer3d/ruler-utils/layer3D.js +0 -495
- package/es/components/viewer3d/ruler-utils/ruler3D.js +0 -224
- package/es/components/viewer3d/ruler-utils/scene3D.js +0 -59
- package/es/components/viewer3d/ruler-utils/state3D.js +0 -18
- package/es/components/viewer3d/scene-creator.js +0 -3818
- package/es/components/viewer3d/three-memory-cleaner.js +0 -51
- package/es/components/viewer3d/viewer3d-first-person.js +0 -311
- package/es/components/viewer3d/viewer3d.js +0 -2654
- package/es/constants.js +0 -769
- package/es/index.html.ejs +0 -264
- package/es/models.js +0 -512
- package/es/plugins/SVGLoader.js +0 -1414
- package/es/plugins/console-debugger.js +0 -34
- package/es/plugins/export.js +0 -7
- package/es/plugins/keyboard.js +0 -110
- package/es/reducers/areas-reducer.js +0 -12
- package/es/reducers/export.js +0 -25
- package/es/reducers/groups-reducer.js +0 -38
- package/es/reducers/holes-reducer.js +0 -62
- package/es/reducers/items-reducer.js +0 -143
- package/es/reducers/lines-reducer.js +0 -45
- package/es/reducers/project-reducer.js +0 -136
- package/es/reducers/reducer.js +0 -19
- package/es/reducers/scene-reducer.js +0 -28
- package/es/reducers/user-reducer.js +0 -41
- package/es/reducers/vertices-reducer.js +0 -19
- package/es/reducers/viewer2d-reducer.js +0 -77
- package/es/reducers/viewer3d-reducer.js +0 -58
- package/es/shared-style.js +0 -66
- package/es/translator/en.js +0 -104
- package/es/translator/it.js +0 -79
- package/es/translator/ru.js +0 -79
- package/es/translator/translator.js +0 -80
- package/es/utils/browser.js +0 -33
- package/es/utils/convert-units-lite.js +0 -29
- package/es/utils/email-validator.js +0 -4
- package/es/utils/export.js +0 -25
- package/es/utils/geometry.js +0 -2609
- package/es/utils/get-edges-of-subgraphs.js +0 -26
- package/es/utils/graph-cycles.js +0 -238
- package/es/utils/graph-inner-cycles.js +0 -46
- package/es/utils/graph.js +0 -145
- package/es/utils/helper.js +0 -436
- package/es/utils/history.js +0 -29
- package/es/utils/id-broker.js +0 -15
- package/es/utils/isolate-event-handler.js +0 -1622
- package/es/utils/logger.js +0 -8
- package/es/utils/math.js +0 -50
- package/es/utils/molding.js +0 -1347
- package/es/utils/name-generator.js +0 -17
- package/es/utils/objects-utils.js +0 -50
- package/es/utils/phone-validator.js +0 -4
- package/es/utils/process-black-list.js +0 -15
- package/es/utils/react-if.js +0 -18
- package/es/utils/ruler.js +0 -58
- package/es/utils/snap-scene.js +0 -94
- package/es/utils/snap.js +0 -231
- package/es/utils/summarizeCart.js +0 -24
- package/es/utils/threeCSG.es6.js +0 -494
- package/es/version.js +0 -1
- /package/es/{catalog/lines/wall/textures/plaster-normal.jpg → 1fc74a85baa030dbc913.jpg} +0 -0
- /package/es/{catalog/lines/wall/wall.png → 30a49a74d9bd10068b65.png} +0 -0
- /package/es/{catalog/lines/wall/textures/bricks-normal2.jpg → 340a84d3930143a53545.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/morden-normal.jpg → 5c8d36b3e7223934f447.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/bricks-normal.jpg → 81e7a7e6edf162e88b44.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/morden.jpg → 8fe0f1210d8ba435a790.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/bricks.jpg → a07d30a04bda8ee03491.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/painted.jpg → bee3f62687a97bcc3d9f.jpg} +0 -0
- /package/es/{catalog/areas/area/textures/strand-porcelain.jpg → c232d250fd899392b1b7.jpg} +0 -0
- /package/es/{catalog/areas/area/textures/tile1.jpg → c7ae6f4de09134ebe588.jpg} +0 -0
- /package/es/{catalog/lines/wall/textures/plaster.jpg → dad5ee758630256ee702.jpg} +0 -0
- /package/es/{catalog/areas/area/textures/grass.jpg → e470a2ce76062955fa98.jpg} +0 -0
- /package/es/{catalog/areas/area/textures/parquet.jpg → e5ae13166775e7d071e4.jpg} +0 -0
- /package/es/{catalog/areas/area/textures/ceramic-tile.jpg → e8e5de0892f5375460bd.jpg} +0 -0
|
@@ -1,1622 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
4
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
5
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
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; }
|
|
7
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
-
import { Map } from 'immutable';
|
|
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";
|
|
10
|
-
import { isEmpty, updateViwer2D, centering2D } from "./helper";
|
|
11
|
-
import exporter from "../catalog/utils/exporter";
|
|
12
|
-
import { render2DItem, render3DItem, render3DApplianceItem, render3DLightingItem } from "../catalog/utils/item-loader";
|
|
13
|
-
import { convert } from "./convert-units-lite";
|
|
14
|
-
import { GeometryUtils, MathUtils } from "./export";
|
|
15
|
-
import { returnReplaceableDeepSearchType } from "../components/viewer2d/utils";
|
|
16
|
-
import { SVGLoader } from 'three/addons/loaders/SVGLoader.js';
|
|
17
|
-
import { getMoldingDataOfScene2 } from "./molding";
|
|
18
|
-
import { Scene, State } from "../models";
|
|
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>
|
|
38
|
-
function loadJSON(_x) {
|
|
39
|
-
return _loadJSON.apply(this, arguments);
|
|
40
|
-
}
|
|
41
|
-
/********Parse TempPlaceholder from cabinetPayloadData **************/
|
|
42
|
-
function _loadJSON() {
|
|
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) {
|
|
47
|
-
case 0:
|
|
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) {
|
|
61
|
-
var xhr = new XMLHttpRequest();
|
|
62
|
-
xhr.onreadystatechange = function () {
|
|
63
|
-
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
64
|
-
if (xhr.status === 200) resolve(JSON.parse(xhr.responseText));else reject(xhr);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
xhr.open('GET', path, true);
|
|
68
|
-
xhr.send();
|
|
69
|
-
});
|
|
70
|
-
__jsonCache.set(path, p);
|
|
71
|
-
return _context3.abrupt("return", p);
|
|
72
|
-
case 3:
|
|
73
|
-
case "end":
|
|
74
|
-
return _context3.stop();
|
|
75
|
-
}
|
|
76
|
-
}, _callee3);
|
|
77
|
-
}));
|
|
78
|
-
return _loadJSON.apply(this, arguments);
|
|
79
|
-
}
|
|
80
|
-
function parseTempPlaceholdersFromCabinetPayload(_x2) {
|
|
81
|
-
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
82
|
-
}
|
|
83
|
-
/***** Update cabinetPayloadData with updatedTempPlaceholders *****/
|
|
84
|
-
function _parseTempPlaceholdersFromCabinetPayload() {
|
|
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) {
|
|
89
|
-
case 0:
|
|
90
|
-
link = '';
|
|
91
|
-
keys = Object.keys(cabinetPayload.structure_json);
|
|
92
|
-
temp = [];
|
|
93
|
-
i = 0;
|
|
94
|
-
case 1:
|
|
95
|
-
if (!(i < keys.length)) {
|
|
96
|
-
_context5.next = 4;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
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'))) {
|
|
100
|
-
_context5.next = 3;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
link = cabinetPayload.structure_json[keys[i]];
|
|
104
|
-
_t2 = temp;
|
|
105
|
-
_t3 = keys[i];
|
|
106
|
-
_context5.next = 2;
|
|
107
|
-
return loadJSON(link);
|
|
108
|
-
case 2:
|
|
109
|
-
_t4 = _context5.sent;
|
|
110
|
-
_t2.push.call(_t2, {
|
|
111
|
-
name: _t3,
|
|
112
|
-
data: _t4
|
|
113
|
-
});
|
|
114
|
-
case 3:
|
|
115
|
-
i++;
|
|
116
|
-
_context5.next = 1;
|
|
117
|
-
break;
|
|
118
|
-
case 4:
|
|
119
|
-
tempPlaceholdersData = [];
|
|
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 = [];
|
|
138
|
-
}
|
|
139
|
-
var tempPlaceholders = nodes.filter(function (element) {
|
|
140
|
-
return element.name.startsWith('ph_');
|
|
141
|
-
});
|
|
142
|
-
tempPlaceholders.sort(function (a, b) {
|
|
143
|
-
return a.name > b.name ? 1 : -1;
|
|
144
|
-
});
|
|
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
|
-
}
|
|
416
|
-
}
|
|
417
|
-
}
|
|
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();
|
|
427
|
-
}
|
|
428
|
-
}, _loop3);
|
|
429
|
-
});
|
|
430
|
-
k = 0;
|
|
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:
|
|
444
|
-
case "end":
|
|
445
|
-
return _context5.stop();
|
|
446
|
-
}
|
|
447
|
-
}, _callee4);
|
|
448
|
-
}));
|
|
449
|
-
return _parseTempPlaceholdersFromCabinetPayload.apply(this, arguments);
|
|
450
|
-
}
|
|
451
|
-
function updateCabinetPayload(_x3) {
|
|
452
|
-
return _updateCabinetPayload.apply(this, arguments);
|
|
453
|
-
}
|
|
454
|
-
function _updateCabinetPayload() {
|
|
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) {
|
|
459
|
-
case 0:
|
|
460
|
-
// let tempPlaceholders = [];
|
|
461
|
-
// tempPlaceholders = await parseTempPlaceholdersFromCabinetPayload(
|
|
462
|
-
// cabinetPayload
|
|
463
|
-
// );
|
|
464
|
-
cabinetPayloadKeys = Object.keys(cabinetPayload);
|
|
465
|
-
for (i = 0; i < cabinetPayloadKeys.length; i++) {
|
|
466
|
-
if (cabinetPayloadKeys[i] === 'structure_json') {
|
|
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;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
return _context6.abrupt("return", cabinetPayload);
|
|
476
|
-
case 1:
|
|
477
|
-
case "end":
|
|
478
|
-
return _context6.stop();
|
|
479
|
-
}
|
|
480
|
-
}, _callee5);
|
|
481
|
-
}));
|
|
482
|
-
return _updateCabinetPayload.apply(this, arguments);
|
|
483
|
-
}
|
|
484
|
-
var loadSVGsByItem = /*#__PURE__*/function () {
|
|
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) {
|
|
489
|
-
case 0:
|
|
490
|
-
if (item !== null && item !== void 0 && item.outline) {
|
|
491
|
-
_context2.next = 1;
|
|
492
|
-
break;
|
|
493
|
-
}
|
|
494
|
-
return _context2.abrupt("return", null);
|
|
495
|
-
case 1:
|
|
496
|
-
url = item.outline;
|
|
497
|
-
if (!__svgCache.has(url)) {
|
|
498
|
-
_context2.next = 2;
|
|
499
|
-
break;
|
|
500
|
-
}
|
|
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:
|
|
547
|
-
case "end":
|
|
548
|
-
return _context2.stop();
|
|
549
|
-
}
|
|
550
|
-
}, _callee2);
|
|
551
|
-
}));
|
|
552
|
-
return function loadSVGsByItem(_x4) {
|
|
553
|
-
return _ref.apply(this, arguments);
|
|
554
|
-
};
|
|
555
|
-
}();
|
|
556
|
-
function addItemToCatalog(_x5, _x6, _x7, _x8) {
|
|
557
|
-
return _addItemToCatalog.apply(this, arguments);
|
|
558
|
-
} // Get attributs of current selected element
|
|
559
|
-
function _addItemToCatalog() {
|
|
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) {
|
|
565
|
-
case 0:
|
|
566
|
-
if (!isEmpty(element === null || element === void 0 ? void 0 : element.name)) {
|
|
567
|
-
_context7.next = 1;
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
return _context7.abrupt("return");
|
|
571
|
-
case 1:
|
|
572
|
-
// clone element
|
|
573
|
-
elementJs = Object.assign({}, element); // if (isEmpty(catalog?.elements[element.name])) {
|
|
574
|
-
_context7.next = 2;
|
|
575
|
-
return loadSVGsByItem(elementJs);
|
|
576
|
-
case 2:
|
|
577
|
-
outlineSVGData = _context7.sent;
|
|
578
|
-
if (!(((_elementJs = elementJs) === null || _elementJs === void 0 ? void 0 : _elementJs.type) === 'cabinet')) {
|
|
579
|
-
_context7.next = 4;
|
|
580
|
-
break;
|
|
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
|
-
}
|
|
597
|
-
// make placeholders of element and tempPlaceholder
|
|
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), {}, {
|
|
601
|
-
cds: {
|
|
602
|
-
data: [_objectSpread({}, elementJs.customer_property)],
|
|
603
|
-
itemID: elementJs.itemID
|
|
604
|
-
}
|
|
605
|
-
});
|
|
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;
|
|
608
|
-
break;
|
|
609
|
-
}
|
|
610
|
-
_context7.next = 3;
|
|
611
|
-
return updateCabinetPayload(elementJs);
|
|
612
|
-
case 3:
|
|
613
|
-
elementJs = _context7.sent;
|
|
614
|
-
case 4:
|
|
615
|
-
elementJs = _objectSpread(_objectSpread({}, elementJs), {}, {
|
|
616
|
-
outlineSVGData: outlineSVGData,
|
|
617
|
-
type: elementJs.type,
|
|
618
|
-
render2DItem: render2DItem
|
|
619
|
-
});
|
|
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
|
-
|
|
665
|
-
elementJs = exporter(elementJs);
|
|
666
|
-
if (catalogInstance !== null && catalogInstance !== void 0 && catalogInstance.validateElement(elementJs)) {
|
|
667
|
-
catalogInstance.registerElement(elementJs);
|
|
668
|
-
projectActions.addElementToCatalog(elementJs);
|
|
669
|
-
}
|
|
670
|
-
case 8:
|
|
671
|
-
case "end":
|
|
672
|
-
return _context7.stop();
|
|
673
|
-
}
|
|
674
|
-
}, _callee6);
|
|
675
|
-
}));
|
|
676
|
-
return _addItemToCatalog.apply(this, arguments);
|
|
677
|
-
}
|
|
678
|
-
function initAttrData(element, layer, state) {
|
|
679
|
-
element = _typeof(element.misc) === 'object' ? element.set('misc', new Map(element.misc)) : element;
|
|
680
|
-
switch (element.prototype) {
|
|
681
|
-
case 'items':
|
|
682
|
-
{
|
|
683
|
-
return new Map(element);
|
|
684
|
-
}
|
|
685
|
-
case 'lines':
|
|
686
|
-
{
|
|
687
|
-
var v_a = layer.vertices.get(element.vertices.get(0));
|
|
688
|
-
var v_b = layer.vertices.get(element.vertices.get(1));
|
|
689
|
-
var distance = GeometryUtils.pointsDistance(v_a.x, v_a.y, v_b.x, v_b.y);
|
|
690
|
-
var _unit = element.misc.get('_unitLength') || UNIT_INCH;
|
|
691
|
-
var _length = convert(distance).from(UNIT_CENTIMETER).to(_unit);
|
|
692
|
-
if (state.mode == MODE_DRAWING_LINE) {
|
|
693
|
-
return new Map({
|
|
694
|
-
vertexOne: v_a,
|
|
695
|
-
vertexTwo: v_b,
|
|
696
|
-
lineLength: new Map({
|
|
697
|
-
length: distance,
|
|
698
|
-
_length: _length,
|
|
699
|
-
_unit: _unit
|
|
700
|
-
}),
|
|
701
|
-
focus: element.focus
|
|
702
|
-
});
|
|
703
|
-
} else {
|
|
704
|
-
var allLines = layer.lines.toArray();
|
|
705
|
-
var relatedLine = allLines.filter(function (line) {
|
|
706
|
-
return line.vertices.toArray().includes(v_b.id) && line.id != element.id;
|
|
707
|
-
})[0];
|
|
708
|
-
var relatedVertexID = relatedLine && (relatedLine.vertices.toArray()[0] == v_b.id ? relatedLine.vertices.toArray()[1] : relatedLine.vertices.toArray()[0]);
|
|
709
|
-
var v_d = relatedVertexID && layer.getIn(['vertices', relatedVertexID]);
|
|
710
|
-
var lineToExtend = relatedVertexID && allLines.filter(function (line) {
|
|
711
|
-
return line.vertices.toArray().includes(relatedVertexID) && line.id != relatedLine.id;
|
|
712
|
-
})[0];
|
|
713
|
-
var v_c = lineToExtend && layer.getIn(['vertices', lineToExtend.vertices.toArray()[0] == v_d.id ? lineToExtend.vertices.toArray()[1] : lineToExtend.vertices.toArray()[0]]);
|
|
714
|
-
return new Map({
|
|
715
|
-
vertexOne: v_a,
|
|
716
|
-
vertexTwo: v_b,
|
|
717
|
-
vertexThree: v_c,
|
|
718
|
-
vertexFour: v_d,
|
|
719
|
-
lineToExtend: lineToExtend,
|
|
720
|
-
lineLength: new Map({
|
|
721
|
-
length: distance,
|
|
722
|
-
_length: _length,
|
|
723
|
-
_unit: _unit
|
|
724
|
-
}),
|
|
725
|
-
focus: element.focus
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
case 'holes':
|
|
730
|
-
{
|
|
731
|
-
var line = layer.lines.get(element.line);
|
|
732
|
-
var _layer$vertices$get = layer.vertices.get(line.vertices.get(0)),
|
|
733
|
-
x0 = _layer$vertices$get.x,
|
|
734
|
-
y0 = _layer$vertices$get.y;
|
|
735
|
-
var _layer$vertices$get2 = layer.vertices.get(line.vertices.get(1)),
|
|
736
|
-
x1 = _layer$vertices$get2.x,
|
|
737
|
-
y1 = _layer$vertices$get2.y;
|
|
738
|
-
var lineLength = GeometryUtils.pointsDistance(x0, y0, x1, y1);
|
|
739
|
-
var startAt = lineLength * element.offset - element.properties.get('width').get('length') / 2;
|
|
740
|
-
var endAt = lineLength - lineLength * element.offset - element.properties.get('width').get('length') / 2;
|
|
741
|
-
var _unitA = element.misc.get('_unitA') || UNIT_INCH;
|
|
742
|
-
var _lengthA = convert(x0 > x1 ? endAt : startAt).from(UNIT_CENTIMETER).to(_unitA);
|
|
743
|
-
var _unitB = element.misc.get('_unitB') || UNIT_INCH;
|
|
744
|
-
var _lengthB = convert(x0 > x1 ? startAt : endAt).from(UNIT_CENTIMETER).to(_unitB);
|
|
745
|
-
return new Map({
|
|
746
|
-
offset: element.offset,
|
|
747
|
-
offsetA: new Map({
|
|
748
|
-
length: MathUtils.toFixedFloat(x0 > x1 ? endAt : startAt, PRECISION),
|
|
749
|
-
_length: MathUtils.toFixedFloat(_lengthA, PRECISION),
|
|
750
|
-
_unit: _unitA
|
|
751
|
-
}),
|
|
752
|
-
offsetB: new Map({
|
|
753
|
-
length: MathUtils.toFixedFloat(x0 > x1 ? startAt : endAt, PRECISION),
|
|
754
|
-
_length: MathUtils.toFixedFloat(_lengthB, PRECISION),
|
|
755
|
-
_unit: _unitB
|
|
756
|
-
})
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
case 'areas':
|
|
760
|
-
{
|
|
761
|
-
return new Map({});
|
|
762
|
-
}
|
|
763
|
-
default:
|
|
764
|
-
return null;
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
// Get properties of current selected element
|
|
768
|
-
function initPropData(element, catalog) {
|
|
769
|
-
var mapped = {};
|
|
770
|
-
if (!catalog.elements.hasOwnProperty(element.type) && !(!catalog.elements[element.type] && !!catalog.elements[returnReplaceableDeepSearchType(element.type)])) {
|
|
771
|
-
console.log("Last Selected ".concat(element.type, " Element does not exist in catalog."));
|
|
772
|
-
return new Map(mapped);
|
|
773
|
-
}
|
|
774
|
-
var catalogElement = catalog.getElement(element.type);
|
|
775
|
-
var isFiller = catalogElement.long_name ? catalogElement.long_name.toUpperCase().includes('FILLER') : false;
|
|
776
|
-
if (isFiller) {
|
|
777
|
-
var height = {
|
|
778
|
-
defaultValue: element.properties.get('height').toJS(),
|
|
779
|
-
label: 'Height',
|
|
780
|
-
type: 'length-measure'
|
|
781
|
-
};
|
|
782
|
-
var depth = {
|
|
783
|
-
defaultValue: element.properties.get('depth').toJS(),
|
|
784
|
-
label: 'Depth',
|
|
785
|
-
type: 'length-measure'
|
|
786
|
-
};
|
|
787
|
-
catalogElement.properties = {
|
|
788
|
-
altitude: catalogElement.properties.altitude,
|
|
789
|
-
width: catalogElement.properties.width,
|
|
790
|
-
height: height,
|
|
791
|
-
depth: depth,
|
|
792
|
-
flip_doorhandle: catalogElement.properties.flip_doorhandle,
|
|
793
|
-
resize_and_scaling: catalogElement.properties.resize_and_scaling
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
for (var name in catalogElement.properties) {
|
|
797
|
-
mapped[name] = new Map({
|
|
798
|
-
currentValue: element.properties.has(name) ? element.properties.get(name) : fromJS(catalogElement.properties[name].defaultValue),
|
|
799
|
-
configs: catalogElement.properties[name]
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
return new Map(mapped);
|
|
803
|
-
}
|
|
804
|
-
function updateAttributeOfSelectedElement(element, attrPayload, state, layer, catalog, projectActions) {
|
|
805
|
-
var _attributesFormData;
|
|
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']);
|
|
809
|
-
var attributesFormData = initAttrData(element, layer, state);
|
|
810
|
-
var value = attrPayload.value;
|
|
811
|
-
var attributeName = attrPayload.attributeName;
|
|
812
|
-
// pre process
|
|
813
|
-
if (attributeName === ATT_ITEM_POS) {
|
|
814
|
-
// calculate the new position of movement
|
|
815
|
-
var rotRad = (value.directionAng + element.rotation) / 180 * Math.PI;
|
|
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');
|
|
818
|
-
value = {
|
|
819
|
-
x: newX,
|
|
820
|
-
y: newY
|
|
821
|
-
};
|
|
822
|
-
} else if (attributeName === ATT_LINE_LENGTH || attributeName === ATT_HOLE_OFFSET_A || attributeName === ATT_HOLE_OFFSET_B) {
|
|
823
|
-
var att = attributesFormData.has(attributeName) ? attributesFormData.get(attributeName) : element[attributeName];
|
|
824
|
-
if (att) value = att.merge({
|
|
825
|
-
_length: value,
|
|
826
|
-
_unit: layerUnit,
|
|
827
|
-
length: convert(value).from(layerUnit).to(UNIT_CENTIMETER)
|
|
828
|
-
});
|
|
829
|
-
}
|
|
830
|
-
// make the new attrivutes
|
|
831
|
-
switch (element.prototype) {
|
|
832
|
-
case 'items':
|
|
833
|
-
{
|
|
834
|
-
if (attributeName == ATT_ITEM_POS) {
|
|
835
|
-
var xVal = value.x;
|
|
836
|
-
var yVal = value.y;
|
|
837
|
-
attributesFormData = attributesFormData.set('x', xVal);
|
|
838
|
-
attributesFormData = attributesFormData.set('y', yVal);
|
|
839
|
-
} else {
|
|
840
|
-
attributesFormData = attributesFormData.set(attributeName, value);
|
|
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);
|
|
846
|
-
break;
|
|
847
|
-
}
|
|
848
|
-
case 'lines':
|
|
849
|
-
{
|
|
850
|
-
switch (attributeName) {
|
|
851
|
-
case ATT_LINE_LENGTH:
|
|
852
|
-
{
|
|
853
|
-
var v_0 = attributesFormData.get('vertexOne');
|
|
854
|
-
var v_1 = attributesFormData.get('vertexTwo');
|
|
855
|
-
var v_b_new = GeometryUtils.extendLine(v_0.x, v_0.y, v_1.x, v_1.y, value.get('length'), PRECISION);
|
|
856
|
-
attributesFormData = attributesFormData.withMutations(function (attr) {
|
|
857
|
-
attr.set('vertexTwo', v_1.merge(v_b_new));
|
|
858
|
-
attr.set('lineLength', value);
|
|
859
|
-
});
|
|
860
|
-
break;
|
|
861
|
-
}
|
|
862
|
-
case ATT_VERTEXT_ONE:
|
|
863
|
-
case ATT_VERTEXT_TWO:
|
|
864
|
-
{
|
|
865
|
-
attributesFormData = attributesFormData.withMutations(function (attr) {
|
|
866
|
-
attr.set(attributeName, attr.get(attributeName).merge(value));
|
|
867
|
-
var newDistance = GeometryUtils.verticesDistance(attr.get('vertexOne'), attr.get('vertexTwo'));
|
|
868
|
-
attr.mergeIn(['lineLength'], attr.get('lineLength').merge({
|
|
869
|
-
length: newDistance,
|
|
870
|
-
_length: convert(newDistance).from(UNIT_CENTIMETER).to(attr.get('lineLength').get('_unit'))
|
|
871
|
-
}));
|
|
872
|
-
});
|
|
873
|
-
break;
|
|
874
|
-
}
|
|
875
|
-
default:
|
|
876
|
-
{
|
|
877
|
-
attributesFormData = attributesFormData.set(attributeName, value);
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
break;
|
|
882
|
-
}
|
|
883
|
-
case 'holes':
|
|
884
|
-
{
|
|
885
|
-
switch (attributeName) {
|
|
886
|
-
case ATT_HOLE_OFFSET_A:
|
|
887
|
-
{
|
|
888
|
-
var line = layer.lines.get(element.line);
|
|
889
|
-
var _layer$vertices$get3 = layer.vertices.get(line.vertices.get(0)),
|
|
890
|
-
x0 = _layer$vertices$get3.x,
|
|
891
|
-
y0 = _layer$vertices$get3.y;
|
|
892
|
-
var _layer$vertices$get4 = layer.vertices.get(line.vertices.get(1)),
|
|
893
|
-
x1 = _layer$vertices$get4.x,
|
|
894
|
-
y1 = _layer$vertices$get4.y;
|
|
895
|
-
var alpha = GeometryUtils.angleBetweenTwoPoints(x0, y0, x1, y1);
|
|
896
|
-
var lineLength = GeometryUtils.pointsDistance(x0, y0, x1, y1);
|
|
897
|
-
var widthLength = element.properties.get('width').get('length');
|
|
898
|
-
var halfWidthLength = widthLength / 2;
|
|
899
|
-
var lengthValue = value.get('length');
|
|
900
|
-
lengthValue = Math.max(lengthValue, 0);
|
|
901
|
-
lengthValue = Math.min(lengthValue, lineLength - widthLength);
|
|
902
|
-
var xp = (lengthValue + halfWidthLength) * Math.cos(alpha) + x0;
|
|
903
|
-
var yp = (lengthValue + halfWidthLength) * Math.sin(alpha) + y0;
|
|
904
|
-
var offset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, xp, yp);
|
|
905
|
-
/*
|
|
906
|
-
if (x0 > x1) offset = 1 - offset;
|
|
907
|
-
*/
|
|
908
|
-
var endAt = MathUtils.toFixedFloat(lineLength - lineLength * offset - halfWidthLength, PRECISION);
|
|
909
|
-
var offsetUnit = attributesFormData.getIn(['offsetB', '_unit']);
|
|
910
|
-
var offsetB = new Map({
|
|
911
|
-
length: endAt,
|
|
912
|
-
_length: convert(endAt).from(UNIT_CENTIMETER).to(offsetUnit),
|
|
913
|
-
_unit: offsetUnit
|
|
914
|
-
});
|
|
915
|
-
attributesFormData = attributesFormData.set('offsetB', offsetB).set('offset', offset);
|
|
916
|
-
var offsetAttribute = new Map({
|
|
917
|
-
length: MathUtils.toFixedFloat(lengthValue, PRECISION),
|
|
918
|
-
_unit: value.get('_unit'),
|
|
919
|
-
_length: MathUtils.toFixedFloat(convert(lengthValue).from(UNIT_CENTIMETER).to(value.get('_unit')), PRECISION)
|
|
920
|
-
});
|
|
921
|
-
attributesFormData = attributesFormData.set(attributeName, offsetAttribute);
|
|
922
|
-
break;
|
|
923
|
-
}
|
|
924
|
-
case ATT_HOLE_OFFSET_B:
|
|
925
|
-
{
|
|
926
|
-
var _line = layer.lines.get(element.line);
|
|
927
|
-
var _layer$vertices$get5 = layer.vertices.get(_line.vertices.get(0)),
|
|
928
|
-
_x9 = _layer$vertices$get5.x,
|
|
929
|
-
_y = _layer$vertices$get5.y;
|
|
930
|
-
var _layer$vertices$get6 = layer.vertices.get(_line.vertices.get(1)),
|
|
931
|
-
_x0 = _layer$vertices$get6.x,
|
|
932
|
-
_y2 = _layer$vertices$get6.y;
|
|
933
|
-
var _alpha = GeometryUtils.angleBetweenTwoPoints(_x9, _y, _x0, _y2);
|
|
934
|
-
var _lineLength = GeometryUtils.pointsDistance(_x9, _y, _x0, _y2);
|
|
935
|
-
var _widthLength = element.properties.get('width').get('length');
|
|
936
|
-
var _halfWidthLength = _widthLength / 2;
|
|
937
|
-
var _lengthValue = value.get('length');
|
|
938
|
-
_lengthValue = Math.max(_lengthValue, 0);
|
|
939
|
-
_lengthValue = Math.min(_lengthValue, _lineLength - _widthLength);
|
|
940
|
-
var _xp = _x0 - (_lengthValue + _halfWidthLength) * Math.cos(_alpha);
|
|
941
|
-
var _yp = _y2 - (_lengthValue + _halfWidthLength) * Math.sin(_alpha);
|
|
942
|
-
var _offset = GeometryUtils.pointPositionOnLineSegment(_x9, _y, _x0, _y2, _xp, _yp);
|
|
943
|
-
/*
|
|
944
|
-
if (x0 > x1) offset = 1 - offset;
|
|
945
|
-
*/
|
|
946
|
-
var startAt = MathUtils.toFixedFloat(_lineLength * _offset - _halfWidthLength, PRECISION);
|
|
947
|
-
var _offsetUnit = attributesFormData.getIn(['offsetA', '_unit']);
|
|
948
|
-
var offsetA = new Map({
|
|
949
|
-
length: startAt,
|
|
950
|
-
_length: convert(startAt).from(UNIT_CENTIMETER).to(_offsetUnit),
|
|
951
|
-
_unit: _offsetUnit
|
|
952
|
-
});
|
|
953
|
-
attributesFormData = attributesFormData.set('offsetA', offsetA).set('offset', _offset);
|
|
954
|
-
var _offsetAttribute = new Map({
|
|
955
|
-
length: MathUtils.toFixedFloat(_lengthValue, PRECISION),
|
|
956
|
-
_unit: value.get('_unit'),
|
|
957
|
-
_length: MathUtils.toFixedFloat(convert(_lengthValue).from(UNIT_CENTIMETER).to(value.get('_unit')), PRECISION)
|
|
958
|
-
});
|
|
959
|
-
attributesFormData = attributesFormData.set(attributeName, _offsetAttribute);
|
|
960
|
-
break;
|
|
961
|
-
}
|
|
962
|
-
default:
|
|
963
|
-
{
|
|
964
|
-
attributesFormData = attributesFormData.set(attributeName, value);
|
|
965
|
-
break;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
break;
|
|
969
|
-
}
|
|
970
|
-
default:
|
|
971
|
-
break;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
// update attribute action
|
|
975
|
-
switch (element.prototype) {
|
|
976
|
-
case 'items':
|
|
977
|
-
{
|
|
978
|
-
projectActions.setItemsAttributes(attributesFormData);
|
|
979
|
-
break;
|
|
980
|
-
}
|
|
981
|
-
case 'lines':
|
|
982
|
-
{
|
|
983
|
-
projectActions.setLinesAttributes(attributesFormData);
|
|
984
|
-
break;
|
|
985
|
-
}
|
|
986
|
-
case 'holes':
|
|
987
|
-
{
|
|
988
|
-
projectActions.setHolesAttributes(attributesFormData);
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
// invoke callback
|
|
994
|
-
if (callback) callback((_attributesFormData = attributesFormData) === null || _attributesFormData === void 0 ? void 0 : _attributesFormData.toJS());
|
|
995
|
-
}
|
|
996
|
-
function updatePropertyOfSelectedElement(element, propertyPayload, catalog,
|
|
997
|
-
// class instance of Catalog, get from props
|
|
998
|
-
projectActions) {
|
|
999
|
-
var _propertiesFormData;
|
|
1000
|
-
var callback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
1001
|
-
var propertiesFormData = initPropData(element, catalog);
|
|
1002
|
-
var value = propertyPayload.value;
|
|
1003
|
-
var propertyName = propertyPayload.propertyName;
|
|
1004
|
-
// make new properties
|
|
1005
|
-
if (propertyName === PROP_FLIP_DOOR_HANDLE && element.properties.get(PROP_OPEN_DOORS)) {
|
|
1006
|
-
alert('Doors are already open.');
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
|
-
propertiesFormData = propertiesFormData.setIn([propertyName, 'currentValue'], value);
|
|
1010
|
-
|
|
1011
|
-
// update property action
|
|
1012
|
-
if (propertiesFormData) {
|
|
1013
|
-
var properties = propertiesFormData.map(function (data) {
|
|
1014
|
-
return data.get('currentValue');
|
|
1015
|
-
});
|
|
1016
|
-
projectActions.setProperties(properties);
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
// invoke callback
|
|
1020
|
-
if (callback) callback((_propertiesFormData = propertiesFormData) === null || _propertiesFormData === void 0 ? void 0 : _propertiesFormData.toJS());
|
|
1021
|
-
}
|
|
1022
|
-
function getElement(objProps, state) {
|
|
1023
|
-
var layerID = state.scene.selectedLayer;
|
|
1024
|
-
var curObject = null;
|
|
1025
|
-
if (!isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementPrototype) && !isEmpty(objProps === null || objProps === void 0 ? void 0 : objProps.elementId)) curObject = state.getIn(['scene', 'layers', layerID, objProps.elementPrototype, objProps.elementId]);else {
|
|
1026
|
-
// if no specified object property then get the first selected element
|
|
1027
|
-
var layer = state.scene.layers.get(state.scene.selectedLayer);
|
|
1028
|
-
var selected = [];
|
|
1029
|
-
layer.selected.forEach(function (data, prototype) {
|
|
1030
|
-
if (prototype == 'vertices') return;
|
|
1031
|
-
if (data.size > 0) {
|
|
1032
|
-
var values = data.toJS();
|
|
1033
|
-
for (var i = 0; i < values.length; i++) {
|
|
1034
|
-
selected.push({
|
|
1035
|
-
type: prototype,
|
|
1036
|
-
id: values[i]
|
|
1037
|
-
});
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
});
|
|
1041
|
-
if (selected.length === 1) {
|
|
1042
|
-
var selData = selected[0];
|
|
1043
|
-
switch (selData.type) {
|
|
1044
|
-
case ELEMENT_HOLE:
|
|
1045
|
-
curObject = layer.holes.get(selData.id);
|
|
1046
|
-
break;
|
|
1047
|
-
case ELEMENT_ITEM:
|
|
1048
|
-
curObject = layer.items.get(selData.id);
|
|
1049
|
-
break;
|
|
1050
|
-
case ELEMENT_LINE:
|
|
1051
|
-
curObject = layer.lines.get(selData.id);
|
|
1052
|
-
break;
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
return curObject;
|
|
1057
|
-
}
|
|
1058
|
-
function loadMoldingSvg(_x1) {
|
|
1059
|
-
return _loadMoldingSvg.apply(this, arguments);
|
|
1060
|
-
}
|
|
1061
|
-
function _loadMoldingSvg() {
|
|
1062
|
-
_loadMoldingSvg = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(molding) {
|
|
1063
|
-
return _regeneratorRuntime.wrap(function (_context8) {
|
|
1064
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
1065
|
-
case 0:
|
|
1066
|
-
return _context8.abrupt("return", new Promise(function (resolve, reject) {
|
|
1067
|
-
var url = molding === null || molding === void 0 ? void 0 : molding.shape_svg;
|
|
1068
|
-
if (!url) {
|
|
1069
|
-
// Skip if no SVG URL available
|
|
1070
|
-
return resolve();
|
|
1071
|
-
}
|
|
1072
|
-
var loader = new SVGLoader();
|
|
1073
|
-
loader.load(url, function (data) {
|
|
1074
|
-
var _data$xml$viewBox$ani, _data$xml, _data$xml$viewBox$ani2, _data$xml2;
|
|
1075
|
-
molding.data = {
|
|
1076
|
-
paths: data.paths,
|
|
1077
|
-
svg_width: (_data$xml$viewBox$ani = (_data$xml = data.xml) === null || _data$xml === void 0 || (_data$xml = _data$xml.viewBox) === null || _data$xml === void 0 || (_data$xml = _data$xml.animVal) === null || _data$xml === void 0 ? void 0 : _data$xml.width) !== null && _data$xml$viewBox$ani !== void 0 ? _data$xml$viewBox$ani : 0,
|
|
1078
|
-
svg_height: (_data$xml$viewBox$ani2 = (_data$xml2 = data.xml) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.viewBox) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.animVal) === null || _data$xml2 === void 0 ? void 0 : _data$xml2.height) !== null && _data$xml$viewBox$ani2 !== void 0 ? _data$xml$viewBox$ani2 : 0
|
|
1079
|
-
};
|
|
1080
|
-
resolve();
|
|
1081
|
-
}, null, function (error) {
|
|
1082
|
-
console.error(error);
|
|
1083
|
-
reject(error);
|
|
1084
|
-
});
|
|
1085
|
-
}));
|
|
1086
|
-
case 1:
|
|
1087
|
-
case "end":
|
|
1088
|
-
return _context8.stop();
|
|
1089
|
-
}
|
|
1090
|
-
}, _callee7);
|
|
1091
|
-
}));
|
|
1092
|
-
return _loadMoldingSvg.apply(this, arguments);
|
|
1093
|
-
}
|
|
1094
|
-
function setFinishing(props, state, payload) {
|
|
1095
|
-
switch (payload.category) {
|
|
1096
|
-
case FINISHING_TYPE.WALL_COLOR:
|
|
1097
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.itemsActions.setWallColor(payload.color);
|
|
1098
|
-
break;
|
|
1099
|
-
case FINISHING_TYPE.COUNTER_TOP:
|
|
1100
|
-
props.itemsActions.setCounterTop({
|
|
1101
|
-
uri: payload.texture
|
|
1102
|
-
});
|
|
1103
|
-
break;
|
|
1104
|
-
case FINISHING_TYPE.FLOOR_STYLE:
|
|
1105
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.areaActions.setFloorStyles({
|
|
1106
|
-
uri: payload.texture
|
|
1107
|
-
});
|
|
1108
|
-
break;
|
|
1109
|
-
case FINISHING_TYPE.BACKSPLASH:
|
|
1110
|
-
if (state.mode !== MODE_ELEVATION_VIEW) props.itemsActions.setBacksplash({
|
|
1111
|
-
uri: payload.texture
|
|
1112
|
-
});
|
|
1113
|
-
break;
|
|
1114
|
-
case FINISHING_TYPE.DOOR_HANDLE:
|
|
1115
|
-
props.itemsActions.setDoorHandle(payload.gltf);
|
|
1116
|
-
break;
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
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
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
} else if (eventType === EXTERNAL_EVENT_ROTATE_PAN) {
|
|
1173
|
-
var rotateType = payload.rotateType;
|
|
1174
|
-
switch (rotateType) {
|
|
1175
|
-
case TOP:
|
|
1176
|
-
window.interval = setTimeout(function () {
|
|
1177
|
-
window.SPKeyDown({
|
|
1178
|
-
keyCode: 87
|
|
1179
|
-
});
|
|
1180
|
-
}, 50);
|
|
1181
|
-
break;
|
|
1182
|
-
case BOTTOM:
|
|
1183
|
-
window.interval = setTimeout(function () {
|
|
1184
|
-
window.SPKeyDown({
|
|
1185
|
-
keyCode: 83
|
|
1186
|
-
});
|
|
1187
|
-
}, 50);
|
|
1188
|
-
break;
|
|
1189
|
-
case RIGHT:
|
|
1190
|
-
window.interval = setTimeout(function () {
|
|
1191
|
-
window.SPKeyDown({
|
|
1192
|
-
keyCode: 68
|
|
1193
|
-
});
|
|
1194
|
-
}, 50);
|
|
1195
|
-
break;
|
|
1196
|
-
case LEFT:
|
|
1197
|
-
window.interval = setTimeout(function () {
|
|
1198
|
-
window.SPKeyDown({
|
|
1199
|
-
keyCode: 65
|
|
1200
|
-
});
|
|
1201
|
-
}, 50);
|
|
1202
|
-
break;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
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
|
-
}
|
|
1231
|
-
export function handleExternalEvent(_x10) {
|
|
1232
|
-
return _handleExternalEvent.apply(this, arguments);
|
|
1233
|
-
}
|
|
1234
|
-
function _handleExternalEvent() {
|
|
1235
|
-
_handleExternalEvent = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(props) {
|
|
1236
|
-
var _evt$payload3, _evt$payload4;
|
|
1237
|
-
var evt, state, layerId, layer, _evt$payload, _state$catalog, cdsItems, itemKeys, _loop6, i, newScene, tempState, _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, measurementUnit, _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) {
|
|
1240
|
-
case 0:
|
|
1241
|
-
// console.log('***external event****', props.externalEvent);
|
|
1242
|
-
evt = props.externalEvent;
|
|
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]);
|
|
1252
|
-
_t5 = evt === null || evt === void 0 ? void 0 : evt.type;
|
|
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;
|
|
1254
|
-
break;
|
|
1255
|
-
case 2:
|
|
1256
|
-
if (!(evt !== null && evt !== void 0 && evt.payload)) {
|
|
1257
|
-
_context11.next = 6;
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
// prepare item data request
|
|
1261
|
-
cdsItems = [];
|
|
1262
|
-
itemKeys = 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 && _evt$payload.items ? Object.keys(evt.payload.layers['layer-1'].items) : [];
|
|
1263
|
-
_loop6 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop6() {
|
|
1264
|
-
var _evt$payload2, _it$properties, _it$properties2, _it$properties3, _it$doorStyle2;
|
|
1265
|
-
var it;
|
|
1266
|
-
return _regeneratorRuntime.wrap(function (_context0) {
|
|
1267
|
-
while (1) switch (_context0.prev = _context0.next) {
|
|
1268
|
-
case 0:
|
|
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
|
-
/////////
|
|
1274
|
-
if (!cdsItems.some(function (v) {
|
|
1275
|
-
var _it$doorStyle;
|
|
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;
|
|
1277
|
-
})) cdsItems.push({
|
|
1278
|
-
itemID: it.itemID,
|
|
1279
|
-
prototype: it.prototype,
|
|
1280
|
-
category: it.category,
|
|
1281
|
-
name: it.name,
|
|
1282
|
-
type: it.type,
|
|
1283
|
-
sku_number: it.sku_number,
|
|
1284
|
-
cdsId: (_it$doorStyle2 = it.doorStyle) === null || _it$doorStyle2 === void 0 || (_it$doorStyle2 = _it$doorStyle2.doorStyles) === null || _it$doorStyle2 === void 0 ? void 0 : _it$doorStyle2.cabinet_door_style_id
|
|
1285
|
-
});
|
|
1286
|
-
case 1:
|
|
1287
|
-
case "end":
|
|
1288
|
-
return _context0.stop();
|
|
1289
|
-
}
|
|
1290
|
-
}, _loop6);
|
|
1291
|
-
});
|
|
1292
|
-
i = 0;
|
|
1293
|
-
case 3:
|
|
1294
|
-
if (!(i < itemKeys.length)) {
|
|
1295
|
-
_context11.next = 5;
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
return _context11.delegateYield(_loop6(), "t0", 4);
|
|
1299
|
-
case 4:
|
|
1300
|
-
i++;
|
|
1301
|
-
_context11.next = 3;
|
|
1302
|
-
break;
|
|
1303
|
-
case 5:
|
|
1304
|
-
newScene = new Scene(evt === null || evt === void 0 ? void 0 : evt.payload);
|
|
1305
|
-
tempState = new State({
|
|
1306
|
-
scene: newScene.toJS(),
|
|
1307
|
-
catalog: (_state$catalog = state.catalog) === null || _state$catalog === void 0 ? void 0 : _state$catalog.toJS()
|
|
1308
|
-
}); // request item catalog data to host app
|
|
1309
|
-
if (cdsItems.length > 0) {
|
|
1310
|
-
(_props$onInternalEven = props.onInternalEvent) === null || _props$onInternalEven === void 0 || _props$onInternalEven.call(props, {
|
|
1311
|
-
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1312
|
-
value: {
|
|
1313
|
-
cdsItems: cdsItems
|
|
1314
|
-
}
|
|
1315
|
-
}, /*#__PURE__*/function () {
|
|
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) {
|
|
1320
|
-
case 0:
|
|
1321
|
-
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
1322
|
-
_i = 0;
|
|
1323
|
-
case 1:
|
|
1324
|
-
if (!(_i < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1325
|
-
_context9.next = 3;
|
|
1326
|
-
break;
|
|
1327
|
-
}
|
|
1328
|
-
_context9.next = 2;
|
|
1329
|
-
return addItemToCatalog(rt[_i], tempState, props.catalog, props.projectActions);
|
|
1330
|
-
case 2:
|
|
1331
|
-
_i++;
|
|
1332
|
-
_context9.next = 1;
|
|
1333
|
-
break;
|
|
1334
|
-
case 3:
|
|
1335
|
-
props.projectActions.loadProject(evt.payload);
|
|
1336
|
-
case 4:
|
|
1337
|
-
case "end":
|
|
1338
|
-
return _context9.stop();
|
|
1339
|
-
}
|
|
1340
|
-
}, _callee8);
|
|
1341
|
-
}));
|
|
1342
|
-
return function (_x11) {
|
|
1343
|
-
return _ref3.apply(this, arguments);
|
|
1344
|
-
};
|
|
1345
|
-
}());
|
|
1346
|
-
} else props.projectActions.loadProject(evt.payload);
|
|
1347
|
-
case 6:
|
|
1348
|
-
return _context11.abrupt("continue", 45);
|
|
1349
|
-
case 7:
|
|
1350
|
-
props.projectActions.unselectAll();
|
|
1351
|
-
props.projectActions.setMode(MODE_IDLE_3D);
|
|
1352
|
-
return _context11.abrupt("continue", 45);
|
|
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:
|
|
1361
|
-
if (state.mode === MODE_IDLE || state.mode === MODE_2D_PAN) props.linesActions.selectToolDrawingLine('wall');else {
|
|
1362
|
-
props.projectActions.setMode(MODE_IDLE);
|
|
1363
|
-
props.linesActions.selectToolDrawingLine('wall');
|
|
1364
|
-
}
|
|
1365
|
-
return _context11.abrupt("continue", 45);
|
|
1366
|
-
case 11:
|
|
1367
|
-
if (isEmpty(evt === null || evt === void 0 ? void 0 : evt.payload)) {
|
|
1368
|
-
_context11.next = 13;
|
|
1369
|
-
break;
|
|
1370
|
-
}
|
|
1371
|
-
element = evt.payload;
|
|
1372
|
-
_context11.next = 12;
|
|
1373
|
-
return addItemToCatalog(element, state, props.catalog, props.projectActions);
|
|
1374
|
-
case 12:
|
|
1375
|
-
// start drawing item
|
|
1376
|
-
if (ARRAY_3D_MODES.includes(state.mode)) {
|
|
1377
|
-
// in 3d view
|
|
1378
|
-
props.itemsActions.selectToolDrawingItem3D(element.name);
|
|
1379
|
-
} else {
|
|
1380
|
-
// in 2d view
|
|
1381
|
-
// create cabinet
|
|
1382
|
-
props.itemsActions.selectToolDrawingItem(element.name);
|
|
1383
|
-
// mapping the initial position of client coord to viewer2D coord
|
|
1384
|
-
_evt$payload$initialP = evt.payload.initialPosition, mouseX = _evt$payload$initialP.mouseX, mouseY = _evt$payload$initialP.mouseY;
|
|
1385
|
-
v2d = (_state$viewer2D = state.viewer2D) === null || _state$viewer2D === void 0 ? void 0 : _state$viewer2D.toJS();
|
|
1386
|
-
if (mouseX && mouseY && v2d) {
|
|
1387
|
-
vPosX = (mouseX - v2d.e) / v2d.a;
|
|
1388
|
-
vPosY = (mouseY - v2d.f) / v2d.d;
|
|
1389
|
-
layerID = state.scene.selectedLayer; // move cabinet to initial position
|
|
1390
|
-
props.itemsActions.updateDrawingItem(layerID, vPosX, -vPosY + state.scene.height, true);
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
props.projectActions.pushLastSelectedCatalogElementToHistory(element);
|
|
1394
|
-
props.projectActions.setIsCabinetDrawing(true);
|
|
1395
|
-
case 13:
|
|
1396
|
-
return _context11.abrupt("continue", 45);
|
|
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:
|
|
1404
|
-
defaulTitle = 'Untitle';
|
|
1405
|
-
props.projectActions.newProject();
|
|
1406
|
-
props.projectActions.rename(defaulTitle);
|
|
1407
|
-
return _context11.abrupt("continue", 45);
|
|
1408
|
-
case 17:
|
|
1409
|
-
_evt$payload5 = evt.payload, doorStyle = _evt$payload5.doorStyle, itemCDS = _evt$payload5.itemCDS, isAll = _evt$payload5.isAll; // prepare item data request
|
|
1410
|
-
_layerId = state.getIn(['scene', 'selectedLayer']);
|
|
1411
|
-
_cdsItems = [];
|
|
1412
|
-
allItems = state.getIn(['scene', 'layers', _layerId, 'items']).toJS();
|
|
1413
|
-
selectedItemId = state.getIn(['scene', 'layers', _layerId]).selected.items.toJS()[0];
|
|
1414
|
-
_itemKeys = isAll ? (_Object$keys = Object.keys(allItems)) !== null && _Object$keys !== void 0 ? _Object$keys : [] : [selectedItemId];
|
|
1415
|
-
_loop7 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop7() {
|
|
1416
|
-
var _itemCDS$find;
|
|
1417
|
-
var item, cdsId;
|
|
1418
|
-
return _regeneratorRuntime.wrap(function (_context10) {
|
|
1419
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
1420
|
-
case 0:
|
|
1421
|
-
item = allItems[_itemKeys[_i2]];
|
|
1422
|
-
cdsId = (_itemCDS$find = itemCDS.find(function (itCDS) {
|
|
1423
|
-
return itCDS.itemID === item.itemID;
|
|
1424
|
-
})) === null || _itemCDS$find === void 0 ? void 0 : _itemCDS$find.cabinet_door_style_id;
|
|
1425
|
-
if (cdsId && !_cdsItems.some(function (v) {
|
|
1426
|
-
return item.itemID === v.itemID && item.name === v.name && cdsId === v.cdsId;
|
|
1427
|
-
})) _cdsItems.push({
|
|
1428
|
-
itemID: item.itemID,
|
|
1429
|
-
prototype: item.prototype,
|
|
1430
|
-
category: item.category,
|
|
1431
|
-
name: item.name,
|
|
1432
|
-
type: item.type,
|
|
1433
|
-
sku_number: item.sku_number,
|
|
1434
|
-
cdsId: cdsId
|
|
1435
|
-
});
|
|
1436
|
-
case 1:
|
|
1437
|
-
case "end":
|
|
1438
|
-
return _context10.stop();
|
|
1439
|
-
}
|
|
1440
|
-
}, _loop7);
|
|
1441
|
-
});
|
|
1442
|
-
_i2 = 0;
|
|
1443
|
-
case 18:
|
|
1444
|
-
if (!(_i2 < _itemKeys.length)) {
|
|
1445
|
-
_context11.next = 20;
|
|
1446
|
-
break;
|
|
1447
|
-
}
|
|
1448
|
-
return _context11.delegateYield(_loop7(), "t1", 19);
|
|
1449
|
-
case 19:
|
|
1450
|
-
_i2++;
|
|
1451
|
-
_context11.next = 18;
|
|
1452
|
-
break;
|
|
1453
|
-
case 20:
|
|
1454
|
-
// request item catalog data to host app
|
|
1455
|
-
if (_cdsItems.length > 0) {
|
|
1456
|
-
(_props$onInternalEven2 = props.onInternalEvent) === null || _props$onInternalEven2 === void 0 || _props$onInternalEven2.call(props, {
|
|
1457
|
-
type: INTERNAL_EVENT_ITEMS_CATALOG,
|
|
1458
|
-
value: {
|
|
1459
|
-
cdsItems: _cdsItems
|
|
1460
|
-
}
|
|
1461
|
-
}, /*#__PURE__*/function () {
|
|
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) {
|
|
1466
|
-
case 0:
|
|
1467
|
-
rt = mergeSameElements(result === null || result === void 0 ? void 0 : result.elements);
|
|
1468
|
-
_i3 = 0;
|
|
1469
|
-
case 1:
|
|
1470
|
-
if (!(_i3 < (rt === null || rt === void 0 ? void 0 : rt.length))) {
|
|
1471
|
-
_context1.next = 3;
|
|
1472
|
-
break;
|
|
1473
|
-
}
|
|
1474
|
-
_context1.next = 2;
|
|
1475
|
-
return addItemToCatalog(rt[_i3], state, props.catalog, props.projectActions);
|
|
1476
|
-
case 2:
|
|
1477
|
-
_i3++;
|
|
1478
|
-
_context1.next = 1;
|
|
1479
|
-
break;
|
|
1480
|
-
case 3:
|
|
1481
|
-
props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1482
|
-
case 4:
|
|
1483
|
-
case "end":
|
|
1484
|
-
return _context1.stop();
|
|
1485
|
-
}
|
|
1486
|
-
}, _callee9);
|
|
1487
|
-
}));
|
|
1488
|
-
return function (_x12) {
|
|
1489
|
-
return _ref4.apply(this, arguments);
|
|
1490
|
-
};
|
|
1491
|
-
}());
|
|
1492
|
-
} else props.itemsActions.setDoorStyle(doorStyle, itemCDS, isAll);
|
|
1493
|
-
return _context11.abrupt("continue", 45);
|
|
1494
|
-
case 21:
|
|
1495
|
-
_evt$payload6 = evt.payload, roomShapeType = _evt$payload6.roomShapeType, width = _evt$payload6.width, height = _evt$payload6.height, measurementUnit = _evt$payload6.measurementUnit, _doorStyle = _evt$payload6.doorStyle;
|
|
1496
|
-
props.projectActions.createRoomWithShape(roomShapeType, width, height, measurementUnit, _doorStyle);
|
|
1497
|
-
return _context11.abrupt("continue", 45);
|
|
1498
|
-
case 22:
|
|
1499
|
-
value = state.getIn(['viewer2D']).toJS();
|
|
1500
|
-
value.a += 0.1;
|
|
1501
|
-
value.d += 0.1;
|
|
1502
|
-
value.e -= value.SVGWidth * 0.1 / 2;
|
|
1503
|
-
value.f -= value.SVGHeight * 0.1 / 2;
|
|
1504
|
-
updateViwer2D(value, props.viewer2DActions);
|
|
1505
|
-
return _context11.abrupt("continue", 45);
|
|
1506
|
-
case 23:
|
|
1507
|
-
_value = state.getIn(['viewer2D']).toJS();
|
|
1508
|
-
_value.a -= 0.1;
|
|
1509
|
-
_value.d -= 0.1;
|
|
1510
|
-
_value.e += _value.SVGWidth * 0.1 / 2;
|
|
1511
|
-
_value.f += _value.SVGHeight * 0.1 / 2;
|
|
1512
|
-
updateViwer2D(_value, props.viewer2DActions);
|
|
1513
|
-
return _context11.abrupt("continue", 45);
|
|
1514
|
-
case 24:
|
|
1515
|
-
centering2D(state, props.viewer2DActions);
|
|
1516
|
-
return _context11.abrupt("continue", 45);
|
|
1517
|
-
case 25:
|
|
1518
|
-
props.projectActions.undo();
|
|
1519
|
-
return _context11.abrupt("continue", 45);
|
|
1520
|
-
case 26:
|
|
1521
|
-
props.projectActions.redo();
|
|
1522
|
-
return _context11.abrupt("continue", 45);
|
|
1523
|
-
case 27:
|
|
1524
|
-
_evt$payload7 = evt.payload, moldingInfo = _evt$payload7.moldingInfo, isGlobal = _evt$payload7.isGlobal;
|
|
1525
|
-
_context11.next = 28;
|
|
1526
|
-
return loadMoldingSvg(moldingInfo);
|
|
1527
|
-
case 28:
|
|
1528
|
-
props.itemsActions.setMolding(moldingInfo, isGlobal);
|
|
1529
|
-
return _context11.abrupt("continue", 45);
|
|
1530
|
-
case 29:
|
|
1531
|
-
distElement = getElement(evt.payload, state);
|
|
1532
|
-
if (distElement) props.itemsActions.duplicateSelected(distElement, props.onInternalEvent);
|
|
1533
|
-
return _context11.abrupt("continue", 45);
|
|
1534
|
-
case 30:
|
|
1535
|
-
_distElement = getElement(evt.payload, state);
|
|
1536
|
-
if (_distElement) props.projectActions.remove(_distElement);
|
|
1537
|
-
return _context11.abrupt("continue", 45);
|
|
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:
|
|
1578
|
-
_layerID = state.scene.selectedLayer;
|
|
1579
|
-
_layer2 = state.scene.getIn(['layers', _layerID]).toJS();
|
|
1580
|
-
orginalItemInfo = evt === null || evt === void 0 || (_evt$payload9 = evt.payload) === null || _evt$payload9 === void 0 ? void 0 : _evt$payload9.orginalItemInfo;
|
|
1581
|
-
originalItem = _layer2 === null || _layer2 === void 0 ? void 0 : _layer2.items[orginalItemInfo.id];
|
|
1582
|
-
_context11.next = 42;
|
|
1583
|
-
return addItemToCatalog(evt.payload.replaceItemInfo, state, props.catalog, props.projectActions);
|
|
1584
|
-
case 42:
|
|
1585
|
-
originalItemPos = {
|
|
1586
|
-
rotation: originalItem.rotation,
|
|
1587
|
-
selectedItemId: originalItem.id,
|
|
1588
|
-
x: originalItem.x,
|
|
1589
|
-
y: originalItem.y
|
|
1590
|
-
};
|
|
1591
|
-
replaceItem = {
|
|
1592
|
-
name: evt === null || evt === void 0 || (_evt$payload0 = evt.payload) === null || _evt$payload0 === void 0 || (_evt$payload0 = _evt$payload0.replaceItemInfo) === null || _evt$payload0 === void 0 ? void 0 : _evt$payload0.name,
|
|
1593
|
-
info: {
|
|
1594
|
-
width: evt === null || evt === void 0 || (_evt$payload1 = evt.payload) === null || _evt$payload1 === void 0 || (_evt$payload1 = _evt$payload1.replaceItemInfo) === null || _evt$payload1 === void 0 || (_evt$payload1 = _evt$payload1.sizeinfo) === null || _evt$payload1 === void 0 ? void 0 : _evt$payload1.width,
|
|
1595
|
-
height: evt === null || evt === void 0 || (_evt$payload10 = evt.payload) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.replaceItemInfo) === null || _evt$payload10 === void 0 || (_evt$payload10 = _evt$payload10.sizeinfo) === null || _evt$payload10 === void 0 ? void 0 : _evt$payload10.height
|
|
1596
|
-
}
|
|
1597
|
-
};
|
|
1598
|
-
props.itemsActions.replaceItem(originalItemPos, originalItem, replaceItem);
|
|
1599
|
-
return _context11.abrupt("continue", 45);
|
|
1600
|
-
case 43:
|
|
1601
|
-
setFinishing(props, state, evt.payload);
|
|
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);
|
|
1607
|
-
// send scene object from 3DTool to HostApp using internalEvent
|
|
1608
|
-
(_props$onInternalEven3 = props.onInternalEvent) === null || _props$onInternalEven3 === void 0 || _props$onInternalEven3.call(props, {
|
|
1609
|
-
type: INTERNAL_EVENT_SYNC_SCENE,
|
|
1610
|
-
value: {
|
|
1611
|
-
scene: sceneData
|
|
1612
|
-
}
|
|
1613
|
-
});
|
|
1614
|
-
return _context11.abrupt("continue", 45);
|
|
1615
|
-
case 45:
|
|
1616
|
-
case "end":
|
|
1617
|
-
return _context11.stop();
|
|
1618
|
-
}
|
|
1619
|
-
}, _callee0);
|
|
1620
|
-
}));
|
|
1621
|
-
return _handleExternalEvent.apply(this, arguments);
|
|
1622
|
-
}
|