blue-chestnut-solar-expert 0.0.68 → 0.0.69
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/dist/cjs/app-globals-I24yU8do.js +10 -0
- package/dist/cjs/app-globals-I24yU8do.js.map +1 -0
- package/dist/cjs/basedecoder-CQuzfSgz.js +116 -0
- package/dist/cjs/basedecoder-CQuzfSgz.js.map +1 -0
- package/dist/cjs/deflate-AzGzQSW2.js +17 -0
- package/dist/cjs/deflate-AzGzQSW2.js.map +1 -0
- package/dist/cjs/eraser-icon_19.cjs.entry.js +31 -0
- package/dist/cjs/eraser-icon_19.cjs.entry.js.map +1 -0
- package/dist/cjs/index-HgRXF6kp.js +1470 -0
- package/dist/cjs/index-HgRXF6kp.js.map +1 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/jpeg-Bx3bTm32.js +904 -0
- package/dist/cjs/jpeg-Bx3bTm32.js.map +1 -0
- package/dist/cjs/lerc-Bdx5y-yw.js +4427 -0
- package/dist/cjs/lerc-Bdx5y-yw.js.map +1 -0
- package/dist/cjs/loader.cjs.js +18 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/loading-widget.cjs.entry.js +22 -0
- package/dist/{stencil-library/polygon-information.entry.esm.js.map → cjs/loading-widget.cjs.entry.js.map} +1 -1
- package/dist/cjs/loading-widget.entry.cjs.js.map +1 -0
- package/dist/cjs/lzw-BmFug486.js +140 -0
- package/dist/cjs/lzw-BmFug486.js.map +1 -0
- package/dist/cjs/packbits-CYx9fB0v.js +35 -0
- package/dist/cjs/packbits-CYx9fB0v.js.map +1 -0
- package/dist/cjs/pako.esm-0mKI6Jik.js +3243 -0
- package/dist/cjs/pako.esm-0mKI6Jik.js.map +1 -0
- package/dist/cjs/raw-DC82yoyr.js +16 -0
- package/dist/cjs/raw-DC82yoyr.js.map +1 -0
- package/dist/cjs/stencil-library.cjs.js +30 -0
- package/dist/cjs/stencil-library.cjs.js.map +1 -0
- package/dist/cjs/webimage-Dc0t2xAB.js +49 -0
- package/dist/cjs/webimage-Dc0t2xAB.js.map +1 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/icons/eraser.js +64 -0
- package/dist/collection/components/icons/eraser.js.map +1 -0
- package/dist/collection/components/icons/house.js +64 -0
- package/dist/collection/components/icons/house.js.map +1 -0
- package/dist/collection/components/icons/icon.js +108 -0
- package/dist/collection/components/icons/icon.js.map +1 -0
- package/dist/collection/components/icons/marker.js +64 -0
- package/dist/collection/components/icons/marker.js.map +1 -0
- package/dist/collection/components/icons/move.js +64 -0
- package/dist/collection/components/icons/move.js.map +1 -0
- package/dist/collection/components/icons/octagonMinus.js +64 -0
- package/dist/collection/components/icons/octagonMinus.js.map +1 -0
- package/dist/collection/components/icons/search.js +64 -0
- package/dist/collection/components/icons/search.js.map +1 -0
- package/dist/collection/components/icons/settings.js +64 -0
- package/dist/collection/components/icons/settings.js.map +1 -0
- package/dist/collection/components/icons/undo.js +64 -0
- package/dist/collection/components/icons/undo.js.map +1 -0
- package/dist/collection/components/map-draw/map-draw.js +824 -0
- package/dist/collection/components/map-draw/map-draw.js.map +1 -0
- package/dist/collection/components/map-draw/map-selector.js +246 -0
- package/dist/collection/components/map-draw/map-selector.js.map +1 -0
- package/dist/collection/components/map-draw/polygon-buttons.js +86 -0
- package/dist/collection/components/map-draw/polygon-buttons.js.map +1 -0
- package/dist/collection/components/map-draw/polygon-information.js +211 -0
- package/dist/collection/components/map-draw/polygon-information.js.map +1 -0
- package/dist/collection/components/map-draw/tool-box.js +108 -0
- package/dist/collection/components/map-draw/tool-box.js.map +1 -0
- package/dist/collection/components/map-draw/tutorial-component.js +219 -0
- package/dist/collection/components/map-draw/tutorial-component.js.map +1 -0
- package/dist/collection/components/settings/settings.js +127 -0
- package/dist/collection/components/settings/settings.js.map +1 -0
- package/dist/collection/components/solar-expert/solar-expert.js +241 -0
- package/dist/collection/components/solar-expert/solar-expert.js.map +1 -0
- package/dist/collection/components/solar-system-form/solar-system-form.js +617 -0
- package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -0
- package/dist/collection/components/widgets/loading-widget.js +18 -0
- package/dist/collection/components/widgets/loading-widget.js.map +1 -0
- package/dist/collection/components/widgets/toast-notification.js +133 -0
- package/dist/collection/components/widgets/toast-notification.js.map +1 -0
- package/dist/{stencil-library/config-CWfV1nKn.js → collection/config.js} +4 -10
- package/dist/collection/config.js.map +1 -0
- package/dist/collection/constants.js +90 -0
- package/dist/collection/constants.js.map +1 -0
- package/dist/collection/index.js +2 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/output.css +1126 -0
- package/dist/collection/store.js +43 -0
- package/dist/collection/store.js.map +1 -0
- package/dist/collection/types/lang.js +2 -0
- package/dist/collection/types/lang.js.map +1 -0
- package/dist/collection/types/shapes.js +2 -0
- package/dist/collection/types/shapes.js.map +1 -0
- package/dist/collection/utils/api.js +94 -0
- package/dist/collection/utils/api.js.map +1 -0
- package/dist/collection/utils/images.js +2 -0
- package/dist/collection/utils/images.js.map +1 -0
- package/dist/collection/utils/lang/english.js +164 -0
- package/dist/collection/utils/lang/english.js.map +1 -0
- package/dist/collection/utils/lang/general.js +30 -0
- package/dist/collection/utils/lang/general.js.map +1 -0
- package/dist/collection/utils/lang/german.js +164 -0
- package/dist/collection/utils/lang/german.js.map +1 -0
- package/dist/collection/utils/lang/spanish.js +164 -0
- package/dist/collection/utils/lang/spanish.js.map +1 -0
- package/dist/{stencil-library/tools-BNYKV5H5.js → collection/utils/render/tools.js} +8 -14
- package/dist/collection/utils/render/tools.js.map +1 -0
- package/dist/collection/utils/solar.js +135 -0
- package/dist/collection/utils/solar.js.map +1 -0
- package/dist/collection/utils/theme.js +97 -0
- package/dist/collection/utils/theme.js.map +1 -0
- package/dist/{stencil-library/utils-BCUZxI9u.js → collection/utils/utils.js} +3 -9
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/eraser-icon.js +11 -0
- package/dist/components/eraser-icon.js.map +1 -0
- package/dist/components/house-icon.js +11 -0
- package/dist/components/house-icon.js.map +1 -0
- package/dist/components/icon-selector.js +11 -0
- package/dist/components/icon-selector.js.map +1 -0
- package/dist/components/index.js +1269 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/loading-widget.js +38 -0
- package/dist/{stencil-library/marker-icon.entry.esm.js.map → components/loading-widget.js.map} +1 -1
- package/dist/components/map-draw.js +11 -0
- package/dist/components/map-draw.js.map +1 -0
- package/dist/components/map-selector.js +11 -0
- package/dist/components/map-selector.js.map +1 -0
- package/dist/components/marker-icon.js +11 -0
- package/dist/components/marker-icon.js.map +1 -0
- package/dist/components/move-icon.js +11 -0
- package/dist/components/move-icon.js.map +1 -0
- package/dist/components/octagon-minus-icon.js +11 -0
- package/dist/components/octagon-minus-icon.js.map +1 -0
- package/dist/{stencil-library/polygon-buttons.entry.js → components/p-26DHwbCE.js} +29 -10
- package/dist/{stencil-library/solar-expert.entry.js.map → components/p-26DHwbCE.js.map} +1 -1
- package/dist/components/p-B54Ul0nf.js +15 -0
- package/dist/components/p-B54Ul0nf.js.map +1 -0
- package/dist/components/p-B5WTRCh8.js +3241 -0
- package/dist/components/p-B5WTRCh8.js.map +1 -0
- package/dist/{stencil-library/jpeg-Dd5nnHR5.js → components/p-BGoSj_DR.js} +3 -11
- package/dist/components/p-BGoSj_DR.js.map +1 -0
- package/dist/{stencil-library/octagon-minus-icon.entry.js → components/p-BJLO76Yi.js} +27 -9
- package/dist/components/p-BJLO76Yi.js.map +1 -0
- package/dist/components/p-BOe-Z8rz.js +16323 -0
- package/dist/components/p-BOe-Z8rz.js.map +1 -0
- package/dist/{stencil-library/map-selector.entry.js → components/p-Bduzzygj.js} +453 -12
- package/dist/components/p-Bduzzygj.js.map +1 -0
- package/dist/{stencil-library/packbits-X3R_utTs.js → components/p-ByX6QP-E.js} +3 -9
- package/dist/components/p-ByX6QP-E.js.map +1 -0
- package/dist/{stencil-library/solar-system-form.entry.js → components/p-C3ZXE525.js} +382 -80
- package/dist/components/p-C3ZXE525.js.map +1 -0
- package/dist/{stencil-library/icon-selector.entry.js → components/p-C5QieOat.js} +76 -9
- package/dist/components/p-C5QieOat.js.map +1 -0
- package/dist/{stencil-library/eraser-icon.entry.js → components/p-CL74Q4VR.js} +27 -9
- package/dist/components/p-CL74Q4VR.js.map +1 -0
- package/dist/{stencil-library/webimage-CBrfoxHM.js → components/p-Cgchl6bA.js} +3 -9
- package/dist/components/p-Cgchl6bA.js.map +1 -0
- package/dist/{stencil-library/tool-box.entry.js → components/p-Cx7fffWb.js} +135 -11
- package/dist/components/p-Cx7fffWb.js.map +1 -0
- package/dist/{stencil-library/tutorial-component.entry.js → components/p-D2AHNjbG.js} +35 -10
- package/dist/{stencil-library/toast-notification.entry.esm.js.map → components/p-D2AHNjbG.js.map} +1 -1
- package/dist/{stencil-library/house-icon.entry.js → components/p-D8w3bTPO.js} +27 -9
- package/dist/components/p-D8w3bTPO.js.map +1 -0
- package/dist/{stencil-library/search-icon.entry.js → components/p-DBwr8xSB.js} +27 -9
- package/dist/components/p-DBwr8xSB.js.map +1 -0
- package/dist/{stencil-library/lerc-7W4E8EBs.js → components/p-DLWzgdrw.js} +1981 -27
- package/dist/components/p-DLWzgdrw.js.map +1 -0
- package/dist/{stencil-library/settings-icon.entry.js → components/p-DTXeHbuh.js} +27 -9
- package/dist/{stencil-library/octagon-minus-icon.entry.esm.js.map → components/p-DTXeHbuh.js.map} +1 -1
- package/dist/{stencil-library/settings-modal.entry.js → components/p-Ddk3b30j.js} +30 -12
- package/dist/{stencil-library/polygon-buttons.entry.esm.js.map → components/p-Ddk3b30j.js.map} +1 -1
- package/dist/{stencil-library/store-CcqrFuBK.js → components/p-DfzSejIb.js} +3 -3
- package/dist/components/p-DfzSejIb.js.map +1 -0
- package/dist/{stencil-library/move-icon.entry.js → components/p-FdEV2qPo.js} +27 -9
- package/dist/components/p-FdEV2qPo.js.map +1 -0
- package/dist/{stencil-library/polygon-information.entry.js → components/p-OxUYjaAL.js} +68 -11
- package/dist/components/p-OxUYjaAL.js.map +1 -0
- package/dist/{stencil-library/toast-notification.entry.js → components/p-P28NBglk.js} +30 -9
- package/dist/{stencil-library/loading-widget.entry.js.map → components/p-P28NBglk.js.map} +1 -1
- package/dist/{stencil-library/marker-icon.entry.js → components/p-Umz6nJIv.js} +27 -9
- package/dist/components/p-Umz6nJIv.js.map +1 -0
- package/dist/components/p-WmcSqXD8.js +14 -0
- package/dist/components/p-WmcSqXD8.js.map +1 -0
- package/dist/components/p-j-vOrhhh.js +114 -0
- package/dist/components/p-j-vOrhhh.js.map +1 -0
- package/dist/{stencil-library/lzw--P4c0ZHH.js → components/p-q8auDIJ2.js} +4 -10
- package/dist/components/p-q8auDIJ2.js.map +1 -0
- package/dist/{stencil-library/undo-icon.entry.js → components/p-waOPoUcA.js} +27 -9
- package/dist/components/p-waOPoUcA.js.map +1 -0
- package/dist/components/polygon-buttons.js +11 -0
- package/dist/components/polygon-buttons.js.map +1 -0
- package/dist/components/polygon-information.js +11 -0
- package/dist/components/polygon-information.js.map +1 -0
- package/dist/components/search-icon.js +11 -0
- package/dist/components/search-icon.js.map +1 -0
- package/dist/components/settings-icon.js +11 -0
- package/dist/components/settings-icon.js.map +1 -0
- package/dist/components/settings-modal.js +11 -0
- package/dist/components/settings-modal.js.map +1 -0
- package/dist/{stencil-library/solar-expert.entry.js → components/solar-expert.js} +149 -13
- package/dist/components/solar-expert.js.map +1 -0
- package/dist/components/solar-system-form.js +11 -0
- package/dist/components/solar-system-form.js.map +1 -0
- package/dist/components/toast-notification.js +11 -0
- package/dist/components/toast-notification.js.map +1 -0
- package/dist/components/tool-box.js +11 -0
- package/dist/components/tool-box.js.map +1 -0
- package/dist/components/tutorial-component.js +11 -0
- package/dist/components/tutorial-component.js.map +1 -0
- package/dist/components/undo-icon.js +11 -0
- package/dist/components/undo-icon.js.map +1 -0
- package/dist/esm/basedecoder-j-vOrhhh.js +114 -0
- package/dist/esm/basedecoder-j-vOrhhh.js.map +1 -0
- package/dist/esm/deflate-DHgPf9CO.js +15 -0
- package/dist/{stencil-library/deflate-0Vdd6-55.js.map → esm/deflate-DHgPf9CO.js.map} +1 -1
- package/dist/esm/eraser-icon_19.entry.js +7 -0
- package/dist/esm/eraser-icon_19.entry.js.map +1 -0
- package/dist/esm/index-C2JRBB5c.js +1458 -0
- package/dist/esm/index-C2JRBB5c.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/jpeg-CJLm1GkA.js +902 -0
- package/dist/esm/jpeg-CJLm1GkA.js.map +1 -0
- package/dist/esm/lerc-DF5Lrv5A.js +4424 -0
- package/dist/esm/lerc-DF5Lrv5A.js.map +1 -0
- package/dist/esm/loader.js +16 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/{stencil-library → esm}/loading-widget.entry.js +2 -2
- package/dist/esm/loading-widget.entry.js.map +1 -0
- package/dist/esm/lzw-DaOzWJUD.js +138 -0
- package/dist/esm/lzw-DaOzWJUD.js.map +1 -0
- package/dist/esm/packbits-CZPyx9kx.js +33 -0
- package/dist/esm/packbits-CZPyx9kx.js.map +1 -0
- package/dist/esm/pako.esm-B5WTRCh8.js +3241 -0
- package/dist/{stencil-library/pako.esm-CPorU236.js.map → esm/pako.esm-B5WTRCh8.js.map} +1 -1
- package/dist/esm/raw-pqeeWc2_.js +14 -0
- package/dist/esm/raw-pqeeWc2_.js.map +1 -0
- package/dist/esm/stencil-library.js +26 -0
- package/dist/esm/stencil-library.js.map +1 -0
- package/dist/esm/webimage-BiHardhv.js +47 -0
- package/dist/{stencil-library/webimage-CBrfoxHM.js.map → esm/webimage-BiHardhv.js.map} +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stencil-library/index.esm.js +1 -13
- package/dist/stencil-library/index.esm.js.map +1 -1
- package/dist/stencil-library/{search-icon.entry.js.map → p-9b4e52c3.entry.js} +2 -1
- package/dist/stencil-library/p-9b4e52c3.entry.js.map +1 -0
- package/dist/stencil-library/p-B54Ul0nf.js +2 -0
- package/dist/stencil-library/p-B54Ul0nf.js.map +1 -0
- package/dist/stencil-library/p-B5WTRCh8.js +2 -0
- package/dist/stencil-library/p-B5WTRCh8.js.map +1 -0
- package/dist/stencil-library/p-BGoSj_DR.js +2 -0
- package/dist/stencil-library/p-BGoSj_DR.js.map +1 -0
- package/dist/stencil-library/p-ByX6QP-E.js +2 -0
- package/dist/stencil-library/p-ByX6QP-E.js.map +1 -0
- package/dist/stencil-library/p-C2JRBB5c.js +3 -0
- package/dist/stencil-library/p-C2JRBB5c.js.map +1 -0
- package/dist/stencil-library/p-CX8V3eiN.js +2 -0
- package/dist/stencil-library/p-CX8V3eiN.js.map +1 -0
- package/dist/stencil-library/p-Cgchl6bA.js +2 -0
- package/dist/stencil-library/p-Cgchl6bA.js.map +1 -0
- package/dist/stencil-library/p-CymYGBJH.js +2 -0
- package/dist/stencil-library/p-CymYGBJH.js.map +1 -0
- package/dist/stencil-library/p-DHgjDQwz.js +10 -0
- package/dist/stencil-library/p-DHgjDQwz.js.map +1 -0
- package/dist/stencil-library/p-WmcSqXD8.js +2 -0
- package/dist/stencil-library/p-WmcSqXD8.js.map +1 -0
- package/dist/stencil-library/p-ba64c5e4.entry.js +2 -0
- package/dist/stencil-library/p-ba64c5e4.entry.js.map +1 -0
- package/dist/stencil-library/p-j-vOrhhh.js +2 -0
- package/dist/stencil-library/p-j-vOrhhh.js.map +1 -0
- package/dist/stencil-library/p-q8auDIJ2.js +2 -0
- package/dist/stencil-library/p-q8auDIJ2.js.map +1 -0
- package/dist/stencil-library/stencil-library.esm.js +1 -52
- package/dist/stencil-library/stencil-library.esm.js.map +1 -1
- package/dist/types/components/solar-system-form/solar-system-form.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/dist/types/utils/api.d.ts +1 -0
- package/package.json +1 -1
- package/dist/stencil-library/config-CWfV1nKn.js.map +0 -1
- package/dist/stencil-library/constants-hboFofU4.js +0 -1522
- package/dist/stencil-library/constants-hboFofU4.js.map +0 -1
- package/dist/stencil-library/decoder-DNOvLSaS.js +0 -39
- package/dist/stencil-library/decoder-DNOvLSaS.js.map +0 -1
- package/dist/stencil-library/deflate-0Vdd6-55.js +0 -21
- package/dist/stencil-library/eraser-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/eraser-icon.entry.js.map +0 -1
- package/dist/stencil-library/house-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/house-icon.entry.js.map +0 -1
- package/dist/stencil-library/icon-selector.entry.esm.js.map +0 -1
- package/dist/stencil-library/icon-selector.entry.js.map +0 -1
- package/dist/stencil-library/index-CChkgM3J.js +0 -414
- package/dist/stencil-library/index-CChkgM3J.js.map +0 -1
- package/dist/stencil-library/index-ICfDNUMe.js +0 -4172
- package/dist/stencil-library/index-ICfDNUMe.js.map +0 -1
- package/dist/stencil-library/jpeg-Dd5nnHR5.js.map +0 -1
- package/dist/stencil-library/lerc-7W4E8EBs.js.map +0 -1
- package/dist/stencil-library/lzw--P4c0ZHH.js.map +0 -1
- package/dist/stencil-library/map-draw-Cx9WZoKH.js +0 -25567
- package/dist/stencil-library/map-draw-Cx9WZoKH.js.map +0 -1
- package/dist/stencil-library/map-draw.entry.esm.js.map +0 -1
- package/dist/stencil-library/map-draw.entry.js +0 -12
- package/dist/stencil-library/map-draw.entry.js.map +0 -1
- package/dist/stencil-library/map-selector.entry.esm.js.map +0 -1
- package/dist/stencil-library/map-selector.entry.js.map +0 -1
- package/dist/stencil-library/marker-icon.entry.js.map +0 -1
- package/dist/stencil-library/move-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/move-icon.entry.js.map +0 -1
- package/dist/stencil-library/octagon-minus-icon.entry.js.map +0 -1
- package/dist/stencil-library/packbits-X3R_utTs.js.map +0 -1
- package/dist/stencil-library/pako.esm-CPorU236.js +0 -6881
- package/dist/stencil-library/polygon-buttons.entry.js.map +0 -1
- package/dist/stencil-library/polygon-information.entry.js.map +0 -1
- package/dist/stencil-library/raw-BxukYehy.js +0 -20
- package/dist/stencil-library/raw-BxukYehy.js.map +0 -1
- package/dist/stencil-library/search-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/settings-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/settings-icon.entry.js.map +0 -1
- package/dist/stencil-library/settings-modal.entry.esm.js.map +0 -1
- package/dist/stencil-library/settings-modal.entry.js.map +0 -1
- package/dist/stencil-library/solar-expert.entry.esm.js.map +0 -1
- package/dist/stencil-library/solar-system-form.entry.esm.js.map +0 -1
- package/dist/stencil-library/solar-system-form.entry.js.map +0 -1
- package/dist/stencil-library/store-CcqrFuBK.js.map +0 -1
- package/dist/stencil-library/toast-notification.entry.js.map +0 -1
- package/dist/stencil-library/tool-box.entry.esm.js.map +0 -1
- package/dist/stencil-library/tool-box.entry.js.map +0 -1
- package/dist/stencil-library/tools-BNYKV5H5.js.map +0 -1
- package/dist/stencil-library/tutorial-component.entry.esm.js.map +0 -1
- package/dist/stencil-library/tutorial-component.entry.js.map +0 -1
- package/dist/stencil-library/undo-icon.entry.esm.js.map +0 -1
- package/dist/stencil-library/undo-icon.entry.js.map +0 -1
- package/dist/stencil-library/utils-BCUZxI9u.js.map +0 -1
- /package/dist/{stencil-library → esm}/app-globals-CX8V3eiN.js +0 -0
- /package/dist/{stencil-library → esm}/app-globals-CX8V3eiN.js.map +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { getLanguageStrings } from "../../utils/lang/general";
|
|
3
|
+
import { state } from "../../store";
|
|
4
|
+
import { azimuthToCardinal } from "../../utils/utils";
|
|
5
|
+
export class PolygonInformation {
|
|
6
|
+
currentPolygon;
|
|
7
|
+
numberOfPanels;
|
|
8
|
+
handleAzimuthChange;
|
|
9
|
+
handlePitchChange;
|
|
10
|
+
calculateSolarPanels;
|
|
11
|
+
markAsFlatRoof;
|
|
12
|
+
currentTool;
|
|
13
|
+
getDisplayAzimuth(azimuth) {
|
|
14
|
+
return (Math.round(azimuth) + 90) % 360;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
const t = getLanguageStrings(state.settings.language);
|
|
18
|
+
// console.log(this.currentPolygon);
|
|
19
|
+
return (h("div", { key: '060e66e13afe182ecbf621c096f1c6f153e74b41', class: "flex gap-4 flex-row justify-center items-center w-full rounded-4xl pb-2", style: {
|
|
20
|
+
border: "1px solid var(--color-border)",
|
|
21
|
+
} }, h("div", { key: '2d0461d15674861e3823cb0d431ca9ef6dd7e5e3', class: "w-full bg-primary rounded-4xl p-3 text-secondary" }, h("h3", { key: '904865a975021b13726c7b4e7f8ca1500ff0b9dd', class: "text-lg font-semibold mb-4 text-center" }, t.mapDraw.information), h("polygon-buttons", { key: 'e8dbba596ca4e30c305967eb5ff2510134fffc02', calculateSolarPanels: this.calculateSolarPanels, markAsFlatRoof: this.markAsFlatRoof, currentTool: this.currentTool }), this.currentPolygon?.area
|
|
22
|
+
? (h("div", { class: "space-y-4" }, h("div", null, h("div", { class: "grid grid-cols-2 gap-2" }, h("div", null, h("h4", { class: "text-sm font-medium text-text-muted" }, t.mapDraw.area), h("p", { class: "text-lg" }, this.currentPolygon
|
|
23
|
+
?.area
|
|
24
|
+
.toFixed(0), " m\u00B2")), h("div", null, h("div", null, h("h4", { class: "text-sm font-medium text-text-muted" }, t.mapDraw.panels), h("p", { class: "text-lg" }, this.numberOfPanels ?? 0))))), h("div", { class: "grid grid-cols-1 md:grid-cols-2 gap-4" }, h("div", null, h("h4", { class: "text-sm font-medium text-text-muted" }, t.mapDraw.azimuth), h("div", { class: "flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2" }, h("input", { class: "text-lg w-full", onKeyDown: (e) => {
|
|
25
|
+
if (e.key === "Enter") {
|
|
26
|
+
this.handleAzimuthChange(e);
|
|
27
|
+
e.target
|
|
28
|
+
.blur();
|
|
29
|
+
}
|
|
30
|
+
}, value: this.getDisplayAzimuth(this.currentPolygon
|
|
31
|
+
?.azimuth ??
|
|
32
|
+
0) }), "(", azimuthToCardinal(this.getDisplayAzimuth(this.currentPolygon.azimuth)), ")"), !state.isIOS && (h("input", { type: "range", min: "0", max: "360", step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: this.getDisplayAzimuth(this.currentPolygon
|
|
33
|
+
?.azimuth ??
|
|
34
|
+
0), onInput: (e) => {
|
|
35
|
+
this.handleAzimuthChange(e);
|
|
36
|
+
} }))), h("div", null, h("h4", { class: "text-sm font-medium text-text-muted md:pl-2" }, t.mapDraw.pitch), h("div", { class: "flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2" }, h("input", { class: "text-lg w-full", onKeyDown: (e) => {
|
|
37
|
+
if (e.key === "Enter") {
|
|
38
|
+
this.handlePitchChange(e);
|
|
39
|
+
e.target
|
|
40
|
+
.blur();
|
|
41
|
+
}
|
|
42
|
+
}, value: Math.round(this.currentPolygon
|
|
43
|
+
?.pitch ??
|
|
44
|
+
0) }), "\u00B0"), !state.isIOS && (h("input", { type: "range", min: "0", max: "90", step: "1", class: "input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted", value: Math.round(this.currentPolygon
|
|
45
|
+
?.pitch ??
|
|
46
|
+
0), onInput: (e) => {
|
|
47
|
+
this.handlePitchChange(e);
|
|
48
|
+
} }))))))
|
|
49
|
+
: (h("p", { class: "text-text-secondary text-center" }, t.mapDraw.noPolygonSelected)))));
|
|
50
|
+
}
|
|
51
|
+
static get is() { return "polygon-information"; }
|
|
52
|
+
static get originalStyleUrls() {
|
|
53
|
+
return {
|
|
54
|
+
"$": ["../../output.css"]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static get styleUrls() {
|
|
58
|
+
return {
|
|
59
|
+
"$": ["../../output.css"]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
static get properties() {
|
|
63
|
+
return {
|
|
64
|
+
"currentPolygon": {
|
|
65
|
+
"type": "unknown",
|
|
66
|
+
"attribute": "current-polygon",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "Polygon",
|
|
70
|
+
"resolved": "Polygon",
|
|
71
|
+
"references": {
|
|
72
|
+
"Polygon": {
|
|
73
|
+
"location": "import",
|
|
74
|
+
"path": "harmonia-types",
|
|
75
|
+
"id": "../../../harmonia/packages/harmonia-types/dist/index.d.ts::Polygon"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"required": false,
|
|
80
|
+
"optional": false,
|
|
81
|
+
"docs": {
|
|
82
|
+
"tags": [],
|
|
83
|
+
"text": ""
|
|
84
|
+
},
|
|
85
|
+
"getter": false,
|
|
86
|
+
"setter": false
|
|
87
|
+
},
|
|
88
|
+
"numberOfPanels": {
|
|
89
|
+
"type": "number",
|
|
90
|
+
"attribute": "number-of-panels",
|
|
91
|
+
"mutable": false,
|
|
92
|
+
"complexType": {
|
|
93
|
+
"original": "number | undefined",
|
|
94
|
+
"resolved": "number",
|
|
95
|
+
"references": {}
|
|
96
|
+
},
|
|
97
|
+
"required": false,
|
|
98
|
+
"optional": false,
|
|
99
|
+
"docs": {
|
|
100
|
+
"tags": [],
|
|
101
|
+
"text": ""
|
|
102
|
+
},
|
|
103
|
+
"getter": false,
|
|
104
|
+
"setter": false,
|
|
105
|
+
"reflect": false
|
|
106
|
+
},
|
|
107
|
+
"handleAzimuthChange": {
|
|
108
|
+
"type": "unknown",
|
|
109
|
+
"attribute": "handle-azimuth-change",
|
|
110
|
+
"mutable": false,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "(event: Event) => void",
|
|
113
|
+
"resolved": "(event: Event) => void",
|
|
114
|
+
"references": {
|
|
115
|
+
"Event": {
|
|
116
|
+
"location": "global",
|
|
117
|
+
"id": "global::Event"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"required": false,
|
|
122
|
+
"optional": false,
|
|
123
|
+
"docs": {
|
|
124
|
+
"tags": [],
|
|
125
|
+
"text": ""
|
|
126
|
+
},
|
|
127
|
+
"getter": false,
|
|
128
|
+
"setter": false
|
|
129
|
+
},
|
|
130
|
+
"handlePitchChange": {
|
|
131
|
+
"type": "unknown",
|
|
132
|
+
"attribute": "handle-pitch-change",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "(event: Event) => void",
|
|
136
|
+
"resolved": "(event: Event) => void",
|
|
137
|
+
"references": {
|
|
138
|
+
"Event": {
|
|
139
|
+
"location": "global",
|
|
140
|
+
"id": "global::Event"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": false,
|
|
145
|
+
"optional": false,
|
|
146
|
+
"docs": {
|
|
147
|
+
"tags": [],
|
|
148
|
+
"text": ""
|
|
149
|
+
},
|
|
150
|
+
"getter": false,
|
|
151
|
+
"setter": false
|
|
152
|
+
},
|
|
153
|
+
"calculateSolarPanels": {
|
|
154
|
+
"type": "unknown",
|
|
155
|
+
"attribute": "calculate-solar-panels",
|
|
156
|
+
"mutable": false,
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "() => void",
|
|
159
|
+
"resolved": "() => void",
|
|
160
|
+
"references": {}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": false,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": ""
|
|
167
|
+
},
|
|
168
|
+
"getter": false,
|
|
169
|
+
"setter": false
|
|
170
|
+
},
|
|
171
|
+
"markAsFlatRoof": {
|
|
172
|
+
"type": "unknown",
|
|
173
|
+
"attribute": "mark-as-flat-roof",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "() => void",
|
|
177
|
+
"resolved": "() => void",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false
|
|
188
|
+
},
|
|
189
|
+
"currentTool": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"attribute": "current-tool",
|
|
192
|
+
"mutable": false,
|
|
193
|
+
"complexType": {
|
|
194
|
+
"original": "string",
|
|
195
|
+
"resolved": "string",
|
|
196
|
+
"references": {}
|
|
197
|
+
},
|
|
198
|
+
"required": false,
|
|
199
|
+
"optional": false,
|
|
200
|
+
"docs": {
|
|
201
|
+
"tags": [],
|
|
202
|
+
"text": ""
|
|
203
|
+
},
|
|
204
|
+
"getter": false,
|
|
205
|
+
"setter": false,
|
|
206
|
+
"reflect": false
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=polygon-information.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon-information.js","sourceRoot":"","sources":["../../../src/components/map-draw/polygon-information.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MA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AAK,OAAO,EAAE,CAAC;gDACpB,IAAI,CAAC,iBAAiB,CAClB,CAAC,CACJ,CAAC;gDACD,CAAC,CAAC,MAA2B;qDACzB,IAAI,EAAE,CAAC;4CAChB,CAAC;wCACL,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,KAAK,CACb,IAAI,CAAC,cAAc;4CACf,EAAE,KAAK;4CACP,CAAC,CACR,GACH;6CAEA;gCACL,CAAC,KAAK,CAAC,KAAK,IAAI,CACb,aACI,IAAI,EAAC,OAAO,EACZ,GAAG,EAAC,GAAG,EACP,GAAG,EAAC,IAAI,EACR,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,uWAAuW,EAC7W,KAAK,EAAE,IAAI,CAAC,KAAK,CACb,IAAI,CAAC,cAAc;wCACf,EAAE,KAAK;wCACP,CAAC,CACR,EACD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;wCACX,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;oCAC9B,CAAC,GACH,CACL,CACC,CACJ,CACJ,CACT;oBACD,CAAC,CAAC,CACE,SAAG,KAAK,EAAC,iCAAiC,IACrC,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAC5B,CACP,CACH,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport { Polygon } from \"harmonia-types\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { state } from \"../../store\";\r\nimport { azimuthToCardinal } from \"../../utils/utils\";\r\n\r\n@Component({\r\n tag: \"polygon-information\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class PolygonInformation {\r\n @Prop()\r\n currentPolygon: Polygon;\r\n @Prop()\r\n numberOfPanels: number | undefined;\r\n @Prop()\r\n handleAzimuthChange: (event: Event) => void;\r\n @Prop()\r\n handlePitchChange: (event: Event) => void;\r\n @Prop()\r\n calculateSolarPanels: () => void;\r\n @Prop()\r\n markAsFlatRoof: () => void;\r\n @Prop()\r\n currentTool: string;\r\n\r\n private getDisplayAzimuth(azimuth: number): number {\r\n return (Math.round(azimuth) + 90) % 360;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n // console.log(this.currentPolygon);\r\n\r\n return (\r\n <div\r\n class=\"flex gap-4 flex-row justify-center items-center w-full rounded-4xl pb-2\"\r\n style={{\r\n border: \"1px solid var(--color-border)\",\r\n }}\r\n >\r\n <div class=\"w-full bg-primary rounded-4xl p-3 text-secondary\">\r\n <h3 class=\"text-lg font-semibold mb-4 text-center\">\r\n {t.mapDraw.information}\r\n </h3>\r\n <polygon-buttons\r\n calculateSolarPanels={this.calculateSolarPanels}\r\n markAsFlatRoof={this.markAsFlatRoof}\r\n currentTool={this.currentTool}\r\n />\r\n {this.currentPolygon?.area\r\n ? (\r\n <div class=\"space-y-4\">\r\n <div>\r\n <div class=\"grid grid-cols-2 gap-2\">\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.area}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.currentPolygon\r\n ?.area\r\n .toFixed(0)} m²\r\n </p>\r\n </div>\r\n <div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.panels}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.numberOfPanels ?? 0}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted\">\r\n {t.mapDraw.azimuth}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handleAzimuthChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={this.getDisplayAzimuth(\r\n this.currentPolygon\r\n ?.azimuth ??\r\n 0,\r\n )}\r\n />\r\n ({azimuthToCardinal(\r\n this.getDisplayAzimuth(\r\n this.currentPolygon.azimuth,\r\n ),\r\n )})\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"360\"\r\n step=\"1\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={this.getDisplayAzimuth(\r\n this.currentPolygon\r\n ?.azimuth ??\r\n 0,\r\n )}\r\n onInput={(e) => {\r\n this.handleAzimuthChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted md:pl-2\">\r\n {t.mapDraw.pitch}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-muted rounded-4xl p-2\">\r\n <input\r\n class=\"text-lg w-full\"\r\n onKeyDown={(e) => {\r\n if (e.key === \"Enter\") {\r\n this.handlePitchChange(\r\n e,\r\n );\r\n (e.target as HTMLInputElement)\r\n .blur();\r\n }\r\n }}\r\n value={Math.round(\r\n this.currentPolygon\r\n ?.pitch ??\r\n 0,\r\n )}\r\n />\r\n °\r\n </div>\r\n {!state.isIOS && (\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"90\"\r\n step=\"1\"\r\n class=\"input-slider w-full custom-range appearance-none rounded-full bg-transparent [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-black/25 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:h-[10px] [&::-webkit-slider-thumb]:w-[10px] [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-muted\"\r\n value={Math.round(\r\n this.currentPolygon\r\n ?.pitch ??\r\n 0,\r\n )}\r\n onInput={(e) => {\r\n this.handlePitchChange(e);\r\n }}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n : (\r\n <p class=\"text-text-secondary text-center\">\r\n {t.mapDraw.noPolygonSelected}\r\n </p>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { getLanguageStrings } from "../../utils/lang/general";
|
|
3
|
+
import { state } from "../../store";
|
|
4
|
+
import { tools, undoTool } from "../../utils/render/tools";
|
|
5
|
+
export class ToolBox {
|
|
6
|
+
currentTool;
|
|
7
|
+
undoCallback;
|
|
8
|
+
onToolSelect;
|
|
9
|
+
render() {
|
|
10
|
+
const t = getLanguageStrings(state.settings.language);
|
|
11
|
+
const undoToolStrings = t.mapDraw.tools[undoTool.name];
|
|
12
|
+
return (h("div", { key: '2d370aab5a5abc591a825e8731427987bc025104', class: "flex gap-1 sm:gap-4 rounded-4xl bg-primary pt-3 pl-3 pr-3 flex-wrap justify-center w-full text-xs" }, tools.map((tool) => {
|
|
13
|
+
const toolStrings = t.mapDraw.tools[tool.name];
|
|
14
|
+
return (h("button", { class: `px-3 py-2 rounded-4xl transition-colors duration-200 ${this.currentTool.name === tool.name
|
|
15
|
+
? "bg-secondary hover:bg-secondary/80"
|
|
16
|
+
: "bg-primary hover:bg-muted"}`, style: {
|
|
17
|
+
color: this.currentTool.name === tool.name
|
|
18
|
+
? "var(--color-secondary-foreground)"
|
|
19
|
+
: "var(--color-primary-foreground)",
|
|
20
|
+
border: "1px solid var(--color-border)",
|
|
21
|
+
}, "aria-label": toolStrings.ariaLabel, title: toolStrings.explanation, onClick: () => this.onToolSelect(tool) }, h("div", { class: "flex items-center gap-1 flex-col" }, h("icon-selector", { name: tool.icon }), h("span", null, toolStrings.name))));
|
|
22
|
+
}), h("button", { key: '528e903d4e16afd09c583c1ac5e4472862e4a83d', class: `px-3 py-2 rounded-4xl transition-colors duration-200 bg-primary hover:bg-muted text-primary-foreground focus:border-2 focus:border-secondary`, style: {
|
|
23
|
+
border: "1px solid var(--color-border)",
|
|
24
|
+
}, "aria-label": undoToolStrings.ariaLabel, title: undoToolStrings.explanation, onClick: () => this.undoCallback() }, h("div", { key: '2e04251067a1c45dda457ed0803b1949b0425898', class: "flex items-center gap-1 flex-col" }, h("undo-icon", { key: '4aa276bbf830aab8849641af22a0bfb3da01191b' }), h("span", { key: '1378fa20a41e5e510c96346f085502ed2aaaea95' }, undoToolStrings.name)))));
|
|
25
|
+
}
|
|
26
|
+
static get is() { return "tool-box"; }
|
|
27
|
+
static get originalStyleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["../../output.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get styleUrls() {
|
|
33
|
+
return {
|
|
34
|
+
"$": ["../../output.css"]
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
static get properties() {
|
|
38
|
+
return {
|
|
39
|
+
"currentTool": {
|
|
40
|
+
"type": "unknown",
|
|
41
|
+
"attribute": "current-tool",
|
|
42
|
+
"mutable": false,
|
|
43
|
+
"complexType": {
|
|
44
|
+
"original": "Tool",
|
|
45
|
+
"resolved": "Tool",
|
|
46
|
+
"references": {
|
|
47
|
+
"Tool": {
|
|
48
|
+
"location": "import",
|
|
49
|
+
"path": "../../utils/render/tools",
|
|
50
|
+
"id": "src/utils/render/tools.ts::Tool"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"required": false,
|
|
55
|
+
"optional": false,
|
|
56
|
+
"docs": {
|
|
57
|
+
"tags": [],
|
|
58
|
+
"text": ""
|
|
59
|
+
},
|
|
60
|
+
"getter": false,
|
|
61
|
+
"setter": false
|
|
62
|
+
},
|
|
63
|
+
"undoCallback": {
|
|
64
|
+
"type": "unknown",
|
|
65
|
+
"attribute": "undo-callback",
|
|
66
|
+
"mutable": false,
|
|
67
|
+
"complexType": {
|
|
68
|
+
"original": "() => void",
|
|
69
|
+
"resolved": "() => void",
|
|
70
|
+
"references": {}
|
|
71
|
+
},
|
|
72
|
+
"required": false,
|
|
73
|
+
"optional": false,
|
|
74
|
+
"docs": {
|
|
75
|
+
"tags": [],
|
|
76
|
+
"text": ""
|
|
77
|
+
},
|
|
78
|
+
"getter": false,
|
|
79
|
+
"setter": false
|
|
80
|
+
},
|
|
81
|
+
"onToolSelect": {
|
|
82
|
+
"type": "unknown",
|
|
83
|
+
"attribute": "on-tool-select",
|
|
84
|
+
"mutable": false,
|
|
85
|
+
"complexType": {
|
|
86
|
+
"original": "(tool: Tool) => void",
|
|
87
|
+
"resolved": "(tool: Tool) => void",
|
|
88
|
+
"references": {
|
|
89
|
+
"Tool": {
|
|
90
|
+
"location": "import",
|
|
91
|
+
"path": "../../utils/render/tools",
|
|
92
|
+
"id": "src/utils/render/tools.ts::Tool"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"getter": false,
|
|
103
|
+
"setter": false
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=tool-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-box.js","sourceRoot":"","sources":["../../../src/components/map-draw/tool-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA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ClC,gBAAO,WAAW,CAAC,IAAI,CAAQ,CAC7B,CACD,CACZ,CAAC;YACN,CAAC,CAAC;YACF,+DACI,KAAK,EAAE,8IAA8I,EACrJ,KAAK,EAAE;oBACH,MAAM,EAAE,+BAA+B;iBAC1C,gBACW,eAAe,CAAC,SAAS,EACrC,KAAK,EAAE,eAAe,CAAC,WAAW,EAClC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;gBAElC,4DAAK,KAAK,EAAC,kCAAkC;oBACzC,mEAAa;oBACb,+DAAO,eAAe,CAAC,IAAI,CAAQ,CACjC,CACD,CACP,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from \"@stencil/core\";\r\nimport { Tool } from \"../../utils/render/tools\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { state } from \"../../store\";\r\nimport { tools, undoTool } from \"../../utils/render/tools\";\r\n\r\n@Component({\r\n tag: \"tool-box\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class ToolBox {\r\n @Prop()\r\n currentTool: Tool;\r\n @Prop()\r\n undoCallback: () => void;\r\n @Prop()\r\n onToolSelect: (tool: Tool) => void;\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n const undoToolStrings = t.mapDraw.tools[undoTool.name];\r\n\r\n return (\r\n <div class=\"flex gap-1 sm:gap-4 rounded-4xl bg-primary pt-3 pl-3 pr-3 flex-wrap justify-center w-full text-xs\">\r\n {tools.map((tool) => {\r\n const toolStrings = t.mapDraw.tools[tool.name];\r\n return (\r\n <button\r\n class={`px-3 py-2 rounded-4xl transition-colors duration-200 ${\r\n this.currentTool.name === tool.name\r\n ? \"bg-secondary hover:bg-secondary/80\"\r\n : \"bg-primary hover:bg-muted\"\r\n }`}\r\n style={{\r\n color: this.currentTool.name === tool.name\r\n ? \"var(--color-secondary-foreground)\"\r\n : \"var(--color-primary-foreground)\",\r\n border: \"1px solid var(--color-border)\",\r\n }}\r\n aria-label={toolStrings.ariaLabel}\r\n title={toolStrings.explanation}\r\n onClick={() => this.onToolSelect(tool)}\r\n >\r\n <div class=\"flex items-center gap-1 flex-col\">\r\n <icon-selector name={tool.icon} />\r\n <span>{toolStrings.name}</span>\r\n </div>\r\n </button>\r\n );\r\n })}\r\n <button\r\n class={`px-3 py-2 rounded-4xl transition-colors duration-200 bg-primary hover:bg-muted text-primary-foreground focus:border-2 focus:border-secondary`}\r\n style={{\r\n border: \"1px solid var(--color-border)\",\r\n }}\r\n aria-label={undoToolStrings.ariaLabel}\r\n title={undoToolStrings.explanation}\r\n onClick={() => this.undoCallback()}\r\n >\r\n <div class=\"flex items-center gap-1 flex-col\">\r\n <undo-icon />\r\n <span>{undoToolStrings.name}</span>\r\n </div>\r\n </button>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { getLanguageStrings } from "../../utils/lang/general";
|
|
3
|
+
import { state } from "../../store";
|
|
4
|
+
export class TutorialComponent {
|
|
5
|
+
onClose;
|
|
6
|
+
onSkip;
|
|
7
|
+
showSkipButton = false;
|
|
8
|
+
title;
|
|
9
|
+
description;
|
|
10
|
+
videoSource;
|
|
11
|
+
isLoading = true;
|
|
12
|
+
dotCount = 0;
|
|
13
|
+
isVideoPlaying = false;
|
|
14
|
+
dotInterval;
|
|
15
|
+
handleCloseTutorial = () => {
|
|
16
|
+
if (this.onClose) {
|
|
17
|
+
this.onClose();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
handleSkipTutorial = () => {
|
|
21
|
+
if (this.onSkip) {
|
|
22
|
+
this.onSkip();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
handleVideoLoadStart = () => {
|
|
26
|
+
this.isLoading = true;
|
|
27
|
+
};
|
|
28
|
+
handleVideoCanPlay = () => {
|
|
29
|
+
this.isLoading = false;
|
|
30
|
+
this.stopDotAnimation();
|
|
31
|
+
};
|
|
32
|
+
handleVideoPlay = () => {
|
|
33
|
+
this.isVideoPlaying = true;
|
|
34
|
+
};
|
|
35
|
+
handleVideoPause = () => {
|
|
36
|
+
this.isVideoPlaying = false;
|
|
37
|
+
};
|
|
38
|
+
handleVideoClick = () => {
|
|
39
|
+
if (state.isMobile) {
|
|
40
|
+
const video = document.querySelector("video");
|
|
41
|
+
if (video) {
|
|
42
|
+
if (video.paused) {
|
|
43
|
+
video.play();
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
video.pause();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
componentWillLoad() {
|
|
52
|
+
this.startDotAnimation();
|
|
53
|
+
}
|
|
54
|
+
componentWillUnload() {
|
|
55
|
+
this.stopDotAnimation();
|
|
56
|
+
}
|
|
57
|
+
startDotAnimation() {
|
|
58
|
+
this.dotInterval = window.setInterval(() => {
|
|
59
|
+
this.dotCount = (this.dotCount + 1) % 4; // 0, 1, 2, 3 (0 means no dots)
|
|
60
|
+
}, 500); // Change every 500ms
|
|
61
|
+
}
|
|
62
|
+
stopDotAnimation() {
|
|
63
|
+
if (this.dotInterval) {
|
|
64
|
+
clearInterval(this.dotInterval);
|
|
65
|
+
this.dotInterval = null;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
const t = getLanguageStrings(state.settings.language);
|
|
70
|
+
// Use provided props or fall back to default values
|
|
71
|
+
const tutorialTitle = this.title || t.mapDraw.tutorial.title;
|
|
72
|
+
const tutorialDescription = this.description ||
|
|
73
|
+
t.mapDraw.tutorial.description;
|
|
74
|
+
const videoSrc = this.videoSource || "/assets/videos/tutorial1.mp4";
|
|
75
|
+
return (h("div", { key: '2f9134a303787f3f1bef384971812aebb664ef44', class: "fixed inset-0 z-50 flex items-center justify-center p-4" }, h("div", { key: '98d065ba7e264dfe3317defec98dda11dac51315', class: "absolute inset-0", style: {
|
|
76
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
77
|
+
} }), h("div", { key: 'cf65eb0cf7a7663fa9e199089e115117dbcf3ee7', class: "relative z-10 w-full max-w-2xl max-h-full overflow-y-auto" }, h("div", { key: 'df0111b1ab74a04b5141eed9f44c2a7a25c2d363', class: "flex flex-col gap-4 bg-primary rounded-4xl p-6" }, h("div", { key: 'ce343c8ce4216038e523a86ea64233177d4da27d', class: "w-full text-center space-y-4" }, h("h2", { key: 'fbedfae3afbd578e20a2b42bcafbed33636d4206', class: "text-2xl font-bold text-secondary" }, tutorialTitle), h("p", { key: 'd13ab83f9278cd645a0bb03010d7c703b930ad23', class: "text-text-secondary" }, tutorialDescription)), h("div", { key: '46a5cd8d8dc850b4eeda9eaa6066d1de1bae98d2', class: "flex items-start justify-center bg-primary rounded-4xl" }, h("div", { key: 'd2ece90512af28d8fa078be7a0a9e354ce3c4cf0', class: "relative flex items-center justify-center rounded-4xl bg-secondary overflow-hidden w-64 h-64" }, this.isLoading && (h("div", { key: 'd9d72623a1947f094fa60fd2fdfeaa95297b7849', class: "absolute inset-0 flex items-center justify-center z-10" }, h("span", { key: '4b18decb7ac66203d7a227d48c70ff91c9ec6824', class: "text-text-secondary" }, t.mapDraw.loading, ".".repeat(this.dotCount)))), h("video", { key: '19ceccc0a48869f3fc1c5b0de0a8bbf6786e5d0e', class: `w-full h-full object-contain rounded-4xl ${state.isMobile
|
|
78
|
+
? "cursor-pointer"
|
|
79
|
+
: "pointer-events-none"}`, autoplay: true, muted: true, loop: true, playsinline: true, onLoadStart: this.handleVideoLoadStart, onCanPlay: this.handleVideoCanPlay, onPlay: this.handleVideoPlay, onPause: this.handleVideoPause, onClick: this.handleVideoClick, style: {
|
|
80
|
+
aspectRatio: "1/1",
|
|
81
|
+
} }, h("source", { key: '3652b2397c4397578049cec441a50f0dcb02ad7d', src: videoSrc, type: "video/mp4" }), "Your browser does not support the video tag."))), state.isMobile && !this.isVideoPlaying && (h("div", { key: '41e7cebeb19caa36e6e89df1dc042314b069892e', class: "text-center" }, h("p", { key: '970fbbe47bec2c4beecd966179d3d8693326aa8d', class: "text-sm text-text-secondary" }, t.mapDraw.tutorial.mobileInstruction))), h("div", { key: '206ec33205f1353533edcb5598b523892ed9c80d', class: "w-full flex justify-center gap-4" }, this.showSkipButton && (h("button", { key: 'd849283abdb80d41f39d5a0b0ec5f116d9e498a5', onClick: this.handleSkipTutorial, class: "px-6 py-3 bg-gray-500 text-white rounded-lg font-medium hover:bg-gray-600 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-0" }, t.mapDraw.tutorial.obstacle.skip)), h("button", { key: 'e4fcd08b350da47dc2849eec3ff72b682d89fb83', onClick: this.handleCloseTutorial, class: "px-6 py-3 bg-tertiary text-white rounded-lg font-medium hover:bg-tertiary/80 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-tertiary focus:ring-offset-0" }, t.mapDraw.tutorial.understood))))));
|
|
82
|
+
}
|
|
83
|
+
static get is() { return "tutorial-component"; }
|
|
84
|
+
static get originalStyleUrls() {
|
|
85
|
+
return {
|
|
86
|
+
"$": ["../../output.css"]
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
static get styleUrls() {
|
|
90
|
+
return {
|
|
91
|
+
"$": ["../../output.css"]
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
static get properties() {
|
|
95
|
+
return {
|
|
96
|
+
"onClose": {
|
|
97
|
+
"type": "unknown",
|
|
98
|
+
"attribute": "on-close",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "() => void",
|
|
102
|
+
"resolved": "() => void",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"getter": false,
|
|
112
|
+
"setter": false
|
|
113
|
+
},
|
|
114
|
+
"onSkip": {
|
|
115
|
+
"type": "unknown",
|
|
116
|
+
"attribute": "on-skip",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "() => void",
|
|
120
|
+
"resolved": "() => void",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": true,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"getter": false,
|
|
130
|
+
"setter": false
|
|
131
|
+
},
|
|
132
|
+
"showSkipButton": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"attribute": "show-skip-button",
|
|
135
|
+
"mutable": false,
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "boolean",
|
|
138
|
+
"resolved": "boolean",
|
|
139
|
+
"references": {}
|
|
140
|
+
},
|
|
141
|
+
"required": false,
|
|
142
|
+
"optional": true,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": ""
|
|
146
|
+
},
|
|
147
|
+
"getter": false,
|
|
148
|
+
"setter": false,
|
|
149
|
+
"reflect": false,
|
|
150
|
+
"defaultValue": "false"
|
|
151
|
+
},
|
|
152
|
+
"title": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"attribute": "title",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "string",
|
|
158
|
+
"resolved": "string",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": true,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": ""
|
|
166
|
+
},
|
|
167
|
+
"getter": false,
|
|
168
|
+
"setter": false,
|
|
169
|
+
"reflect": false
|
|
170
|
+
},
|
|
171
|
+
"description": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"attribute": "description",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "string",
|
|
177
|
+
"resolved": "string",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": true,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"getter": false,
|
|
187
|
+
"setter": false,
|
|
188
|
+
"reflect": false
|
|
189
|
+
},
|
|
190
|
+
"videoSource": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"attribute": "video-source",
|
|
193
|
+
"mutable": false,
|
|
194
|
+
"complexType": {
|
|
195
|
+
"original": "string",
|
|
196
|
+
"resolved": "string",
|
|
197
|
+
"references": {}
|
|
198
|
+
},
|
|
199
|
+
"required": false,
|
|
200
|
+
"optional": true,
|
|
201
|
+
"docs": {
|
|
202
|
+
"tags": [],
|
|
203
|
+
"text": ""
|
|
204
|
+
},
|
|
205
|
+
"getter": false,
|
|
206
|
+
"setter": false,
|
|
207
|
+
"reflect": false
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
static get states() {
|
|
212
|
+
return {
|
|
213
|
+
"isLoading": {},
|
|
214
|
+
"dotCount": {},
|
|
215
|
+
"isVideoPlaying": {}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=tutorial-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tutorial-component.js","sourceRoot":"","sources":["../../../src/components/map-draw/tutorial-component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,O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kBAAkB,EAChC,KAAK,EAAC,kLAAkL,IAEvL,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAC5B,CACZ;wBACD,+DACI,OAAO,EAAE,IAAI,CAAC,mBAAmB,EACjC,KAAK,EAAC,qLAAqL,IAE1L,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CACzB,CACP,CACJ,CACJ,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State } from \"@stencil/core\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { state } from \"../../store\";\r\n\r\n@Component({\r\n tag: \"tutorial-component\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class TutorialComponent {\r\n @Prop()\r\n onClose: () => void;\r\n @Prop()\r\n onSkip?: () => void;\r\n @Prop()\r\n showSkipButton?: boolean = false;\r\n @Prop()\r\n title?: string;\r\n @Prop()\r\n description?: string;\r\n @Prop()\r\n videoSource?: string;\r\n\r\n @State()\r\n private isLoading = true;\r\n @State()\r\n private dotCount = 0;\r\n @State()\r\n private isVideoPlaying = false;\r\n\r\n private dotInterval: number;\r\n\r\n private handleCloseTutorial = () => {\r\n if (this.onClose) {\r\n this.onClose();\r\n }\r\n };\r\n\r\n private handleSkipTutorial = () => {\r\n if (this.onSkip) {\r\n this.onSkip();\r\n }\r\n };\r\n\r\n private handleVideoLoadStart = () => {\r\n this.isLoading = true;\r\n };\r\n\r\n private handleVideoCanPlay = () => {\r\n this.isLoading = false;\r\n this.stopDotAnimation();\r\n };\r\n\r\n private handleVideoPlay = () => {\r\n this.isVideoPlaying = true;\r\n };\r\n\r\n private handleVideoPause = () => {\r\n this.isVideoPlaying = false;\r\n };\r\n\r\n private handleVideoClick = () => {\r\n if (state.isMobile) {\r\n const video = document.querySelector(\"video\") as HTMLVideoElement;\r\n if (video) {\r\n if (video.paused) {\r\n video.play();\r\n } else {\r\n video.pause();\r\n }\r\n }\r\n }\r\n };\r\n\r\n componentWillLoad() {\r\n this.startDotAnimation();\r\n }\r\n\r\n componentWillUnload() {\r\n this.stopDotAnimation();\r\n }\r\n\r\n private startDotAnimation() {\r\n this.dotInterval = window.setInterval(() => {\r\n this.dotCount = (this.dotCount + 1) % 4; // 0, 1, 2, 3 (0 means no dots)\r\n }, 500); // Change every 500ms\r\n }\r\n\r\n private stopDotAnimation() {\r\n if (this.dotInterval) {\r\n clearInterval(this.dotInterval);\r\n this.dotInterval = null;\r\n }\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n\r\n // Use provided props or fall back to default values\r\n const tutorialTitle = this.title || t.mapDraw.tutorial.title;\r\n const tutorialDescription = this.description ||\r\n t.mapDraw.tutorial.description;\r\n const videoSrc = this.videoSource || \"/assets/videos/tutorial1.mp4\";\r\n\r\n return (\r\n <div class=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\r\n {/* Backdrop */}\r\n <div\r\n class=\"absolute inset-0\"\r\n style={{\r\n backgroundColor: \"rgba(0, 0, 0, 0.5)\",\r\n }}\r\n />\r\n\r\n {/* Scrollable content container */}\r\n <div class=\"relative z-10 w-full max-w-2xl max-h-full overflow-y-auto\">\r\n <div class=\"flex flex-col gap-4 bg-primary rounded-4xl p-6\">\r\n {/* Title and Description */}\r\n <div class=\"w-full text-center space-y-4\">\r\n <h2 class=\"text-2xl font-bold text-secondary\">\r\n {tutorialTitle}\r\n </h2>\r\n <p class=\"text-text-secondary\">\r\n {tutorialDescription}\r\n </p>\r\n </div>\r\n\r\n {/* Tutorial Video Container */}\r\n <div class=\"flex items-start justify-center bg-primary rounded-4xl\">\r\n <div class=\"relative flex items-center justify-center rounded-4xl bg-secondary overflow-hidden w-64 h-64\">\r\n {/* Loading Spinner */}\r\n {this.isLoading && (\r\n <div class=\"absolute inset-0 flex items-center justify-center z-10\">\r\n <span class=\"text-text-secondary\">\r\n {t.mapDraw.loading}\r\n {\".\".repeat(this.dotCount)}\r\n </span>\r\n </div>\r\n )}\r\n\r\n <video\r\n class={`w-full h-full object-contain rounded-4xl ${\r\n state.isMobile\r\n ? \"cursor-pointer\"\r\n : \"pointer-events-none\"\r\n }`}\r\n autoplay\r\n muted\r\n loop\r\n playsinline\r\n onLoadStart={this.handleVideoLoadStart}\r\n onCanPlay={this.handleVideoCanPlay}\r\n onPlay={this.handleVideoPlay}\r\n onPause={this.handleVideoPause}\r\n onClick={this.handleVideoClick}\r\n style={{\r\n aspectRatio: \"1/1\",\r\n }}\r\n >\r\n <source\r\n src={videoSrc}\r\n type=\"video/mp4\"\r\n />\r\n Your browser does not support the video tag.\r\n </video>\r\n </div>\r\n </div>\r\n\r\n {/* Mobile Instruction Text */}\r\n {state.isMobile && !this.isVideoPlaying && (\r\n <div class=\"text-center\">\r\n <p class=\"text-sm text-text-secondary\">\r\n {t.mapDraw.tutorial.mobileInstruction}\r\n </p>\r\n </div>\r\n )}\r\n\r\n {/* Close Button */}\r\n <div class=\"w-full flex justify-center gap-4\">\r\n {this.showSkipButton && (\r\n <button\r\n onClick={this.handleSkipTutorial}\r\n class=\"px-6 py-3 bg-gray-500 text-white rounded-lg font-medium hover:bg-gray-600 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-0\"\r\n >\r\n {t.mapDraw.tutorial.obstacle.skip}\r\n </button>\r\n )}\r\n <button\r\n onClick={this.handleCloseTutorial}\r\n class=\"px-6 py-3 bg-tertiary text-white rounded-lg font-medium hover:bg-tertiary/80 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-tertiary focus:ring-offset-0\"\r\n >\r\n {t.mapDraw.tutorial.understood}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|