@trailstash/ultra 3.0.0-dev
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/.gitlab-ci.yml +15 -0
- package/Examples/alt-bbox-format.ultra +9 -0
- package/Examples/atp-usps-dropboxes.ultra +68 -0
- package/Examples/bike-infra.ultra +111 -0
- package/Examples/contribution-heatmap.ultra +17 -0
- package/Examples/custom-style.ultra +114 -0
- package/Examples/glow-effect.ultra +27 -0
- package/Examples/index.md +7 -0
- package/Examples/landmarks-prototype.ultra +68 -0
- package/Examples/minimalist-ski-map.ultra +55 -0
- package/Examples/opentrailstash-3d.ultra +40 -0
- package/Examples/overture-landcover-plus-hillshade.ultra +45 -0
- package/Examples/overture-places-and-osm.ultra +29 -0
- package/Examples/trees.ultra +60 -0
- package/Examples/wikidata-photo.ultra +28 -0
- package/Examples/within-bounds.ultra +12 -0
- package/LICENSE +23 -0
- package/MapLibre-Examples/3d-buildings.ultra +43 -0
- package/MapLibre-Examples/3d-extrusion-floorplan.ultra +28 -0
- package/MapLibre-Examples/3d-terrain.ultra +39 -0
- package/MapLibre-Examples/add-image.ultra +26 -0
- package/MapLibre-Examples/attribution-position.ultra +12 -0
- package/MapLibre-Examples/change-case-of-labels.ultra +26 -0
- package/MapLibre-Examples/cluster.ultra +59 -0
- package/MapLibre-Examples/cooperative-gestures.ultra +11 -0
- package/MapLibre-Examples/custom-marker-icons.ultra +65 -0
- package/MapLibre-Examples/data-driven-lines.ultra +169 -0
- package/MapLibre-Examples/disable-rotation.ultra +11 -0
- package/MapLibre-Examples/disable-scroll-zoom.ultra +9 -0
- package/MapLibre-Examples/display-and-style-rich-text-labels.ultra +22 -0
- package/MapLibre-Examples/fill-pattern.ultra +43 -0
- package/MapLibre-Examples/fullscreen.ultra +10 -0
- package/MapLibre-Examples/geojson-layer-in-stack.ultra +23 -0
- package/MapLibre-Examples/geojson-line.ultra +114 -0
- package/MapLibre-Examples/geojson-markers.ultra +217 -0
- package/MapLibre-Examples/geojson-polygon.ultra +104 -0
- package/MapLibre-Examples/heatmap-layer.ultra +111 -0
- package/MapLibre-Examples/index.md +4 -0
- package/MapLibre-Examples/locate-user.ultra +14 -0
- package/MapLibre-Examples/map-tiles.ultra +9 -0
- package/MapLibre-Examples/pmtiles.ultra +25 -0
- package/MapLibre-Examples/wms.ultra +14 -0
- package/README.md +46 -0
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +3 -0
- package/bin/run.js +5 -0
- package/build-examples-docs.js +104 -0
- package/build-examples-images.js +87 -0
- package/build-sprites.sh +30 -0
- package/cli/build.js +53 -0
- package/cli/serve.js +34 -0
- package/components/button-modal.js +111 -0
- package/components/button.css +22 -0
- package/components/button.js +6 -0
- package/components/code-editor.js +87 -0
- package/components/download-button.js +69 -0
- package/components/fontawesome-icon.js +80 -0
- package/components/fs-button.js +52 -0
- package/components/help-modal.js +98 -0
- package/components/map-popup.js +57 -0
- package/components/nav-bar.js +76 -0
- package/components/run-button.js +78 -0
- package/components/share-button.js +35 -0
- package/components/share-modal.js +139 -0
- package/components/style-picker.js +47 -0
- package/components/ultra-ide.js +298 -0
- package/components/ultra-loader.js +60 -0
- package/components/ultra-map.js +312 -0
- package/configs/minimal.js +9 -0
- package/configs/overpass-ultra.js +185 -0
- package/docs/assets/Examples/alt-bbox-format.png +0 -0
- package/docs/assets/Examples/atp-usps-dropboxes.png +0 -0
- package/docs/assets/Examples/bike-infra.png +0 -0
- package/docs/assets/Examples/contribution-heatmap.png +0 -0
- package/docs/assets/Examples/custom-style.png +0 -0
- package/docs/assets/Examples/glow-effect.png +0 -0
- package/docs/assets/Examples/landmarks-prototype.png +0 -0
- package/docs/assets/Examples/minimalist-ski-map.png +0 -0
- package/docs/assets/Examples/opentrailstash-3d.png +0 -0
- package/docs/assets/Examples/overture-landcover-plus-hillshade.png +0 -0
- package/docs/assets/Examples/overture-places-and-osm.png +0 -0
- package/docs/assets/Examples/trees.png +0 -0
- package/docs/assets/Examples/wikidata-photo.png +0 -0
- package/docs/assets/Examples/within-bounds.png +0 -0
- package/docs/assets/MapLibre-Examples/3d-buildings.png +0 -0
- package/docs/assets/MapLibre-Examples/3d-extrusion-floorplan.png +0 -0
- package/docs/assets/MapLibre-Examples/3d-terrain.png +0 -0
- package/docs/assets/MapLibre-Examples/add-image.png +0 -0
- package/docs/assets/MapLibre-Examples/attribution-position.png +0 -0
- package/docs/assets/MapLibre-Examples/change-case-of-labels.png +0 -0
- package/docs/assets/MapLibre-Examples/cluster.png +0 -0
- package/docs/assets/MapLibre-Examples/cooperative-gestures.png +0 -0
- package/docs/assets/MapLibre-Examples/custom-marker-icons.png +0 -0
- package/docs/assets/MapLibre-Examples/data-driven-lines.png +0 -0
- package/docs/assets/MapLibre-Examples/disable-rotation.png +0 -0
- package/docs/assets/MapLibre-Examples/disable-scroll-zoom.png +0 -0
- package/docs/assets/MapLibre-Examples/display-and-style-rich-text-labels.png +0 -0
- package/docs/assets/MapLibre-Examples/fill-pattern.png +0 -0
- package/docs/assets/MapLibre-Examples/fullscreen.png +0 -0
- package/docs/assets/MapLibre-Examples/geojson-layer-in-stack.png +0 -0
- package/docs/assets/MapLibre-Examples/geojson-line.png +0 -0
- package/docs/assets/MapLibre-Examples/geojson-markers.png +0 -0
- package/docs/assets/MapLibre-Examples/geojson-polygon.png +0 -0
- package/docs/assets/MapLibre-Examples/heatmap-layer.png +0 -0
- package/docs/assets/MapLibre-Examples/locate-user.png +0 -0
- package/docs/assets/MapLibre-Examples/map-tiles.png +0 -0
- package/docs/assets/MapLibre-Examples/pmtiles.png +0 -0
- package/docs/assets/MapLibre-Examples/wms.png +0 -0
- package/docs/assets/data/Examples/atp_usps_collection_boxes.geojson +1 -0
- package/docs/further-reading.md +15 -0
- package/docs/index.md +55 -0
- package/docs/overrides/partials/integrations/analytics/custom.html +11 -0
- package/docs/query-shortcuts.md +21 -0
- package/docs/style.md +120 -0
- package/docs/url-parameters.md +45 -0
- package/docs/yaml.md +117 -0
- package/index.js +53 -0
- package/lib/base.css +12 -0
- package/lib/bounds.js +8 -0
- package/lib/dom.js +21 -0
- package/lib/glyphFallback.js +31 -0
- package/lib/localStorage.js +34 -0
- package/lib/normalize.js +5 -0
- package/lib/queryMap.js +50 -0
- package/lib/queryParams.js +142 -0
- package/lib/queryProviders/auto.js +47 -0
- package/lib/queryProviders/geojson.js +134 -0
- package/lib/queryProviders/gpx.js +101 -0
- package/lib/queryProviders/index.js +22 -0
- package/lib/queryProviders/kml.js +132 -0
- package/lib/queryProviders/osm.js +199 -0
- package/lib/queryProviders/overpass.js +162 -0
- package/lib/queryProviders/raster.js +23 -0
- package/lib/queryProviders/tcx.js +105 -0
- package/lib/queryProviders/vector.js +13 -0
- package/lib/settings.js +72 -0
- package/lib/sprites.js +18 -0
- package/lib/style.js +222 -0
- package/mkdocs.yml +26 -0
- package/package.json +80 -0
- package/screenshot.png +0 -0
- package/static/embed.js +18 -0
- package/static/font/0-255.pbf +0 -0
- package/static/font/1024-1279.pbf +0 -0
- package/static/font/10240-10495.pbf +3 -0
- package/static/font/10496-10751.pbf +0 -0
- package/static/font/10752-11007.pbf +3 -0
- package/static/font/11008-11263.pbf +0 -0
- package/static/font/11264-11519.pbf +0 -0
- package/static/font/11520-11775.pbf +0 -0
- package/static/font/11776-12031.pbf +0 -0
- package/static/font/12032-12287.pbf +0 -0
- package/static/font/12288-12543.pbf +0 -0
- package/static/font/12544-12799.pbf +0 -0
- package/static/font/1280-1535.pbf +0 -0
- package/static/font/12800-13055.pbf +0 -0
- package/static/font/13056-13311.pbf +0 -0
- package/static/font/13312-13567.pbf +0 -0
- package/static/font/13568-13823.pbf +0 -0
- package/static/font/13824-14079.pbf +0 -0
- package/static/font/14080-14335.pbf +0 -0
- package/static/font/14336-14591.pbf +0 -0
- package/static/font/14592-14847.pbf +0 -0
- package/static/font/14848-15103.pbf +0 -0
- package/static/font/15104-15359.pbf +0 -0
- package/static/font/1536-1791.pbf +0 -0
- package/static/font/15360-15615.pbf +0 -0
- package/static/font/15616-15871.pbf +0 -0
- package/static/font/15872-16127.pbf +0 -0
- package/static/font/16128-16383.pbf +0 -0
- package/static/font/16384-16639.pbf +0 -0
- package/static/font/16640-16895.pbf +0 -0
- package/static/font/16896-17151.pbf +0 -0
- package/static/font/17152-17407.pbf +0 -0
- package/static/font/17408-17663.pbf +0 -0
- package/static/font/17664-17919.pbf +0 -0
- package/static/font/1792-2047.pbf +0 -0
- package/static/font/17920-18175.pbf +0 -0
- package/static/font/18176-18431.pbf +0 -0
- package/static/font/18432-18687.pbf +0 -0
- package/static/font/18688-18943.pbf +0 -0
- package/static/font/18944-19199.pbf +0 -0
- package/static/font/19200-19455.pbf +0 -0
- package/static/font/19456-19711.pbf +0 -0
- package/static/font/19712-19967.pbf +0 -0
- package/static/font/19968-20223.pbf +0 -0
- package/static/font/20224-20479.pbf +0 -0
- package/static/font/2048-2303.pbf +0 -0
- package/static/font/20480-20735.pbf +0 -0
- package/static/font/20736-20991.pbf +0 -0
- package/static/font/20992-21247.pbf +0 -0
- package/static/font/21248-21503.pbf +0 -0
- package/static/font/21504-21759.pbf +0 -0
- package/static/font/21760-22015.pbf +0 -0
- package/static/font/22016-22271.pbf +0 -0
- package/static/font/22272-22527.pbf +192 -26
- package/static/font/22528-22783.pbf +0 -0
- package/static/font/22784-23039.pbf +0 -0
- package/static/font/2304-2559.pbf +0 -0
- package/static/font/23040-23295.pbf +0 -0
- package/static/font/23296-23551.pbf +0 -0
- package/static/font/23552-23807.pbf +0 -0
- package/static/font/23808-24063.pbf +0 -0
- package/static/font/24064-24319.pbf +0 -0
- package/static/font/24320-24575.pbf +0 -0
- package/static/font/24576-24831.pbf +0 -0
- package/static/font/24832-25087.pbf +0 -0
- package/static/font/25088-25343.pbf +0 -0
- package/static/font/25344-25599.pbf +0 -0
- package/static/font/256-511.pbf +0 -0
- package/static/font/2560-2815.pbf +0 -0
- package/static/font/25600-25855.pbf +0 -0
- package/static/font/25856-26111.pbf +0 -0
- package/static/font/26112-26367.pbf +0 -0
- package/static/font/26368-26623.pbf +0 -0
- package/static/font/26624-26879.pbf +0 -0
- package/static/font/26880-27135.pbf +0 -0
- package/static/font/27136-27391.pbf +0 -0
- package/static/font/27392-27647.pbf +0 -0
- package/static/font/27648-27903.pbf +0 -0
- package/static/font/27904-28159.pbf +0 -0
- package/static/font/2816-3071.pbf +0 -0
- package/static/font/28160-28415.pbf +0 -0
- package/static/font/28416-28671.pbf +0 -0
- package/static/font/28672-28927.pbf +0 -0
- package/static/font/28928-29183.pbf +0 -0
- package/static/font/29184-29439.pbf +0 -0
- package/static/font/29440-29695.pbf +0 -0
- package/static/font/29696-29951.pbf +0 -0
- package/static/font/29952-30207.pbf +0 -0
- package/static/font/30208-30463.pbf +0 -0
- package/static/font/30464-30719.pbf +0 -0
- package/static/font/3072-3327.pbf +0 -0
- package/static/font/30720-30975.pbf +0 -0
- package/static/font/30976-31231.pbf +0 -0
- package/static/font/31232-31487.pbf +0 -0
- package/static/font/31488-31743.pbf +0 -0
- package/static/font/31744-31999.pbf +0 -0
- package/static/font/32000-32255.pbf +0 -0
- package/static/font/32256-32511.pbf +0 -0
- package/static/font/32512-32767.pbf +0 -0
- package/static/font/32768-33023.pbf +0 -0
- package/static/font/33024-33279.pbf +0 -0
- package/static/font/3328-3583.pbf +0 -0
- package/static/font/33280-33535.pbf +0 -0
- package/static/font/33536-33791.pbf +0 -0
- package/static/font/33792-34047.pbf +0 -0
- package/static/font/34048-34303.pbf +0 -0
- package/static/font/34304-34559.pbf +0 -0
- package/static/font/34560-34815.pbf +0 -0
- package/static/font/34816-35071.pbf +0 -0
- package/static/font/35072-35327.pbf +0 -0
- package/static/font/35328-35583.pbf +0 -0
- package/static/font/35584-35839.pbf +0 -0
- package/static/font/3584-3839.pbf +0 -0
- package/static/font/35840-36095.pbf +0 -0
- package/static/font/36096-36351.pbf +0 -0
- package/static/font/36352-36607.pbf +0 -0
- package/static/font/36608-36863.pbf +0 -0
- package/static/font/36864-37119.pbf +0 -0
- package/static/font/37120-37375.pbf +0 -0
- package/static/font/37376-37631.pbf +0 -0
- package/static/font/37632-37887.pbf +0 -0
- package/static/font/37888-38143.pbf +0 -0
- package/static/font/38144-38399.pbf +0 -0
- package/static/font/3840-4095.pbf +0 -0
- package/static/font/38400-38655.pbf +45 -4
- package/static/font/38656-38911.pbf +0 -0
- package/static/font/38912-39167.pbf +0 -0
- package/static/font/39168-39423.pbf +0 -0
- package/static/font/39424-39679.pbf +0 -0
- package/static/font/39680-39935.pbf +0 -0
- package/static/font/39936-40191.pbf +0 -0
- package/static/font/40192-40447.pbf +0 -0
- package/static/font/40448-40703.pbf +0 -0
- package/static/font/40704-40959.pbf +0 -0
- package/static/font/4096-4351.pbf +0 -0
- package/static/font/40960-41215.pbf +3 -0
- package/static/font/41216-41471.pbf +3 -0
- package/static/font/41472-41727.pbf +3 -0
- package/static/font/41728-41983.pbf +3 -0
- package/static/font/41984-42239.pbf +3 -0
- package/static/font/42240-42495.pbf +3 -0
- package/static/font/42496-42751.pbf +3 -0
- package/static/font/42752-43007.pbf +0 -0
- package/static/font/43008-43263.pbf +0 -0
- package/static/font/43264-43519.pbf +0 -0
- package/static/font/4352-4607.pbf +0 -0
- package/static/font/43520-43775.pbf +0 -0
- package/static/font/43776-44031.pbf +0 -0
- package/static/font/44032-44287.pbf +0 -0
- package/static/font/44288-44543.pbf +0 -0
- package/static/font/44544-44799.pbf +0 -0
- package/static/font/44800-45055.pbf +0 -0
- package/static/font/45056-45311.pbf +0 -0
- package/static/font/45312-45567.pbf +0 -0
- package/static/font/45568-45823.pbf +0 -0
- package/static/font/45824-46079.pbf +0 -0
- package/static/font/4608-4863.pbf +0 -0
- package/static/font/46080-46335.pbf +0 -0
- package/static/font/46336-46591.pbf +0 -0
- package/static/font/46592-46847.pbf +0 -0
- package/static/font/46848-47103.pbf +0 -0
- package/static/font/47104-47359.pbf +0 -0
- package/static/font/47360-47615.pbf +0 -0
- package/static/font/47616-47871.pbf +0 -0
- package/static/font/47872-48127.pbf +0 -0
- package/static/font/48128-48383.pbf +0 -0
- package/static/font/48384-48639.pbf +0 -0
- package/static/font/4864-5119.pbf +0 -0
- package/static/font/48640-48895.pbf +0 -0
- package/static/font/48896-49151.pbf +0 -0
- package/static/font/49152-49407.pbf +0 -0
- package/static/font/49408-49663.pbf +0 -0
- package/static/font/49664-49919.pbf +0 -0
- package/static/font/49920-50175.pbf +0 -0
- package/static/font/50176-50431.pbf +0 -0
- package/static/font/50432-50687.pbf +0 -0
- package/static/font/50688-50943.pbf +0 -0
- package/static/font/50944-51199.pbf +0 -0
- package/static/font/512-767.pbf +0 -0
- package/static/font/5120-5375.pbf +3 -0
- package/static/font/51200-51455.pbf +0 -0
- package/static/font/51456-51711.pbf +0 -0
- package/static/font/51712-51967.pbf +0 -0
- package/static/font/51968-52223.pbf +0 -0
- package/static/font/52224-52479.pbf +0 -0
- package/static/font/52480-52735.pbf +0 -0
- package/static/font/52736-52991.pbf +0 -0
- package/static/font/52992-53247.pbf +0 -0
- package/static/font/53248-53503.pbf +0 -0
- package/static/font/53504-53759.pbf +0 -0
- package/static/font/5376-5631.pbf +3 -0
- package/static/font/53760-54015.pbf +0 -0
- package/static/font/54016-54271.pbf +0 -0
- package/static/font/54272-54527.pbf +0 -0
- package/static/font/54528-54783.pbf +0 -0
- package/static/font/54784-55039.pbf +0 -0
- package/static/font/55040-55295.pbf +0 -0
- package/static/font/55296-55551.pbf +3 -0
- package/static/font/55552-55807.pbf +3 -0
- package/static/font/55808-56063.pbf +3 -0
- package/static/font/56064-56319.pbf +3 -0
- package/static/font/5632-5887.pbf +3 -0
- package/static/font/56320-56575.pbf +3 -0
- package/static/font/56576-56831.pbf +3 -0
- package/static/font/56832-57087.pbf +3 -0
- package/static/font/57088-57343.pbf +3 -0
- package/static/font/57344-57599.pbf +3 -0
- package/static/font/57600-57855.pbf +3 -0
- package/static/font/57856-58111.pbf +3 -0
- package/static/font/58112-58367.pbf +3 -0
- package/static/font/58368-58623.pbf +3 -0
- package/static/font/58624-58879.pbf +3 -0
- package/static/font/5888-6143.pbf +0 -0
- package/static/font/58880-59135.pbf +3 -0
- package/static/font/59136-59391.pbf +3 -0
- package/static/font/59392-59647.pbf +3 -0
- package/static/font/59648-59903.pbf +3 -0
- package/static/font/59904-60159.pbf +3 -0
- package/static/font/60160-60415.pbf +3 -0
- package/static/font/60416-60671.pbf +3 -0
- package/static/font/60672-60927.pbf +3 -0
- package/static/font/60928-61183.pbf +3 -0
- package/static/font/61184-61439.pbf +3 -0
- package/static/font/6144-6399.pbf +0 -0
- package/static/font/61440-61695.pbf +3 -0
- package/static/font/61696-61951.pbf +3 -0
- package/static/font/61952-62207.pbf +3 -0
- package/static/font/62208-62463.pbf +3 -0
- package/static/font/62464-62719.pbf +3 -0
- package/static/font/62720-62975.pbf +3 -0
- package/static/font/62976-63231.pbf +3 -0
- package/static/font/63232-63487.pbf +3 -0
- package/static/font/63488-63743.pbf +3 -0
- package/static/font/63744-63999.pbf +0 -0
- package/static/font/6400-6655.pbf +0 -0
- package/static/font/64000-64255.pbf +0 -0
- package/static/font/64256-64511.pbf +0 -0
- package/static/font/64512-64767.pbf +0 -0
- package/static/font/64768-65023.pbf +0 -0
- package/static/font/65024-65279.pbf +0 -0
- package/static/font/65280-65535.pbf +0 -0
- package/static/font/6656-6911.pbf +3 -0
- package/static/font/6912-7167.pbf +0 -0
- package/static/font/7168-7423.pbf +0 -0
- package/static/font/7424-7679.pbf +0 -0
- package/static/font/768-1023.pbf +0 -0
- package/static/font/7680-7935.pbf +0 -0
- package/static/font/7936-8191.pbf +0 -0
- package/static/font/8192-8447.pbf +0 -0
- package/static/font/8448-8703.pbf +0 -0
- package/static/font/8704-8959.pbf +0 -0
- package/static/font/8960-9215.pbf +0 -0
- package/static/font/9216-9471.pbf +0 -0
- package/static/font/9472-9727.pbf +0 -0
- package/static/font/9728-9983.pbf +0 -0
- package/static/font/9984-10239.pbf +0 -0
- package/static/index.html +59 -0
- package/static/logo.png +0 -0
- package/static/logo.svg +78 -0
- package/static/mapbox-gl-rtl-text@0.2.3.js +9851 -0
- package/static/minimal.js +9 -0
- package/static/minimal.json +7 -0
- package/static/sprites/maki.json +1706 -0
- package/static/sprites/maki.license +116 -0
- package/static/sprites/maki.png +0 -0
- package/static/sprites/maki@2x.json +1706 -0
- package/static/sprites/maki@2x.png +0 -0
- package/static/sprites/temaki.json +4306 -0
- package/static/sprites/temaki.license +118 -0
- package/static/sprites/temaki.png +0 -0
- package/static/sprites/temaki@2x.json +4306 -0
- package/static/sprites/temaki@2x.png +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { icon } from "@fortawesome/fontawesome-svg-core";
|
|
2
|
+
import {
|
|
3
|
+
faUpRightAndDownLeftFromCenter as faMaximize,
|
|
4
|
+
faDownLeftAndUpRightToCenter as faMinimize,
|
|
5
|
+
} from "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
|
|
7
|
+
const faMaximizeIcon = icon(faMaximize);
|
|
8
|
+
const faMinimizeIcon = icon(faMinimize);
|
|
9
|
+
|
|
10
|
+
import { h } from "../lib/dom.js";
|
|
11
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
12
|
+
import { style as buttonCSS } from "./button.js";
|
|
13
|
+
|
|
14
|
+
const style = new CSSStyleSheet();
|
|
15
|
+
style.replaceSync(`
|
|
16
|
+
:host {
|
|
17
|
+
}
|
|
18
|
+
button {
|
|
19
|
+
background: white;
|
|
20
|
+
}
|
|
21
|
+
`);
|
|
22
|
+
|
|
23
|
+
export class FSButton extends HTMLElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
30
|
+
|
|
31
|
+
shadow.adoptedStyleSheets.push(normalizeCSS);
|
|
32
|
+
shadow.adoptedStyleSheets.push(buttonCSS);
|
|
33
|
+
shadow.adoptedStyleSheets.push(style);
|
|
34
|
+
|
|
35
|
+
const icon = h("fa-icon", { icon: "up-right-and-down-left-from-center" });
|
|
36
|
+
const button = h("button", {}, icon);
|
|
37
|
+
this.refs = { button, icon };
|
|
38
|
+
|
|
39
|
+
button.addEventListener("click", (e) => {
|
|
40
|
+
if (this.classList.contains("fs")) {
|
|
41
|
+
this.refs.icon.icon = "up-right-and-down-left-from-center";
|
|
42
|
+
this.dispatchEvent(new Event("exit-fullscreen"));
|
|
43
|
+
} else {
|
|
44
|
+
this.refs.icon.icon = "down-left-and-up-right-to-center";
|
|
45
|
+
this.dispatchEvent(new Event("enter-fullscreen"));
|
|
46
|
+
}
|
|
47
|
+
this.classList.toggle("fs");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
shadow.appendChild(button);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { marked } from "marked";
|
|
2
|
+
import { h, t } from "../lib/dom.js";
|
|
3
|
+
import { style as buttonCSS } from "./button.js";
|
|
4
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
5
|
+
import { toQueryParams } from "../lib/queryParams.js";
|
|
6
|
+
import { version as maplibreVersion } from "maplibre-gl/package.json";
|
|
7
|
+
import { version as osmtogeojsonVersion } from "osmtogeojson/package.json";
|
|
8
|
+
import { version as togeojsonVersion } from "../node_modules/@tmcw/togeojson/package.json";
|
|
9
|
+
import readme from "../README.md";
|
|
10
|
+
|
|
11
|
+
export class HelpModal extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.help = readme;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
connectedCallback() {
|
|
18
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
19
|
+
|
|
20
|
+
const readmeHTML = marked
|
|
21
|
+
.parse(this.help)
|
|
22
|
+
.replace(/<\/h3>/g, "</h5>")
|
|
23
|
+
.replace(/<h3>/g, "<h5>")
|
|
24
|
+
.replace(/<\/h2>/g, "</h4>")
|
|
25
|
+
.replace(/<h2>/g, "<h4>")
|
|
26
|
+
.replace(/<\/h1>/g, "</h3>")
|
|
27
|
+
.replace(/<h1>/g, "<h3>");
|
|
28
|
+
|
|
29
|
+
const div = h(
|
|
30
|
+
"div",
|
|
31
|
+
{ style: "padding: 0 8px 8px;max-width:800px;", slot: "modal-content" },
|
|
32
|
+
`
|
|
33
|
+
${readmeHTML}
|
|
34
|
+
<div>
|
|
35
|
+
<h4>Data Sources</h4>
|
|
36
|
+
<ul>
|
|
37
|
+
<li>
|
|
38
|
+
Data ©
|
|
39
|
+
<a target="_blank" href="http://openstreetmap.org/">OpenStreetMap</a>
|
|
40
|
+
contributors,
|
|
41
|
+
<span style="font-size: smaller">
|
|
42
|
+
<a target="_blank" href="http://opendatacommons.org/licenses/odbl/1-0/"
|
|
43
|
+
>ODbL</a
|
|
44
|
+
>
|
|
45
|
+
(<a target="_blank" href="http://www.openstreetmap.org/copyright">Terms</a>)
|
|
46
|
+
</span>
|
|
47
|
+
</li>
|
|
48
|
+
<li>
|
|
49
|
+
Data mining by
|
|
50
|
+
<a target="_blank" href="http://overpass-api.de/">Overpass API</a>
|
|
51
|
+
</li>
|
|
52
|
+
<li>
|
|
53
|
+
<a target="_blank" href="https://www.openmaptiles.org/"
|
|
54
|
+
>OpenMapTiles
|
|
55
|
+
</a>
|
|
56
|
+
hosted by the
|
|
57
|
+
<a target="_blank" href="http://tile.ourmap.us/">
|
|
58
|
+
OSM Americana Community Vector Tile Server</a
|
|
59
|
+
>
|
|
60
|
+
</li>
|
|
61
|
+
<li>
|
|
62
|
+
<a target="_blank" href="https://www.protomaps.com/"
|
|
63
|
+
>Protomaps
|
|
64
|
+
</a>
|
|
65
|
+
hosted by the Protomaps API
|
|
66
|
+
</li>
|
|
67
|
+
</ul>
|
|
68
|
+
<h4>Software & Libraries</h4>
|
|
69
|
+
<ul>
|
|
70
|
+
<li>
|
|
71
|
+
Map powered by
|
|
72
|
+
<a target="_blank" href="https://maplibre.org/projects/maplibre-gl-js/"
|
|
73
|
+
>MapLibre GL JS</a
|
|
74
|
+
> <code>${maplibreVersion}</code>
|
|
75
|
+
</li>
|
|
76
|
+
<li>
|
|
77
|
+
OSM to GeoJSON conversion powered by
|
|
78
|
+
<a target="_blank" href="https://github.com/tyrasd/osmtogeojson"
|
|
79
|
+
>osmtogeojson</a
|
|
80
|
+
> <code>${osmtogeojsonVersion}</code>
|
|
81
|
+
</li>
|
|
82
|
+
<li>
|
|
83
|
+
KML/GPX/TCX to GeoJSON conversion powered by
|
|
84
|
+
<a target="_blank" href="https://github.com/placemark/togeojson"
|
|
85
|
+
>@tmcw/togeojson</a
|
|
86
|
+
> <code>${togeojsonVersion}</code>
|
|
87
|
+
</li>
|
|
88
|
+
</ul>
|
|
89
|
+
</div>
|
|
90
|
+
`,
|
|
91
|
+
);
|
|
92
|
+
div.addEventListener("click", (e) => e.stopPropagation());
|
|
93
|
+
const button = h("button-modal", { text: "Help", icon: "question" }, div);
|
|
94
|
+
this.refs = { button, div };
|
|
95
|
+
|
|
96
|
+
shadow.appendChild(button);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Liquid } from "liquidjs";
|
|
2
|
+
import { h, t } from "../lib/dom.js";
|
|
3
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
4
|
+
|
|
5
|
+
const engine = new Liquid();
|
|
6
|
+
|
|
7
|
+
const style = new CSSStyleSheet();
|
|
8
|
+
style.replaceSync(`
|
|
9
|
+
a {
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
}
|
|
12
|
+
h1,h2,h3,h4,h5,h6 {
|
|
13
|
+
margin: .5em 0;
|
|
14
|
+
}
|
|
15
|
+
`);
|
|
16
|
+
|
|
17
|
+
const defaultTemplate = `
|
|
18
|
+
<h3>Properties</h3>
|
|
19
|
+
{%- for prop in properties %}
|
|
20
|
+
<code>{{ prop[0] }} = {{ prop[1] }}</code>
|
|
21
|
+
<br>
|
|
22
|
+
{%- endfor %}
|
|
23
|
+
`;
|
|
24
|
+
const defaultContextBuilder = ({ properties }) => ({ properties });
|
|
25
|
+
|
|
26
|
+
export class MapPopup extends HTMLElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.template = defaultTemplate;
|
|
30
|
+
this.contextBuilder = defaultContextBuilder;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
35
|
+
|
|
36
|
+
shadow.adoptedStyleSheets.push(normalizeCSS);
|
|
37
|
+
shadow.adoptedStyleSheets.push(style);
|
|
38
|
+
|
|
39
|
+
const div = h("div");
|
|
40
|
+
div.style.maxHeight = "1000px";
|
|
41
|
+
div.style.overflowY = "auto";
|
|
42
|
+
let first = true;
|
|
43
|
+
for (const f of Object.values(this.features)) {
|
|
44
|
+
if (first) {
|
|
45
|
+
first = false;
|
|
46
|
+
} else {
|
|
47
|
+
div.appendChild(h("hr"));
|
|
48
|
+
}
|
|
49
|
+
const html = engine.parseAndRenderSync(
|
|
50
|
+
this.template,
|
|
51
|
+
this.contextBuilder(f),
|
|
52
|
+
);
|
|
53
|
+
div.appendChild(h("div", {}, html));
|
|
54
|
+
}
|
|
55
|
+
shadow.appendChild(div);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { h, t } from "../lib/dom.js";
|
|
2
|
+
|
|
3
|
+
const style = new CSSStyleSheet();
|
|
4
|
+
style.replaceSync(`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
nav {
|
|
9
|
+
background: white;
|
|
10
|
+
border-bottom: 1px solid #8f8f9d;
|
|
11
|
+
padding: 4px;
|
|
12
|
+
}
|
|
13
|
+
:host(.fs) nav {
|
|
14
|
+
background: none;
|
|
15
|
+
border: none;
|
|
16
|
+
padding: 0;
|
|
17
|
+
}
|
|
18
|
+
a {
|
|
19
|
+
color: black;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
}
|
|
22
|
+
b, img {
|
|
23
|
+
margin: 0 0 0 10px;
|
|
24
|
+
}
|
|
25
|
+
img {
|
|
26
|
+
vertical-align: middle;
|
|
27
|
+
height: 22px;
|
|
28
|
+
}
|
|
29
|
+
nav > * {
|
|
30
|
+
margin-right: 4px;
|
|
31
|
+
}
|
|
32
|
+
slot {
|
|
33
|
+
padding: 100px;
|
|
34
|
+
}
|
|
35
|
+
::slotted(fs-button) {
|
|
36
|
+
z-index: 1;
|
|
37
|
+
position: fixed;
|
|
38
|
+
top: 4px;
|
|
39
|
+
right: 4px;
|
|
40
|
+
}
|
|
41
|
+
:host(.fs) nav > a {
|
|
42
|
+
display: none;
|
|
43
|
+
}
|
|
44
|
+
@media (max-width: 900px) {
|
|
45
|
+
b {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`);
|
|
50
|
+
|
|
51
|
+
export class NavBar extends HTMLElement {
|
|
52
|
+
title;
|
|
53
|
+
icon;
|
|
54
|
+
|
|
55
|
+
constructor() {
|
|
56
|
+
super();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
connectedCallback() {
|
|
60
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
61
|
+
shadow.adoptedStyleSheets.push(style);
|
|
62
|
+
const nav = h(
|
|
63
|
+
"nav",
|
|
64
|
+
{},
|
|
65
|
+
h("slot", { name: "fs-button" }),
|
|
66
|
+
h("slot", { name: "buttons" }),
|
|
67
|
+
h(
|
|
68
|
+
"a",
|
|
69
|
+
{ href: "." },
|
|
70
|
+
h("b", {}, t(this.title)),
|
|
71
|
+
h("img", { src: this.icon }),
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
shadow.appendChild(nav);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { h } from "../lib/dom.js";
|
|
2
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
3
|
+
import { style as buttonCSS } from "./button.js";
|
|
4
|
+
|
|
5
|
+
const style = new CSSStyleSheet();
|
|
6
|
+
style.replaceSync(`
|
|
7
|
+
:host {
|
|
8
|
+
}
|
|
9
|
+
button {
|
|
10
|
+
background: #2ecc40;
|
|
11
|
+
width: 100px;
|
|
12
|
+
color: white;
|
|
13
|
+
}
|
|
14
|
+
button:after {
|
|
15
|
+
content: " Run";
|
|
16
|
+
}
|
|
17
|
+
button.loading {
|
|
18
|
+
background: #ff4136;
|
|
19
|
+
}
|
|
20
|
+
button.loading:after {
|
|
21
|
+
content: " Cancel";
|
|
22
|
+
}
|
|
23
|
+
`);
|
|
24
|
+
|
|
25
|
+
export class RunButton extends HTMLElement {
|
|
26
|
+
static observedAttributes = ["loading"];
|
|
27
|
+
|
|
28
|
+
get loading() {
|
|
29
|
+
return this.hasAttribute("loading");
|
|
30
|
+
}
|
|
31
|
+
set loading(value) {
|
|
32
|
+
if (value) {
|
|
33
|
+
return this.setAttribute("loading", "");
|
|
34
|
+
} else {
|
|
35
|
+
return this.removeAttribute("loading");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
45
|
+
|
|
46
|
+
shadow.adoptedStyleSheets.push(normalizeCSS);
|
|
47
|
+
shadow.adoptedStyleSheets.push(buttonCSS);
|
|
48
|
+
shadow.adoptedStyleSheets.push(style);
|
|
49
|
+
|
|
50
|
+
const button = h("button", {}, h("fa-icon", { icon: "play" }));
|
|
51
|
+
this.refs = { button };
|
|
52
|
+
|
|
53
|
+
button.addEventListener("auxclick", (e) => {
|
|
54
|
+
this.dispatchEvent(new Event("auxclick"));
|
|
55
|
+
});
|
|
56
|
+
button.addEventListener("click", (e) => {
|
|
57
|
+
if (this.loading) {
|
|
58
|
+
this.refs.button.children[0].icon = "play";
|
|
59
|
+
this.dispatchEvent(new Event("abort"));
|
|
60
|
+
} else {
|
|
61
|
+
this.refs.button.children[0].icon = "xmark";
|
|
62
|
+
this.dispatchEvent(new Event("run"));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
shadow.appendChild(button);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
70
|
+
if (newValue === "") {
|
|
71
|
+
this.refs.button.classList.add("loading");
|
|
72
|
+
this.refs.button.children[0].icon = "xmark";
|
|
73
|
+
} else {
|
|
74
|
+
this.refs.button.classList.remove("loading");
|
|
75
|
+
this.refs.button.children[0].icon = "play";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { h } from "../lib/dom.js";
|
|
2
|
+
import buttonStyle from "./button.css";
|
|
3
|
+
import { style as buttonCSS } from "./button.js";
|
|
4
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
5
|
+
|
|
6
|
+
export const css = new CSSStyleSheet();
|
|
7
|
+
css.replaceSync(`
|
|
8
|
+
button:after {
|
|
9
|
+
content: " Share";
|
|
10
|
+
}
|
|
11
|
+
@media (max-width: 900px) {
|
|
12
|
+
button:after {
|
|
13
|
+
content: "";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`);
|
|
17
|
+
|
|
18
|
+
export class ShareButton extends HTMLElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
connectedCallback() {
|
|
24
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
25
|
+
|
|
26
|
+
shadow.adoptedStyleSheets.push(normalizeCSS);
|
|
27
|
+
shadow.adoptedStyleSheets.push(buttonCSS);
|
|
28
|
+
shadow.adoptedStyleSheets.push(css);
|
|
29
|
+
|
|
30
|
+
const button = h("button", {}, h("fa-icon", { icon: "link" }));
|
|
31
|
+
this.refs = { button };
|
|
32
|
+
|
|
33
|
+
shadow.appendChild(button);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { h, t } from "../lib/dom.js";
|
|
2
|
+
import { style as buttonCSS } from "./button.js";
|
|
3
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
4
|
+
import { toQueryParams } from "../lib/queryParams.js";
|
|
5
|
+
|
|
6
|
+
export class ShareModal extends HTMLElement {
|
|
7
|
+
#center;
|
|
8
|
+
#zoom;
|
|
9
|
+
#query;
|
|
10
|
+
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
get center() {
|
|
16
|
+
return this.#center;
|
|
17
|
+
}
|
|
18
|
+
set center(value) {
|
|
19
|
+
this.#center = value;
|
|
20
|
+
this.update();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
get zoom() {
|
|
24
|
+
return this.#zoom;
|
|
25
|
+
}
|
|
26
|
+
set zoom(value) {
|
|
27
|
+
this.#zoom = value;
|
|
28
|
+
this.update();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get query() {
|
|
32
|
+
return this.#query;
|
|
33
|
+
}
|
|
34
|
+
set query(value) {
|
|
35
|
+
this.#query = value;
|
|
36
|
+
this.update();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
41
|
+
|
|
42
|
+
const queryInput = h("input", { type: "text" });
|
|
43
|
+
const mapInput = h("input", { type: "text" });
|
|
44
|
+
const mapViewCheckBox = h("input", { type: "checkbox", checked: true });
|
|
45
|
+
mapViewCheckBox.addEventListener("click", (e) => {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
this.update();
|
|
48
|
+
});
|
|
49
|
+
const mapViewLabel = h(
|
|
50
|
+
"label",
|
|
51
|
+
{},
|
|
52
|
+
mapViewCheckBox,
|
|
53
|
+
t(" include current map state"),
|
|
54
|
+
);
|
|
55
|
+
mapViewLabel.addEventListener("click", (e) => {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
});
|
|
58
|
+
const autoRunCheckBox = h("input", { type: "checkbox" });
|
|
59
|
+
autoRunCheckBox.addEventListener("click", (e) => {
|
|
60
|
+
e.stopPropagation();
|
|
61
|
+
this.update();
|
|
62
|
+
});
|
|
63
|
+
const autoRunLabel = h(
|
|
64
|
+
"label",
|
|
65
|
+
{},
|
|
66
|
+
autoRunCheckBox,
|
|
67
|
+
t(" run this query immediately after loading"),
|
|
68
|
+
);
|
|
69
|
+
autoRunLabel.addEventListener("click", (e) => {
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
});
|
|
72
|
+
const div = h(
|
|
73
|
+
"div",
|
|
74
|
+
{ style: "", slot: "modal-content" },
|
|
75
|
+
h(
|
|
76
|
+
"style",
|
|
77
|
+
{},
|
|
78
|
+
`
|
|
79
|
+
div {
|
|
80
|
+
padding: 0 8px 8px;
|
|
81
|
+
}
|
|
82
|
+
h3, h5 {
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
}
|
|
85
|
+
input[type=text] {
|
|
86
|
+
width: 100%;
|
|
87
|
+
padding: 0;
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
label {
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
`,
|
|
94
|
+
),
|
|
95
|
+
h("h3", {}, "Query"),
|
|
96
|
+
h("p", {}, "Copy this link to share the current code:"),
|
|
97
|
+
queryInput,
|
|
98
|
+
h("h5", {}, "Options"),
|
|
99
|
+
mapViewLabel,
|
|
100
|
+
autoRunLabel,
|
|
101
|
+
h("h3", {}, "Map"),
|
|
102
|
+
h("p", {}, "Copy this link to share the an interactive map:"),
|
|
103
|
+
mapInput,
|
|
104
|
+
);
|
|
105
|
+
const button = h(
|
|
106
|
+
"button-modal",
|
|
107
|
+
{ text: "Share", icon: "share-nodes" },
|
|
108
|
+
div,
|
|
109
|
+
);
|
|
110
|
+
this.refs = {
|
|
111
|
+
button,
|
|
112
|
+
div,
|
|
113
|
+
mapInput,
|
|
114
|
+
queryInput,
|
|
115
|
+
autoRunCheckBox,
|
|
116
|
+
mapViewCheckBox,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
queryInput.addEventListener("focus", () => queryInput.select());
|
|
120
|
+
mapInput.addEventListener("focus", () => mapInput.select());
|
|
121
|
+
|
|
122
|
+
shadow.appendChild(button);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
update() {
|
|
126
|
+
const opts = { query: this.query, mode: "ide" };
|
|
127
|
+
if (this.refs.mapViewCheckBox.checked) {
|
|
128
|
+
opts.center = this.center;
|
|
129
|
+
opts.zoom = this.zoom;
|
|
130
|
+
}
|
|
131
|
+
opts.autoRun = this.refs.autoRunCheckBox.checked;
|
|
132
|
+
this.refs.queryInput.value = toQueryParams(opts);
|
|
133
|
+
delete opts.autoRun;
|
|
134
|
+
opts.center = this.center;
|
|
135
|
+
opts.zoom = this.zoom;
|
|
136
|
+
opts.mode = "map";
|
|
137
|
+
this.refs.mapInput.value = toQueryParams(opts);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { h, t } from "../lib/dom.js";
|
|
2
|
+
import { style as buttonCSS } from "./button.js";
|
|
3
|
+
import { normalizeCSS } from "../lib/normalize.js";
|
|
4
|
+
|
|
5
|
+
const style = `margin: 10px 0; display: block; width: 100%; text-align: left;`;
|
|
6
|
+
|
|
7
|
+
export class StylePicker extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.styles = [];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
15
|
+
|
|
16
|
+
if (!this.styles || this.styles.length === 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const div = h("div", { slot: "modal-content" });
|
|
21
|
+
const button = h(
|
|
22
|
+
"button-modal",
|
|
23
|
+
{ text: "Pick Style", icon: "paintbrush" },
|
|
24
|
+
div,
|
|
25
|
+
);
|
|
26
|
+
this.refs = { button, div };
|
|
27
|
+
|
|
28
|
+
for (const [name, value, tiles] of this.styles) {
|
|
29
|
+
const styleButton = h(
|
|
30
|
+
"button",
|
|
31
|
+
{ style },
|
|
32
|
+
t(name),
|
|
33
|
+
// h("br"),
|
|
34
|
+
// h("small", {}, `Tiles: ${tiles}`),
|
|
35
|
+
);
|
|
36
|
+
styleButton.addEventListener("click", (e) => {
|
|
37
|
+
button.toggle();
|
|
38
|
+
this.dispatchEvent(
|
|
39
|
+
new CustomEvent("change", { detail: { value: value } }),
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
div.appendChild(styleButton);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
shadow.appendChild(button);
|
|
46
|
+
}
|
|
47
|
+
}
|