blue-chestnut-solar-expert 0.0.22 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/cjs/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.cjs.js.map +1 -1
  2. package/dist/cjs/eraser-icon_16.cjs.entry.js +235 -112
  3. package/dist/cjs/eraser-icon_16.cjs.entry.js.map +1 -1
  4. package/dist/cjs/{index-elxiOP_I.js → index-C3Kp1xqq.js} +5 -28
  5. package/dist/cjs/index-C3Kp1xqq.js.map +1 -0
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/loading-widget.cjs.entry.js +3 -3
  8. package/dist/cjs/loading-widget.cjs.entry.js.map +1 -1
  9. package/dist/cjs/loading-widget.entry.cjs.js.map +1 -1
  10. package/dist/cjs/solar-calculator.cjs.entry.js +3 -3
  11. package/dist/cjs/solar-calculator.cjs.entry.js.map +1 -1
  12. package/dist/cjs/solar-calculator.entry.cjs.js.map +1 -1
  13. package/dist/cjs/stencil-library.cjs.js +2 -2
  14. package/dist/collection/components/map-draw/map-draw.js +8 -10
  15. package/dist/collection/components/map-draw/map-draw.js.map +1 -1
  16. package/dist/collection/components/map-draw/map-selector.js +1 -4
  17. package/dist/collection/components/map-draw/map-selector.js.map +1 -1
  18. package/dist/collection/components/map-draw/polygon-buttons.js +4 -4
  19. package/dist/collection/components/map-draw/polygon-buttons.js.map +1 -1
  20. package/dist/collection/components/map-draw/polygon-information.js +9 -10
  21. package/dist/collection/components/map-draw/polygon-information.js.map +1 -1
  22. package/dist/collection/components/map-draw/tool-box.js +5 -13
  23. package/dist/collection/components/map-draw/tool-box.js.map +1 -1
  24. package/dist/collection/components/settings/settings.js +8 -8
  25. package/dist/collection/components/settings/settings.js.map +1 -1
  26. package/dist/collection/components/solar-calculator/solar-calculator.js +1 -1
  27. package/dist/collection/components/solar-calculator/solar-calculator.js.map +1 -1
  28. package/dist/collection/components/solar-expert/solar-expert.js +84 -5
  29. package/dist/collection/components/solar-expert/solar-expert.js.map +1 -1
  30. package/dist/collection/components/solar-system-form/solar-system-form.js +43 -43
  31. package/dist/collection/components/solar-system-form/solar-system-form.js.map +1 -1
  32. package/dist/collection/components/widgets/loading-widget.js +1 -1
  33. package/dist/collection/components/widgets/loading-widget.js.map +1 -1
  34. package/dist/collection/config.js.map +1 -1
  35. package/dist/collection/output.css +110 -87
  36. package/dist/collection/utils/theme.js +89 -0
  37. package/dist/collection/utils/theme.js.map +1 -0
  38. package/dist/components/eraser-icon.js +1 -1
  39. package/dist/components/house-icon.js +1 -1
  40. package/dist/components/icon-selector.js +1 -1
  41. package/dist/components/index.js +4 -22
  42. package/dist/components/index.js.map +1 -1
  43. package/dist/components/loading-widget.js +2 -2
  44. package/dist/components/loading-widget.js.map +1 -1
  45. package/dist/components/map-draw.js +1 -1
  46. package/dist/components/map-selector.js +1 -1
  47. package/dist/components/move-icon.js +1 -1
  48. package/dist/components/octagon-minus-icon.js +1 -1
  49. package/dist/components/p-B59N-NRF.js +46 -0
  50. package/dist/components/p-B59N-NRF.js.map +1 -0
  51. package/dist/components/p-B9Z3uCsI.js +156 -0
  52. package/dist/components/p-B9Z3uCsI.js.map +1 -0
  53. package/dist/components/p-BErX7-yM.js +38 -0
  54. package/dist/components/p-BErX7-yM.js.map +1 -0
  55. package/dist/components/p-B_1gV3Qz.js +171 -0
  56. package/dist/components/p-B_1gV3Qz.js.map +1 -0
  57. package/dist/components/p-C07IG8Cw.js +38 -0
  58. package/dist/components/p-C07IG8Cw.js.map +1 -0
  59. package/dist/components/p-CRAV1GgV.js +38 -0
  60. package/dist/components/p-CRAV1GgV.js.map +1 -0
  61. package/dist/components/p-CcnjDP5h.js +38 -0
  62. package/dist/components/p-CcnjDP5h.js.map +1 -0
  63. package/dist/components/p-CfPlvF4Z.js +38 -0
  64. package/dist/components/p-CfPlvF4Z.js.map +1 -0
  65. package/dist/components/p-CgW5mzbD.js +103 -0
  66. package/dist/components/p-CgW5mzbD.js.map +1 -0
  67. package/dist/components/p-CucBs_yI.js +555 -0
  68. package/dist/components/p-CucBs_yI.js.map +1 -0
  69. package/dist/components/{p-CaedRXrz.js → p-Cum4j9Q1.js} +24 -26
  70. package/dist/components/p-Cum4j9Q1.js.map +1 -0
  71. package/dist/components/p-DtGH0yPG.js +38 -0
  72. package/dist/components/p-DtGH0yPG.js.map +1 -0
  73. package/dist/components/p-m5YlFZMR.js +148 -0
  74. package/dist/components/p-m5YlFZMR.js.map +1 -0
  75. package/dist/components/p-rhCvDg4h.js +38 -0
  76. package/dist/components/p-rhCvDg4h.js.map +1 -0
  77. package/dist/components/p-tY_1hcaO.js +74 -0
  78. package/dist/components/p-tY_1hcaO.js.map +1 -0
  79. package/dist/components/polygon-buttons.js +1 -1
  80. package/dist/components/polygon-information.js +1 -1
  81. package/dist/components/search-icon.js +1 -1
  82. package/dist/components/settings-icon.js +1 -1
  83. package/dist/components/settings-modal.js +1 -1
  84. package/dist/components/solar-calculator.js +2 -2
  85. package/dist/components/solar-calculator.js.map +1 -1
  86. package/dist/components/solar-expert.js +159 -21
  87. package/dist/components/solar-expert.js.map +1 -1
  88. package/dist/components/solar-system-form.js +1 -1
  89. package/dist/components/tool-box.js +1 -1
  90. package/dist/components/undo-icon.js +1 -1
  91. package/dist/esm/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.js.map +1 -1
  92. package/dist/esm/eraser-icon_16.entry.js +235 -112
  93. package/dist/esm/eraser-icon_16.entry.js.map +1 -1
  94. package/dist/esm/{index-yVbXII2Q.js → index-DNOniOEj.js} +5 -28
  95. package/dist/esm/index-DNOniOEj.js.map +1 -0
  96. package/dist/esm/loader.js +3 -3
  97. package/dist/esm/loading-widget.entry.js +3 -3
  98. package/dist/esm/loading-widget.entry.js.map +1 -1
  99. package/dist/esm/solar-calculator.entry.js +3 -3
  100. package/dist/esm/solar-calculator.entry.js.map +1 -1
  101. package/dist/esm/stencil-library.js +3 -3
  102. package/dist/stencil-library/eraser-icon.house-icon.icon-selector.map-draw.map-selector.move-icon.octagon-minus-icon.polygon-buttons.polygon-information.search-icon.settings-icon.settings-modal.solar-expert.solar-system-form.tool-box.undo-icon.entry.esm.js.map +1 -1
  103. package/dist/stencil-library/index.esm.js.map +1 -1
  104. package/dist/stencil-library/loading-widget.entry.esm.js.map +1 -1
  105. package/dist/stencil-library/p-100ab140.entry.js +2 -0
  106. package/dist/stencil-library/p-100ab140.entry.js.map +1 -0
  107. package/dist/stencil-library/p-91bf731c.entry.js +32 -0
  108. package/dist/stencil-library/{p-1acfe8c0.entry.js.map → p-91bf731c.entry.js.map} +1 -1
  109. package/dist/stencil-library/p-DNOniOEj.js +3 -0
  110. package/dist/stencil-library/{index-DZjEuBrX.js.map → p-DNOniOEj.js.map} +1 -1
  111. package/dist/stencil-library/p-f85ca33a.entry.js +2 -0
  112. package/dist/stencil-library/p-f85ca33a.entry.js.map +1 -0
  113. package/dist/stencil-library/solar-calculator.entry.esm.js.map +1 -1
  114. package/dist/stencil-library/stencil-library.esm.js +1 -1
  115. package/dist/stencil-library/stencil-library.esm.js.map +1 -1
  116. package/dist/types/components/solar-expert/solar-expert.d.ts +4 -0
  117. package/dist/types/components.d.ts +4 -2
  118. package/dist/types/config.d.ts +26 -0
  119. package/dist/types/utils/theme.d.ts +9 -0
  120. package/package.json +1 -1
  121. package/dist/cjs/index-elxiOP_I.js.map +0 -1
  122. package/dist/components/p-BDBrVfn4.js +0 -38
  123. package/dist/components/p-BDBrVfn4.js.map +0 -1
  124. package/dist/components/p-BDrs1Te9.js +0 -38
  125. package/dist/components/p-BDrs1Te9.js.map +0 -1
  126. package/dist/components/p-BbXgEBG5.js +0 -38
  127. package/dist/components/p-BbXgEBG5.js.map +0 -1
  128. package/dist/components/p-BrVkygdn.js +0 -38
  129. package/dist/components/p-BrVkygdn.js.map +0 -1
  130. package/dist/components/p-CTYaeZhp.js +0 -555
  131. package/dist/components/p-CTYaeZhp.js.map +0 -1
  132. package/dist/components/p-CabEU06O.js +0 -103
  133. package/dist/components/p-CabEU06O.js.map +0 -1
  134. package/dist/components/p-CaedRXrz.js.map +0 -1
  135. package/dist/components/p-CumvV0_M.js +0 -38
  136. package/dist/components/p-CumvV0_M.js.map +0 -1
  137. package/dist/components/p-CvYS8YPD.js +0 -74
  138. package/dist/components/p-CvYS8YPD.js.map +0 -1
  139. package/dist/components/p-DI6_jwLe.js +0 -38
  140. package/dist/components/p-DI6_jwLe.js.map +0 -1
  141. package/dist/components/p-DYiK8eDp.js +0 -38
  142. package/dist/components/p-DYiK8eDp.js.map +0 -1
  143. package/dist/components/p-DufgH4Gd.js +0 -46
  144. package/dist/components/p-DufgH4Gd.js.map +0 -1
  145. package/dist/components/p-G74Ln5vx.js +0 -149
  146. package/dist/components/p-G74Ln5vx.js.map +0 -1
  147. package/dist/components/p-bu76_2XI.js +0 -164
  148. package/dist/components/p-bu76_2XI.js.map +0 -1
  149. package/dist/components/p-oY2qkchz.js +0 -174
  150. package/dist/components/p-oY2qkchz.js.map +0 -1
  151. package/dist/esm/index-yVbXII2Q.js.map +0 -1
  152. package/dist/stencil-library/api-E7GpMOpJ.js.map +0 -1
  153. package/dist/stencil-library/app-globals-DQuL1Twl.js.map +0 -1
  154. package/dist/stencil-library/config-BV_PiZGS.js.map +0 -1
  155. package/dist/stencil-library/decoder-DSavpK4g.js.map +0 -1
  156. package/dist/stencil-library/deflate-BNIZ2wXt.js.map +0 -1
  157. package/dist/stencil-library/index-DimvNaNS.js.map +0 -1
  158. package/dist/stencil-library/jpeg-B79KZkPY.js.map +0 -1
  159. package/dist/stencil-library/lerc-B-ZLzzvM.js.map +0 -1
  160. package/dist/stencil-library/lzw-1xg7uPVo.js.map +0 -1
  161. package/dist/stencil-library/p-1acfe8c0.entry.js +0 -32
  162. package/dist/stencil-library/p-62debd50.entry.js +0 -2
  163. package/dist/stencil-library/p-62debd50.entry.js.map +0 -1
  164. package/dist/stencil-library/p-c4c3bbee.entry.js +0 -2
  165. package/dist/stencil-library/p-c4c3bbee.entry.js.map +0 -1
  166. package/dist/stencil-library/p-yVbXII2Q.js +0 -3
  167. package/dist/stencil-library/p-yVbXII2Q.js.map +0 -1
  168. package/dist/stencil-library/packbits-0MTMkUGE.js.map +0 -1
  169. package/dist/stencil-library/pako.esm-BdkEMvj8.js.map +0 -1
  170. package/dist/stencil-library/raw-W8mxtLfl.js.map +0 -1
  171. package/dist/stencil-library/solar-expert.entry.esm.js.map +0 -1
  172. package/dist/stencil-library/solar-expert.entry.js +0 -92
  173. package/dist/stencil-library/solar-expert.entry.js.map +0 -1
  174. package/dist/stencil-library/store-DUpvKmRV.js.map +0 -1
  175. package/dist/stencil-library/tools-DU7Muwzb.js.map +0 -1
  176. package/dist/stencil-library/utils-CTW6J-87.js.map +0 -1
  177. package/dist/stencil-library/webimage-CLeW6JHT.js.map +0 -1
