@honua/app-platform 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 +11 -0
- package/app/index.d.ts +164 -0
- package/app/index.d.ts.map +1 -0
- package/app/index.js +424 -0
- package/app-controller/controller.d.ts +425 -0
- package/app-controller/controller.d.ts.map +1 -0
- package/app-controller/controller.js +1173 -0
- package/app-controller/index.d.ts +14 -0
- package/app-controller/index.d.ts.map +1 -0
- package/app-controller/index.js +12 -0
- package/app-workspace/index.d.ts +421 -0
- package/app-workspace/index.d.ts.map +1 -0
- package/app-workspace/index.js +722 -0
- package/collaboration/client.d.ts +40 -0
- package/collaboration/client.d.ts.map +1 -0
- package/collaboration/client.js +299 -0
- package/collaboration/errors.d.ts +15 -0
- package/collaboration/errors.d.ts.map +1 -0
- package/collaboration/errors.js +17 -0
- package/collaboration/fixture.d.ts +41 -0
- package/collaboration/fixture.d.ts.map +1 -0
- package/collaboration/fixture.js +362 -0
- package/collaboration/index.d.ts +18 -0
- package/collaboration/index.d.ts.map +1 -0
- package/collaboration/index.js +14 -0
- package/collaboration/types.d.ts +240 -0
- package/collaboration/types.d.ts.map +1 -0
- package/collaboration/types.js +1 -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 +63 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +52 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/pmtiles.d.ts +162 -0
- package/contract/pmtiles.d.ts.map +1 -0
- package/contract/pmtiles.js +155 -0
- package/contract/source.d.ts +447 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3909 -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 +694 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +183 -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/controls/basemap-style-binding.d.ts +54 -0
- package/controls/basemap-style-binding.d.ts.map +1 -0
- package/controls/basemap-style-binding.js +199 -0
- package/controls/basemap-switcher.d.ts +95 -0
- package/controls/basemap-switcher.d.ts.map +1 -0
- package/controls/basemap-switcher.js +379 -0
- package/controls/element-utils.d.ts +48 -0
- package/controls/element-utils.d.ts.map +1 -0
- package/controls/element-utils.js +78 -0
- package/controls/index.d.ts +33 -0
- package/controls/index.d.ts.map +1 -0
- package/controls/index.js +30 -0
- package/controls/layer-list.d.ts +98 -0
- package/controls/layer-list.d.ts.map +1 -0
- package/controls/layer-list.js +375 -0
- package/controls/legend-derive.d.ts +53 -0
- package/controls/legend-derive.d.ts.map +1 -0
- package/controls/legend-derive.js +196 -0
- package/controls/legend.d.ts +104 -0
- package/controls/legend.d.ts.map +1 -0
- package/controls/legend.js +381 -0
- package/controls/swipe-control.d.ts +80 -0
- package/controls/swipe-control.d.ts.map +1 -0
- package/controls/swipe-control.js +368 -0
- package/controls/types.d.ts +227 -0
- package/controls/types.d.ts.map +1 -0
- package/controls/types.js +11 -0
- package/core/auth/client-credentials-provider.d.ts +51 -0
- package/core/auth/client-credentials-provider.d.ts.map +1 -0
- package/core/auth/client-credentials-provider.js +115 -0
- package/core/auth/credential-store.d.ts +52 -0
- package/core/auth/credential-store.d.ts.map +1 -0
- package/core/auth/credential-store.js +82 -0
- package/core/auth/index.d.ts +23 -0
- package/core/auth/index.d.ts.map +1 -0
- package/core/auth/index.js +20 -0
- package/core/auth/oauth2-provider.d.ts +114 -0
- package/core/auth/oauth2-provider.d.ts.map +1 -0
- package/core/auth/oauth2-provider.js +408 -0
- package/core/auth/pkce.d.ts +25 -0
- package/core/auth/pkce.d.ts.map +1 -0
- package/core/auth/pkce.js +46 -0
- package/core/auth/static-providers.d.ts +20 -0
- package/core/auth/static-providers.d.ts.map +1 -0
- package/core/auth/static-providers.js +26 -0
- package/core/auth/token-endpoint.d.ts +40 -0
- package/core/auth/token-endpoint.d.ts.map +1 -0
- package/core/auth/token-endpoint.js +133 -0
- package/core/auth/types.d.ts +144 -0
- package/core/auth/types.d.ts.map +1 -0
- package/core/auth/types.js +8 -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 +607 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1716 -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 +139 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +176 -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/geoparquet-sql.d.ts +162 -0
- package/core/geoparquet-sql.d.ts.map +1 -0
- package/core/geoparquet-sql.js +333 -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-endpoint-layout.d.ts +70 -0
- package/core/ogc-endpoint-layout.d.ts.map +1 -0
- package/core/ogc-endpoint-layout.js +173 -0
- package/core/ogc-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +129 -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-static.d.ts +51 -0
- package/core/stac-static.d.ts.map +1 -0
- package/core/stac-static.js +195 -0
- package/core/stac.d.ts +67 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +259 -0
- package/core/surfaces.d.ts +540 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1964 -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 +1404 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +153 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +490 -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 +232 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +426 -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 +74 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +245 -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 +50 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +142 -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/filter-registry/index.d.ts +145 -0
- package/filter-registry/index.d.ts.map +1 -0
- package/filter-registry/index.js +531 -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/geocoding/index.d.ts +106 -0
- package/geocoding/index.d.ts.map +1 -0
- package/geocoding/index.js +278 -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/operate/client.d.ts +94 -0
- package/operate/client.d.ts.map +1 -0
- package/operate/client.js +361 -0
- package/operate/index.d.ts +22 -0
- package/operate/index.d.ts.map +1 -0
- package/operate/index.js +19 -0
- package/operate/types.d.ts +397 -0
- package/operate/types.d.ts.map +1 -0
- package/operate/types.js +17 -0
- package/operator/client.d.ts +60 -0
- package/operator/client.d.ts.map +1 -0
- package/operator/client.js +20 -0
- package/operator/controllers/approval.d.ts +52 -0
- package/operator/controllers/approval.d.ts.map +1 -0
- package/operator/controllers/approval.js +123 -0
- package/operator/controllers/base.d.ts +27 -0
- package/operator/controllers/base.d.ts.map +1 -0
- package/operator/controllers/base.js +53 -0
- package/operator/controllers/builder-workspace.d.ts +55 -0
- package/operator/controllers/builder-workspace.d.ts.map +1 -0
- package/operator/controllers/builder-workspace.js +108 -0
- package/operator/controllers/chat.d.ts +61 -0
- package/operator/controllers/chat.d.ts.map +1 -0
- package/operator/controllers/chat.js +154 -0
- package/operator/controllers/clarification.d.ts +52 -0
- package/operator/controllers/clarification.d.ts.map +1 -0
- package/operator/controllers/clarification.js +121 -0
- package/operator/controllers/execution.d.ts +60 -0
- package/operator/controllers/execution.d.ts.map +1 -0
- package/operator/controllers/execution.js +286 -0
- package/operator/controllers/index.d.ts +23 -0
- package/operator/controllers/index.d.ts.map +1 -0
- package/operator/controllers/index.js +15 -0
- package/operator/controllers/map-workspace.d.ts +85 -0
- package/operator/controllers/map-workspace.d.ts.map +1 -0
- package/operator/controllers/map-workspace.js +296 -0
- package/operator/controllers/plan-review.d.ts +66 -0
- package/operator/controllers/plan-review.d.ts.map +1 -0
- package/operator/controllers/plan-review.js +124 -0
- package/operator/errors.d.ts +62 -0
- package/operator/errors.d.ts.map +1 -0
- package/operator/errors.js +75 -0
- package/operator/i18n/index.d.ts +10 -0
- package/operator/i18n/index.d.ts.map +1 -0
- package/operator/i18n/index.js +8 -0
- package/operator/i18n/messages.d.ts +19 -0
- package/operator/i18n/messages.d.ts.map +1 -0
- package/operator/i18n/messages.js +54 -0
- package/operator/index.d.ts +19 -0
- package/operator/index.d.ts.map +1 -0
- package/operator/index.js +15 -0
- package/operator/telemetry.d.ts +26 -0
- package/operator/telemetry.d.ts.map +1 -0
- package/operator/telemetry.js +9 -0
- package/operator/theming/index.d.ts +12 -0
- package/operator/theming/index.d.ts.map +1 -0
- package/operator/theming/index.js +9 -0
- package/operator/theming/provider.d.ts +27 -0
- package/operator/theming/provider.d.ts.map +1 -0
- package/operator/theming/provider.js +26 -0
- package/operator/theming/tokens.d.ts +28 -0
- package/operator/theming/tokens.d.ts.map +1 -0
- package/operator/theming/tokens.js +65 -0
- package/operator/workspace/events.d.ts +70 -0
- package/operator/workspace/events.d.ts.map +1 -0
- package/operator/workspace/events.js +9 -0
- package/operator/workspace/index.d.ts +12 -0
- package/operator/workspace/index.d.ts.map +1 -0
- package/operator/workspace/index.js +8 -0
- package/operator/workspace/types.d.ts +178 -0
- package/operator/workspace/types.d.ts.map +1 -0
- package/operator/workspace/types.js +47 -0
- package/operator/workspace/workspace.d.ts +58 -0
- package/operator/workspace/workspace.d.ts.map +1 -0
- package/operator/workspace/workspace.js +339 -0
- package/package.json +105 -0
- package/realtime/exploration.d.ts +16 -0
- package/realtime/exploration.d.ts.map +1 -0
- package/realtime/exploration.js +32 -0
- package/realtime/honua-server.d.ts +123 -0
- package/realtime/honua-server.d.ts.map +1 -0
- package/realtime/honua-server.js +188 -0
- package/realtime/index.d.ts +20 -0
- package/realtime/index.d.ts.map +1 -0
- package/realtime/index.js +14 -0
- package/realtime/projections.d.ts +30 -0
- package/realtime/projections.d.ts.map +1 -0
- package/realtime/projections.js +51 -0
- package/realtime/reducer.d.ts +14 -0
- package/realtime/reducer.d.ts.map +1 -0
- package/realtime/reducer.js +351 -0
- package/realtime/sse.d.ts +23 -0
- package/realtime/sse.d.ts.map +1 -0
- package/realtime/sse.js +143 -0
- package/realtime/store.d.ts +18 -0
- package/realtime/store.d.ts.map +1 -0
- package/realtime/store.js +63 -0
- package/realtime/types.d.ts +190 -0
- package/realtime/types.d.ts.map +1 -0
- package/realtime/types.js +10 -0
- package/replica-sync/client.d.ts +32 -0
- package/replica-sync/client.d.ts.map +1 -0
- package/replica-sync/client.js +52 -0
- package/replica-sync/errors.d.ts +22 -0
- package/replica-sync/errors.d.ts.map +1 -0
- package/replica-sync/errors.js +29 -0
- package/replica-sync/fixture.d.ts +40 -0
- package/replica-sync/fixture.d.ts.map +1 -0
- package/replica-sync/fixture.js +364 -0
- package/replica-sync/index.d.ts +22 -0
- package/replica-sync/index.d.ts.map +1 -0
- package/replica-sync/index.js +17 -0
- package/replica-sync/types.d.ts +270 -0
- package/replica-sync/types.d.ts.map +1 -0
- package/replica-sync/types.js +13 -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 +40 -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 +272 -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 +30 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +257 -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/pmtiles-protocol.d.ts +77 -0
- package/runtime/pmtiles-protocol.d.ts.map +1 -0
- package/runtime/pmtiles-protocol.js +120 -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 +428 -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/scene-workspace/analysis-widgets.d.ts +334 -0
- package/scene-workspace/analysis-widgets.d.ts.map +1 -0
- package/scene-workspace/analysis-widgets.js +424 -0
- package/scene-workspace/cesium-adapter.d.ts +438 -0
- package/scene-workspace/cesium-adapter.d.ts.map +1 -0
- package/scene-workspace/cesium-adapter.js +493 -0
- package/scene-workspace/index.d.ts +21 -0
- package/scene-workspace/index.d.ts.map +1 -0
- package/scene-workspace/index.js +14 -0
- package/scene-workspace/primitives.d.ts +162 -0
- package/scene-workspace/primitives.d.ts.map +1 -0
- package/scene-workspace/primitives.js +255 -0
- package/scene-workspace/scene-discovery.d.ts +196 -0
- package/scene-workspace/scene-discovery.d.ts.map +1 -0
- package/scene-workspace/scene-discovery.js +228 -0
- package/scene-workspace/scene-view.d.ts +209 -0
- package/scene-workspace/scene-view.d.ts.map +1 -0
- package/scene-workspace/scene-view.js +267 -0
- package/scene-workspace/types.d.ts +229 -0
- package/scene-workspace/types.d.ts.map +1 -0
- package/scene-workspace/types.js +23 -0
- package/scene-workspace/workspace.d.ts +13 -0
- package/scene-workspace/workspace.d.ts.map +1 -0
- package/scene-workspace/workspace.js +391 -0
- package/share/denial.d.ts +78 -0
- package/share/denial.d.ts.map +1 -0
- package/share/denial.js +61 -0
- package/share/embed-token.d.ts +71 -0
- package/share/embed-token.d.ts.map +1 -0
- package/share/embed-token.js +99 -0
- package/share/index.d.ts +35 -0
- package/share/index.d.ts.map +1 -0
- package/share/index.js +30 -0
- package/share/open-data.d.ts +114 -0
- package/share/open-data.d.ts.map +1 -0
- package/share/open-data.js +81 -0
- package/share/types.d.ts +163 -0
- package/share/types.d.ts.map +1 -0
- package/share/types.js +17 -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/web-components/controller.d.ts +39 -0
- package/web-components/controller.d.ts.map +1 -0
- package/web-components/controller.js +640 -0
- package/web-components/elements.d.ts +210 -0
- package/web-components/elements.d.ts.map +1 -0
- package/web-components/elements.js +1651 -0
- package/web-components/index.d.ts +24 -0
- package/web-components/index.d.ts.map +1 -0
- package/web-components/index.js +22 -0
- package/web-components/maplibre-renderer.d.ts +22 -0
- package/web-components/maplibre-renderer.d.ts.map +1 -0
- package/web-components/maplibre-renderer.js +474 -0
- package/web-components/types.d.ts +397 -0
- package/web-components/types.d.ts.map +1 -0
- package/web-components/types.js +1 -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,227 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class SketchCompat {
|
|
3
|
+
view;
|
|
4
|
+
layer;
|
|
5
|
+
container;
|
|
6
|
+
eventBus;
|
|
7
|
+
updateOnGraphicClick;
|
|
8
|
+
creationMode;
|
|
9
|
+
defaultCreateOptions;
|
|
10
|
+
defaultUpdateOptions;
|
|
11
|
+
loaded;
|
|
12
|
+
loadStatus;
|
|
13
|
+
state;
|
|
14
|
+
activeTool;
|
|
15
|
+
activeCreateOptions;
|
|
16
|
+
activeUpdateGraphics;
|
|
17
|
+
activeUpdateOptions;
|
|
18
|
+
watchListeners;
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this.view = options.view;
|
|
21
|
+
this.layer = options.layer;
|
|
22
|
+
this.container = options.container;
|
|
23
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.view, options.layer) ?? new CompatEventBus();
|
|
24
|
+
this.updateOnGraphicClick = options.updateOnGraphicClick ?? true;
|
|
25
|
+
this.creationMode = options.creationMode ?? "single";
|
|
26
|
+
this.defaultCreateOptions = { ...(options.defaultCreateOptions ?? {}) };
|
|
27
|
+
this.defaultUpdateOptions = { ...(options.defaultUpdateOptions ?? {}) };
|
|
28
|
+
this.loaded = false;
|
|
29
|
+
this.loadStatus = "not-loaded";
|
|
30
|
+
this.state = "ready";
|
|
31
|
+
this.activeTool = undefined;
|
|
32
|
+
this.activeCreateOptions = undefined;
|
|
33
|
+
this.activeUpdateGraphics = [];
|
|
34
|
+
this.activeUpdateOptions = undefined;
|
|
35
|
+
this.watchListeners = new Map();
|
|
36
|
+
}
|
|
37
|
+
async load() {
|
|
38
|
+
if (this.loaded) {
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
this.loadStatus = "loading";
|
|
42
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
43
|
+
this.eventBus.emit("sketch.loading", undefined, this);
|
|
44
|
+
this.loaded = true;
|
|
45
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
46
|
+
this.loadStatus = "loaded";
|
|
47
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
48
|
+
this.eventBus.emit("sketch.loaded", undefined, this);
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
async when(callback) {
|
|
52
|
+
const widget = await this.load();
|
|
53
|
+
if (callback) {
|
|
54
|
+
callback(widget);
|
|
55
|
+
}
|
|
56
|
+
return widget;
|
|
57
|
+
}
|
|
58
|
+
watch(propertyName, listener) {
|
|
59
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
60
|
+
if (!listeners) {
|
|
61
|
+
listeners = new Set();
|
|
62
|
+
this.watchListeners.set(propertyName, listeners);
|
|
63
|
+
}
|
|
64
|
+
listeners.add(listener);
|
|
65
|
+
return {
|
|
66
|
+
remove: () => {
|
|
67
|
+
listeners?.delete(listener);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
create(tool, options) {
|
|
72
|
+
this.state = "active";
|
|
73
|
+
this.notifyWatchers("state", this.state);
|
|
74
|
+
this.activeTool = tool;
|
|
75
|
+
this.notifyWatchers("activeTool", this.activeTool);
|
|
76
|
+
this.activeCreateOptions = {
|
|
77
|
+
...this.defaultCreateOptions,
|
|
78
|
+
...(options ?? {}),
|
|
79
|
+
};
|
|
80
|
+
this.notifyWatchers("activeCreateOptions", this.activeCreateOptions);
|
|
81
|
+
this.eventBus.emit("sketch.create-started", {
|
|
82
|
+
tool,
|
|
83
|
+
creationMode: this.creationMode,
|
|
84
|
+
options: this.activeCreateOptions,
|
|
85
|
+
}, this);
|
|
86
|
+
}
|
|
87
|
+
complete(graphic) {
|
|
88
|
+
if (this.state !== "active" || !this.activeTool) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
const tool = this.activeTool;
|
|
92
|
+
const createdGraphic = graphic ?? {};
|
|
93
|
+
appendGraphic(this.layer, createdGraphic);
|
|
94
|
+
this.clearActiveState();
|
|
95
|
+
this.eventBus.emit("sketch.create-completed", {
|
|
96
|
+
tool,
|
|
97
|
+
graphic: createdGraphic,
|
|
98
|
+
layerGraphicCount: getLayerGraphics(this.layer).length,
|
|
99
|
+
}, this);
|
|
100
|
+
return {
|
|
101
|
+
state: "complete",
|
|
102
|
+
tool,
|
|
103
|
+
graphic: createdGraphic,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
cancel() {
|
|
107
|
+
if (this.state !== "active" || !this.activeTool) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const tool = this.activeTool;
|
|
111
|
+
this.clearActiveState();
|
|
112
|
+
this.eventBus.emit("sketch.create-cancelled", { tool }, this);
|
|
113
|
+
return {
|
|
114
|
+
state: "cancel",
|
|
115
|
+
tool,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
update(graphics, options) {
|
|
119
|
+
const normalizedGraphics = normalizeGraphicsInput(graphics);
|
|
120
|
+
this.activeUpdateGraphics = [...normalizedGraphics];
|
|
121
|
+
this.notifyWatchers("activeUpdateGraphics", this.activeUpdateGraphics);
|
|
122
|
+
this.activeUpdateOptions = {
|
|
123
|
+
...this.defaultUpdateOptions,
|
|
124
|
+
...(options ?? {}),
|
|
125
|
+
};
|
|
126
|
+
this.notifyWatchers("activeUpdateOptions", this.activeUpdateOptions);
|
|
127
|
+
this.eventBus.emit("sketch.update-started", {
|
|
128
|
+
count: normalizedGraphics.length,
|
|
129
|
+
options: this.activeUpdateOptions,
|
|
130
|
+
}, this);
|
|
131
|
+
return this.activeUpdateGraphics;
|
|
132
|
+
}
|
|
133
|
+
delete(graphics) {
|
|
134
|
+
const targets = graphics !== undefined ? normalizeGraphicsInput(graphics) : [...this.activeUpdateGraphics];
|
|
135
|
+
let removed = 0;
|
|
136
|
+
for (const target of targets) {
|
|
137
|
+
if (removeGraphic(this.layer, target)) {
|
|
138
|
+
removed += 1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (removed > 0) {
|
|
142
|
+
this.eventBus.emit("sketch.graphics-deleted", {
|
|
143
|
+
count: removed,
|
|
144
|
+
layerGraphicCount: getLayerGraphics(this.layer).length,
|
|
145
|
+
}, this);
|
|
146
|
+
}
|
|
147
|
+
if (this.activeUpdateGraphics.length > 0) {
|
|
148
|
+
this.activeUpdateGraphics = this.activeUpdateGraphics.filter((graphic) => !targets.some((target) => target === graphic));
|
|
149
|
+
this.notifyWatchers("activeUpdateGraphics", this.activeUpdateGraphics);
|
|
150
|
+
}
|
|
151
|
+
return removed;
|
|
152
|
+
}
|
|
153
|
+
reset() {
|
|
154
|
+
this.clearActiveState();
|
|
155
|
+
this.activeUpdateGraphics = [];
|
|
156
|
+
this.notifyWatchers("activeUpdateGraphics", this.activeUpdateGraphics);
|
|
157
|
+
this.activeUpdateOptions = undefined;
|
|
158
|
+
this.notifyWatchers("activeUpdateOptions", this.activeUpdateOptions);
|
|
159
|
+
this.eventBus.emit("sketch.reset", undefined, this);
|
|
160
|
+
}
|
|
161
|
+
clearActiveState() {
|
|
162
|
+
this.state = "ready";
|
|
163
|
+
this.notifyWatchers("state", this.state);
|
|
164
|
+
this.activeTool = undefined;
|
|
165
|
+
this.notifyWatchers("activeTool", this.activeTool);
|
|
166
|
+
this.activeCreateOptions = undefined;
|
|
167
|
+
this.notifyWatchers("activeCreateOptions", this.activeCreateOptions);
|
|
168
|
+
}
|
|
169
|
+
destroy() {
|
|
170
|
+
this.watchListeners.clear();
|
|
171
|
+
}
|
|
172
|
+
notifyWatchers(propertyName, value) {
|
|
173
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
174
|
+
if (!listeners) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
for (const listener of listeners) {
|
|
178
|
+
safeInvokeCompatListener(listener, value);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function normalizeGraphicsInput(graphics) {
|
|
183
|
+
return Array.isArray(graphics) ? [...graphics] : [graphics];
|
|
184
|
+
}
|
|
185
|
+
function appendGraphic(layer, graphic) {
|
|
186
|
+
if (!isGraphicsLayerLike(layer)) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (typeof layer.add === "function") {
|
|
190
|
+
layer.add(graphic);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (Array.isArray(layer.graphics)) {
|
|
194
|
+
layer.graphics.push(graphic);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function removeGraphic(layer, graphic) {
|
|
198
|
+
if (!isGraphicsLayerLike(layer)) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
if (typeof layer.remove === "function") {
|
|
202
|
+
const beforeCount = getLayerGraphics(layer).length;
|
|
203
|
+
const result = layer.remove(graphic);
|
|
204
|
+
if (result !== undefined) {
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
return getLayerGraphics(layer).length < beforeCount;
|
|
208
|
+
}
|
|
209
|
+
if (!Array.isArray(layer.graphics)) {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
const index = layer.graphics.findIndex((candidate) => candidate === graphic);
|
|
213
|
+
if (index < 0) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
layer.graphics.splice(index, 1);
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
function getLayerGraphics(layer) {
|
|
220
|
+
if (!isGraphicsLayerLike(layer) || !Array.isArray(layer.graphics)) {
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
return layer.graphics;
|
|
224
|
+
}
|
|
225
|
+
function isGraphicsLayerLike(value) {
|
|
226
|
+
return typeof value === "object" && value !== null;
|
|
227
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface SpatialReferenceCompatOptions {
|
|
2
|
+
wkid?: number;
|
|
3
|
+
latestWkid?: number;
|
|
4
|
+
wkt?: string;
|
|
5
|
+
vcsWkid?: number;
|
|
6
|
+
latestVcsWkid?: number;
|
|
7
|
+
}
|
|
8
|
+
export type SpatialReferenceLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
9
|
+
export interface SpatialReferenceHandleCompat {
|
|
10
|
+
remove(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class SpatialReferenceCompat {
|
|
13
|
+
loaded: boolean;
|
|
14
|
+
loadStatus: SpatialReferenceLoadStatusCompat;
|
|
15
|
+
wkid: number | undefined;
|
|
16
|
+
latestWkid: number | undefined;
|
|
17
|
+
wkt: string | undefined;
|
|
18
|
+
vcsWkid: number | undefined;
|
|
19
|
+
latestVcsWkid: number | undefined;
|
|
20
|
+
private readonly watchListeners;
|
|
21
|
+
constructor(options?: SpatialReferenceCompatOptions);
|
|
22
|
+
load(): Promise<SpatialReferenceCompat>;
|
|
23
|
+
when(callback?: (spatialReference: SpatialReferenceCompat) => void): Promise<SpatialReferenceCompat>;
|
|
24
|
+
watch(propertyName: string, listener: (value: unknown) => void): SpatialReferenceHandleCompat;
|
|
25
|
+
update(options: SpatialReferenceCompatOptions): void;
|
|
26
|
+
clone(): SpatialReferenceCompat;
|
|
27
|
+
toJSON(): SpatialReferenceCompatOptions;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
private notifyWatchers;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=spatial-reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spatial-reference.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/spatial-reference.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,gCAAgC,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEnF,MAAM,WAAW,4BAA4B;IAC3C,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,sBAAsB;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,gCAAgC,CAAC;IAC7C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,6BAAkC;IAWjD,IAAI,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAcvC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAQ1G,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,4BAA4B;IAe7F,MAAM,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI;IAuBpD,KAAK,IAAI,sBAAsB;IAI/B,MAAM,IAAI,6BAA6B;IAUvC,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class SpatialReferenceCompat {
|
|
3
|
+
loaded;
|
|
4
|
+
loadStatus;
|
|
5
|
+
wkid;
|
|
6
|
+
latestWkid;
|
|
7
|
+
wkt;
|
|
8
|
+
vcsWkid;
|
|
9
|
+
latestVcsWkid;
|
|
10
|
+
watchListeners;
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.loaded = false;
|
|
13
|
+
this.loadStatus = "not-loaded";
|
|
14
|
+
this.wkid = finiteNumberOrUndefined(options.wkid);
|
|
15
|
+
this.latestWkid = finiteNumberOrUndefined(options.latestWkid);
|
|
16
|
+
this.wkt = options.wkt;
|
|
17
|
+
this.vcsWkid = finiteNumberOrUndefined(options.vcsWkid);
|
|
18
|
+
this.latestVcsWkid = finiteNumberOrUndefined(options.latestVcsWkid);
|
|
19
|
+
this.watchListeners = new Map();
|
|
20
|
+
}
|
|
21
|
+
async load() {
|
|
22
|
+
if (this.loaded) {
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
this.loadStatus = "loading";
|
|
26
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
27
|
+
this.loaded = true;
|
|
28
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
29
|
+
this.loadStatus = "loaded";
|
|
30
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
async when(callback) {
|
|
34
|
+
const spatialReference = await this.load();
|
|
35
|
+
if (callback) {
|
|
36
|
+
callback(spatialReference);
|
|
37
|
+
}
|
|
38
|
+
return spatialReference;
|
|
39
|
+
}
|
|
40
|
+
watch(propertyName, listener) {
|
|
41
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
42
|
+
if (!listeners) {
|
|
43
|
+
listeners = new Set();
|
|
44
|
+
this.watchListeners.set(propertyName, listeners);
|
|
45
|
+
}
|
|
46
|
+
listeners.add(listener);
|
|
47
|
+
return {
|
|
48
|
+
remove: () => {
|
|
49
|
+
listeners?.delete(listener);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
update(options) {
|
|
54
|
+
if (options.wkid !== undefined) {
|
|
55
|
+
this.wkid = finiteNumberOrUndefined(options.wkid);
|
|
56
|
+
this.notifyWatchers("wkid", this.wkid);
|
|
57
|
+
}
|
|
58
|
+
if (options.latestWkid !== undefined) {
|
|
59
|
+
this.latestWkid = finiteNumberOrUndefined(options.latestWkid);
|
|
60
|
+
this.notifyWatchers("latestWkid", this.latestWkid);
|
|
61
|
+
}
|
|
62
|
+
if (options.wkt !== undefined) {
|
|
63
|
+
this.wkt = options.wkt;
|
|
64
|
+
this.notifyWatchers("wkt", this.wkt);
|
|
65
|
+
}
|
|
66
|
+
if (options.vcsWkid !== undefined) {
|
|
67
|
+
this.vcsWkid = finiteNumberOrUndefined(options.vcsWkid);
|
|
68
|
+
this.notifyWatchers("vcsWkid", this.vcsWkid);
|
|
69
|
+
}
|
|
70
|
+
if (options.latestVcsWkid !== undefined) {
|
|
71
|
+
this.latestVcsWkid = finiteNumberOrUndefined(options.latestVcsWkid);
|
|
72
|
+
this.notifyWatchers("latestVcsWkid", this.latestVcsWkid);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
clone() {
|
|
76
|
+
return new SpatialReferenceCompat(this.toJSON());
|
|
77
|
+
}
|
|
78
|
+
toJSON() {
|
|
79
|
+
return {
|
|
80
|
+
wkid: this.wkid,
|
|
81
|
+
latestWkid: this.latestWkid,
|
|
82
|
+
wkt: this.wkt,
|
|
83
|
+
vcsWkid: this.vcsWkid,
|
|
84
|
+
latestVcsWkid: this.latestVcsWkid,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
destroy() {
|
|
88
|
+
this.watchListeners.clear();
|
|
89
|
+
}
|
|
90
|
+
notifyWatchers(propertyName, value) {
|
|
91
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
92
|
+
if (!listeners) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
for (const listener of listeners) {
|
|
96
|
+
safeInvokeCompatListener(listener, value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function finiteNumberOrUndefined(value) {
|
|
101
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
102
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface SwipeCompatOptions {
|
|
3
|
+
view?: unknown;
|
|
4
|
+
container?: unknown;
|
|
5
|
+
leadingLayers?: readonly unknown[];
|
|
6
|
+
trailingLayers?: readonly unknown[];
|
|
7
|
+
position?: number;
|
|
8
|
+
eventBus?: CompatEventBus;
|
|
9
|
+
}
|
|
10
|
+
export type SwipeLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
11
|
+
export interface SwipeHandleCompat {
|
|
12
|
+
remove(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class SwipeCompat {
|
|
15
|
+
readonly view: unknown;
|
|
16
|
+
readonly container: unknown;
|
|
17
|
+
readonly eventBus: CompatEventBus;
|
|
18
|
+
loaded: boolean;
|
|
19
|
+
loadStatus: SwipeLoadStatusCompat;
|
|
20
|
+
leadingLayers: unknown[];
|
|
21
|
+
trailingLayers: unknown[];
|
|
22
|
+
position: number;
|
|
23
|
+
private readonly watchListeners;
|
|
24
|
+
constructor(options?: SwipeCompatOptions);
|
|
25
|
+
load(): Promise<SwipeCompat>;
|
|
26
|
+
when(callback?: (widget: SwipeCompat) => void): Promise<SwipeCompat>;
|
|
27
|
+
watch(propertyName: string, listener: (value: unknown) => void): SwipeHandleCompat;
|
|
28
|
+
setPosition(position: number): void;
|
|
29
|
+
setLeadingLayers(layers: readonly unknown[]): void;
|
|
30
|
+
setTrailingLayers(layers: readonly unknown[]): void;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
private notifyWatchers;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=swipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/swipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,cAAc,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,WAAW;IACtB,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,qBAAqB,CAAC;IAClC,aAAa,EAAE,OAAO,EAAE,CAAC;IACzB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,kBAAuB;IAetC,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAgB5B,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1E,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,iBAAiB;IAelF,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC,gBAAgB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAMlD,iBAAiB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAMnD,OAAO,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener } from "./event-bus.js";
|
|
2
|
+
export class SwipeCompat {
|
|
3
|
+
view;
|
|
4
|
+
container;
|
|
5
|
+
eventBus;
|
|
6
|
+
loaded;
|
|
7
|
+
loadStatus;
|
|
8
|
+
leadingLayers;
|
|
9
|
+
trailingLayers;
|
|
10
|
+
position;
|
|
11
|
+
watchListeners;
|
|
12
|
+
constructor(options = {}) {
|
|
13
|
+
this.view = options.view;
|
|
14
|
+
this.container = options.container;
|
|
15
|
+
this.eventBus =
|
|
16
|
+
options.eventBus ??
|
|
17
|
+
resolveCompatEventBus(options.view, options.leadingLayers, options.trailingLayers) ??
|
|
18
|
+
new CompatEventBus();
|
|
19
|
+
this.loaded = false;
|
|
20
|
+
this.loadStatus = "not-loaded";
|
|
21
|
+
this.leadingLayers = options.leadingLayers ? [...options.leadingLayers] : [];
|
|
22
|
+
this.trailingLayers = options.trailingLayers ? [...options.trailingLayers] : [];
|
|
23
|
+
this.position = normalizePosition(options.position ?? 50);
|
|
24
|
+
this.watchListeners = new Map();
|
|
25
|
+
}
|
|
26
|
+
async load() {
|
|
27
|
+
if (this.loaded) {
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
this.loadStatus = "loading";
|
|
31
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
32
|
+
this.eventBus.emit("swipe.loading", undefined, this);
|
|
33
|
+
this.loaded = true;
|
|
34
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
35
|
+
this.loadStatus = "loaded";
|
|
36
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
37
|
+
this.eventBus.emit("swipe.loaded", undefined, this);
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
async when(callback) {
|
|
41
|
+
const widget = await this.load();
|
|
42
|
+
if (callback) {
|
|
43
|
+
callback(widget);
|
|
44
|
+
}
|
|
45
|
+
return widget;
|
|
46
|
+
}
|
|
47
|
+
watch(propertyName, listener) {
|
|
48
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
49
|
+
if (!listeners) {
|
|
50
|
+
listeners = new Set();
|
|
51
|
+
this.watchListeners.set(propertyName, listeners);
|
|
52
|
+
}
|
|
53
|
+
listeners.add(listener);
|
|
54
|
+
return {
|
|
55
|
+
remove: () => {
|
|
56
|
+
listeners?.delete(listener);
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
setPosition(position) {
|
|
61
|
+
this.position = normalizePosition(position);
|
|
62
|
+
this.notifyWatchers("position", this.position);
|
|
63
|
+
this.eventBus.emit("swipe.position-changed", { position: this.position }, this);
|
|
64
|
+
}
|
|
65
|
+
setLeadingLayers(layers) {
|
|
66
|
+
this.leadingLayers = [...layers];
|
|
67
|
+
this.notifyWatchers("leadingLayers", this.leadingLayers);
|
|
68
|
+
this.eventBus.emit("swipe.layers-changed", { side: "leading", count: this.leadingLayers.length }, this);
|
|
69
|
+
}
|
|
70
|
+
setTrailingLayers(layers) {
|
|
71
|
+
this.trailingLayers = [...layers];
|
|
72
|
+
this.notifyWatchers("trailingLayers", this.trailingLayers);
|
|
73
|
+
this.eventBus.emit("swipe.layers-changed", { side: "trailing", count: this.trailingLayers.length }, this);
|
|
74
|
+
}
|
|
75
|
+
destroy() {
|
|
76
|
+
this.watchListeners.clear();
|
|
77
|
+
}
|
|
78
|
+
notifyWatchers(propertyName, value) {
|
|
79
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
80
|
+
if (!listeners) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const listener of listeners) {
|
|
84
|
+
safeInvokeCompatListener(listener, value);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function normalizePosition(value) {
|
|
89
|
+
if (!Number.isFinite(value)) {
|
|
90
|
+
return 50;
|
|
91
|
+
}
|
|
92
|
+
return Math.min(100, Math.max(0, Math.trunc(value)));
|
|
93
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface TableListCompatOptions {
|
|
3
|
+
view?: unknown;
|
|
4
|
+
map?: unknown;
|
|
5
|
+
container?: unknown;
|
|
6
|
+
tables?: readonly unknown[];
|
|
7
|
+
eventBus?: CompatEventBus;
|
|
8
|
+
autoRefresh?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type TableListLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
11
|
+
export interface TableListHandleCompat {
|
|
12
|
+
remove(): void;
|
|
13
|
+
}
|
|
14
|
+
export declare class TableListCompat {
|
|
15
|
+
readonly view: unknown;
|
|
16
|
+
readonly map: unknown;
|
|
17
|
+
readonly container: unknown;
|
|
18
|
+
readonly eventBus: CompatEventBus;
|
|
19
|
+
readonly autoRefresh: boolean;
|
|
20
|
+
loaded: boolean;
|
|
21
|
+
loadStatus: TableListLoadStatusCompat;
|
|
22
|
+
tables: unknown[];
|
|
23
|
+
private readonly subscriptions;
|
|
24
|
+
private readonly watchListeners;
|
|
25
|
+
private explicitTables;
|
|
26
|
+
constructor(options?: TableListCompatOptions);
|
|
27
|
+
load(): Promise<TableListCompat>;
|
|
28
|
+
when(callback?: (widget: TableListCompat) => void): Promise<TableListCompat>;
|
|
29
|
+
watch(propertyName: string, listener: (value: unknown) => void): TableListHandleCompat;
|
|
30
|
+
setTables(tables: readonly unknown[]): void;
|
|
31
|
+
useMapTables(): readonly unknown[];
|
|
32
|
+
refresh(): readonly unknown[];
|
|
33
|
+
destroy(): void;
|
|
34
|
+
private notifyWatchers;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=table-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-list.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/table-list.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAIf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5E,MAAM,WAAW,qBAAqB;IACpC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,eAAe;IAC1B,SAAgB,IAAI,EAAE,OAAO,CAAC;IAC9B,SAAgB,GAAG,EAAE,OAAO,CAAC;IAC7B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IACzC,SAAgB,WAAW,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,yBAAyB,CAAC;IACtC,MAAM,EAAE,OAAO,EAAE,CAAC;IAEzB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4B;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;IAC5E,OAAO,CAAC,cAAc,CAAwB;gBAE3B,OAAO,GAAE,sBAA2B;IAwB1C,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAiBhC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,eAAe,CAAC;IAQlF,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,qBAAqB;IAetF,SAAS,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAO3C,YAAY,IAAI,SAAS,OAAO,EAAE;IAKlC,OAAO,IAAI,SAAS,OAAO,EAAE;IAY7B,OAAO,IAAI,IAAI;IAOtB,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { CompatEventBus, resolveCompatEventBus, safeInvokeCompatListener, } from "./event-bus.js";
|
|
2
|
+
export class TableListCompat {
|
|
3
|
+
view;
|
|
4
|
+
map;
|
|
5
|
+
container;
|
|
6
|
+
eventBus;
|
|
7
|
+
autoRefresh;
|
|
8
|
+
loaded;
|
|
9
|
+
loadStatus;
|
|
10
|
+
tables;
|
|
11
|
+
subscriptions;
|
|
12
|
+
watchListeners;
|
|
13
|
+
explicitTables;
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
this.view = options.view;
|
|
16
|
+
this.map = options.map ?? extractViewMap(options.view);
|
|
17
|
+
this.container = options.container;
|
|
18
|
+
this.eventBus = options.eventBus ?? resolveCompatEventBus(options.view, options.map) ?? new CompatEventBus();
|
|
19
|
+
this.autoRefresh = options.autoRefresh ?? true;
|
|
20
|
+
this.loaded = false;
|
|
21
|
+
this.loadStatus = "not-loaded";
|
|
22
|
+
this.explicitTables = options.tables ? [...options.tables] : undefined;
|
|
23
|
+
this.tables = this.explicitTables ? [...this.explicitTables] : extractTablesFromMap(this.map);
|
|
24
|
+
this.subscriptions = [];
|
|
25
|
+
this.watchListeners = new Map();
|
|
26
|
+
if (this.autoRefresh) {
|
|
27
|
+
this.subscriptions.push(this.eventBus.on("map.tables-changed", () => {
|
|
28
|
+
if (this.explicitTables === undefined) {
|
|
29
|
+
this.refresh();
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async load() {
|
|
35
|
+
if (this.loaded) {
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
this.loadStatus = "loading";
|
|
39
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
40
|
+
this.eventBus.emit("table-list.loading", undefined, this);
|
|
41
|
+
this.refresh();
|
|
42
|
+
this.loaded = true;
|
|
43
|
+
this.notifyWatchers("loaded", this.loaded);
|
|
44
|
+
this.loadStatus = "loaded";
|
|
45
|
+
this.notifyWatchers("loadStatus", this.loadStatus);
|
|
46
|
+
this.eventBus.emit("table-list.loaded", { count: this.tables.length }, this);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
async when(callback) {
|
|
50
|
+
const widget = await this.load();
|
|
51
|
+
if (callback) {
|
|
52
|
+
callback(widget);
|
|
53
|
+
}
|
|
54
|
+
return widget;
|
|
55
|
+
}
|
|
56
|
+
watch(propertyName, listener) {
|
|
57
|
+
let listeners = this.watchListeners.get(propertyName);
|
|
58
|
+
if (!listeners) {
|
|
59
|
+
listeners = new Set();
|
|
60
|
+
this.watchListeners.set(propertyName, listeners);
|
|
61
|
+
}
|
|
62
|
+
listeners.add(listener);
|
|
63
|
+
return {
|
|
64
|
+
remove: () => {
|
|
65
|
+
listeners?.delete(listener);
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
setTables(tables) {
|
|
70
|
+
this.explicitTables = [...tables];
|
|
71
|
+
this.tables = [...this.explicitTables];
|
|
72
|
+
this.notifyWatchers("tables", this.tables);
|
|
73
|
+
this.eventBus.emit("table-list.tables-changed", { count: this.tables.length }, this);
|
|
74
|
+
}
|
|
75
|
+
useMapTables() {
|
|
76
|
+
this.explicitTables = undefined;
|
|
77
|
+
return this.refresh();
|
|
78
|
+
}
|
|
79
|
+
refresh() {
|
|
80
|
+
if (this.explicitTables) {
|
|
81
|
+
this.tables = [...this.explicitTables];
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
this.tables = extractTablesFromMap(this.map);
|
|
85
|
+
}
|
|
86
|
+
this.notifyWatchers("tables", this.tables);
|
|
87
|
+
this.eventBus.emit("table-list.refreshed", { count: this.tables.length }, this);
|
|
88
|
+
return this.tables;
|
|
89
|
+
}
|
|
90
|
+
destroy() {
|
|
91
|
+
for (const subscription of this.subscriptions.splice(0)) {
|
|
92
|
+
subscription.remove();
|
|
93
|
+
}
|
|
94
|
+
this.watchListeners.clear();
|
|
95
|
+
}
|
|
96
|
+
notifyWatchers(propertyName, value) {
|
|
97
|
+
const listeners = this.watchListeners.get(propertyName);
|
|
98
|
+
if (!listeners) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
for (const listener of listeners) {
|
|
102
|
+
safeInvokeCompatListener(listener, value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function extractViewMap(view) {
|
|
107
|
+
if (!isRecord(view)) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
return view.map;
|
|
111
|
+
}
|
|
112
|
+
function extractTablesFromMap(map) {
|
|
113
|
+
if (!isRecord(map)) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
if (Array.isArray(map.allTables)) {
|
|
117
|
+
return [...map.allTables];
|
|
118
|
+
}
|
|
119
|
+
if (Array.isArray(map.tables)) {
|
|
120
|
+
return [...map.tables];
|
|
121
|
+
}
|
|
122
|
+
return [];
|
|
123
|
+
}
|
|
124
|
+
function isRecord(value) {
|
|
125
|
+
return typeof value === "object" && value !== null;
|
|
126
|
+
}
|