@honua/react 0.0.20-alpha.0
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/LICENSE +201 -0
- package/README.md +9 -0
- package/contract/analytics-sources.d.ts +149 -0
- package/contract/analytics-sources.d.ts.map +1 -0
- package/contract/analytics-sources.js +235 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +760 -0
- package/contract/edit-sketch.d.ts +91 -0
- package/contract/edit-sketch.d.ts.map +1 -0
- package/contract/edit-sketch.js +281 -0
- package/contract/index.d.ts +61 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +51 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/source.d.ts +423 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3802 -0
- package/contract/spatial-aggregation.d.ts +336 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +298 -0
- package/contract/temporal.d.ts +455 -0
- package/contract/temporal.d.ts.map +1 -0
- package/contract/temporal.js +146 -0
- package/contract/tiles.d.ts +370 -0
- package/contract/tiles.d.ts.map +1 -0
- package/contract/tiles.js +519 -0
- package/contract/types.d.ts +665 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +175 -0
- package/contract/widget-source.d.ts +205 -0
- package/contract/widget-source.d.ts.map +1 -0
- package/contract/widget-source.js +1473 -0
- package/control-plane/client.d.ts +95 -0
- package/control-plane/client.d.ts.map +1 -0
- package/control-plane/client.js +374 -0
- package/control-plane/index.d.ts +18 -0
- package/control-plane/index.d.ts.map +1 -0
- package/control-plane/index.js +14 -0
- package/control-plane/types.d.ts +233 -0
- package/control-plane/types.d.ts.map +1 -0
- package/control-plane/types.js +7 -0
- package/core/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +79 -0
- package/core/cache-state.d.ts +79 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +87 -0
- package/core/client.d.ts +577 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1664 -0
- package/core/compatibility.d.ts +18 -0
- package/core/compatibility.d.ts.map +1 -0
- package/core/compatibility.js +245 -0
- package/core/errors.d.ts +107 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +156 -0
- package/core/esri-geojson.d.ts +66 -0
- package/core/esri-geojson.d.ts.map +1 -0
- package/core/esri-geojson.js +363 -0
- package/core/geoservices.d.ts +34 -0
- package/core/geoservices.d.ts.map +1 -0
- package/core/geoservices.js +434 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +688 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +913 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +134 -0
- package/core/ogc-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +114 -0
- package/core/ogc-maps.d.ts +49 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +126 -0
- package/core/ogc-processes.d.ts +118 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +423 -0
- package/core/ogc-records.d.ts +75 -0
- package/core/ogc-records.d.ts.map +1 -0
- package/core/ogc-records.js +251 -0
- package/core/ogc-tiles.d.ts +125 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +183 -0
- package/core/path-utils.d.ts +69 -0
- package/core/path-utils.d.ts.map +1 -0
- package/core/path-utils.js +123 -0
- package/core/pbf-decoder.d.ts +39 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +702 -0
- package/core/process-runner.d.ts +104 -0
- package/core/process-runner.d.ts.map +1 -0
- package/core/process-runner.js +315 -0
- package/core/protocol-transport.d.ts +76 -0
- package/core/protocol-transport.d.ts.map +1 -0
- package/core/protocol-transport.js +15 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/request-pipeline.d.ts +88 -0
- package/core/request-pipeline.d.ts.map +1 -0
- package/core/request-pipeline.js +273 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac.d.ts +55 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +229 -0
- package/core/surfaces.d.ts +527 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1917 -0
- package/core/terrain-elevation.d.ts +114 -0
- package/core/terrain-elevation.d.ts.map +1 -0
- package/core/terrain-elevation.js +150 -0
- package/core/types.d.ts +1355 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +143 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +478 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +634 -0
- package/core/wfs.d.ts +219 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +406 -0
- package/core/wire-shared.d.ts +32 -0
- package/core/wire-shared.d.ts.map +1 -0
- package/core/wire-shared.js +76 -0
- package/core/wms-axis.d.ts +36 -0
- package/core/wms-axis.d.ts.map +1 -0
- package/core/wms-axis.js +73 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +559 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +144 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +338 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +402 -0
- package/core/wmts.d.ts +103 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +332 -0
- package/core/xml-text.d.ts +20 -0
- package/core/xml-text.d.ts.map +1 -0
- package/core/xml-text.js +85 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +127 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-filter.d.ts +55 -0
- package/esri-compat/feature-filter.d.ts.map +1 -0
- package/esri-compat/feature-filter.js +109 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +661 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/geojson-layer.d.ts +86 -0
- package/esri-compat/geojson-layer.d.ts.map +1 -0
- package/esri-compat/geojson-layer.js +191 -0
- package/esri-compat/geometry-engine.d.ts +107 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -0
- package/esri-compat/geometry-engine.js +266 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +31 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +115 -0
- package/esri-compat/imagery-layer.d.ts +78 -0
- package/esri-compat/imagery-layer.d.ts.map +1 -0
- package/esri-compat/imagery-layer.js +167 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +709 -0
- package/esri-compat/map-view.d.ts +323 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1175 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +35 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +115 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +58 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +128 -0
- package/esri-compat/reactive-utils.d.ts +24 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +193 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +168 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +13 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +68 -0
- package/esri-compat/vector-tile-layer.d.ts +47 -0
- package/esri-compat/vector-tile-layer.d.ts.map +1 -0
- package/esri-compat/vector-tile-layer.js +130 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/esri-compat/wfs-layer.d.ts +64 -0
- package/esri-compat/wfs-layer.d.ts.map +1 -0
- package/esri-compat/wfs-layer.js +145 -0
- package/esri-compat/wms-layer.d.ts +76 -0
- package/esri-compat/wms-layer.d.ts.map +1 -0
- package/esri-compat/wms-layer.js +157 -0
- package/exploration/context.d.ts +25 -0
- package/exploration/context.d.ts.map +1 -0
- package/exploration/context.js +396 -0
- package/exploration/index.d.ts +27 -0
- package/exploration/index.d.ts.map +1 -0
- package/exploration/index.js +24 -0
- package/exploration/presets.d.ts +27 -0
- package/exploration/presets.d.ts.map +1 -0
- package/exploration/presets.js +114 -0
- package/exploration/reducer.d.ts +23 -0
- package/exploration/reducer.d.ts.map +1 -0
- package/exploration/reducer.js +332 -0
- package/exploration/selection.d.ts +25 -0
- package/exploration/selection.d.ts.map +1 -0
- package/exploration/selection.js +34 -0
- package/exploration/selectors.d.ts +56 -0
- package/exploration/selectors.d.ts.map +1 -0
- package/exploration/selectors.js +110 -0
- package/exploration/types.d.ts +294 -0
- package/exploration/types.d.ts.map +1 -0
- package/exploration/types.js +33 -0
- package/expr/expression.d.ts +457 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +663 -0
- package/expr/index.d.ts +32 -0
- package/expr/index.d.ts.map +1 -0
- package/expr/index.js +30 -0
- package/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/generated-app/errors.d.ts +41 -0
- package/generated-app/errors.d.ts.map +1 -0
- package/generated-app/errors.js +41 -0
- package/generated-app/index.d.ts +17 -0
- package/generated-app/index.d.ts.map +1 -0
- package/generated-app/index.js +12 -0
- package/generated-app/manifest.d.ts +183 -0
- package/generated-app/manifest.d.ts.map +1 -0
- package/generated-app/manifest.js +14 -0
- package/generated-app/projection.d.ts +44 -0
- package/generated-app/projection.d.ts.map +1 -0
- package/generated-app/projection.js +234 -0
- package/generated-app/runtime.d.ts +215 -0
- package/generated-app/runtime.d.ts.map +1 -0
- package/generated-app/runtime.js +1196 -0
- package/interactions/detail-model.d.ts +54 -0
- package/interactions/detail-model.d.ts.map +1 -0
- package/interactions/detail-model.js +105 -0
- package/interactions/exploration-bindings.d.ts +120 -0
- package/interactions/exploration-bindings.d.ts.map +1 -0
- package/interactions/exploration-bindings.js +218 -0
- package/interactions/feature-state.d.ts +144 -0
- package/interactions/feature-state.d.ts.map +1 -0
- package/interactions/feature-state.js +169 -0
- package/interactions/hit-test.d.ts +112 -0
- package/interactions/hit-test.d.ts.map +1 -0
- package/interactions/hit-test.js +291 -0
- package/interactions/index.d.ts +31 -0
- package/interactions/index.d.ts.map +1 -0
- package/interactions/index.js +24 -0
- package/interactions/share-state.d.ts +36 -0
- package/interactions/share-state.d.ts.map +1 -0
- package/interactions/share-state.js +123 -0
- package/map/feature-service-adapter.d.ts +138 -0
- package/map/feature-service-adapter.d.ts.map +1 -0
- package/map/feature-service-adapter.js +279 -0
- package/map/honua-map.d.ts +203 -0
- package/map/honua-map.d.ts.map +1 -0
- package/map/honua-map.js +347 -0
- package/map/index.d.ts +27 -0
- package/map/index.d.ts.map +1 -0
- package/map/index.js +22 -0
- package/map/maplibre-target.d.ts +103 -0
- package/map/maplibre-target.d.ts.map +1 -0
- package/map/maplibre-target.js +164 -0
- package/map/webmap-maplibre.d.ts +60 -0
- package/map/webmap-maplibre.d.ts.map +1 -0
- package/map/webmap-maplibre.js +212 -0
- package/package.json +37 -0
- package/react/context.d.ts +32 -0
- package/react/context.d.ts.map +1 -0
- package/react/context.js +19 -0
- package/react/honua-layer.d.ts +35 -0
- package/react/honua-layer.d.ts.map +1 -0
- package/react/honua-layer.js +47 -0
- package/react/honua-map.d.ts +83 -0
- package/react/honua-map.d.ts.map +1 -0
- package/react/honua-map.js +109 -0
- package/react/honua-popup.d.ts +26 -0
- package/react/honua-popup.d.ts.map +1 -0
- package/react/honua-popup.js +34 -0
- package/react/hooks.d.ts +127 -0
- package/react/hooks.d.ts.map +1 -0
- package/react/hooks.js +206 -0
- package/react/index.d.ts +42 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +34 -0
- package/react/provider.d.ts +36 -0
- package/react/provider.d.ts.map +1 -0
- package/react/provider.js +35 -0
- package/react/query-cache.d.ts +76 -0
- package/react/query-cache.d.ts.map +1 -0
- package/react/query-cache.js +188 -0
- package/runtime/diff.d.ts +31 -0
- package/runtime/diff.d.ts.map +1 -0
- package/runtime/diff.js +143 -0
- package/runtime/errors.d.ts +40 -0
- package/runtime/errors.d.ts.map +1 -0
- package/runtime/errors.js +35 -0
- package/runtime/index.d.ts +59 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +43 -0
- package/runtime/legend.d.ts +23 -0
- package/runtime/legend.d.ts.map +1 -0
- package/runtime/legend.js +38 -0
- package/runtime/load-package.d.ts +125 -0
- package/runtime/load-package.d.ts.map +1 -0
- package/runtime/load-package.js +264 -0
- package/runtime/map-package-fetch.d.ts +107 -0
- package/runtime/map-package-fetch.d.ts.map +1 -0
- package/runtime/map-package-fetch.js +336 -0
- package/runtime/map-package-realtime.d.ts +169 -0
- package/runtime/map-package-realtime.d.ts.map +1 -0
- package/runtime/map-package-realtime.js +350 -0
- package/runtime/map-package-validation.d.ts +43 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +269 -0
- package/runtime/map-package-watch.d.ts +78 -0
- package/runtime/map-package-watch.d.ts.map +1 -0
- package/runtime/map-package-watch.js +695 -0
- package/runtime/map-package.d.ts +167 -0
- package/runtime/map-package.d.ts.map +1 -0
- package/runtime/map-package.js +15 -0
- package/runtime/ogc-styles.d.ts +110 -0
- package/runtime/ogc-styles.d.ts.map +1 -0
- package/runtime/ogc-styles.js +195 -0
- package/runtime/popups.d.ts +62 -0
- package/runtime/popups.d.ts.map +1 -0
- package/runtime/popups.js +95 -0
- package/runtime/query-tiles.d.ts +217 -0
- package/runtime/query-tiles.d.ts.map +1 -0
- package/runtime/query-tiles.js +801 -0
- package/runtime/runtime.d.ts +243 -0
- package/runtime/runtime.d.ts.map +1 -0
- package/runtime/runtime.js +1147 -0
- package/runtime/source-bridge.d.ts +99 -0
- package/runtime/source-bridge.d.ts.map +1 -0
- package/runtime/source-bridge.js +401 -0
- package/runtime/style-compose.d.ts +46 -0
- package/runtime/style-compose.d.ts.map +1 -0
- package/runtime/style-compose.js +144 -0
- package/runtime/style-interactions.d.ts +141 -0
- package/runtime/style-interactions.d.ts.map +1 -0
- package/runtime/style-interactions.js +574 -0
- package/runtime/style-spec-validation.d.ts +23 -0
- package/runtime/style-spec-validation.d.ts.map +1 -0
- package/runtime/style-spec-validation.js +357 -0
- package/studio/capability-manifest.d.ts +285 -0
- package/studio/capability-manifest.d.ts.map +1 -0
- package/studio/capability-manifest.js +59 -0
- package/studio/chart-spec.d.ts +85 -0
- package/studio/chart-spec.d.ts.map +1 -0
- package/studio/chart-spec.js +106 -0
- package/studio/index.d.ts +34 -0
- package/studio/index.d.ts.map +1 -0
- package/studio/index.js +27 -0
- package/studio/provenance.d.ts +131 -0
- package/studio/provenance.d.ts.map +1 -0
- package/studio/provenance.js +39 -0
- package/studio/publish.d.ts +64 -0
- package/studio/publish.d.ts.map +1 -0
- package/studio/publish.js +13 -0
- package/studio/types.d.ts +278 -0
- package/studio/types.d.ts.map +1 -0
- package/studio/types.js +71 -0
- package/studio/validate.d.ts +45 -0
- package/studio/validate.d.ts.map +1 -0
- package/studio/validate.js +255 -0
- package/studio/validation.d.ts +112 -0
- package/studio/validation.d.ts.map +1 -0
- package/studio/validation.js +42 -0
- package/style/factory.d.ts +30 -0
- package/style/factory.d.ts.map +1 -0
- package/style/factory.js +61 -0
- package/style/index.d.ts +25 -0
- package/style/index.d.ts.map +1 -0
- package/style/index.js +24 -0
- package/style/specification.d.ts +203 -0
- package/style/specification.d.ts.map +1 -0
- package/style/specification.js +178 -0
- package/style/wms-wmts-resolvers.d.ts +38 -0
- package/style/wms-wmts-resolvers.d.ts.map +1 -0
- package/style/wms-wmts-resolvers.js +92 -0
- package/webmap/contract.d.ts +28 -0
- package/webmap/contract.d.ts.map +1 -0
- package/webmap/contract.js +130 -0
- package/webmap/convert-basemap.d.ts +17 -0
- package/webmap/convert-basemap.d.ts.map +1 -0
- package/webmap/convert-basemap.js +78 -0
- package/webmap/convert-extent.d.ts +17 -0
- package/webmap/convert-extent.d.ts.map +1 -0
- package/webmap/convert-extent.js +114 -0
- package/webmap/convert-label.d.ts +13 -0
- package/webmap/convert-label.d.ts.map +1 -0
- package/webmap/convert-label.js +125 -0
- package/webmap/convert-layer.d.ts +22 -0
- package/webmap/convert-layer.d.ts.map +1 -0
- package/webmap/convert-layer.js +181 -0
- package/webmap/convert-popup.d.ts +34 -0
- package/webmap/convert-popup.d.ts.map +1 -0
- package/webmap/convert-popup.js +68 -0
- package/webmap/convert-renderer.d.ts +17 -0
- package/webmap/convert-renderer.d.ts.map +1 -0
- package/webmap/convert-renderer.js +161 -0
- package/webmap/convert-symbol.d.ts +17 -0
- package/webmap/convert-symbol.d.ts.map +1 -0
- package/webmap/convert-symbol.js +122 -0
- package/webmap/index.d.ts +44 -0
- package/webmap/index.d.ts.map +1 -0
- package/webmap/index.js +33 -0
- package/webmap/parse.d.ts +25 -0
- package/webmap/parse.d.ts.map +1 -0
- package/webmap/parse.js +83 -0
- package/webmap/types.d.ts +264 -0
- package/webmap/types.d.ts.map +1 -0
- package/webmap/types.js +13 -0
- package/webmap/warnings.d.ts +30 -0
- package/webmap/warnings.d.ts.map +1 -0
- package/webmap/warnings.js +37 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link HonuaLayer} — declaratively add a runtime source + layer to the
|
|
3
|
+
* {@link HonuaMap} it is nested under. Mounting adds the layer (and its source,
|
|
4
|
+
* if provided); unmounting removes them. StrictMode-safe: the add/remove pair
|
|
5
|
+
* is balanced across the double-invoked mount.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from "react";
|
|
10
|
+
import type { RuntimeLayerOrder, RuntimeLayerSpecification, RuntimeSourceSpecification } from "../runtime/index.js";
|
|
11
|
+
/** A source to register alongside a {@link HonuaLayer}. */
|
|
12
|
+
export interface HonuaLayerSource {
|
|
13
|
+
id: string;
|
|
14
|
+
spec: RuntimeSourceSpecification;
|
|
15
|
+
}
|
|
16
|
+
/** Props for {@link HonuaLayer}. */
|
|
17
|
+
export interface HonuaLayerProps {
|
|
18
|
+
/** The MapLibre-shaped runtime layer specification. Its `id` must be stable. */
|
|
19
|
+
layer: RuntimeLayerSpecification;
|
|
20
|
+
/**
|
|
21
|
+
* Optional source to add before the layer. Removed on unmount only if this
|
|
22
|
+
* component added it (i.e. it was not already present on the runtime).
|
|
23
|
+
*/
|
|
24
|
+
source?: HonuaLayerSource;
|
|
25
|
+
/** Insertion order (e.g. `{ beforeId }`). */
|
|
26
|
+
order?: RuntimeLayerOrder;
|
|
27
|
+
/** Called if adding/removing the layer or source throws. */
|
|
28
|
+
onError?: (error: unknown) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Add a layer (and optionally its source) to the enclosing `HonuaMap` runtime.
|
|
32
|
+
* Must be rendered inside a {@link HonuaMap}; renders nothing itself.
|
|
33
|
+
*/
|
|
34
|
+
export declare function HonuaLayer({ layer, source, order, onError }: HonuaLayerProps): ReactNode;
|
|
35
|
+
//# sourceMappingURL=honua-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honua-layer.d.ts","sourceRoot":"","sources":["../../../src/react/honua-layer.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAGpH,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,0BAA0B,CAAC;CAClC;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,KAAK,EAAE,yBAAyB,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4DAA4D;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,eAAe,GAAG,SAAS,CAgCxF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link HonuaLayer} — declaratively add a runtime source + layer to the
|
|
3
|
+
* {@link HonuaMap} it is nested under. Mounting adds the layer (and its source,
|
|
4
|
+
* if provided); unmounting removes them. StrictMode-safe: the add/remove pair
|
|
5
|
+
* is balanced across the double-invoked mount.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { useEffect } from "react";
|
|
10
|
+
import { useMapRuntime } from "./hooks.js";
|
|
11
|
+
/**
|
|
12
|
+
* Add a layer (and optionally its source) to the enclosing `HonuaMap` runtime.
|
|
13
|
+
* Must be rendered inside a {@link HonuaMap}; renders nothing itself.
|
|
14
|
+
*/
|
|
15
|
+
export function HonuaLayer({ layer, source, order, onError }) {
|
|
16
|
+
const runtime = useMapRuntime();
|
|
17
|
+
const layerId = layer.id;
|
|
18
|
+
const sourceId = source?.id;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!runtime)
|
|
21
|
+
return;
|
|
22
|
+
let addedSource = false;
|
|
23
|
+
try {
|
|
24
|
+
if (source && !runtime.map.getSource?.(source.id)) {
|
|
25
|
+
runtime.addSource(source.id, source.spec);
|
|
26
|
+
addedSource = true;
|
|
27
|
+
}
|
|
28
|
+
runtime.addLayer(layer, order);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
onError?.(error);
|
|
32
|
+
}
|
|
33
|
+
return () => {
|
|
34
|
+
try {
|
|
35
|
+
runtime.removeLayer(layerId);
|
|
36
|
+
if (addedSource && sourceId) {
|
|
37
|
+
runtime.removeSource(sourceId);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
onError?.(error);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: re-run on runtime + identity of layer/source/order; onError is a stable-intent callback.
|
|
45
|
+
}, [runtime, layer, source, order, layerId, sourceId]);
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link HonuaMap} — a React component that owns a {@link HonuaMapRuntime}
|
|
3
|
+
* lifecycle over a MapLibre GL map. It can create and own the map itself, or
|
|
4
|
+
* attach to an externally-owned map instance (the `@vis.gl/react-maplibre`
|
|
5
|
+
* interop pattern). Children ({@link HonuaLayer} / {@link HonuaPopup}) reach the
|
|
6
|
+
* runtime through context.
|
|
7
|
+
*
|
|
8
|
+
* SSR-safe: `maplibre-gl` is only imported (dynamically) inside a mount effect,
|
|
9
|
+
* never at module load. StrictMode-safe: the mount effect fully disposes the
|
|
10
|
+
* runtime and removes any owned map on cleanup, so a double-invoked mount never
|
|
11
|
+
* leaks a runtime or a WebGL context.
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
16
|
+
import type { HonuaMapPackage, HonuaMapRuntime, LoadMapPackageOptions, MaplibreMap } from "../runtime/index.js";
|
|
17
|
+
/** Options accepted by the `maplibre-gl` `Map` constructor that `HonuaMap` uses. */
|
|
18
|
+
export interface MapLibreMapOptions {
|
|
19
|
+
container: string | HTMLElement;
|
|
20
|
+
style: unknown;
|
|
21
|
+
center?: [number, number];
|
|
22
|
+
zoom?: number;
|
|
23
|
+
[key: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The shape of the `maplibre-gl` module `HonuaMap` needs when it owns the map.
|
|
27
|
+
* Pass your imported `maplibre-gl` namespace as {@link HonuaMapProps.mapLibre},
|
|
28
|
+
* or let `HonuaMap` dynamically `import("maplibre-gl")`.
|
|
29
|
+
*/
|
|
30
|
+
export interface MapLibreGlModule {
|
|
31
|
+
Map: new (options: MapLibreMapOptions) => MaplibreMap & {
|
|
32
|
+
remove(): void;
|
|
33
|
+
};
|
|
34
|
+
Popup: new (options?: Record<string, unknown>) => unknown;
|
|
35
|
+
}
|
|
36
|
+
/** Props for {@link HonuaMap}. */
|
|
37
|
+
export interface HonuaMapProps {
|
|
38
|
+
/** The `MapPackage` to compose onto the map. */
|
|
39
|
+
package: HonuaMapPackage;
|
|
40
|
+
/**
|
|
41
|
+
* Attach to an existing, externally-owned map instead of creating one. When
|
|
42
|
+
* set, `HonuaMap` never removes the map on unmount (the owner is responsible)
|
|
43
|
+
* — it only disposes the runtime.
|
|
44
|
+
*/
|
|
45
|
+
map?: MaplibreMap;
|
|
46
|
+
/**
|
|
47
|
+
* The `maplibre-gl` module. Provide it to avoid a dynamic import (and to pin
|
|
48
|
+
* the exact version). Ignored when {@link map} is supplied.
|
|
49
|
+
*/
|
|
50
|
+
mapLibre?: MapLibreGlModule;
|
|
51
|
+
/**
|
|
52
|
+
* Extra options merged into the `maplibre-gl` `Map` constructor when
|
|
53
|
+
* `HonuaMap` owns the map (`container` and `style` are managed for you).
|
|
54
|
+
*/
|
|
55
|
+
mapOptions?: Partial<Omit<MapLibreMapOptions, "container">>;
|
|
56
|
+
/**
|
|
57
|
+
* Extra options forwarded to `loadMapPackage`. `client` is taken from the
|
|
58
|
+
* provider; a `popupFactory` is defaulted from the maplibre module when one
|
|
59
|
+
* is available so {@link HonuaPopup} works out of the box.
|
|
60
|
+
*/
|
|
61
|
+
loadOptions?: Omit<LoadMapPackageOptions, "client">;
|
|
62
|
+
/** Called once the runtime is ready. */
|
|
63
|
+
onRuntime?: (runtime: HonuaMapRuntime) => void;
|
|
64
|
+
/** Called if map creation or package loading fails. */
|
|
65
|
+
onError?: (error: unknown) => void;
|
|
66
|
+
className?: string;
|
|
67
|
+
style?: CSSProperties;
|
|
68
|
+
children?: ReactNode;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Render a Honua-composed MapLibre map.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <HonuaMap package={mapPackage} style={{ height: 480 }}>
|
|
76
|
+
* <HonuaLayer layer={{ id: "sites", type: "circle", source: "sites", paint: { "circle-radius": 6 } }}
|
|
77
|
+
* source={{ id: "sites", spec: { type: "geojson", data: sitesGeoJson } }} />
|
|
78
|
+
* <HonuaPopup layer="sites" binding={{ sourceId: "sites", title: "Site" }} />
|
|
79
|
+
* </HonuaMap>
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function HonuaMap(props: HonuaMapProps): ReactNode;
|
|
83
|
+
//# sourceMappingURL=honua-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honua-map.d.ts","sourceRoot":"","sources":["../../../src/react/honua-map.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAA+B,MAAM,OAAO,CAAC;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAMhH,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,KAAK,OAAO,EAAE,kBAAkB,KAAK,WAAW,GAAG;QAAE,MAAM,IAAI,IAAI,CAAA;KAAE,CAAC;IAC3E,KAAK,EAAE,KAAK,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;CAC3D;AAID,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5D;;;;OAIG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IACpD,wCAAwC;IACxC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CAiGxD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* {@link HonuaMap} — a React component that owns a {@link HonuaMapRuntime}
|
|
4
|
+
* lifecycle over a MapLibre GL map. It can create and own the map itself, or
|
|
5
|
+
* attach to an externally-owned map instance (the `@vis.gl/react-maplibre`
|
|
6
|
+
* interop pattern). Children ({@link HonuaLayer} / {@link HonuaPopup}) reach the
|
|
7
|
+
* runtime through context.
|
|
8
|
+
*
|
|
9
|
+
* SSR-safe: `maplibre-gl` is only imported (dynamically) inside a mount effect,
|
|
10
|
+
* never at module load. StrictMode-safe: the mount effect fully disposes the
|
|
11
|
+
* runtime and removes any owned map on cleanup, so a double-invoked mount never
|
|
12
|
+
* leaks a runtime or a WebGL context.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import { useEffect, useRef, useState } from "react";
|
|
17
|
+
import { loadMapPackage } from "../runtime/index.js";
|
|
18
|
+
import { useHonuaClient } from "./hooks.js";
|
|
19
|
+
import { HonuaMapContext } from "./context.js";
|
|
20
|
+
const EMPTY_STYLE = { version: 8, sources: {}, layers: [] };
|
|
21
|
+
/**
|
|
22
|
+
* Render a Honua-composed MapLibre map.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <HonuaMap package={mapPackage} style={{ height: 480 }}>
|
|
27
|
+
* <HonuaLayer layer={{ id: "sites", type: "circle", source: "sites", paint: { "circle-radius": 6 } }}
|
|
28
|
+
* source={{ id: "sites", spec: { type: "geojson", data: sitesGeoJson } }} />
|
|
29
|
+
* <HonuaPopup layer="sites" binding={{ sourceId: "sites", title: "Site" }} />
|
|
30
|
+
* </HonuaMap>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function HonuaMap(props) {
|
|
34
|
+
const { package: mapPackage, map: externalMap, mapLibre, mapOptions, loadOptions, onRuntime, onError, className, style, children, } = props;
|
|
35
|
+
const client = useHonuaClient();
|
|
36
|
+
const containerRef = useRef(null);
|
|
37
|
+
const [contextValue, setContextValue] = useState({ runtime: null, map: null });
|
|
38
|
+
// The package reference last handed to load/updatePackage — lets us route
|
|
39
|
+
// subsequent package changes through `updatePackage` instead of reloading.
|
|
40
|
+
const appliedPackageRef = useRef(null);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
let cancelled = false;
|
|
43
|
+
let runtime = null;
|
|
44
|
+
let ownedMap = null;
|
|
45
|
+
const start = async () => {
|
|
46
|
+
let map = externalMap ?? null;
|
|
47
|
+
let gl = mapLibre;
|
|
48
|
+
if (!map) {
|
|
49
|
+
const container = containerRef.current;
|
|
50
|
+
if (!container)
|
|
51
|
+
return;
|
|
52
|
+
gl = mapLibre ?? (await import("maplibre-gl")).default;
|
|
53
|
+
if (cancelled)
|
|
54
|
+
return;
|
|
55
|
+
ownedMap = new gl.Map({
|
|
56
|
+
container,
|
|
57
|
+
style: EMPTY_STYLE,
|
|
58
|
+
...mapOptions,
|
|
59
|
+
});
|
|
60
|
+
map = ownedMap;
|
|
61
|
+
}
|
|
62
|
+
// Default a popup factory from the maplibre module (when we have it) so
|
|
63
|
+
// HonuaPopup works without extra wiring.
|
|
64
|
+
const glModule = gl;
|
|
65
|
+
const popupFactory = loadOptions?.popupFactory ?? (glModule ? (() => new glModule.Popup()) : undefined);
|
|
66
|
+
const loaded = await loadMapPackage(mapPackage, map, {
|
|
67
|
+
...loadOptions,
|
|
68
|
+
client,
|
|
69
|
+
popupFactory,
|
|
70
|
+
});
|
|
71
|
+
if (cancelled) {
|
|
72
|
+
loaded.dispose();
|
|
73
|
+
ownedMap?.remove();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
runtime = loaded;
|
|
77
|
+
appliedPackageRef.current = mapPackage;
|
|
78
|
+
setContextValue({ runtime: loaded, map });
|
|
79
|
+
onRuntime?.(loaded);
|
|
80
|
+
};
|
|
81
|
+
start().catch((error) => {
|
|
82
|
+
if (cancelled)
|
|
83
|
+
return;
|
|
84
|
+
onError?.(error);
|
|
85
|
+
});
|
|
86
|
+
return () => {
|
|
87
|
+
cancelled = true;
|
|
88
|
+
runtime?.dispose();
|
|
89
|
+
ownedMap?.remove();
|
|
90
|
+
appliedPackageRef.current = null;
|
|
91
|
+
setContextValue({ runtime: null, map: null });
|
|
92
|
+
};
|
|
93
|
+
// Recreate only when the client, external map, or maplibre module changes.
|
|
94
|
+
// Package-content changes are handled by the effect below via updatePackage.
|
|
95
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: intentionally excludes mapPackage/options to avoid map re-creation.
|
|
96
|
+
}, [client, externalMap, mapLibre]);
|
|
97
|
+
// Route package changes to updatePackage without tearing down the map.
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const runtime = contextValue.runtime;
|
|
100
|
+
if (!runtime)
|
|
101
|
+
return;
|
|
102
|
+
if (appliedPackageRef.current === mapPackage)
|
|
103
|
+
return;
|
|
104
|
+
appliedPackageRef.current = mapPackage;
|
|
105
|
+
runtime.updatePackage(mapPackage).catch((error) => onError?.(error));
|
|
106
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: onError is a callback prop; re-running on its identity is undesirable.
|
|
107
|
+
}, [contextValue.runtime, mapPackage]);
|
|
108
|
+
return (_jsxs(HonuaMapContext.Provider, { value: contextValue, children: [externalMap ? null : _jsx("div", { ref: containerRef, className: className, style: style, "data-honua-map": "" }), children] }));
|
|
109
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link HonuaPopup} — declaratively bind a runtime popup to a layer inside a
|
|
3
|
+
* {@link HonuaMap}. The binding is removed on unmount (StrictMode-safe).
|
|
4
|
+
*
|
|
5
|
+
* Requires the enclosing `HonuaMap` to have a `popupFactory` — `HonuaMap`
|
|
6
|
+
* defaults one from its maplibre module, so this works out of the box.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from "react";
|
|
11
|
+
import type { HonuaMapPackagePopupBinding } from "../runtime/index.js";
|
|
12
|
+
/** Props for {@link HonuaPopup}. */
|
|
13
|
+
export interface HonuaPopupProps {
|
|
14
|
+
/** The layer id whose feature clicks open the popup. */
|
|
15
|
+
layer: string;
|
|
16
|
+
/** Optional popup binding (source id, title, template, field). */
|
|
17
|
+
binding?: HonuaMapPackagePopupBinding;
|
|
18
|
+
/** Called if binding the popup throws (e.g. no `popupFactory` configured). */
|
|
19
|
+
onError?: (error: unknown) => void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Bind a click-to-open popup to a layer in the enclosing `HonuaMap`. Must be
|
|
23
|
+
* rendered inside a {@link HonuaMap}; renders nothing itself.
|
|
24
|
+
*/
|
|
25
|
+
export declare function HonuaPopup({ layer, binding, onError }: HonuaPopupProps): ReactNode;
|
|
26
|
+
//# sourceMappingURL=honua-popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"honua-popup.d.ts","sourceRoot":"","sources":["../../../src/react/honua-popup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGvE,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,OAAO,CAAC,EAAE,2BAA2B,CAAC;IACtC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,eAAe,GAAG,SAAS,CAkBlF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {@link HonuaPopup} — declaratively bind a runtime popup to a layer inside a
|
|
3
|
+
* {@link HonuaMap}. The binding is removed on unmount (StrictMode-safe).
|
|
4
|
+
*
|
|
5
|
+
* Requires the enclosing `HonuaMap` to have a `popupFactory` — `HonuaMap`
|
|
6
|
+
* defaults one from its maplibre module, so this works out of the box.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { useEffect } from "react";
|
|
11
|
+
import { useMapRuntime } from "./hooks.js";
|
|
12
|
+
/**
|
|
13
|
+
* Bind a click-to-open popup to a layer in the enclosing `HonuaMap`. Must be
|
|
14
|
+
* rendered inside a {@link HonuaMap}; renders nothing itself.
|
|
15
|
+
*/
|
|
16
|
+
export function HonuaPopup({ layer, binding, onError }) {
|
|
17
|
+
const runtime = useMapRuntime();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!runtime)
|
|
20
|
+
return;
|
|
21
|
+
let handle;
|
|
22
|
+
try {
|
|
23
|
+
handle = runtime.bindPopup(layer, binding);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
onError?.(error);
|
|
27
|
+
}
|
|
28
|
+
return () => {
|
|
29
|
+
handle?.remove();
|
|
30
|
+
};
|
|
31
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: re-bind on runtime + layer + binding identity; onError is a stable-intent callback.
|
|
32
|
+
}, [runtime, layer, binding]);
|
|
33
|
+
return null;
|
|
34
|
+
}
|
package/react/hooks.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@honua/react` hooks: {@link useHonuaClient}, {@link useDataset},
|
|
3
|
+
* {@link useQuery}, {@link useCapabilities}, {@link useMapRuntime}, and
|
|
4
|
+
* {@link useRealtime}.
|
|
5
|
+
*
|
|
6
|
+
* All data hooks are AbortController-wired and StrictMode-safe, and expose
|
|
7
|
+
* `loading` / `error` / `data` state. Query results are referentially stable
|
|
8
|
+
* until the underlying data changes (NFR-001) because reads go through
|
|
9
|
+
* `useSyncExternalStore` over the provider's {@link HonuaQueryCache}.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import type { CapabilityPolicy, Dataset, DatasetId, Query, Result, Source, SourceDescriptor, SourceResolver } from "../contract/index.js";
|
|
14
|
+
import type { HonuaClient } from "../core/client.js";
|
|
15
|
+
import type { HonuaCompatibilityRequest, HonuaServerCompatibility } from "../core/types.js";
|
|
16
|
+
import type { HonuaMapRuntime } from "../runtime/index.js";
|
|
17
|
+
import { type HonuaQueryCache, type QuerySnapshot } from "./query-cache.js";
|
|
18
|
+
/**
|
|
19
|
+
* Access the {@link HonuaClient} published by the nearest {@link HonuaProvider}.
|
|
20
|
+
*
|
|
21
|
+
* @throws if called outside a `HonuaProvider`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useHonuaClient(): HonuaClient;
|
|
24
|
+
/**
|
|
25
|
+
* Access the provider's {@link HonuaQueryCache}. Rarely needed directly;
|
|
26
|
+
* exposed for advanced invalidation (`cache.invalidate(key)` / `cache.clear()`).
|
|
27
|
+
*/
|
|
28
|
+
export declare function useHonuaQueryCache(): HonuaQueryCache;
|
|
29
|
+
/** Options accepted by {@link useDataset}. `client` is taken from context. */
|
|
30
|
+
export interface UseDatasetOptions {
|
|
31
|
+
id: DatasetId;
|
|
32
|
+
sources: ReadonlyArray<SourceDescriptor>;
|
|
33
|
+
capabilityPolicy?: CapabilityPolicy;
|
|
34
|
+
skipCompatibilityCheck?: boolean;
|
|
35
|
+
resolveSource?: SourceResolver;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build a memoized {@link Dataset} bound to the provider's client. The dataset
|
|
39
|
+
* identity is stable until its `id`, source descriptors, or policy change, so
|
|
40
|
+
* it is safe to pass its sources into {@link useQuery} across re-renders.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const dataset = useDataset({
|
|
45
|
+
* id: "incidents",
|
|
46
|
+
* sources: [{ id: "incidents", protocol: "geoservices-feature-service",
|
|
47
|
+
* locator: { url, serviceId: "incidents", layerId: 0 },
|
|
48
|
+
* capabilities: PROTOCOL_DEFAULT_CAPABILITIES["geoservices-feature-service"] }],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function useDataset(options: UseDatasetOptions): Dataset;
|
|
53
|
+
/** Options for {@link useQuery}. */
|
|
54
|
+
export interface UseQueryOptions {
|
|
55
|
+
/** When `false`, the query is not executed and stays in `idle`. Default `true`. */
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
/** Use `source.queryAll()` (drain every page) instead of a single page. */
|
|
58
|
+
drainAllPages?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/** Result of {@link useQuery}: a stable snapshot plus a `refetch` trigger. */
|
|
61
|
+
export interface UseQueryResult<T> extends QuerySnapshot<Result<T>> {
|
|
62
|
+
/** Force a fresh fetch, superseding any in-flight request. */
|
|
63
|
+
refetch: () => void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Execute a contract {@link Query} against a {@link Source} with loading /
|
|
67
|
+
* error / data state. Results are cached per `(source, query-hash)` inside the
|
|
68
|
+
* provider and are referentially stable until the data changes. The request is
|
|
69
|
+
* aborted when the component unmounts or the query key changes; superseded
|
|
70
|
+
* responses are ignored (no races).
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* const { data, isLoading, error, refetch } = useQuery(
|
|
75
|
+
* dataset.source("incidents"),
|
|
76
|
+
* { where: "STATUS = 'OPEN'", returnGeometry: true },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function useQuery<T = Record<string, unknown>>(source: Source<T> | undefined | null, query?: Query<T>, options?: UseQueryOptions): UseQueryResult<T>;
|
|
81
|
+
/** Options for {@link useCapabilities}. */
|
|
82
|
+
export interface UseCapabilitiesOptions {
|
|
83
|
+
/** When `false`, capabilities are not fetched. Default `true`. */
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
/** Forwarded to `client.getCompatibility` (e.g. `{ refresh: true }`). */
|
|
86
|
+
request?: Omit<HonuaCompatibilityRequest, "signal">;
|
|
87
|
+
}
|
|
88
|
+
/** Result of {@link useCapabilities}. */
|
|
89
|
+
export interface UseCapabilitiesResult extends QuerySnapshot<HonuaServerCompatibility> {
|
|
90
|
+
refetch: () => void;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Fetch the Honua server's capability / compatibility descriptor
|
|
94
|
+
* (`serverVersion`, `releaseChannel`, feature flags) with loading / error /
|
|
95
|
+
* data state. Cached per-request inside the provider.
|
|
96
|
+
*/
|
|
97
|
+
export declare function useCapabilities(options?: UseCapabilitiesOptions): UseCapabilitiesResult;
|
|
98
|
+
/**
|
|
99
|
+
* Access the {@link HonuaMapRuntime} owned by the nearest {@link HonuaMap}.
|
|
100
|
+
* Returns `null` until the map has finished loading its package, and when
|
|
101
|
+
* called outside a `HonuaMap`.
|
|
102
|
+
*/
|
|
103
|
+
export declare function useMapRuntime(): HonuaMapRuntime | null;
|
|
104
|
+
/** A realtime subscription cleanup handle, in any of the SDK's shapes. */
|
|
105
|
+
export type RealtimeCleanup = (() => void) | {
|
|
106
|
+
close(): void;
|
|
107
|
+
} | {
|
|
108
|
+
remove(): void;
|
|
109
|
+
} | {
|
|
110
|
+
unsubscribe(): void;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Open a realtime subscription for the lifetime of the component and tear it
|
|
114
|
+
* down on unmount (StrictMode-safe: the effect's cleanup runs between the
|
|
115
|
+
* double-invoked mounts, so no duplicate subscriptions leak).
|
|
116
|
+
*
|
|
117
|
+
* `factory` should open the subscription and return its cleanup handle. It is
|
|
118
|
+
* re-run whenever `deps` change. Works with the SDK realtime store
|
|
119
|
+
* (`store.connect(...)` returns `{ close() }`) or any `() => void` unsubscribe.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```tsx
|
|
123
|
+
* useRealtime(() => store.connect(transport, request), [transport, request]);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function useRealtime(factory: (() => RealtimeCleanup | undefined) | null | undefined, deps?: readonly unknown[]): void;
|
|
127
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/react/hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,EACN,MAAM,EACN,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAiC,MAAM,kBAAkB,CAAC;AAU3G;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,SAAS,CAAC;IACd,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACzC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,cAAc,CAAC;CAChC;AAcD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAqB9D;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,8EAA8E;AAC9E,MAAM,WAAW,cAAc,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,8DAA8D;IAC9D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClD,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACpC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAChB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAAC,CAAC,CAAC,CA2CnB;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,OAAO,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;CACrD;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAsB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IACpF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,qBAAqB,CAmC3F;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,eAAe,GAAG,IAAI,CAEtD;AAED,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG;IAAE,KAAK,IAAI,IAAI,CAAA;CAAE,GAAG;IAAE,MAAM,IAAI,IAAI,CAAA;CAAE,GAAG;IAAE,WAAW,IAAI,IAAI,CAAA;CAAE,CAAC;AAE9G;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/D,IAAI,GAAE,SAAS,OAAO,EAAO,GAC5B,IAAI,CASN"}
|