@@ -10,11 +10,11 @@ export class PolygonInformation {
10
10
  calculateSolarPanels;
11
11
  render() {
12
12
  const t = getLanguageStrings(state.settings.language);
13
- return (h("div", { key: 'd6ab424241a7a68ed6e9c8732d7142b2097d0491', class: "flex gap-4 flex-row justify-center items-center w-full" }, h("div", { key: '1e5870aa04b0d26668a28663779e3f4248eb5791', class: "w-full bg-[#f3ebda] rounded-4xl p-4" }, h("h3", { key: 'db95c0cb87f0c922f4c03ee3b6bd4c5f5b0131df', class: "text-lg font-semibold mb-4 text-center" }, t.mapDraw.information), this.currentPolygon?.details
14
- ? (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-gray-600" }, t.mapDraw.area), h("p", { class: "text-lg" }, this.currentPolygon.details
13
+ return (h("div", { key: 'e7d612eebc40e57e1fb4f2828f052e71dd41cecd', class: "flex gap-4 flex-row justify-center items-center w-full" }, h("div", { key: '257fd1d17428e53c4ea334b7d7a51c5d4dbaed17', class: "w-full bg-primary rounded-4xl p-4 text-secondary" }, h("h3", { key: 'b7fdad47b78b1634f1abe941fa2e74b339a4c2f7', class: "text-lg font-semibold mb-4 text-center" }, t.mapDraw.information), this.currentPolygon?.details
14
+ ? (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.details
15
15
  ?.area
16
- .toFixed(2), " m\u00B2")), h("div", null, h("div", null, h("h4", { class: "text-sm font-medium text-gray-600" }, t.mapDraw.panels), h("p", { class: "text-lg" }, this.positionedPanels
17
- ?.length ?? 0))))), h("div", null, h("h4", { class: "text-sm font-medium text-gray-600" }, t.mapDraw.azimuth), h("div", { class: "flex gap-2 flex-row justify-start bg-white rounded-4xl p-2" }, h("input", { class: "text-lg w-full", onKeyDown: (e) => {
16
+ .toFixed(2), " 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.positionedPanels
17
+ ?.length ?? 0))))), 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) => {
18
18
  if (e.key === "Enter") {
19
19
  this.handleAzimuthChange(e);
20
20
  e.target
@@ -23,7 +23,7 @@ export class PolygonInformation {
23
23
  }, value: this.currentPolygon
24
24
  .details
25
25
  ?.azimuth }), "(", azimuthToCardinal(this.currentPolygon.details
26
- ?.azimuth), ")"), h("input", { type: "range", min: "0", max: "360", 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-white", value: this.currentPolygon
26
+ ?.azimuth), ")"), !state.isIOS && (h("input", { type: "range", min: "0", max: "360", 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.currentPolygon
27
27
  .details?.azimuth, onInput: (e) => {
28
28
  const target = e
29
29
  .target;
@@ -36,7 +36,7 @@ export class PolygonInformation {
36
36
  this.positionedPanels) {
37
37
  this.calculateSolarPanels();
38
38
  }
39
- } })), h("div", null, h("h4", { class: "text-sm font-medium text-gray-600 pl-2" }, t.mapDraw.pitch), h("div", { class: "flex gap-2 flex-row justify-start bg-white rounded-4xl p-2" }, h("input", { class: "text-lg w-full", onKeyDown: (e) => {
39
+ } }))), h("div", null, h("h4", { class: "text-sm font-medium text-text-muted 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) => {
40
40
  if (e.key === "Enter") {
41
41
  this.handlePitchChange(e);
42
42
  e.target
@@ -44,7 +44,7 @@ export class PolygonInformation {
44
44
  }
45
45
  }, value: this.currentPolygon
46
46
  .details
47
- ?.pitch }), "\u00B0"), h("input", { type: "range", min: "0", max: "90", 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-white", value: this.currentPolygon
47
+ ?.pitch }), "\u00B0"), !state.isIOS && (h("input", { type: "range", min: "0", max: "90", 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.currentPolygon
48
48
  .details?.pitch, onInput: (e) => {
49
49
  const target = e
50
50
  .target;
@@ -57,11 +57,10 @@ export class PolygonInformation {
57
57
  this.positionedPanels) {
58
58
  this.calculateSolarPanels();
59
59
  }
60
- } }))))
61
- : (h("p", { class: "text-gray-500 text-center" }, t.mapDraw.noPolygonSelected)))));
60
+ } })))))
61
+ : (h("p", { class: "text-text-secondary text-center" }, t.mapDraw.noPolygonSelected)))));
62
62
  }
63
63
  static get is() { return "polygon-information"; }
64
- static get encapsulation() { return "shadow"; }
65
64
  static get originalStyleUrls() {
66
65
  return {
67
66
  "$": ["../../output.css"]
@@ -1 +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,MAAM,mBAAmB,CAAC;AAOtD,MAAM,OAAO,kBAAkB;IAE3B,cAAc,CAAU;IAExB,gBAAgB,CAAqC;IAErD,mBAAmB,CAAyB;IAE5C,iBAAiB,CAAyB;IAE1C,oBAAoB,CAAa;IAEjC,MAAM;QACF,MAAM,CAAC,GAAG,kBAAkB,CAA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E,EAAE;oCACX,MAAM,MAAM,GAAG,CAAC;yCACX,MAA0B,CAAC;oCAChC,MAAM,KAAK,GAAG,UAAU,CACpB,MAAM,CAAC,KAAK,CACf,CAAC;oCACF,IAAI,CAAC,cAAc,CAAC,OAAO;yCACtB,KAAK,GAAG,KAAK,CAAC;oCACnB,IACI,IAAI,CAAC,cAAc;yCACV,IAAI;wCACT,MAAM;wCACV,IAAI,CAAC,gBAAgB,EACvB,CAAC;wCACC,IAAI,CAAC,oBAAoB,EAAE,CAAC;oCAChC,CAAC;gCACL,CAAC,GACH,CACA,CACJ,CACT;oBACD,CAAC,CAAC,CACE,SAAG,KAAK,EAAC,2BAA2B,IAC/B,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, SolarPanelSystemPart } from \"../../components\";\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: true,\r\n})\r\nexport class PolygonInformation {\r\n @Prop()\r\n currentPolygon: Polygon;\r\n @Prop()\r\n positionedPanels: SolarPanelSystemPart[] | 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\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n\r\n return (\r\n <div class=\"flex gap-4 flex-row justify-center items-center w-full\">\r\n <div class=\"w-full bg-[#f3ebda] rounded-4xl p-4\">\r\n <h3 class=\"text-lg font-semibold mb-4 text-center\">\r\n {t.mapDraw.information}\r\n </h3>\r\n {this.currentPolygon?.details\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-gray-600\">\r\n {t.mapDraw.area}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.currentPolygon.details\r\n ?.area\r\n .toFixed(2)} m²\r\n </p>\r\n </div>\r\n <div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-gray-600\">\r\n {t.mapDraw.panels}\r\n </h4>\r\n <p class=\"text-lg\">\r\n {this.positionedPanels\r\n ?.length ?? 0}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-gray-600\">\r\n {t.mapDraw.azimuth}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-white 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.currentPolygon\r\n .details\r\n ?.azimuth}\r\n />\r\n ({azimuthToCardinal(\r\n this.currentPolygon.details\r\n ?.azimuth,\r\n )})\r\n </div>\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"360\"\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-white\"\r\n value={this.currentPolygon\r\n .details?.azimuth}\r\n onInput={(e) => {\r\n const target = e\r\n .target as HTMLInputElement;\r\n const azimuth = parseFloat(\r\n target.value,\r\n );\r\n this.currentPolygon.details\r\n .azimuth = azimuth;\r\n if (\r\n this.currentPolygon\r\n .type ===\r\n \"roof\" &&\r\n this.positionedPanels\r\n ) {\r\n this.calculateSolarPanels();\r\n }\r\n }}\r\n />\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-gray-600 pl-2\">\r\n {t.mapDraw.pitch}\r\n </h4>\r\n <div class=\"flex gap-2 flex-row justify-start bg-white 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={this.currentPolygon\r\n .details\r\n ?.pitch}\r\n />\r\n °\r\n </div>\r\n <input\r\n type=\"range\"\r\n min=\"0\"\r\n max=\"90\"\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-white\"\r\n value={this.currentPolygon\r\n .details?.pitch}\r\n onInput={(e) => {\r\n const target = e\r\n .target as HTMLInputElement;\r\n const pitch = parseFloat(\r\n target.value,\r\n );\r\n this.currentPolygon.details\r\n .pitch = pitch;\r\n if (\r\n this.currentPolygon\r\n .type ===\r\n \"roof\" &&\r\n this.positionedPanels\r\n ) {\r\n this.calculateSolarPanels();\r\n }\r\n }}\r\n />\r\n </div>\r\n </div>\r\n )\r\n : (\r\n <p class=\"text-gray-500 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"]}
1
+ {"version":3,"file":"polygon-information.js","sourceRoot":"","sources":["../../../src/components/map-draw/polygon-information.tsx"],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AE,EAAE;wCACb,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;4CACpB,IAAI,CAAC,iBAAiB,CAClB,CAAC,CACJ,CAAC;4CACD,CAAC,CAAC,MAA2B;iDACzB,IAAI,EAAE,CAAC;wCAChB,CAAC;oCACL,CAAC,EACD,KAAK,EAAE,IAAI,CAAC,cAAc;yCACrB,OAAO;wCACR,EAAE,KAAK,GACb;yCAEA;4BACL,CAAC,KAAK,CAAC,KAAK,IAAI,CACb,aACI,IAAI,EAAC,OAAO,EACZ,GAAG,EAAC,GAAG,EACP,GAAG,EAAC,IAAI,EACR,KAAK,EAAC,uWAAuW,EAC7W,KAAK,EAAE,IAAI,CAAC,cAAc;qCACrB,OAAO,EAAE,KAAK,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oCACX,MAAM,MAAM,GAAG,CAAC;yCACX,MAA0B,CAAC;oCAChC,MAAM,KAAK,GAAG,UAAU,CACpB,MAAM,CAAC,KAAK,CACf,CAAC;oCACF,IAAI,CAAC,cAAc,CAAC,OAAO;yCACtB,KAAK,GAAG,KAAK,CAAC;oCACnB,IACI,IAAI,CAAC,cAAc;yCACV,IAAI;wCACT,MAAM;wCACV,IAAI,CAAC,gBAAgB,EACvB,CAAC;wCACC,IAAI,CAAC,oBAAoB,EAAE,CAAC;oCAChC,CAAC;gCACL,CAAC,GACH,CACL,CACC,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, SolarPanelSystemPart } from \"../../components\";\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 positionedPanels: SolarPanelSystemPart[] | 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\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n\r\n return (\r\n <div class=\"flex gap-4 flex-row justify-center items-center w-full\">\r\n <div class=\"w-full bg-primary rounded-4xl p-4 text-secondary\">\r\n <h3 class=\"text-lg font-semibold mb-4 text-center\">\r\n {t.mapDraw.information}\r\n </h3>\r\n {this.currentPolygon?.details\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.details\r\n ?.area\r\n .toFixed(2)} 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.positionedPanels\r\n ?.length ?? 0}\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\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.currentPolygon\r\n .details\r\n ?.azimuth}\r\n />\r\n ({azimuthToCardinal(\r\n this.currentPolygon.details\r\n ?.azimuth,\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 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.currentPolygon\r\n .details?.azimuth}\r\n onInput={(e) => {\r\n const target = e\r\n .target as HTMLInputElement;\r\n const azimuth = parseFloat(\r\n target.value,\r\n );\r\n this.currentPolygon.details\r\n .azimuth = azimuth;\r\n if (\r\n this.currentPolygon\r\n .type ===\r\n \"roof\" &&\r\n this.positionedPanels\r\n ) {\r\n this.calculateSolarPanels();\r\n }\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div>\r\n <h4 class=\"text-sm font-medium text-text-muted 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={this.currentPolygon\r\n .details\r\n ?.pitch}\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 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.currentPolygon\r\n .details?.pitch}\r\n onInput={(e) => {\r\n const target = e\r\n .target as HTMLInputElement;\r\n const pitch = parseFloat(\r\n target.value,\r\n );\r\n this.currentPolygon.details\r\n .pitch = pitch;\r\n if (\r\n this.currentPolygon\r\n .type ===\r\n \"roof\" &&\r\n this.positionedPanels\r\n ) {\r\n this.calculateSolarPanels();\r\n }\r\n }}\r\n />\r\n )}\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"]}
@@ -9,20 +9,12 @@ export class ToolBox {
9
9
  render() {
10
10
  const t = getLanguageStrings(state.settings.language);
11
11
  const undoToolStrings = t.mapDraw.tools[undoTool.name];
12
- return (h("div", { key: '21ef401acdfa0169902c72c51a7fad31c6fd75c4', class: "flex lg:gap-4 rounded-4xl bg-[#f3ebda] p-4 flex-wrap justify-center w-full text-xs" }, tools.map((tool) => {
12
+ return (h("div", { key: '6a249c8eddd0bf541a98f77d09bcc9e297e8ec63', class: "flex lg:gap-4 rounded-4xl bg-primary p-4 flex-wrap justify-center w-full text-xs" }, tools.map((tool) => {
13
13
  const toolStrings = t.mapDraw.tools[tool.name];
14
- return (h("button", { class: `px-4 py-2 rounded-4xl transition-colors duration-200 hover:bg-[#ffffff] ${this.currentTool.name === tool.name
15
- ? "bg-[#271200] hover:bg-gray-500"
16
- : "bg-[#f3ebda] hover:bg-[#ffffff]"}`, style: {
17
- color: this.currentTool.name === tool.name
18
- ? "#ffffff"
19
- : "#000000",
20
- }, "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))));
21
- }), h("button", { key: '2de8094cce52d847d6cf65966876e449b86156af', class: `px-4 py-2 rounded-4xl transition-colors duration-200 hover:bg-[#ffffff] ${this.currentTool.name === undoTool.name
22
- ? "bg-[#271200] hover:bg-gray-500"
23
- : "bg-[#f3ebda] hover:bg-[#ffffff]"}`, style: {
24
- color: "#000000",
25
- }, "aria-label": undoToolStrings.ariaLabel, title: undoToolStrings.explanation, onClick: () => this.undoCallback() }, h("div", { key: '559227361f76ce39b4c2e48f216d477737e46d6c', class: "flex items-center gap-1 flex-col" }, h("undo-icon", { key: '6b97156dfd7d50c11ad627e9b6d11539e4b0fc7e' }), h("span", { key: '6307014e12640793d7e2511b790d192824a8d2fa' }, undoToolStrings.name)))));
14
+ return (h("button", { class: `px-4 py-2 rounded-4xl transition-colors duration-200 ${this.currentTool.name === tool.name
15
+ ? "bg-secondary hover:bg-secondary/80 text-secondary-foreground"
16
+ : "bg-primary hover:bg-muted text-primary-foreground"}`, "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))));
17
+ }), h("button", { key: 'bc2dc6f90419ca7a8ff0ede18b82c2ad51b94280', class: `px-4 py-2 rounded-4xl transition-colors duration-200 bg-primary hover:bg-muted text-primary-foreground`, "aria-label": undoToolStrings.ariaLabel, title: undoToolStrings.explanation, onClick: () => this.undoCallback() }, h("div", { key: '1112ed1599e5ef3c007dd9122cca62b42137852c', class: "flex items-center gap-1 flex-col" }, h("undo-icon", { key: '3b7425e904e07e8c17fb538eef2bfedb74837ab3' }), h("span", { key: 'b5df30aa88a8d323ff9855ebcdc3a54226092a46' }, undoToolStrings.name)))));
26
18
  }
27
19
  static get is() { return "tool-box"; }
28
20
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"tool-box.js","sourceRoot":"","sources":["../../../src/components/map-draw/tool-box.tsx"],"names":[],"mappings":"AAAA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WAAW,CAAC,IAAI,CAAQ,CAC7B,CACD,CACZ,CAAC;YACN,CAAC,CAAC;YACF,+DACI,KAAK,EAAE,2EACH,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;oBACnC,CAAC,CAAC,gCAAgC;oBAClC,CAAC,CAAC,iCACV,EAAE,EACF,KAAK,EAAE;oBACH,KAAK,EAAE,SAAS;iBACnB,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 lg:gap-4 rounded-4xl bg-[#f3ebda] p-4 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-4 py-2 rounded-4xl transition-colors duration-200 hover:bg-[#ffffff] ${\r\n this.currentTool.name === tool.name\r\n ? \"bg-[#271200] hover:bg-gray-500\"\r\n : \"bg-[#f3ebda] hover:bg-[#ffffff]\"\r\n }`}\r\n style={{\r\n color: this.currentTool.name === tool.name\r\n ? \"#ffffff\"\r\n : \"#000000\",\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-4 py-2 rounded-4xl transition-colors duration-200 hover:bg-[#ffffff] ${\r\n this.currentTool.name === undoTool.name\r\n ? \"bg-[#271200] hover:bg-gray-500\"\r\n : \"bg-[#f3ebda] hover:bg-[#ffffff]\"\r\n }`}\r\n style={{\r\n color: \"#000000\",\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"]}
1
+ {"version":3,"file":"tool-box.js","sourceRoot":"","sources":["../../../src/components/map-draw/tool-box.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,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO3D,MAAM,OAAO,OAAO;IAEhB,WAAW,CAAO;IAElB,YAAY,CAAa;IAEzB,YAAY,CAAuB;IAEnC,MAAM;QACF,MAAM,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEvD,OAAO,CACH,4DAAK,KAAK,EAAC,kFAAkF;YACxF,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChB,MAAM,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC/C,OAAO,CACH,cACI,KAAK,EAAE,wDACH,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;wBAC/B,CAAC,CAAC,8DAA8D;wBAChE,CAAC,CAAC,mDACV,EAAE,gBACU,WAAW,CAAC,SAAS,EACjC,KAAK,EAAE,WAAW,CAAC,WAAW,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;oBAEtC,WAAK,KAAK,EAAC,kCAAkC;wBACzC,qBAAe,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;wBAClC,gBAAO,WAAW,CAAC,IAAI,CAAQ,CAC7B,CACD,CACZ,CAAC;YACN,CAAC,CAAC;YACF,+DACI,KAAK,EAAE,wGAAwG,gBACnG,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 lg:gap-4 rounded-4xl bg-primary p-4 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-4 py-2 rounded-4xl transition-colors duration-200 ${\r\n this.currentTool.name === tool.name\r\n ? \"bg-secondary hover:bg-secondary/80 text-secondary-foreground\"\r\n : \"bg-primary hover:bg-muted text-primary-foreground\"\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-4 py-2 rounded-4xl transition-colors duration-200 bg-primary hover:bg-muted text-primary-foreground`}\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"]}
@@ -31,14 +31,14 @@ export class SettingsModal {
31
31
  };
32
32
  render() {
33
33
  const t = getLanguageStrings(state.settings.language);
34
- return (h("div", { key: '69815a7efeb8f52a5d3422b06dc212a50b9f405b', class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50" }, h("div", { key: '29bdfcdafa5765b3357633d3f6519be2abda0f31', class: "bg-[#f3ebda] rounded-4xl p-6 w-full max-w-md" }, h("div", { key: 'c764738701a7bb98247dd394126c70a257c014bf', class: "flex justify-between items-center mb-6" }, h("h2", { key: '5ebd4cae530c898c297f7db28ec96888c2981f2a', class: "text-xl font-semibold" }, "Settings"), h("button", { key: 'f7bea1c79bb453fbb62b478a361a55de0f2d2765', class: "p-2 hover:bg-gray-200 rounded-full transition-colors", onClick: this.handleClose }, h("svg", { key: '972c54d0ff2815eb425e24d1ad9082a7e0c97f01', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("line", { key: 'f11390a3eb51c202edbee1f590a7fa393a9185fd', x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { key: 'a019cd26820d563689c10961770dd87b09103047', x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { key: '4b801dd8b6dbba9c7a2b2e08f03f36202bebbd67', class: "space-y-4" }, h("div", { key: 'f4a1894419edad7da806a2806f77a8fe60ced341' }, h("label", { key: 'da3bb6927298f85bdc73ed89bdb990e52b17ea15', class: "block text-sm font-medium text-gray-600 mb-1" }, t.settings.language), h("select", { key: '825705965ddf8fa20d05905759f2b3b460d52b55', class: "w-full bg-white rounded-4xl p-2", onInput: (e) => this.handleInputChange("language", e.target
35
- .value) }, h("option", { key: 'cfed58aefbe6ebc59702f663308d2d8561cff28d', value: "en", selected: this.tempSettings.language ===
36
- "en" }, "English"), h("option", { key: '2318d8bf1585a7a1fd025f46d01b2bb81363497e', value: "es", selected: this.tempSettings.language ===
37
- "es" }, "Espa\u00F1ol"), h("option", { key: '17b93bbcd8284497f0cef3d6e23ad034621b58af', value: "de", selected: this.tempSettings.language ===
38
- "de" }, "Deutsch"))), h("div", { key: 'c482c4e8dd6ffab0de3d41cb7e41a391dedb714d' }, h("label", { key: 'c1abc00b0fb193044e73db048bf8eed03770a10d', class: "block text-sm font-medium text-gray-600 mb-1" }, t.settings.rowSpacing), h("input", { key: '55458c275f594da462e5665a4f74dcd117ba1de2', type: "number", class: "w-full bg-white rounded-4xl p-2", value: this.tempSettings.rowSpacing, onInput: (e) => this.handleInputChange("rowSpacing", parseFloat(e.target
39
- .value)) })), h("div", { key: 'b2ae04d05ba09bd10619c3bf0608864c2a76870a' }, h("label", { key: '8b7959e10de695570f258e10d67e83a7a360ef6d', class: "block text-sm font-medium text-gray-600 mb-1" }, t.settings.columnSpacing), h("input", { key: 'c67d963036385a0a97fc70ea8b6aadd9c9f65a85', type: "number", class: "w-full bg-white rounded-4xl p-2", value: this.tempSettings.columnSpacing, onInput: (e) => this.handleInputChange("columnSpacing", parseFloat(e.target
40
- .value)) })), h("div", { key: '383a7f16994f833850cb86ba1f1bdd305f94a135' }, h("label", { key: '03605c7ae69c6afeaab0cdfefa491008b49f331c', class: "block text-sm font-medium text-gray-600 mb-1" }, t.settings.borderInset), h("input", { key: '8cb1be4539c7a9677a6138279363e835048e789f', type: "number", class: "w-full bg-white rounded-4xl p-2", value: this.tempSettings.borderInset, onInput: (e) => this.handleInputChange("borderInset", parseFloat(e.target
41
- .value)) }))), h("div", { key: '6774337949104e019f7fb0b028e4f000308f9aeb', class: "flex justify-end gap-4 mt-6" }, h("button", { key: 'c0ec044e5e67450e65c7fb478afc93e476d9450c', class: "px-4 py-2 bg-gray-200 rounded-4xl hover:bg-gray-300 transition-colors", onClick: this.handleClose }, "Cancel"), h("button", { key: 'c9727418d8e49647f8eb0aa11e6051997766becf', class: "px-4 py-2 bg-[#271200] text-white rounded-4xl hover:bg-gray-500 transition-colors", onClick: this.handleSave }, "Save Changes")))));
34
+ return (h("div", { key: '69815a7efeb8f52a5d3422b06dc212a50b9f405b', class: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50" }, h("div", { key: 'ed368ae8d0d6d2946c5a4ecc559f018521e1bce8', class: "bg-primary rounded-4xl p-6 w-full max-w-md" }, h("div", { key: 'f51088beb4d8445503fa08c3dd2a2b8c886f79ce', class: "flex justify-between items-center mb-6" }, h("h2", { key: 'a9bcb7b893961bbf2032c1b8a110624ec3a95e65', class: "text-xl font-semibold" }, "Settings"), h("button", { key: '47d4dc1cc0789485da95218becfc921ae5db177c', class: "p-2 hover:bg-hover rounded-full transition-colors", onClick: this.handleClose }, h("svg", { key: '42923fdd6d5c96ceee98bdddca2e7e6bda42dcfa', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("line", { key: '751c5243b5b785a21131b02a3142c6d46e0cffeb', x1: "18", y1: "6", x2: "6", y2: "18" }), h("line", { key: 'e26bd2a1b20aa718ced6183130e962c9dbd159b9', x1: "6", y1: "6", x2: "18", y2: "18" })))), h("div", { key: '560be61d72a1a98eea4d2788d49eee7a3107470d', class: "space-y-4" }, h("div", { key: '2e6422d175602e7a53eb3d629c37c47980c08da1' }, h("label", { key: '56a2f53ae26c3e7d90519b85f3466604ea46b469', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.language), h("select", { key: 'ab444c024a2dfefd46ba6fb09878e75d52db9478', class: "w-full bg-muted rounded-4xl p-2", onInput: (e) => this.handleInputChange("language", e.target
35
+ .value) }, h("option", { key: 'eb6b88689002c9f379af1c157f19fc123dbe7b4f', value: "en", selected: this.tempSettings.language ===
36
+ "en" }, "English"), h("option", { key: '2203e1615212fdf96463185e9a06df2f65898dc4', value: "es", selected: this.tempSettings.language ===
37
+ "es" }, "Espa\u00F1ol"), h("option", { key: 'ec91327e0070e0045079f63476aab7ea90da43ee', value: "de", selected: this.tempSettings.language ===
38
+ "de" }, "Deutsch"))), h("div", { key: 'ff8d7f227f166862303f666bea321d13b50e79c8' }, h("label", { key: '778fefd538acc3601d8733e8b10e08c7f749cfb2', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.rowSpacing), h("input", { key: 'ebd39dcc7fbb5bb6e806b6482fe5a22730dcc31d', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.rowSpacing, onInput: (e) => this.handleInputChange("rowSpacing", parseFloat(e.target
39
+ .value)) })), h("div", { key: '0f770fa12c399fb1282a95cdaa873d3c4c4591f8' }, h("label", { key: 'bcfdb9dc84393770c93a982e34e38198f2cb59df', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.columnSpacing), h("input", { key: '574dc95db00f9c1725004e6c074e537f1ba51b60', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.columnSpacing, onInput: (e) => this.handleInputChange("columnSpacing", parseFloat(e.target
40
+ .value)) })), h("div", { key: '286a6121aace1b97724bf7c88975a172f0fe1a68' }, h("label", { key: '96b65a6ce1591e0188544db161e018ce90f151e2', class: "block text-sm font-medium text-text-muted mb-1" }, t.settings.borderInset), h("input", { key: '264728330a50df7b3ba02a568ff683dce895b2b3', type: "number", class: "w-full bg-muted rounded-4xl p-2", value: this.tempSettings.borderInset, onInput: (e) => this.handleInputChange("borderInset", parseFloat(e.target
41
+ .value)) }))), h("div", { key: 'd73a232b24082a9c0bef75612184c71f52c59139', class: "flex justify-end gap-4 mt-6" }, h("button", { key: '981039537b08be95b180cc6672725f6b2a5c9281', class: "px-4 py-2 bg-surface rounded-4xl hover:bg-surface-hover transition-colors", onClick: this.handleClose }, "Cancel"), h("button", { key: '7f30b8e87d03e4ab2afe77c0579052993b57d3d3', class: "px-4 py-2 bg-secondary text-muted rounded-4xl hover:bg-text-secondary transition-colors", onClick: this.handleSave }, "Save Changes")))));
42
42
  }
43
43
  static get is() { return "settings-modal"; }
44
44
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/components/settings/settings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EA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;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Event, EventEmitter, h, Prop, State } from \"@stencil/core\";\r\nimport { Settings, state } from \"../../store\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Language } from \"../../types/lang\";\r\n\r\n@Component({\r\n tag: \"settings-modal\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SettingsModal {\r\n @Prop()\r\n settings: Settings;\r\n\r\n @State()\r\n private tempSettings: Settings;\r\n\r\n @Event()\r\n close: EventEmitter<void>;\r\n\r\n @Event()\r\n save: EventEmitter<Settings>;\r\n\r\n componentWillLoad() {\r\n this.tempSettings = { ...this.settings };\r\n }\r\n\r\n private handleClose = () => {\r\n if (\r\n JSON.stringify(this.tempSettings) !== JSON.stringify(this.settings)\r\n ) {\r\n if (\r\n confirm(\r\n \"Are you sure you want to close without saving your changes?\",\r\n )\r\n ) {\r\n this.close.emit();\r\n }\r\n } else {\r\n this.close.emit();\r\n }\r\n };\r\n\r\n private handleSave = () => {\r\n this.save.emit(this.tempSettings);\r\n this.close.emit();\r\n };\r\n\r\n private handleInputChange = (\r\n key: keyof Settings,\r\n value: number | Language,\r\n ) => {\r\n this.tempSettings = {\r\n ...this.tempSettings,\r\n [key]: value,\r\n };\r\n };\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n return (\r\n <div class=\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\">\r\n <div class=\"bg-[#f3ebda] rounded-4xl p-6 w-full max-w-md\">\r\n <div class=\"flex justify-between items-center mb-6\">\r\n <h2 class=\"text-xl font-semibold\">Settings</h2>\r\n <button\r\n class=\"p-2 hover:bg-gray-200 rounded-full transition-colors\"\r\n onClick={this.handleClose}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n >\r\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\r\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"space-y-4\">\r\n <div>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.settings.language}\r\n </label>\r\n <select\r\n class=\"w-full bg-white rounded-4xl p-2\"\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"language\",\r\n (e.target as HTMLSelectElement)\r\n .value as Language,\r\n )}\r\n >\r\n <option\r\n value=\"en\"\r\n selected={this.tempSettings.language ===\r\n \"en\"}\r\n >\r\n English\r\n </option>\r\n <option\r\n value=\"es\"\r\n selected={this.tempSettings.language ===\r\n \"es\"}\r\n >\r\n Español\r\n </option>\r\n <option\r\n value=\"de\"\r\n selected={this.tempSettings.language ===\r\n \"de\"}\r\n >\r\n Deutsch\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.settings.rowSpacing}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-white rounded-4xl p-2\"\r\n value={this.tempSettings.rowSpacing}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"rowSpacing\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.settings.columnSpacing}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-white rounded-4xl p-2\"\r\n value={this.tempSettings.columnSpacing}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"columnSpacing\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-gray-600 mb-1\">\r\n {t.settings.borderInset}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-white rounded-4xl p-2\"\r\n value={this.tempSettings.borderInset}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"borderInset\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex justify-end gap-4 mt-6\">\r\n <button\r\n class=\"px-4 py-2 bg-gray-200 rounded-4xl hover:bg-gray-300 transition-colors\"\r\n onClick={this.handleClose}\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n class=\"px-4 py-2 bg-[#271200] text-white rounded-4xl hover:bg-gray-500 transition-colors\"\r\n onClick={this.handleSave}\r\n >\r\n Save Changes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/components/settings/settings.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAY,KAAK,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAQ9D,MAAM,OAAO,aAAa;IAEtB,QAAQ,CAAW;IAGX,YAAY,CAAW;IAG/B,KAAK,CAAqB;IAG1B,IAAI,CAAyB;IAE7B,iBAAiB;QACb,IAAI,CAAC,YAAY,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAEO,WAAW,GAAG,GAAG,EAAE;QACvB,IACI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EACrE,CAAC;YACC,IACI,OAAO,CACH,6DAA6D,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,EACf,UAAU,CACL,CAAC,CAAC,MAA2B;iCACzB,KAAK,CACb,CACJ,GACP,CACA;oBAEN;wBACI,8DAAO,KAAK,EAAC,gDAAgD,IACxD,CAAC,CAAC,QAAQ,CAAC,WAAW,CACnB;wBACR,8DACI,IAAI,EAAC,QAAQ,EACb,KAAK,EAAC,iCAAiC,EACvC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EACpC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CACX,IAAI,CAAC,iBAAiB,CAClB,aAAa,EACb,UAAU,CACL,CAAC,CAAC,MAA2B;iCACzB,KAAK,CACb,CACJ,GACP,CACA,CACJ;gBAEN,4DAAK,KAAK,EAAC,6BAA6B;oBACpC,+DACI,KAAK,EAAC,2EAA2E,EACjF,OAAO,EAAE,IAAI,CAAC,WAAW,aAGpB;oBACT,+DACI,KAAK,EAAC,yFAAyF,EAC/F,OAAO,EAAE,IAAI,CAAC,UAAU,mBAGnB,CACP,CACJ,CACJ,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Event, EventEmitter, h, Prop, State } from \"@stencil/core\";\r\nimport { Settings, state } from \"../../store\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { Language } from \"../../types/lang\";\r\n\r\n@Component({\r\n tag: \"settings-modal\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SettingsModal {\r\n @Prop()\r\n settings: Settings;\r\n\r\n @State()\r\n private tempSettings: Settings;\r\n\r\n @Event()\r\n close: EventEmitter<void>;\r\n\r\n @Event()\r\n save: EventEmitter<Settings>;\r\n\r\n componentWillLoad() {\r\n this.tempSettings = { ...this.settings };\r\n }\r\n\r\n private handleClose = () => {\r\n if (\r\n JSON.stringify(this.tempSettings) !== JSON.stringify(this.settings)\r\n ) {\r\n if (\r\n confirm(\r\n \"Are you sure you want to close without saving your changes?\",\r\n )\r\n ) {\r\n this.close.emit();\r\n }\r\n } else {\r\n this.close.emit();\r\n }\r\n };\r\n\r\n private handleSave = () => {\r\n this.save.emit(this.tempSettings);\r\n this.close.emit();\r\n };\r\n\r\n private handleInputChange = (\r\n key: keyof Settings,\r\n value: number | Language,\r\n ) => {\r\n this.tempSettings = {\r\n ...this.tempSettings,\r\n [key]: value,\r\n };\r\n };\r\n\r\n render() {\r\n const t = getLanguageStrings(state.settings.language);\r\n return (\r\n <div class=\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\">\r\n <div class=\"bg-primary rounded-4xl p-6 w-full max-w-md\">\r\n <div class=\"flex justify-between items-center mb-6\">\r\n <h2 class=\"text-xl font-semibold\">Settings</h2>\r\n <button\r\n class=\"p-2 hover:bg-hover rounded-full transition-colors\"\r\n onClick={this.handleClose}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n >\r\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\r\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"space-y-4\">\r\n <div>\r\n <label class=\"block text-sm font-medium text-text-muted mb-1\">\r\n {t.settings.language}\r\n </label>\r\n <select\r\n class=\"w-full bg-muted rounded-4xl p-2\"\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"language\",\r\n (e.target as HTMLSelectElement)\r\n .value as Language,\r\n )}\r\n >\r\n <option\r\n value=\"en\"\r\n selected={this.tempSettings.language ===\r\n \"en\"}\r\n >\r\n English\r\n </option>\r\n <option\r\n value=\"es\"\r\n selected={this.tempSettings.language ===\r\n \"es\"}\r\n >\r\n Español\r\n </option>\r\n <option\r\n value=\"de\"\r\n selected={this.tempSettings.language ===\r\n \"de\"}\r\n >\r\n Deutsch\r\n </option>\r\n </select>\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-text-muted mb-1\">\r\n {t.settings.rowSpacing}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-muted rounded-4xl p-2\"\r\n value={this.tempSettings.rowSpacing}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"rowSpacing\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-text-muted mb-1\">\r\n {t.settings.columnSpacing}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-muted rounded-4xl p-2\"\r\n value={this.tempSettings.columnSpacing}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"columnSpacing\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n\r\n <div>\r\n <label class=\"block text-sm font-medium text-text-muted mb-1\">\r\n {t.settings.borderInset}\r\n </label>\r\n <input\r\n type=\"number\"\r\n class=\"w-full bg-muted rounded-4xl p-2\"\r\n value={this.tempSettings.borderInset}\r\n onInput={(e) =>\r\n this.handleInputChange(\r\n \"borderInset\",\r\n parseFloat(\r\n (e.target as HTMLInputElement)\r\n .value,\r\n ),\r\n )}\r\n />\r\n </div>\r\n </div>\r\n\r\n <div class=\"flex justify-end gap-4 mt-6\">\r\n <button\r\n class=\"px-4 py-2 bg-surface rounded-4xl hover:bg-surface-hover transition-colors\"\r\n onClick={this.handleClose}\r\n >\r\n Cancel\r\n </button>\r\n <button\r\n class=\"px-4 py-2 bg-secondary text-muted rounded-4xl hover:bg-text-secondary transition-colors\"\r\n onClick={this.handleSave}\r\n >\r\n Save Changes\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -54,7 +54,7 @@ export class SolarCalculator {
54
54
  });
55
55
  }
56
56
  render() {
57
- return (h("div", { key: 'caa09baccc8825a26b3917be5123d0d25d4e55b0', class: "flex flex-col w-full h-full p-3" }, h("div", { key: '770f517caa0a3e92d4233b1d5e3d29a84b4674be', class: "pb-3" }, h("div", { key: '1e35a2da7b80bd678eaffb81f01baa18ca7a72cf', class: "relative" }, h("i", { key: 'e2a5867e28e59c83c9ba52e25745b5c6de185e20', "data-lucide": "search", class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 " }), h("input", { key: 'ef54e7eb669fcf89bf742fe7cd50bc7af5810665', ref: (el) => this.inputElement = el, type: "text", placeholder: "Search for a location", class: "w-full pl-10 pr-4 py-2 border border-gray-300 rounded-4xl focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white" }))), this.buildingInsights && (h("div", { key: 'ded8f8896117935be39ef2da2e9afc770131125f' }, "buildingInsights", h("div", { key: '4bcf38d36a48ed699c66b896434bb6d35d90c61a' }, JSON.stringify(this.buildingInsights))))));
57
+ return (h("div", { key: 'caa09baccc8825a26b3917be5123d0d25d4e55b0', class: "flex flex-col w-full h-full p-3" }, h("div", { key: '770f517caa0a3e92d4233b1d5e3d29a84b4674be', class: "pb-3" }, h("div", { key: '1e35a2da7b80bd678eaffb81f01baa18ca7a72cf', class: "relative" }, h("i", { key: 'e5cc8ff44508ace9147e90041fe3e817da9eff5d', "data-lucide": "search", class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-text-placeholder " }), h("input", { key: '568e1e0dbdb207ca496062302bee33d4c3e726d6', ref: (el) => this.inputElement = el, type: "text", placeholder: "Search for a location", class: "w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:outline-none focus:ring-2 focus:ring-info bg-muted" }))), this.buildingInsights && (h("div", { key: 'f3669e7ef307e641867f18cdb07523a7ee4c5838' }, "buildingInsights", h("div", { key: '6fc1aa4732666fcb25c61c41871c0769897317d8' }, JSON.stringify(this.buildingInsights))))));
58
58
  }
59
59
  static get is() { return "solar-calculator"; }
60
60
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"solar-calculator.js","sourceRoot":"","sources":["../../../src/components/solar-calculator/solar-calculator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAO7C,MAAM,OAAO,eAAe;IAExB,MAAM,GAAW,GAAG,CAAC,mBAAmB,CAAC;IAGzC,gBAAgB,CAA2B;IAE3C,QAAQ,GAAY,KAAK,CAAC;IAE1B,YAAY,GAA2C,IAAI,CAAC;IAE5D,KAAK,GAA0C,IAAI,CAAC;IAE5C,YAAY,CAAoB;IAExC,iBAAiB;QACb,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAED,gBAAgB;QACZ,WAAW,CAAC;YACR,KAAK,EAAE;gBACH,MAAM;aACT;YACD,QAAQ,EAAE,aAAa;SAC1B,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,mBAAmB;QACrB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,OAAO;QACX,CAAC;QACD,IAAI,CAAC,gBAAgB,GAAG,MAAM,cAAc,CACxC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,EAClC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,EAClC,IAAI,CAAC,MAAM,CACd,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACzB,KAAK,CAAC,yDAAyD,CAAC,CAAC;QACrE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AW,EAAC,uBAAuB,EACnC,KAAK,EAAC,wHAAwH,GAChI,CACA,CACJ;YACL,IAAI,CAAC,gBAAgB,IAAI,CACtB;;gBAEI,8DACK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CACpC,CAIJ,CACT,CACC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Env, h, Prop, State } from \"@stencil/core\";\r\nimport { BuildingInsightsResponse } from \"../../utils/solar\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { fetchSolarData } from \"../../utils/api\";\r\nimport { createIcons, Search } from \"lucide\";\r\n\r\n@Component({\r\n tag: \"solar-calculator\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarCalculator {\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n\r\n @State()\r\n buildingInsights: BuildingInsightsResponse;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n this.loadGoogleMapsScript();\r\n }\r\n\r\n componentDidLoad() {\r\n createIcons({\r\n icons: {\r\n Search,\r\n },\r\n nameAttr: \"data-lucide\",\r\n });\r\n }\r\n\r\n async getBuildingInsights() {\r\n if (!this.place) {\r\n return;\r\n }\r\n this.buildingInsights = await fetchSolarData(\r\n this.place.geometry.location.lat(),\r\n this.place.geometry.location.lng(),\r\n this.apiKey,\r\n );\r\n if (!this.buildingInsights) {\r\n alert(\"No building insights found. Please enter them manually.\");\r\n }\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps:\", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n const place = this.autocomplete?.getPlace();\r\n this.place = place;\r\n this.getBuildingInsights();\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n <div class=\"flex flex-col w-full h-full p-3\">\r\n <div class=\"pb-3\">\r\n <div class=\"relative\">\r\n <i\r\n data-lucide=\"search\"\r\n class=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 \"\r\n />\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder=\"Search for a location\"\r\n class=\"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-4xl focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white\"\r\n />\r\n </div>\r\n </div>\r\n {this.buildingInsights && (\r\n <div>\r\n buildingInsights\r\n <div>\r\n {JSON.stringify(this.buildingInsights)}\r\n </div>\r\n {/* Consumption */}\r\n {/* Configuration (roof, orientation, battery, etc) */}\r\n {/* Results (suggested system size, cost, etc.) */}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"solar-calculator.js","sourceRoot":"","sources":["../../../src/components/solar-calculator/solar-calculator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAO7C,MAAM,OAAO,eAAe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AC,CAAC;QACvD,CAAC;IACL,CAAC;IAEO,sBAAsB,CAC1B,MAAiC;QAEjC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO;QACjD,IAAI,CAAC,YAAY,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAE/D,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,EAAE;YAChD,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM;QACF,OAAO,CACH,4DAAK,KAAK,EAAC,iCAAiC;YACxC,4DAAK,KAAK,EAAC,MAAM;gBACb,4DAAK,KAAK,EAAC,UAAU;oBACjB,yEACgB,QAAQ,EACpB,KAAK,EAAC,2EAA2E,GACnF;oBACF,8DACI,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,EACnC,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,uBAAuB,EACnC,KAAK,EAAC,kHAAkH,GAC1H,CACA,CACJ;YACL,IAAI,CAAC,gBAAgB,IAAI,CACtB;;gBAEI,8DACK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,CACpC,CAIJ,CACT,CACC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Env, h, Prop, State } from \"@stencil/core\";\r\nimport { BuildingInsightsResponse } from \"../../utils/solar\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { fetchSolarData } from \"../../utils/api\";\r\nimport { createIcons, Search } from \"lucide\";\r\n\r\n@Component({\r\n tag: \"solar-calculator\",\r\n styleUrl: \"../../output.css\",\r\n shadow: false,\r\n})\r\nexport class SolarCalculator {\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n\r\n @State()\r\n buildingInsights: BuildingInsightsResponse;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n this.loadGoogleMapsScript();\r\n }\r\n\r\n componentDidLoad() {\r\n createIcons({\r\n icons: {\r\n Search,\r\n },\r\n nameAttr: \"data-lucide\",\r\n });\r\n }\r\n\r\n async getBuildingInsights() {\r\n if (!this.place) {\r\n return;\r\n }\r\n this.buildingInsights = await fetchSolarData(\r\n this.place.geometry.location.lat(),\r\n this.place.geometry.location.lng(),\r\n this.apiKey,\r\n );\r\n if (!this.buildingInsights) {\r\n alert(\"No building insights found. Please enter them manually.\");\r\n }\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps:\", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n const place = this.autocomplete?.getPlace();\r\n this.place = place;\r\n this.getBuildingInsights();\r\n });\r\n }\r\n\r\n render() {\r\n return (\r\n <div class=\"flex flex-col w-full h-full p-3\">\r\n <div class=\"pb-3\">\r\n <div class=\"relative\">\r\n <i\r\n data-lucide=\"search\"\r\n class=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-text-placeholder \"\r\n />\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder=\"Search for a location\"\r\n class=\"w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:outline-none focus:ring-2 focus:ring-info bg-muted\"\r\n />\r\n </div>\r\n </div>\r\n {this.buildingInsights && (\r\n <div>\r\n buildingInsights\r\n <div>\r\n {JSON.stringify(this.buildingInsights)}\r\n </div>\r\n {/* Consumption */}\r\n {/* Configuration (roof, orientation, battery, etc) */}\r\n {/* Results (suggested system size, cost, etc.) */}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -2,10 +2,46 @@ import { Env, h } from "@stencil/core";
2
2
  import { Loader } from "@googlemaps/js-api-loader";
3
3
  import { getLanguageStrings } from "../../utils/lang/general";
4
4
  import { onChange, state } from "../../store";
5
+ import { applyThemeGlobally } from "../../utils/theme";
5
6
  export class SolarExpert {
6
7
  el;
7
8
  apiKey = Env.GOOGLE_MAPS_API_KEY;
8
9
  language = "en";
10
+ colorScheme = null;
11
+ // {
12
+ // primary: "hsl(0 0% 100%)",
13
+ // secondary: "hsl(0 0% 100%)",
14
+ // tertiary: "hsl(0 0% 100%)",
15
+ // muted: "hsl(0 0% 100%)",
16
+ // error: "hsl(0 0% 100%)",
17
+ // // secondary: "hsl(180 100% 25%)",
18
+ // // tertiary: "hsl(24 100% 18%)",
19
+ // // muted: "hsl(0 0% 85%)",
20
+ // // error: "hsl(240 75% 29%)",
21
+ // primaryForeground: "hsl(0 0% 100%)",
22
+ // secondaryForeground: "hsl(0 0% 100%)",
23
+ // tertiaryForeground: "hsl(0 0% 100%)",
24
+ // mutedForeground: "hsl(0 0% 100%)",
25
+ // errorForeground: "hsl(0 0% 100%)",
26
+ // surface: "hsl(0 0% 100%)",
27
+ // surfaceHover: "hsl(0 0% 100%)",
28
+ // surfaceActive: "hsl(0 0% 100%)",
29
+ // // Text colors
30
+ // textMuted: "hsl(0 0% 100%)",
31
+ // textSecondary: "hsl(0 0% 100%)",
32
+ // textPlaceholder: "hsl(0 0% 100%)",
33
+ // // Border colors
34
+ // border: "hsl(0 0% 100%)",
35
+ // borderLight: "hsl(0 0% 100%)",
36
+ // // Status colors
37
+ // success: "hsl(0 0% 100%)",
38
+ // info: "hsl(0 0% 100%)",
39
+ // // Interactive colors
40
+ // hover: "hsl(0 0% 100%)",
41
+ // hoverDark: "hsl(0 0% 100%)",
42
+ // overlay: "hsl(0 0% 100%)",
43
+ // tooltip: "hsl(0 0% 100%)",
44
+ // };
9
45
  latitude = 40.581614;
10
46
  longitude = -4.128423;
11
47
  isLoaded = false;
@@ -25,8 +61,16 @@ export class SolarExpert {
25
61
  }
26
62
  });
27
63
  state.settings.language = this.language;
28
- state.isIOS = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
29
- console.log(state.isIOS);
64
+ state.isIOS = /iPhone|iPad|iPod/.test(navigator.userAgent);
65
+ this.applyTheme();
66
+ }
67
+ colorSchemeChanged() {
68
+ this.applyTheme();
69
+ }
70
+ applyTheme() {
71
+ if (this.colorScheme) {
72
+ applyThemeGlobally(this.colorScheme);
73
+ }
30
74
  }
31
75
  async loadGoogleMapsScript() {
32
76
  try {
@@ -74,10 +118,10 @@ export class SolarExpert {
74
118
  }
75
119
  render() {
76
120
  const t = getLanguageStrings(this.language);
77
- return (h("div", { key: 'f084aa6d49f5c3ee21168d322d58de159b9ad7b9', class: "flex flex-col w-full h-full p-3 m-auto", id: "solar-calculator" }, this.showMapSelector
121
+ return (h("div", { key: '871984aabe069426250bc1118fa55a74f928144f', class: "flex flex-col w-full h-full p-3 m-auto", id: "solar-calculator" }, this.showMapSelector
78
122
  ? (h("map-selector", { "api-key": this.apiKey, language: this.language }))
79
- : (h(h.Fragment, null, h("div", { class: "pb-3 flex flex-row gap-4 items-stretch w-full" }, h("div", { class: "relative flex-3" }, h("div", { class: "absolute left-3 top-1/2 transform -translate-y-1/2" }, h("search-icon", null)), h("input", { ref: (el) => this.inputElement = el, type: "text", placeholder: t.solarExpert
80
- .searchPlaceholder, class: "w-full pl-10 pr-4 py-2 border border-gray-300 rounded-4xl focus:ring-[#271200] bg-white h-full" })), h("button", { onClick: () => this.handleChooseOnMap(), class: "flex-1 pl-4 pr-4 py-2 border border-gray-300 bg-white rounded-4xl focus:ring-[#271200] hover:bg-[#271200] hover:text-white" }, t.mapSelector.chooseOnMap)), h("map-draw", { apiKey: this.apiKey })))));
123
+ : (h(h.Fragment, null, h("div", { class: "pb-3 flex flex-row gap-4 items-stretch w-full bg-primary" }, h("div", { class: "relative flex-3" }, h("div", { class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground" }, h("search-icon", null)), h("input", { ref: (el) => this.inputElement = el, type: "text", placeholder: t.solarExpert
124
+ .searchPlaceholder, class: "w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:ring-secondary bg-muted text-muted-foreground h-full" })), h("button", { onClick: () => this.handleChooseOnMap(), class: "flex-1 pl-4 pr-4 py-2 border border-border bg-muted rounded-4xl focus:ring-secondary hover:bg-secondary hover:text-muted" }, t.mapSelector.chooseOnMap)), h("map-draw", { apiKey: this.apiKey })))));
81
125
  }
82
126
  static get is() { return "solar-expert"; }
83
127
  static get originalStyleUrls() {
@@ -137,6 +181,35 @@ export class SolarExpert {
137
181
  "setter": false,
138
182
  "reflect": false,
139
183
  "defaultValue": "\"en\""
184
+ },
185
+ "colorScheme": {
186
+ "type": "unknown",
187
+ "attribute": "color-scheme",
188
+ "mutable": false,
189
+ "complexType": {
190
+ "original": "Partial<ColorScheme> | null",
191
+ "resolved": "{ primary?: string; primaryForeground?: string; secondary?: string; secondaryForeground?: string; tertiary?: string; tertiaryForeground?: string; muted?: string; mutedForeground?: string; error?: string; errorForeground?: string; surface?: string; surfaceHover?: string; surfaceActive?: string; textMuted?: string; textSecondary?: string; textPlaceholder?: string; border?: string; borderLight?: string; success?: string; info?: string; hover?: string; hoverDark?: string; overlay?: string; tooltip?: string; }",
192
+ "references": {
193
+ "Partial": {
194
+ "location": "global",
195
+ "id": "global::Partial"
196
+ },
197
+ "ColorScheme": {
198
+ "location": "import",
199
+ "path": "../../config",
200
+ "id": "src/config.ts::ColorScheme"
201
+ }
202
+ }
203
+ },
204
+ "required": false,
205
+ "optional": false,
206
+ "docs": {
207
+ "tags": [],
208
+ "text": ""
209
+ },
210
+ "getter": false,
211
+ "setter": false,
212
+ "defaultValue": "null"
140
213
  }
141
214
  };
142
215
  }
@@ -151,5 +224,11 @@ export class SolarExpert {
151
224
  };
152
225
  }
153
226
  static get elementRef() { return "el"; }
227
+ static get watchers() {
228
+ return [{
229
+ "propName": "colorScheme",
230
+ "methodName": "colorSchemeChanged"
231
+ }];
232
+ }
154
233
  }
155
234
  //# sourceMappingURL=solar-expert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solar-expert.js","sourceRoot":"","sources":["../../../src/components/solar-expert/solar-expert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAO9C,MAAM,OAAO,WAAW;IAEpB,EAAE,CAAe;IAGjB,MAAM,GAAW,GAAG,CAAC,mBAAmB,CAAC;IAEzC,QAAQ,GAAa,IAAI,CAAC;IAG1B,QAAQ,GAAkB,SAAS,CAAC;IAEpC,SAAS,GAAkB,CAAC,QAAQ,CAAC;IAErC,QAAQ,GAAY,KAAK,CAAC;IAE1B,YAAY,GAA2C,IAAI,CAAC;IAE5D,KAAK,GAA0C,IAAI,CAAC;IAEpD,eAAe,GAAY,KAAK,CAAC;IAEzB,YAAY,CAAoB;IAExC,iBAAiB;QACb,KAAK,CAAC,QAAQ;YACV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AAK,EAAC,wCAAwC,EAC9C,EAAE,EAAC,kBAAkB,IAEpB,IAAI,CAAC,eAAe;YACjB,CAAC,CAAC,CACE,+BACa,IAAI,CAAC,MAAM,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACzB,CACL;YACD,CAAC,CAAC,CACE;gBACI,WAAK,KAAK,EAAC,+CAA+C;oBACtD,WAAK,KAAK,EAAC,iBAAiB;wBACxB,WAAK,KAAK,EAAC,oDAAoD;4BAC3D,sBAAe,CACb;wBACN,aACI,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,EACnC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,CAAC,CAAC,WAAW;iCACrB,iBAAiB,EACtB,KAAK,EAAC,gGAAgG,GACxG,CACA;oBACN,cACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,EACvC,KAAK,EAAC,4HAA4H,IAEjI,CAAC,CAAC,WAAW,CAAC,WAAW,CACrB,CACP;gBACN,gBACI,MAAM,EAAE,IAAI,CAAC,MAAM,GACrB,CACH,CACN,CACH,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, Env, h, Prop, State } from \"@stencil/core\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { onChange, state } from \"../../store\";\r\n\r\n@Component({\r\n tag: \"solar-expert\",\r\n shadow: false,\r\n styleUrl: \"../../output.css\",\r\n})\r\nexport class SolarExpert {\r\n @Element()\r\n el!: HTMLElement;\r\n\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n @Prop()\r\n language: Language = \"en\";\r\n\r\n @State()\r\n latitude: number | null = 40.581614;\r\n @State()\r\n longitude: number | null = -4.128423;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n @State()\r\n showMapSelector: boolean = false;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n state.isMobile =\r\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i\r\n .test(navigator.userAgent) || window.innerWidth < 768;\r\n this.loadGoogleMapsScript();\r\n onChange(\"latitude\", () => {\r\n if (this.showMapSelector) {\r\n this.showMapSelector = false;\r\n this.scrollToMapDraw();\r\n }\r\n });\r\n state.settings.language = this.language;\r\n state.isIOS = /^((?!chrome|android).)*safari/i.test(\r\n navigator.userAgent,\r\n );\r\n console.log(state.isIOS);\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\", \"maps\", \"marker\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps: \", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n const place = this.autocomplete?.getPlace();\r\n this.latitude = place?.geometry?.location?.lat() ?? 0;\r\n this.longitude = place?.geometry?.location?.lng() ?? 0;\r\n state.latitude = this.latitude;\r\n state.longitude = this.longitude;\r\n\r\n this.scrollToMapDraw();\r\n });\r\n }\r\n\r\n private scrollToMapDraw() {\r\n if (state.isMobile) {\r\n const solarSystemFormElement = this.el.querySelector(\r\n \"solar-system-form\",\r\n );\r\n if (solarSystemFormElement) {\r\n solarSystemFormElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n } else {\r\n const mapDrawElement = this.el.querySelector(\"map-draw\");\r\n if (mapDrawElement) {\r\n mapDrawElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n }\r\n }\r\n\r\n private handleChooseOnMap() {\r\n this.showMapSelector = true;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div\r\n class=\"flex flex-col w-full h-full p-3 m-auto\"\r\n id=\"solar-calculator\"\r\n >\r\n {this.showMapSelector\r\n ? (\r\n <map-selector\r\n api-key={this.apiKey}\r\n language={this.language}\r\n />\r\n )\r\n : (\r\n <>\r\n <div class=\"pb-3 flex flex-row gap-4 items-stretch w-full\">\r\n <div class=\"relative flex-3\">\r\n <div class=\"absolute left-3 top-1/2 transform -translate-y-1/2\">\r\n <search-icon />\r\n </div>\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder={t.solarExpert\r\n .searchPlaceholder}\r\n class=\"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-4xl focus:ring-[#271200] bg-white h-full\"\r\n />\r\n </div>\r\n <button\r\n onClick={() => this.handleChooseOnMap()}\r\n class=\"flex-1 pl-4 pr-4 py-2 border border-gray-300 bg-white rounded-4xl focus:ring-[#271200] hover:bg-[#271200] hover:text-white\"\r\n >\r\n {t.mapSelector.chooseOnMap}\r\n </button>\r\n </div>\r\n <map-draw\r\n apiKey={this.apiKey}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"solar-expert.js","sourceRoot":"","sources":["../../../src/components/solar-expert/solar-expert.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,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C,EAAE,EAAC,kBAAkB,IAEpB,IAAI,CAAC,eAAe;YACjB,CAAC,CAAC,CACE,+BACa,IAAI,CAAC,MAAM,EACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACzB,CACL;YACD,CAAC,CAAC,CACE;gBACI,WAAK,KAAK,EAAC,0DAA0D;oBACjE,WAAK,KAAK,EAAC,iBAAiB;wBACxB,WAAK,KAAK,EAAC,0EAA0E;4BACjF,sBAAe,CACb;wBACN,aACI,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,EACnC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,CAAC,CAAC,WAAW;iCACrB,iBAAiB,EACtB,KAAK,EAAC,oHAAoH,GAC5H,CACA;oBACN,cACI,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,EACvC,KAAK,EAAC,0HAA0H,IAE/H,CAAC,CAAC,WAAW,CAAC,WAAW,CACrB,CACP;gBACN,gBACI,MAAM,EAAE,IAAI,CAAC,MAAM,GACrB,CACH,CACN,CACH,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Element, Env, h, Prop, State, Watch } from \"@stencil/core\";\r\nimport { Loader } from \"@googlemaps/js-api-loader\";\r\nimport { Language } from \"../../types/lang\";\r\nimport { getLanguageStrings } from \"../../utils/lang/general\";\r\nimport { onChange, state } from \"../../store\";\r\nimport { ColorScheme } from \"../../config\";\r\nimport { applyThemeGlobally } from \"../../utils/theme\";\r\n\r\n@Component({\r\n tag: \"solar-expert\",\r\n shadow: false,\r\n styleUrl: \"../../output.css\",\r\n})\r\nexport class SolarExpert {\r\n @Element()\r\n el!: HTMLElement;\r\n\r\n @Prop()\r\n apiKey: string = Env.GOOGLE_MAPS_API_KEY;\r\n @Prop()\r\n language: Language = \"en\";\r\n @Prop()\r\n colorScheme: Partial<ColorScheme> | null = null;\r\n // {\r\n // primary: \"hsl(0 0% 100%)\",\r\n // secondary: \"hsl(0 0% 100%)\",\r\n // tertiary: \"hsl(0 0% 100%)\",\r\n // muted: \"hsl(0 0% 100%)\",\r\n // error: \"hsl(0 0% 100%)\",\r\n // // secondary: \"hsl(180 100% 25%)\",\r\n // // tertiary: \"hsl(24 100% 18%)\",\r\n // // muted: \"hsl(0 0% 85%)\",\r\n // // error: \"hsl(240 75% 29%)\",\r\n // primaryForeground: \"hsl(0 0% 100%)\",\r\n // secondaryForeground: \"hsl(0 0% 100%)\",\r\n // tertiaryForeground: \"hsl(0 0% 100%)\",\r\n // mutedForeground: \"hsl(0 0% 100%)\",\r\n // errorForeground: \"hsl(0 0% 100%)\",\r\n // surface: \"hsl(0 0% 100%)\",\r\n // surfaceHover: \"hsl(0 0% 100%)\",\r\n // surfaceActive: \"hsl(0 0% 100%)\",\r\n // // Text colors\r\n // textMuted: \"hsl(0 0% 100%)\",\r\n // textSecondary: \"hsl(0 0% 100%)\",\r\n // textPlaceholder: \"hsl(0 0% 100%)\",\r\n // // Border colors\r\n // border: \"hsl(0 0% 100%)\",\r\n // borderLight: \"hsl(0 0% 100%)\",\r\n // // Status colors\r\n // success: \"hsl(0 0% 100%)\",\r\n // info: \"hsl(0 0% 100%)\",\r\n // // Interactive colors\r\n // hover: \"hsl(0 0% 100%)\",\r\n // hoverDark: \"hsl(0 0% 100%)\",\r\n // overlay: \"hsl(0 0% 100%)\",\r\n // tooltip: \"hsl(0 0% 100%)\",\r\n // };\r\n\r\n @State()\r\n latitude: number | null = 40.581614;\r\n @State()\r\n longitude: number | null = -4.128423;\r\n @State()\r\n isLoaded: boolean = false;\r\n @State()\r\n autocomplete: google.maps.places.Autocomplete | null = null;\r\n @State()\r\n place: google.maps.places.PlaceResult | null = null;\r\n @State()\r\n showMapSelector: boolean = false;\r\n\r\n private inputElement?: HTMLInputElement;\r\n\r\n componentWillLoad() {\r\n state.isMobile =\r\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i\r\n .test(navigator.userAgent) || window.innerWidth < 768;\r\n this.loadGoogleMapsScript();\r\n onChange(\"latitude\", () => {\r\n if (this.showMapSelector) {\r\n this.showMapSelector = false;\r\n this.scrollToMapDraw();\r\n }\r\n });\r\n state.settings.language = this.language;\r\n state.isIOS = /iPhone|iPad|iPod/.test(navigator.userAgent);\r\n\r\n this.applyTheme();\r\n }\r\n\r\n @Watch(\"colorScheme\")\r\n colorSchemeChanged() {\r\n this.applyTheme();\r\n }\r\n\r\n private applyTheme() {\r\n if (this.colorScheme) {\r\n applyThemeGlobally(this.colorScheme);\r\n }\r\n }\r\n\r\n private async loadGoogleMapsScript() {\r\n try {\r\n const loader = new Loader({\r\n apiKey: this.apiKey,\r\n libraries: [\"places\", \"maps\", \"marker\"],\r\n });\r\n\r\n const places = await loader.importLibrary(\"places\");\r\n this.isLoaded = true;\r\n this.initializeAutocomplete(places);\r\n } catch (error) {\r\n console.error(\"Error loading Google Maps: \", error);\r\n }\r\n }\r\n\r\n private initializeAutocomplete(\r\n places: google.maps.PlacesLibrary,\r\n ) {\r\n if (!this.inputElement || !this.isLoaded) return;\r\n this.autocomplete = new places.Autocomplete(this.inputElement);\r\n\r\n this.autocomplete.addListener(\"place_changed\", () => {\r\n const place = this.autocomplete?.getPlace();\r\n this.latitude = place?.geometry?.location?.lat() ?? 0;\r\n this.longitude = place?.geometry?.location?.lng() ?? 0;\r\n state.latitude = this.latitude;\r\n state.longitude = this.longitude;\r\n\r\n this.scrollToMapDraw();\r\n });\r\n }\r\n\r\n private scrollToMapDraw() {\r\n if (state.isMobile) {\r\n const solarSystemFormElement = this.el.querySelector(\r\n \"solar-system-form\",\r\n );\r\n if (solarSystemFormElement) {\r\n solarSystemFormElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n } else {\r\n const mapDrawElement = this.el.querySelector(\"map-draw\");\r\n if (mapDrawElement) {\r\n mapDrawElement.scrollIntoView({ behavior: \"smooth\" });\r\n }\r\n }\r\n }\r\n\r\n private handleChooseOnMap() {\r\n this.showMapSelector = true;\r\n }\r\n\r\n render() {\r\n const t = getLanguageStrings(this.language);\r\n return (\r\n <div\r\n class=\"flex flex-col w-full h-full p-3 m-auto\"\r\n id=\"solar-calculator\"\r\n >\r\n {this.showMapSelector\r\n ? (\r\n <map-selector\r\n api-key={this.apiKey}\r\n language={this.language}\r\n />\r\n )\r\n : (\r\n <>\r\n <div class=\"pb-3 flex flex-row gap-4 items-stretch w-full bg-primary\">\r\n <div class=\"relative flex-3\">\r\n <div class=\"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground\">\r\n <search-icon />\r\n </div>\r\n <input\r\n ref={(el) => this.inputElement = el}\r\n type=\"text\"\r\n placeholder={t.solarExpert\r\n .searchPlaceholder}\r\n class=\"w-full pl-10 pr-4 py-2 border border-border rounded-4xl focus:ring-secondary bg-muted text-muted-foreground h-full\"\r\n />\r\n </div>\r\n <button\r\n onClick={() => this.handleChooseOnMap()}\r\n class=\"flex-1 pl-4 pr-4 py-2 border border-border bg-muted rounded-4xl focus:ring-secondary hover:bg-secondary hover:text-muted\"\r\n >\r\n {t.mapSelector.chooseOnMap}\r\n </button>\r\n </div>\r\n <map-draw\r\n apiKey={this.apiKey}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}