@honua/app-platform 0.1.1-beta.0 → 0.1.4-beta.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/collaboration/client.d.ts.map +1 -1
- package/connect-url-safety.d.ts +53 -0
- package/connect-url-safety.js +189 -0
- package/contract/discovery.d.ts +34 -0
- package/contract/discovery.d.ts.map +1 -1
- package/contract/index.d.ts +7 -5
- package/contract/index.d.ts.map +1 -1
- package/contract/index.js +3 -2
- package/contract/pmtiles.d.ts +10 -1
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +10 -2
- package/contract/protocol-module.d.ts +84 -9
- package/contract/protocol-module.d.ts.map +1 -1
- package/contract/query-filter-fes.d.ts +18 -0
- package/contract/query-filter-fes.d.ts.map +1 -0
- package/contract/query-filter-fes.js +122 -0
- package/contract/query-filter.d.ts +300 -0
- package/contract/query-filter.d.ts.map +1 -0
- package/contract/query-filter.js +883 -0
- package/contract/schema.d.ts +12 -0
- package/contract/schema.d.ts.map +1 -1
- package/contract/schema.js +34 -0
- package/contract/source-capability-support.d.ts.map +1 -1
- package/contract/source-capability-support.js +15 -3
- package/contract/source.d.ts +45 -25
- package/contract/source.d.ts.map +1 -1
- package/contract/source.js +719 -479
- package/contract/types.d.ts +87 -18
- package/contract/types.d.ts.map +1 -1
- package/contract/widget-source.d.ts.map +1 -1
- package/controls/basemap-switcher.d.ts +19 -11
- package/controls/basemap-switcher.d.ts.map +1 -1
- package/controls/basemap-switcher.js +58 -25
- package/controls/catalog.d.ts +105 -0
- package/controls/catalog.d.ts.map +1 -0
- package/controls/catalog.js +341 -0
- package/controls/element-utils.d.ts +9 -0
- package/controls/element-utils.d.ts.map +1 -1
- package/controls/element-utils.js +17 -0
- package/controls/index.d.ts +29 -8
- package/controls/index.d.ts.map +1 -1
- package/controls/index.js +26 -8
- package/controls/layer-list.d.ts +13 -5
- package/controls/layer-list.d.ts.map +1 -1
- package/controls/layer-list.js +72 -15
- package/controls/legend.d.ts +32 -5
- package/controls/legend.d.ts.map +1 -1
- package/controls/legend.js +95 -25
- package/controls/qualification.d.ts +152 -0
- package/controls/qualification.d.ts.map +1 -0
- package/controls/qualification.js +1265 -0
- package/controls/registry.d.ts +104 -0
- package/controls/registry.d.ts.map +1 -0
- package/controls/registry.js +150 -0
- package/controls/swipe-control.d.ts +6 -1
- package/controls/swipe-control.d.ts.map +1 -1
- package/controls/swipe-control.js +82 -20
- package/core/client.d.ts +45 -21
- package/core/client.d.ts.map +1 -1
- package/core/client.js +224 -46
- package/core/error-classifications.d.ts +6 -0
- package/core/error-classifications.d.ts.map +1 -1
- package/core/error-classifications.js +6 -0
- package/core/error-code-registry.d.ts +6 -0
- package/core/error-code-registry.d.ts.map +1 -1
- package/core/error-code-registry.js +6 -0
- package/core/error-envelope.js +2 -0
- package/core/errors.d.ts +1 -1
- package/core/errors.js +1 -1
- package/core/geoparquet-sql.d.ts +68 -4
- package/core/geoparquet-sql.d.ts.map +1 -1
- package/core/geoparquet-sql.js +325 -8
- package/core/odata-write-codec.d.ts.map +1 -1
- package/core/odata-write-codec.js +0 -1
- package/core/odata.d.ts +6 -0
- package/core/odata.d.ts.map +1 -1
- package/core/odata.js +6 -1
- package/core/ogc-processes.d.ts +182 -25
- package/core/ogc-processes.d.ts.map +1 -1
- package/core/ogc-processes.js +602 -30
- package/core/process-runner.d.ts +8 -1
- package/core/process-runner.d.ts.map +1 -1
- package/core/process-runner.js +1 -0
- package/core/protocol-transport.d.ts +2 -0
- package/core/protocol-transport.d.ts.map +1 -1
- package/core/stac.d.ts +31 -0
- package/core/stac.d.ts.map +1 -1
- package/core/stac.js +136 -19
- package/core/surfaces.d.ts.map +1 -1
- package/core/surfaces.js +273 -68
- package/core/types.d.ts +123 -9
- package/core/types.d.ts.map +1 -1
- package/core/wfs-axis-order.d.ts +18 -0
- package/core/wfs-axis-order.d.ts.map +1 -0
- package/core/wfs-axis-order.js +108 -0
- package/core/wfs-capabilities.d.ts +65 -24
- package/core/wfs-capabilities.d.ts.map +1 -1
- package/core/wfs-capabilities.js +237 -27
- package/core/wfs-filter.d.ts +26 -3
- package/core/wfs-filter.d.ts.map +1 -1
- package/core/wfs-filter.js +48 -53
- package/core/wfs-protocol-error.d.ts +12 -0
- package/core/wfs-protocol-error.d.ts.map +1 -0
- package/core/wfs-protocol-error.js +13 -0
- package/core/wfs.d.ts +53 -1
- package/core/wfs.d.ts.map +1 -1
- package/core/wfs.js +251 -29
- package/core/wms-feature-info.d.ts +92 -0
- package/core/wms-feature-info.d.ts.map +1 -0
- package/core/wms-feature-info.js +285 -0
- package/core/wms.d.ts +9 -0
- package/core/wms.d.ts.map +1 -1
- package/core/wms.js +17 -5
- package/esri-compat/event-bus.d.ts +20 -0
- package/esri-compat/event-bus.d.ts.map +1 -1
- package/esri-compat/feature-filter.d.ts +46 -1
- package/esri-compat/feature-filter.d.ts.map +1 -1
- package/esri-compat/feature-filter.js +49 -0
- package/esri-compat/geojson-layer.d.ts +4 -2
- package/esri-compat/geojson-layer.d.ts.map +1 -1
- package/esri-compat/geojson-layer.js +4 -2
- package/esri-compat/identity-manager.js +2 -2
- package/esri-compat/imagery-layer.d.ts +2 -1
- package/esri-compat/imagery-layer.d.ts.map +1 -1
- package/esri-compat/imagery-layer.js +2 -1
- package/esri-compat/layer-list.d.ts +8 -1
- package/esri-compat/layer-list.d.ts.map +1 -1
- package/esri-compat/layer-list.js +11 -4
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +1 -1
- package/esri-compat/locator.d.ts +297 -0
- package/esri-compat/locator.d.ts.map +1 -0
- package/esri-compat/locator.js +579 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -1
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +1 -1
- package/esri-compat/scene-view.d.ts.map +1 -1
- package/esri-compat/time-slider.d.ts +29 -0
- package/esri-compat/time-slider.d.ts.map +1 -1
- package/esri-compat/time-slider.js +117 -0
- package/esri-compat/wfs-layer.d.ts +2 -1
- package/esri-compat/wfs-layer.d.ts.map +1 -1
- package/esri-compat/wfs-layer.js +2 -1
- package/esri-compat/widget-host.d.ts +42 -6
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +99 -10
- package/generated-app/projection.d.ts.map +1 -1
- package/generated-app/runtime.d.ts.map +1 -1
- package/map/data-to-map-bridge.d.ts +1 -1
- package/map/data-to-map-bridge.d.ts.map +1 -1
- package/map/data-to-map-bridge.js +1 -2
- package/map/honua-map.d.ts.map +1 -1
- package/map/honua-map.js +1 -1
- package/map/index.d.ts +2 -0
- package/map/index.d.ts.map +1 -1
- package/map/index.js +2 -0
- package/map/realtime-reconciliation-adapter.d.ts +98 -0
- package/map/realtime-reconciliation-adapter.d.ts.map +1 -0
- package/map/realtime-reconciliation-adapter.js +84 -0
- package/map/temporal-playback.d.ts +25 -0
- package/map/temporal-playback.d.ts.map +1 -1
- package/map/temporal-playback.js +29 -1
- package/operator/workspace/workspace.d.ts.map +1 -1
- package/operator/workspace/workspace.js +0 -2
- package/package.json +4 -3
- package/query-planner/canonical-filter.d.ts +30 -0
- package/query-planner/canonical-filter.d.ts.map +1 -0
- package/query-planner/canonical-filter.js +30 -0
- package/query-planner/columnar-plan.d.ts +63 -0
- package/query-planner/columnar-plan.d.ts.map +1 -0
- package/query-planner/columnar-plan.js +94 -0
- package/query-planner/diagnostics.d.ts +3 -3
- package/query-planner/diagnostics.d.ts.map +1 -1
- package/query-planner/diagnostics.js +17 -4
- package/query-planner/duckdb.d.ts.map +1 -1
- package/query-planner/duckdb.js +16 -2
- package/query-planner/execution-context.d.ts.map +1 -1
- package/query-planner/execution-context.js +3 -1
- package/query-planner/executor.d.ts.map +1 -1
- package/query-planner/executor.js +7 -1
- package/query-planner/geoservices.d.ts.map +1 -1
- package/query-planner/geoservices.js +24 -5
- package/query-planner/grpc.d.ts.map +1 -1
- package/query-planner/grpc.js +29 -5
- package/query-planner/index.d.ts +20 -5
- package/query-planner/index.d.ts.map +1 -1
- package/query-planner/index.js +16 -3
- package/query-planner/ir.d.ts +6 -1
- package/query-planner/ir.d.ts.map +1 -1
- package/query-planner/ir.js +63 -1
- package/query-planner/odata-protocol-module.d.ts +54 -0
- package/query-planner/odata-protocol-module.d.ts.map +1 -0
- package/query-planner/odata-protocol-module.js +199 -0
- package/query-planner/odata-v1.d.ts +23 -0
- package/query-planner/odata-v1.d.ts.map +1 -0
- package/query-planner/odata-v1.js +202 -0
- package/query-planner/odata.d.ts +0 -3
- package/query-planner/odata.d.ts.map +1 -1
- package/query-planner/odata.js +0 -143
- package/query-planner/ogc-features.d.ts.map +1 -1
- package/query-planner/ogc-features.js +23 -1
- package/query-planner/planner.d.ts +2 -2
- package/query-planner/planner.d.ts.map +1 -1
- package/query-planner/planner.js +146 -27
- package/query-planner/representation.d.ts +59 -0
- package/query-planner/representation.d.ts.map +1 -0
- package/query-planner/representation.js +140 -0
- package/query-planner/types.d.ts +153 -3
- package/query-planner/types.d.ts.map +1 -1
- package/query-planner/wfs-protocol-module.d.ts +57 -0
- package/query-planner/wfs-protocol-module.d.ts.map +1 -0
- package/query-planner/wfs-protocol-module.js +731 -0
- package/query-planner/wfs-v1.d.ts +41 -0
- package/query-planner/wfs-v1.d.ts.map +1 -0
- package/query-planner/wfs-v1.js +366 -0
- package/query-planner/wfs.d.ts +1 -3
- package/query-planner/wfs.d.ts.map +1 -1
- package/query-planner/wfs.js +1 -70
- package/realtime/checkpoint-store.d.ts +206 -0
- package/realtime/checkpoint-store.d.ts.map +1 -0
- package/realtime/checkpoint-store.js +504 -0
- package/realtime/honua-server.d.ts +8 -0
- package/realtime/honua-server.d.ts.map +1 -1
- package/realtime/honua-server.js +123 -14
- package/realtime/index.d.ts +4 -0
- package/realtime/index.d.ts.map +1 -1
- package/realtime/index.js +2 -0
- package/realtime/reconciliation.d.ts +245 -0
- package/realtime/reconciliation.d.ts.map +1 -0
- package/realtime/reconciliation.js +377 -0
- package/realtime/resumable-transport.d.ts.map +1 -1
- package/realtime/sse.d.ts.map +1 -1
- package/realtime/websocket.d.ts.map +1 -1
- package/realtime/wire.d.ts +2 -1
- package/realtime/wire.d.ts.map +1 -1
- package/realtime/wire.js +24 -8
- package/replica-sync/errors.d.ts +19 -1
- package/replica-sync/errors.d.ts.map +1 -1
- package/replica-sync/errors.js +16 -0
- package/replica-sync/geoservices.d.ts +260 -0
- package/replica-sync/geoservices.d.ts.map +1 -0
- package/replica-sync/geoservices.js +1093 -0
- package/replica-sync/index.d.ts +5 -1
- package/replica-sync/index.d.ts.map +1 -1
- package/replica-sync/index.js +3 -1
- package/replica-sync/transport-conformance.d.ts +58 -0
- package/replica-sync/transport-conformance.d.ts.map +1 -0
- package/replica-sync/transport-conformance.js +265 -0
- package/replica-sync/types.d.ts +22 -0
- package/replica-sync/types.d.ts.map +1 -1
- package/runtime/index.d.ts +6 -2
- package/runtime/index.d.ts.map +1 -1
- package/runtime/index.js +3 -1
- package/runtime/load-package.d.ts +24 -0
- package/runtime/load-package.d.ts.map +1 -1
- package/runtime/load-package.js +45 -1
- package/runtime/maplibre-renderer.d.ts +11 -0
- package/runtime/maplibre-renderer.d.ts.map +1 -1
- package/runtime/maplibre-renderer.js +32 -7
- package/runtime/offline-region-protocol.d.ts +73 -0
- package/runtime/offline-region-protocol.d.ts.map +1 -0
- package/runtime/offline-region-protocol.js +63 -0
- package/runtime/offline-region-style.d.ts +78 -0
- package/runtime/offline-region-style.d.ts.map +1 -0
- package/runtime/offline-region-style.js +147 -0
- package/runtime/pmtiles-protocol.d.ts +7 -8
- package/runtime/pmtiles-protocol.d.ts.map +1 -1
- package/runtime/pmtiles-protocol.js +19 -66
- package/runtime/protocol-registry.d.ts +55 -0
- package/runtime/protocol-registry.d.ts.map +1 -0
- package/runtime/protocol-registry.js +103 -0
- package/runtime/runtime.d.ts +2 -0
- package/runtime/runtime.d.ts.map +1 -1
- package/runtime/runtime.js +6 -1
- package/scene-workspace/analysis-widgets.d.ts +4 -2
- package/scene-workspace/analysis-widgets.d.ts.map +1 -1
- package/scene-workspace/analysis-widgets.js +4 -2
- package/scene-workspace/camera-correspondence.d.ts +151 -0
- package/scene-workspace/camera-correspondence.d.ts.map +1 -0
- package/scene-workspace/camera-correspondence.js +220 -0
- package/scene-workspace/cesium-adapter.d.ts +230 -29
- package/scene-workspace/cesium-adapter.d.ts.map +1 -1
- package/scene-workspace/cesium-adapter.js +741 -56
- package/scene-workspace/cesium-mount.d.ts +205 -0
- package/scene-workspace/cesium-mount.d.ts.map +1 -0
- package/scene-workspace/cesium-mount.js +392 -0
- package/scene-workspace/cesium-scene-owner.d.ts +160 -0
- package/scene-workspace/cesium-scene-owner.d.ts.map +1 -0
- package/scene-workspace/cesium-scene-owner.js +205 -0
- package/scene-workspace/cesium-state-sync.d.ts +101 -0
- package/scene-workspace/cesium-state-sync.d.ts.map +1 -0
- package/scene-workspace/cesium-state-sync.js +432 -0
- package/scene-workspace/cesium-time.d.ts +346 -0
- package/scene-workspace/cesium-time.d.ts.map +1 -0
- package/scene-workspace/cesium-time.js +403 -0
- package/scene-workspace/index.d.ts +42 -10
- package/scene-workspace/index.d.ts.map +1 -1
- package/scene-workspace/index.js +32 -7
- package/scene-workspace/maplibre-state-sync.d.ts +112 -0
- package/scene-workspace/maplibre-state-sync.d.ts.map +1 -0
- package/scene-workspace/maplibre-state-sync.js +400 -0
- package/scene-workspace/primitives.d.ts +237 -3
- package/scene-workspace/primitives.d.ts.map +1 -1
- package/scene-workspace/primitives.js +1087 -17
- package/scene-workspace/scene-discovery.d.ts +5 -2
- package/scene-workspace/scene-discovery.d.ts.map +1 -1
- package/scene-workspace/scene-discovery.js +5 -2
- package/scene-workspace/scene-view.d.ts +5 -2
- package/scene-workspace/scene-view.d.ts.map +1 -1
- package/scene-workspace/scene-view.js +5 -2
- package/scene-workspace/source-to-cesium.d.ts +141 -8
- package/scene-workspace/source-to-cesium.d.ts.map +1 -1
- package/scene-workspace/source-to-cesium.js +497 -72
- package/scene-workspace/state-sync-port-kit.d.ts +156 -0
- package/scene-workspace/state-sync-port-kit.d.ts.map +1 -0
- package/scene-workspace/state-sync-port-kit.js +319 -0
- package/scene-workspace/state-sync.d.ts +34 -1
- package/scene-workspace/state-sync.d.ts.map +1 -1
- package/scene-workspace/state-sync.js +48 -0
- package/scene-workspace/types.d.ts +8 -0
- package/scene-workspace/types.d.ts.map +1 -1
- package/scene-workspace/types.js +2 -0
- package/scene-workspace/workspace.d.ts +12 -1
- package/scene-workspace/workspace.d.ts.map +1 -1
- package/scene-workspace/workspace.js +13 -0
- package/studio/index.d.ts +24 -7
- package/studio/index.d.ts.map +1 -1
- package/studio/index.js +21 -7
- package/studio/lifecycle-client.d.ts +164 -0
- package/studio/lifecycle-client.d.ts.map +1 -0
- package/studio/lifecycle-client.js +299 -0
- package/studio/lifecycle-errors.d.ts +91 -0
- package/studio/lifecycle-errors.d.ts.map +1 -0
- package/studio/lifecycle-errors.js +77 -0
- package/studio/lifecycle-types.d.ts +321 -0
- package/studio/lifecycle-types.d.ts.map +1 -0
- package/studio/lifecycle-types.js +22 -0
- package/web-components/controller.d.ts.map +1 -1
- package/web-components/csp-styles.d.ts +6 -0
- package/web-components/csp-styles.d.ts.map +1 -0
- package/web-components/csp-styles.js +53 -0
- package/web-components/elements.d.ts +158 -2
- package/web-components/elements.d.ts.map +1 -1
- package/web-components/elements.js +1302 -215
- package/web-components/export-redaction.d.ts +252 -0
- package/web-components/export-redaction.d.ts.map +1 -0
- package/web-components/export-redaction.js +588 -0
- package/web-components/export.d.ts +417 -0
- package/web-components/export.d.ts.map +1 -0
- package/web-components/export.js +719 -0
- package/web-components/feature-editor-model.d.ts +265 -0
- package/web-components/feature-editor-model.d.ts.map +1 -0
- package/web-components/feature-editor-model.js +438 -0
- package/web-components/feature-editor-sketch.d.ts +125 -0
- package/web-components/feature-editor-sketch.d.ts.map +1 -0
- package/web-components/feature-editor-sketch.js +194 -0
- package/web-components/feature-editor-workflow.d.ts +286 -0
- package/web-components/feature-editor-workflow.d.ts.map +1 -0
- package/web-components/feature-editor-workflow.js +889 -0
- package/web-components/feature-editor.d.ts +83 -0
- package/web-components/feature-editor.d.ts.map +1 -0
- package/web-components/feature-editor.js +829 -0
- package/web-components/feature-table-engine.d.ts +465 -0
- package/web-components/feature-table-engine.d.ts.map +1 -0
- package/web-components/feature-table-engine.js +1360 -0
- package/web-components/feature-table-view.d.ts +95 -0
- package/web-components/feature-table-view.d.ts.map +1 -0
- package/web-components/feature-table-view.js +343 -0
- package/web-components/index.d.ts +34 -3
- package/web-components/index.d.ts.map +1 -1
- package/web-components/index.js +35 -2
- package/web-components/maplibre-renderer.d.ts.map +1 -1
- package/web-components/maplibre-renderer.js +13 -4
- package/web-components/measurement.d.ts +3 -1
- package/web-components/measurement.d.ts.map +1 -1
- package/web-components/measurement.js +62 -18
- package/web-components/time-slider.d.ts +122 -0
- package/web-components/time-slider.d.ts.map +1 -0
- package/web-components/time-slider.js +740 -0
- package/web-components/types.d.ts +310 -0
- package/web-components/types.d.ts.map +1 -1
- package/webmap/convert-label.js +0 -1
- package/webmap/convert-symbol.d.ts.map +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog-driven registration APIs spanning both the `controls` and
|
|
3
|
+
* `web-components` custom-element kits (issue #679; see `./catalog.js` for
|
|
4
|
+
* the metadata these operate over).
|
|
5
|
+
*
|
|
6
|
+
* `controls`-sourced catalog entries are registered synchronously against
|
|
7
|
+
* this module's local sibling files (`./basemap-switcher.js`, `./legend.js`,
|
|
8
|
+
* `./layer-list.js`, `./swipe-control.js`) — none of them import `src/core`
|
|
9
|
+
* or `src/runtime`, so statically importing them here costs nothing beyond
|
|
10
|
+
* what `@honua/sdk-js/controls` already bundles.
|
|
11
|
+
*
|
|
12
|
+
* `web-components`-sourced entries are registered through a **dynamic**
|
|
13
|
+
* `import("../web-components/elements.js")`, so merely importing this module
|
|
14
|
+
* (or `@honua/sdk-js/controls`, which re-exports it) never pulls the
|
|
15
|
+
* `web-components` kit's `src/core` / `src/runtime` dependency into a
|
|
16
|
+
* `controls`-only bundle. That dependency is only paid the first time a
|
|
17
|
+
* caller actually registers a `web-components`-sourced tag.
|
|
18
|
+
*
|
|
19
|
+
* Critically, `web-components/elements.js` is itself side-effect-free on
|
|
20
|
+
* import — it defines the element classes, the tag→constructor lookup, and
|
|
21
|
+
* `defineHonuaWebComponent(tag)` / `defineHonuaWebComponents()`, but does not
|
|
22
|
+
* call either. (The blanket auto-registration existing
|
|
23
|
+
* `@honua/sdk-js/web-components` consumers rely on lives in
|
|
24
|
+
* `web-components/index.js`, which calls `defineHonuaWebComponents()`
|
|
25
|
+
* explicitly.) Without that separation, this module's dynamic import would
|
|
26
|
+
* evaluate `elements.js` and its auto-run would claim every tag the kit
|
|
27
|
+
* owns — including contested tags — as a side effect of registering just
|
|
28
|
+
* one, which a Rollup/Vite production build can also reorder *earlier* than
|
|
29
|
+
* intended when the dynamic import target is merged into the same chunk as a
|
|
30
|
+
* sibling static import of `@honua/sdk-js/web-components` (issue #679 PR
|
|
31
|
+
* review; this combination was the root cause of a real ordering bug in the
|
|
32
|
+
* `web-components-basic` sample before this module existed).
|
|
33
|
+
*
|
|
34
|
+
* Because both the synchronous and dynamic paths funnel through the exact
|
|
35
|
+
* same catalog + `defineIfMissing`-style guards the two kits already use,
|
|
36
|
+
* calling these functions is deterministic and idempotent regardless of how
|
|
37
|
+
* many times, in what order, or from which subpath a caller invokes them —
|
|
38
|
+
* the fix for the import-order-dependent tag ownership issue #679 tracks.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
import { type HonuaComponentCatalogEntry } from "./catalog.js";
|
|
43
|
+
/** The catalog id union; kept as `string` at the type level (see `./catalog.js`) but documented here for discoverability. */
|
|
44
|
+
export type HonuaComponentCatalogId = HonuaComponentCatalogEntry["id"];
|
|
45
|
+
/**
|
|
46
|
+
* The minimal `CustomElementRegistry` surface every registration function in
|
|
47
|
+
* this module (and both kits' existing `define*` functions) needs. A real
|
|
48
|
+
* `CustomElementRegistry`, the object `createComponentRegistry()` returns, or
|
|
49
|
+
* a hand-rolled `{ get, define }` test double all satisfy this.
|
|
50
|
+
*/
|
|
51
|
+
export type HonuaComponentRegistry = Pick<CustomElementRegistry, "get" | "define">;
|
|
52
|
+
export interface HonuaComponentRegistrationOptions {
|
|
53
|
+
/** Registry to define tags on. Defaults to the global `customElements`. */
|
|
54
|
+
readonly registry?: HonuaComponentRegistry;
|
|
55
|
+
}
|
|
56
|
+
/** Thrown by `registerComponent(s)` for an id that is not in `HONUA_COMPONENT_CATALOG`. */
|
|
57
|
+
export declare class HonuaComponentCatalogError extends Error {
|
|
58
|
+
constructor(id: string);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Registers a single catalog entry by id, e.g. `"web-components.map"` or
|
|
62
|
+
* `"controls.basemap-switcher"`. Always returns a `Promise` — `controls`
|
|
63
|
+
* entries resolve synchronously in practice, but a uniform async contract
|
|
64
|
+
* keeps this one typed shape usable for both kits (including the lazy
|
|
65
|
+
* `web-components` path) without callers branching on the id's source.
|
|
66
|
+
*
|
|
67
|
+
* Throws {@link HonuaComponentCatalogError} for an id not in the catalog.
|
|
68
|
+
* No-ops (resolves immediately) when no registry is available (Node/SSR
|
|
69
|
+
* without an explicit `registry` option) — matches every existing `define*`
|
|
70
|
+
* function's DOM-optional contract (NFR-001).
|
|
71
|
+
*/
|
|
72
|
+
export declare function registerComponent(id: HonuaComponentCatalogId, options?: HonuaComponentRegistrationOptions): Promise<void>;
|
|
73
|
+
/** Registers a named subset of catalog entries. See {@link registerComponent}. */
|
|
74
|
+
export declare function registerComponents(ids: readonly HonuaComponentCatalogId[], options?: HonuaComponentRegistrationOptions): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Registers every canonical catalog entry — i.e. everything
|
|
77
|
+
* `@honua/sdk-js/controls` + `@honua/sdk-js/web-components` would
|
|
78
|
+
* auto-register between them, from one call. Equivalent to importing both
|
|
79
|
+
* kits, without needing to import either as a side effect (useful for
|
|
80
|
+
* lazy-loading the whole component set, or for scoped-registry setups where
|
|
81
|
+
* side-effect module import cannot target a specific registry).
|
|
82
|
+
*
|
|
83
|
+
* Non-canonical entries (the `controls` implementations of `honua-legend` /
|
|
84
|
+
* `honua-layer-list`) are intentionally excluded — use
|
|
85
|
+
* {@link registerComponent} / {@link registerComponents} to opt into them
|
|
86
|
+
* explicitly.
|
|
87
|
+
*/
|
|
88
|
+
export declare function registerAllComponents(options?: HonuaComponentRegistrationOptions): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a fresh, isolated component registry: a real `CustomElementRegistry`
|
|
91
|
+
* where the runtime supports constructing one (the Scoped Custom Element
|
|
92
|
+
* Registries proposal — not yet universal), otherwise an in-memory
|
|
93
|
+
* `{ get, define }` object with the same define-once-per-tag idempotency as
|
|
94
|
+
* every `define*` function in this kit.
|
|
95
|
+
*
|
|
96
|
+
* The fallback object satisfies {@link HonuaComponentRegistry} and every
|
|
97
|
+
* kit's `define*(registry)` parameter, so it is usable anywhere a caller
|
|
98
|
+
* wants an isolated registration target (tests, multiple independent
|
|
99
|
+
* catalogs in one process) — but, unlike a real `CustomElementRegistry`, it
|
|
100
|
+
* cannot be passed to `shadowRoot`-scoped APIs like `attachShadow` on
|
|
101
|
+
* runtimes that lack native scoped-registry support.
|
|
102
|
+
*/
|
|
103
|
+
export declare function createComponentRegistry(): HonuaComponentRegistry;
|
|
104
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/controls/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,EAA2B,KAAK,0BAA0B,EAA4B,MAAM,cAAc,CAAC;AAMlH,6HAA6H;AAC7H,MAAM,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,qBAAqB,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;AAEnF,MAAM,WAAW,iCAAiC;IAChD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CAC5C;AAED,2FAA2F;AAC3F,qBAAa,0BAA2B,SAAQ,KAAK;gBAChC,EAAE,EAAE,MAAM;CAI9B;AAqBD;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,uBAAuB,EAC3B,OAAO,GAAE,iCAAsC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,kFAAkF;AAClF,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,SAAS,uBAAuB,EAAE,EACvC,OAAO,GAAE,iCAAsC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,GAAE,iCAAsC,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1G;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,IAAI,sBAAsB,CAmBhE"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog-driven registration APIs spanning both the `controls` and
|
|
3
|
+
* `web-components` custom-element kits (issue #679; see `./catalog.js` for
|
|
4
|
+
* the metadata these operate over).
|
|
5
|
+
*
|
|
6
|
+
* `controls`-sourced catalog entries are registered synchronously against
|
|
7
|
+
* this module's local sibling files (`./basemap-switcher.js`, `./legend.js`,
|
|
8
|
+
* `./layer-list.js`, `./swipe-control.js`) — none of them import `src/core`
|
|
9
|
+
* or `src/runtime`, so statically importing them here costs nothing beyond
|
|
10
|
+
* what `@honua/sdk-js/controls` already bundles.
|
|
11
|
+
*
|
|
12
|
+
* `web-components`-sourced entries are registered through a **dynamic**
|
|
13
|
+
* `import("../web-components/elements.js")`, so merely importing this module
|
|
14
|
+
* (or `@honua/sdk-js/controls`, which re-exports it) never pulls the
|
|
15
|
+
* `web-components` kit's `src/core` / `src/runtime` dependency into a
|
|
16
|
+
* `controls`-only bundle. That dependency is only paid the first time a
|
|
17
|
+
* caller actually registers a `web-components`-sourced tag.
|
|
18
|
+
*
|
|
19
|
+
* Critically, `web-components/elements.js` is itself side-effect-free on
|
|
20
|
+
* import — it defines the element classes, the tag→constructor lookup, and
|
|
21
|
+
* `defineHonuaWebComponent(tag)` / `defineHonuaWebComponents()`, but does not
|
|
22
|
+
* call either. (The blanket auto-registration existing
|
|
23
|
+
* `@honua/sdk-js/web-components` consumers rely on lives in
|
|
24
|
+
* `web-components/index.js`, which calls `defineHonuaWebComponents()`
|
|
25
|
+
* explicitly.) Without that separation, this module's dynamic import would
|
|
26
|
+
* evaluate `elements.js` and its auto-run would claim every tag the kit
|
|
27
|
+
* owns — including contested tags — as a side effect of registering just
|
|
28
|
+
* one, which a Rollup/Vite production build can also reorder *earlier* than
|
|
29
|
+
* intended when the dynamic import target is merged into the same chunk as a
|
|
30
|
+
* sibling static import of `@honua/sdk-js/web-components` (issue #679 PR
|
|
31
|
+
* review; this combination was the root cause of a real ordering bug in the
|
|
32
|
+
* `web-components-basic` sample before this module existed).
|
|
33
|
+
*
|
|
34
|
+
* Because both the synchronous and dynamic paths funnel through the exact
|
|
35
|
+
* same catalog + `defineIfMissing`-style guards the two kits already use,
|
|
36
|
+
* calling these functions is deterministic and idempotent regardless of how
|
|
37
|
+
* many times, in what order, or from which subpath a caller invokes them —
|
|
38
|
+
* the fix for the import-order-dependent tag ownership issue #679 tracks.
|
|
39
|
+
*
|
|
40
|
+
* @module
|
|
41
|
+
*/
|
|
42
|
+
import { defineHonuaBasemapSwitcher } from "./basemap-switcher.js";
|
|
43
|
+
import { HONUA_COMPONENT_CATALOG, getComponentCatalogEntry } from "./catalog.js";
|
|
44
|
+
import { globalDom } from "./element-utils.js";
|
|
45
|
+
import { defineHonuaLayerList } from "./layer-list.js";
|
|
46
|
+
import { defineHonuaLegend } from "./legend.js";
|
|
47
|
+
import { defineHonuaSwipeControl } from "./swipe-control.js";
|
|
48
|
+
/** Thrown by `registerComponent(s)` for an id that is not in `HONUA_COMPONENT_CATALOG`. */
|
|
49
|
+
export class HonuaComponentCatalogError extends Error {
|
|
50
|
+
constructor(id) {
|
|
51
|
+
super(`Unknown Honua component catalog id "${id}".`);
|
|
52
|
+
this.name = "HonuaComponentCatalogError";
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const CONTROLS_REGISTRARS = {
|
|
56
|
+
"controls.basemap-switcher": defineHonuaBasemapSwitcher,
|
|
57
|
+
"controls.swipe-control": defineHonuaSwipeControl,
|
|
58
|
+
"controls.legend": defineHonuaLegend,
|
|
59
|
+
"controls.layer-list": defineHonuaLayerList,
|
|
60
|
+
};
|
|
61
|
+
async function registerWebComponentsEntry(entry, registry) {
|
|
62
|
+
// `elements.js` is side-effect-free (see the module doc above); this only
|
|
63
|
+
// ever defines `entry.tag`, never the other 15 tags the kit owns.
|
|
64
|
+
const webComponents = await import("../web-components/elements.js");
|
|
65
|
+
webComponents.defineHonuaWebComponent(entry.tag, registry);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Registers a single catalog entry by id, e.g. `"web-components.map"` or
|
|
69
|
+
* `"controls.basemap-switcher"`. Always returns a `Promise` — `controls`
|
|
70
|
+
* entries resolve synchronously in practice, but a uniform async contract
|
|
71
|
+
* keeps this one typed shape usable for both kits (including the lazy
|
|
72
|
+
* `web-components` path) without callers branching on the id's source.
|
|
73
|
+
*
|
|
74
|
+
* Throws {@link HonuaComponentCatalogError} for an id not in the catalog.
|
|
75
|
+
* No-ops (resolves immediately) when no registry is available (Node/SSR
|
|
76
|
+
* without an explicit `registry` option) — matches every existing `define*`
|
|
77
|
+
* function's DOM-optional contract (NFR-001).
|
|
78
|
+
*/
|
|
79
|
+
export async function registerComponent(id, options = {}) {
|
|
80
|
+
const entry = getComponentCatalogEntry(id);
|
|
81
|
+
if (!entry)
|
|
82
|
+
throw new HonuaComponentCatalogError(id);
|
|
83
|
+
const registry = options.registry ?? globalDom.customElements;
|
|
84
|
+
if (!registry)
|
|
85
|
+
return;
|
|
86
|
+
if (entry.source === "controls") {
|
|
87
|
+
CONTROLS_REGISTRARS[entry.id]?.(registry);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
await registerWebComponentsEntry(entry, registry);
|
|
91
|
+
}
|
|
92
|
+
/** Registers a named subset of catalog entries. See {@link registerComponent}. */
|
|
93
|
+
export async function registerComponents(ids, options = {}) {
|
|
94
|
+
for (const id of ids) {
|
|
95
|
+
await registerComponent(id, options);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Registers every canonical catalog entry — i.e. everything
|
|
100
|
+
* `@honua/sdk-js/controls` + `@honua/sdk-js/web-components` would
|
|
101
|
+
* auto-register between them, from one call. Equivalent to importing both
|
|
102
|
+
* kits, without needing to import either as a side effect (useful for
|
|
103
|
+
* lazy-loading the whole component set, or for scoped-registry setups where
|
|
104
|
+
* side-effect module import cannot target a specific registry).
|
|
105
|
+
*
|
|
106
|
+
* Non-canonical entries (the `controls` implementations of `honua-legend` /
|
|
107
|
+
* `honua-layer-list`) are intentionally excluded — use
|
|
108
|
+
* {@link registerComponent} / {@link registerComponents} to opt into them
|
|
109
|
+
* explicitly.
|
|
110
|
+
*/
|
|
111
|
+
export async function registerAllComponents(options = {}) {
|
|
112
|
+
const canonicalIds = HONUA_COMPONENT_CATALOG.filter((entry) => entry.canonical).map((entry) => entry.id);
|
|
113
|
+
await registerComponents(canonicalIds, options);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates a fresh, isolated component registry: a real `CustomElementRegistry`
|
|
117
|
+
* where the runtime supports constructing one (the Scoped Custom Element
|
|
118
|
+
* Registries proposal — not yet universal), otherwise an in-memory
|
|
119
|
+
* `{ get, define }` object with the same define-once-per-tag idempotency as
|
|
120
|
+
* every `define*` function in this kit.
|
|
121
|
+
*
|
|
122
|
+
* The fallback object satisfies {@link HonuaComponentRegistry} and every
|
|
123
|
+
* kit's `define*(registry)` parameter, so it is usable anywhere a caller
|
|
124
|
+
* wants an isolated registration target (tests, multiple independent
|
|
125
|
+
* catalogs in one process) — but, unlike a real `CustomElementRegistry`, it
|
|
126
|
+
* cannot be passed to `shadowRoot`-scoped APIs like `attachShadow` on
|
|
127
|
+
* runtimes that lack native scoped-registry support.
|
|
128
|
+
*/
|
|
129
|
+
export function createComponentRegistry() {
|
|
130
|
+
const registryCtor = globalThis
|
|
131
|
+
.CustomElementRegistry;
|
|
132
|
+
if (typeof registryCtor === "function") {
|
|
133
|
+
try {
|
|
134
|
+
return new registryCtor();
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Some runtimes expose the constructor without allowing construction
|
|
138
|
+
// (e.g. spec-gated behind a flag); fall through to the in-memory registry.
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const defined = new Map();
|
|
142
|
+
return {
|
|
143
|
+
get: (tagName) => defined.get(tagName),
|
|
144
|
+
define: (tagName, ctor) => {
|
|
145
|
+
if (defined.has(tagName))
|
|
146
|
+
return;
|
|
147
|
+
defined.set(tagName, ctor);
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
* ## Attributes
|
|
24
24
|
* - `position` — divider position as a percentage 0–100 (default 50).
|
|
25
25
|
* - `orientation` — `"vertical"` (default) or `"horizontal"`.
|
|
26
|
-
* - `label` — accessible name of the divider
|
|
26
|
+
* - `label` — optional accessible name of the divider. Supply this from the
|
|
27
|
+
* host application's message source when the divider needs an accessible
|
|
28
|
+
* name; the control does not provide a locale-specific fallback.
|
|
27
29
|
*
|
|
28
30
|
* ## Events
|
|
29
31
|
* - `change` — `CustomEvent<HonuaSwipeChangeDetail>` (bubbles, composed)
|
|
@@ -65,6 +67,9 @@ export declare class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
65
67
|
/** Divider orientation. Reflects the `orientation` attribute. */
|
|
66
68
|
get orientation(): HonuaSwipeOrientation;
|
|
67
69
|
set orientation(value: HonuaSwipeOrientation);
|
|
70
|
+
/** Accessible name of the divider. Reflects the `label` attribute. */
|
|
71
|
+
get label(): string | null;
|
|
72
|
+
set label(value: string | null);
|
|
68
73
|
attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null): void;
|
|
69
74
|
connectedCallback(): void;
|
|
70
75
|
disconnectedCallback(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipe-control.d.ts","sourceRoot":"","sources":["../../../src/controls/swipe-control.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"swipe-control.d.ts","sourceRoot":"","sources":["../../../src/controls/swipe-control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,EAAE,eAAe,EAAgD,MAAM,oBAAoB,CAAC;AACnG,OAAO,KAAK,EAA0B,aAAa,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAM/F;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,eAAe;;IAC3D,WAAkB,kBAAkB,IAAI,MAAM,EAAE,CAE/C;IASD,mEAAmE;IACnE,IAAW,MAAM,IAAI,aAAa,GAAG,SAAS,CAE7C;IAED,IAAW,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,EAI/C;IAED,+CAA+C;IAC/C,IAAW,SAAS,IAAI,aAAa,GAAG,SAAS,CAEhD;IAED,IAAW,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,EAElD;IAED,4EAA4E;IACrE,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI;IAKtE,iFAAiF;IACjF,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,iEAAiE;IACjE,IAAW,WAAW,IAAI,qBAAqB,CAE9C;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,qBAAqB,EAGlD;IAED,sEAAsE;IACtE,IAAW,KAAK,IAAI,MAAM,GAAG,IAAI,CAEhC;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAOpC;IAEM,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAgB/F,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IA8CnC,SAAS,CAAC,MAAM,IAAI,IAAI;CA0KzB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,wBAA2B,GAAG,IAAI,CAKjF"}
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
* ## Attributes
|
|
24
24
|
* - `position` — divider position as a percentage 0–100 (default 50).
|
|
25
25
|
* - `orientation` — `"vertical"` (default) or `"horizontal"`.
|
|
26
|
-
* - `label` — accessible name of the divider
|
|
26
|
+
* - `label` — optional accessible name of the divider. Supply this from the
|
|
27
|
+
* host application's message source when the divider needs an accessible
|
|
28
|
+
* name; the control does not provide a locale-specific fallback.
|
|
27
29
|
*
|
|
28
30
|
* ## Events
|
|
29
31
|
* - `change` — `CustomEvent<HonuaSwipeChangeDetail>` (bubbles, composed)
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
*
|
|
42
44
|
* @module
|
|
43
45
|
*/
|
|
44
|
-
import { HTMLElementBase, escapeAttribute, globalDom } from "./element-utils.js";
|
|
46
|
+
import { HTMLElementBase, escapeAttribute, globalDom, renderShadowRoot } from "./element-utils.js";
|
|
45
47
|
const DEFAULT_POSITION = 50;
|
|
46
48
|
const STEP = 1;
|
|
47
49
|
const STEP_LARGE = 10;
|
|
@@ -98,6 +100,20 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
98
100
|
return;
|
|
99
101
|
this.setAttribute("orientation", value === "horizontal" ? "horizontal" : "vertical");
|
|
100
102
|
}
|
|
103
|
+
/** Accessible name of the divider. Reflects the `label` attribute. */
|
|
104
|
+
get label() {
|
|
105
|
+
return this.#label();
|
|
106
|
+
}
|
|
107
|
+
set label(value) {
|
|
108
|
+
if (typeof this.setAttribute !== "function")
|
|
109
|
+
return;
|
|
110
|
+
if (value === null) {
|
|
111
|
+
this.removeAttribute?.("label");
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
this.setAttribute("label", value);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
101
117
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
102
118
|
if (name === "position") {
|
|
103
119
|
const parsed = newValue === null ? DEFAULT_POSITION : Number(newValue);
|
|
@@ -146,7 +162,9 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
146
162
|
container.style.clipPath =
|
|
147
163
|
this.orientation === "horizontal"
|
|
148
164
|
? `inset(${pct} 0 0 0)` // hide the top portion above the divider
|
|
149
|
-
:
|
|
165
|
+
: this.#isRtl()
|
|
166
|
+
? `inset(0 ${pct} 0 0)` // hide the right portion before the divider
|
|
167
|
+
: `inset(0 0 0 ${pct})`; // hide the left portion before the divider
|
|
150
168
|
}
|
|
151
169
|
#clearClip(map) {
|
|
152
170
|
const container = map?.getContainer?.();
|
|
@@ -167,8 +185,9 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
167
185
|
this.#updateDividerDom();
|
|
168
186
|
return;
|
|
169
187
|
}
|
|
170
|
-
|
|
171
|
-
|
|
188
|
+
const label = this.#label();
|
|
189
|
+
const ariaLabel = label === null ? "" : ` aria-label="${escapeAttribute(label)}"`;
|
|
190
|
+
renderShadowRoot(root, structuralStyles(), `
|
|
172
191
|
<div
|
|
173
192
|
part="divider"
|
|
174
193
|
class="divider"
|
|
@@ -177,12 +196,12 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
177
196
|
aria-valuemin="0"
|
|
178
197
|
aria-valuemax="100"
|
|
179
198
|
aria-valuenow="${this.#position}"
|
|
180
|
-
aria-orientation="${this
|
|
181
|
-
|
|
199
|
+
aria-orientation="${this.#ariaOrientation()}"
|
|
200
|
+
${ariaLabel}
|
|
182
201
|
>
|
|
183
202
|
<span part="handle" class="handle" aria-hidden="true"></span>
|
|
184
203
|
</div>
|
|
185
|
-
|
|
204
|
+
`);
|
|
186
205
|
this.#rendered = true;
|
|
187
206
|
this.#bindDivider(root);
|
|
188
207
|
this.#updateDividerDom();
|
|
@@ -199,17 +218,21 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
199
218
|
return;
|
|
200
219
|
const pct = `${this.#position}%`;
|
|
201
220
|
if (this.orientation === "horizontal") {
|
|
202
|
-
divider.style.
|
|
203
|
-
divider.style.
|
|
221
|
+
divider.style.insetInlineStart = "0";
|
|
222
|
+
divider.style.insetBlockStart = pct;
|
|
204
223
|
}
|
|
205
224
|
else {
|
|
206
|
-
divider.style.
|
|
207
|
-
divider.style.
|
|
225
|
+
divider.style.insetBlockStart = "0";
|
|
226
|
+
divider.style.insetInlineStart = pct;
|
|
208
227
|
}
|
|
209
228
|
divider.classList?.toggle("divider-horizontal", this.orientation === "horizontal");
|
|
210
229
|
divider.setAttribute?.("aria-valuenow", String(this.#position));
|
|
211
|
-
divider.setAttribute?.("aria-orientation", this
|
|
212
|
-
|
|
230
|
+
divider.setAttribute?.("aria-orientation", this.#ariaOrientation());
|
|
231
|
+
const label = this.#label();
|
|
232
|
+
if (label === null)
|
|
233
|
+
divider.removeAttribute?.("aria-label");
|
|
234
|
+
else
|
|
235
|
+
divider.setAttribute?.("aria-label", label);
|
|
213
236
|
}
|
|
214
237
|
// ── interaction ────────────────────────────────────────────
|
|
215
238
|
#bindDivider(root) {
|
|
@@ -257,21 +280,24 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
257
280
|
: (event.clientY - rect.top) / rect.height
|
|
258
281
|
: rect.width === 0
|
|
259
282
|
? 0
|
|
260
|
-
: (
|
|
283
|
+
: this.#isRtl()
|
|
284
|
+
? 1 - (event.clientX - rect.left) / rect.width
|
|
285
|
+
: (event.clientX - rect.left) / rect.width;
|
|
261
286
|
this.#setPosition(ratio * 100, true);
|
|
262
287
|
}
|
|
263
288
|
#onKeyDown(event) {
|
|
264
289
|
const horizontal = this.orientation === "horizontal";
|
|
290
|
+
const reverseInlineDirection = !horizontal && this.#isRtl();
|
|
265
291
|
const step = event.shiftKey ? STEP_LARGE : STEP;
|
|
266
292
|
let next;
|
|
267
293
|
switch (event.key) {
|
|
268
294
|
case "ArrowRight":
|
|
269
295
|
case "ArrowDown":
|
|
270
|
-
next = this.#position + step;
|
|
296
|
+
next = this.#position + (reverseInlineDirection && event.key === "ArrowRight" ? -step : step);
|
|
271
297
|
break;
|
|
272
298
|
case "ArrowLeft":
|
|
273
299
|
case "ArrowUp":
|
|
274
|
-
next = this.#position - step;
|
|
300
|
+
next = this.#position - (reverseInlineDirection && event.key === "ArrowLeft" ? -step : step);
|
|
275
301
|
break;
|
|
276
302
|
case "Home":
|
|
277
303
|
next = horizontal ? 100 : 0;
|
|
@@ -287,11 +313,23 @@ export class HonuaSwipeControlElement extends HTMLElementBase {
|
|
|
287
313
|
}
|
|
288
314
|
// ── helpers ────────────────────────────────────────────────
|
|
289
315
|
#label() {
|
|
290
|
-
return this.#attr("label")
|
|
316
|
+
return this.#attr("label");
|
|
291
317
|
}
|
|
292
318
|
#attr(name) {
|
|
293
319
|
return typeof this.getAttribute === "function" ? this.getAttribute(name) : null;
|
|
294
320
|
}
|
|
321
|
+
#isRtl() {
|
|
322
|
+
const explicitDirection = this.#attr("dir")?.toLowerCase();
|
|
323
|
+
if (explicitDirection === "rtl")
|
|
324
|
+
return true;
|
|
325
|
+
if (explicitDirection === "ltr")
|
|
326
|
+
return false;
|
|
327
|
+
return globalDom.getComputedStyle?.(this).direction === "rtl";
|
|
328
|
+
}
|
|
329
|
+
/** ARIA describes the axis of the slider value, not the divider's visual axis. */
|
|
330
|
+
#ariaOrientation() {
|
|
331
|
+
return this.orientation === "vertical" ? "horizontal" : "vertical";
|
|
332
|
+
}
|
|
295
333
|
#reflectPosition(value) {
|
|
296
334
|
if (typeof this.setAttribute !== "function" || typeof this.getAttribute !== "function")
|
|
297
335
|
return;
|
|
@@ -330,12 +368,25 @@ function clampPercent(value) {
|
|
|
330
368
|
/** Structural-only styles; theme via `::part(divider)` / `::part(handle)`. */
|
|
331
369
|
function structuralStyles() {
|
|
332
370
|
return `
|
|
333
|
-
:host {
|
|
371
|
+
:host {
|
|
372
|
+
position: absolute;
|
|
373
|
+
inset: 0;
|
|
374
|
+
display: block;
|
|
375
|
+
box-sizing: border-box;
|
|
376
|
+
min-width: 0;
|
|
377
|
+
max-width: 100%;
|
|
378
|
+
min-height: 0;
|
|
379
|
+
max-height: 100%;
|
|
380
|
+
pointer-events: none;
|
|
381
|
+
}
|
|
334
382
|
.divider {
|
|
335
383
|
position: absolute;
|
|
336
|
-
|
|
384
|
+
inset-block-start: 0;
|
|
337
385
|
block-size: 100%;
|
|
338
386
|
inline-size: 0;
|
|
387
|
+
box-sizing: border-box;
|
|
388
|
+
max-width: 100%;
|
|
389
|
+
max-height: 100%;
|
|
339
390
|
border-inline-start: 2px solid currentColor;
|
|
340
391
|
transform: translateX(-1px);
|
|
341
392
|
cursor: ew-resize;
|
|
@@ -364,5 +415,16 @@ function structuralStyles() {
|
|
|
364
415
|
inset-block-start: 0;
|
|
365
416
|
inset-inline-start: 50%;
|
|
366
417
|
}
|
|
418
|
+
@media (forced-colors: active), (prefers-contrast: more) {
|
|
419
|
+
.divider {
|
|
420
|
+
forced-color-adjust: none;
|
|
421
|
+
border-color: ButtonText;
|
|
422
|
+
}
|
|
423
|
+
.handle {
|
|
424
|
+
background: ButtonText;
|
|
425
|
+
outline: 2px solid Canvas;
|
|
426
|
+
outline-offset: 1px;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
367
429
|
`;
|
|
368
430
|
}
|
package/core/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type HonuaMetadataRequestOptions } from "./cache-state.js";
|
|
|
2
2
|
import { HonuaOdataEntitySet } from "./odata.js";
|
|
3
3
|
import { type OgcApiLayoutMode } from "./ogc-endpoint-layout.js";
|
|
4
4
|
import { HonuaOgcMaps } from "./ogc-maps.js";
|
|
5
|
+
import type { HonuaOgcProcessesOptions } from "./ogc-processes.js";
|
|
5
6
|
import { HonuaOgcProcesses } from "./ogc-processes.js";
|
|
6
7
|
import { HonuaOgcRecords } from "./ogc-records.js";
|
|
7
8
|
import { HonuaOgcTiles } from "./ogc-tiles.js";
|
|
@@ -9,7 +10,7 @@ import { type HonuaProcessRunner } from "./process-runner.js";
|
|
|
9
10
|
import type { GeospatialGrpcProcessClient, HonuaProcessAdapter } from "./process-runner.js";
|
|
10
11
|
import { HonuaStacSearch } from "./stac.js";
|
|
11
12
|
import { HonuaFeatureLayer, HonuaGeometryService, HonuaGeoprocessingService, HonuaImageService, HonuaMapLayer, HonuaMapService, HonuaOgcFeatures, HonuaService } from "./surfaces.js";
|
|
12
|
-
import type { ApplyEditsRequest, ExportMapRequest, HonuaApplyEditsResponse, HonuaAuthCredentials, HonuaAuthRefreshReason, HonuaAuthRevocationContext, HonuaClientOptions, HonuaCompatibilityRequest, HonuaExportMapResponse, HonuaFeature, HonuaFindResponse, HonuaIdentifyResponse, HonuaLayerMetadata, HonuaLegendResponse, HonuaOgcCollectionMetadata, HonuaOgcCollectionsResponse, HonuaOgcConformanceResponse, HonuaOgcFeatureCollectionResponse, HonuaOgcFeatureResponse, HonuaOgcLandingResponse, HonuaOgcMapImageResponse, HonuaOgcProcessDescription, HonuaOgcProcessJobAccepted, HonuaOgcProcessJobResults, HonuaOgcProcessJobStatus, HonuaOgcProcessesResponse, HonuaOgcQueryablesResponse, HonuaOgcRecordResponse, HonuaOgcRecordsResponse, HonuaOgcTileMatrixSet, HonuaOgcTileMatrixSetsResponse, HonuaOgcTileResponse, HonuaOgcTilesetMetadata, HonuaOgcTilesetsResponse, HonuaQueryResponse, HonuaRawRequest, HonuaRelatedRecordsResponse, HonuaServerCompatibility, HonuaServerCompatibilityFeature, HonuaServerCompatibilityStatus, HonuaServiceMetadata, HonuaServicesResponse, HonuaStacItemCollectionResponse, HonuaStacItemResponse, HonuaStacLandingResponse, MapFindRequest, MapIdentifyRequest, MapLayerQueryRequest, MapLegendRequest, MapRelatedRecordsRequest, MigrationInventoryScanRequest, MigrationSourceInventoryArtifact, OgcCollectionRequest, OgcCreateItemRequest, OgcDeleteItemRequest, OgcEndpointLayout, OgcItemRequest, OgcItemsRequest, OgcMapImageRequest, OgcMetadataRequest, OgcPatchItemRequest, OgcProcessExecuteRequest, OgcRecordItemRequest, OgcRecordRawItemRequest, OgcRecordsRawSearchRequest, OgcRecordsSearchRequest, OgcReplaceItemRequest, OgcTileRequest, OgcTilesetRequest, OgcTilesetsRequest, QueryFeaturesRequest, QueryMethod, QueryRelatedRecordsRequest, StacSearchRequest } from "./types.js";
|
|
13
|
+
import type { ApplyEditsRequest, ExportMapRequest, HonuaApplyEditsResponse, HonuaAuthCredentials, HonuaAuthRefreshReason, HonuaAuthRevocationContext, HonuaClientOptions, HonuaCompatibilityRequest, HonuaExportMapResponse, HonuaFeature, HonuaFindResponse, HonuaIdentifyResponse, HonuaLayerMetadata, HonuaLegendResponse, HonuaOgcCollectionMetadata, HonuaOgcCollectionsResponse, HonuaOgcConformanceResponse, HonuaOgcFeatureCollectionResponse, HonuaOgcFeatureResponse, HonuaOgcLandingResponse, HonuaOgcMapImageResponse, HonuaOgcProcessDescription, HonuaOgcProcessJobAccepted, HonuaOgcProcessJobResults, HonuaOgcProcessJobStatus, HonuaOgcProcessesResponse, HonuaOgcQueryablesResponse, HonuaOgcRecordResponse, HonuaOgcRecordsResponse, HonuaOgcTileMatrixSet, HonuaOgcTileMatrixSetsResponse, HonuaOgcTileResponse, HonuaOgcTilesetMetadata, HonuaOgcTilesetsResponse, HonuaQueryResponse, HonuaRawRequest, HonuaRelatedRecordsResponse, HonuaRequestContext, HonuaServerCompatibility, HonuaServerCompatibilityFeature, HonuaServerCompatibilityStatus, HonuaServiceMetadata, HonuaServicesResponse, HonuaStacItemCollectionResponse, HonuaStacItemResponse, HonuaStacLandingResponse, MapFindRequest, MapIdentifyRequest, MapLayerQueryRequest, MapLegendRequest, MapRelatedRecordsRequest, MigrationInventoryScanRequest, MigrationSourceInventoryArtifact, OgcCollectionRequest, OgcCreateItemRequest, OgcDeleteItemRequest, OgcEndpointLayout, OgcItemRequest, OgcItemsRequest, OgcMapImageRequest, OgcMetadataRequest, OgcPatchItemRequest, OgcProcessExecuteRequest, OgcProcessJobRequest, OgcRecordItemRequest, OgcRecordRawItemRequest, OgcRecordsRawSearchRequest, OgcRecordsSearchRequest, OgcReplaceItemRequest, OgcTileRequest, OgcTilesetRequest, OgcTilesetsRequest, QueryFeaturesRequest, QueryMethod, QueryRelatedRecordsRequest, StacSearchRequest } from "./types.js";
|
|
13
14
|
import { HonuaWfs } from "./wfs.js";
|
|
14
15
|
import type { WmsCapabilities } from "./wms-capabilities.js";
|
|
15
16
|
import type { HonuaWmsFeatureInfoResponse, HonuaWmsImageResponse, HonuaWmtsFeatureInfoResponse, HonuaWmtsTileResponse, WmsFeatureInfoRequest, WmsLegendRequest, WmsMapRequest, WmtsFeatureInfoRequest, WmtsTileRequest } from "./wms-types.js";
|
|
@@ -252,13 +253,23 @@ export declare class HonuaClient {
|
|
|
252
253
|
ogcRecords(): HonuaOgcRecords;
|
|
253
254
|
wms(serviceId: string): HonuaWms;
|
|
254
255
|
wmts(serviceId: string): HonuaWmts;
|
|
255
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Construct the OGC API Processes client wrapper.
|
|
258
|
+
*
|
|
259
|
+
* `basePath` pins every describe / execute / job route to a raw third-party
|
|
260
|
+
* service root (as discovered by `discoverOgcProcesses()`); omitting it uses
|
|
261
|
+
* the Honua facade prefix `/ogc/processes`. Pass the discovery result (or a
|
|
262
|
+
* `/conformance` response) as `conformance` — and optionally
|
|
263
|
+
* `capabilityPolicy: "strict"` — to gate execution and dismissal against what
|
|
264
|
+
* the server actually declares.
|
|
265
|
+
*/
|
|
266
|
+
ogcProcesses(options?: Omit<HonuaOgcProcessesOptions, "client">): HonuaOgcProcesses;
|
|
256
267
|
stac(): HonuaStacSearch;
|
|
257
268
|
imageService(serviceId: string): HonuaImageService;
|
|
258
269
|
geometryService(): HonuaGeometryService;
|
|
259
270
|
geoprocessing(serviceId: string, taskName?: string): HonuaGeoprocessingService;
|
|
260
271
|
processRunner(adapter: HonuaProcessAdapter): HonuaProcessRunner;
|
|
261
|
-
ogcProcessRunner(): HonuaProcessRunner;
|
|
272
|
+
ogcProcessRunner(options?: Omit<HonuaOgcProcessesOptions, "client">): HonuaProcessRunner;
|
|
262
273
|
geoprocessingRunner(serviceId: string, taskName?: string): HonuaProcessRunner;
|
|
263
274
|
geospatialGrpcProcessRunner(processClient: GeospatialGrpcProcessClient): HonuaProcessRunner;
|
|
264
275
|
wfs(endpointUrl?: string, options?: {
|
|
@@ -363,6 +374,26 @@ export declare class HonuaClient {
|
|
|
363
374
|
okStatuses?: readonly number[];
|
|
364
375
|
redirect?: "safe-follow" | "error" | "manual";
|
|
365
376
|
discardErrorBody?: boolean;
|
|
377
|
+
/**
|
|
378
|
+
* Invoked immediately before every physical fetch attempt, including
|
|
379
|
+
* retry and replay-safe authentication attempts. Bounded callers use
|
|
380
|
+
* this guard to reserve request and byte budgets before network I/O.
|
|
381
|
+
*/
|
|
382
|
+
beforeAttempt?: (request: Readonly<HonuaRequestContext>, attempt: number) => void | Promise<void>;
|
|
383
|
+
/**
|
|
384
|
+
* Invoked before credential refresh or retry backoff can lead to another
|
|
385
|
+
* physical request. Single-attempt binary lanes throw here so a response
|
|
386
|
+
* that cannot be replayed never waits on work whose only purpose is replay.
|
|
387
|
+
*/
|
|
388
|
+
beforeReplay?: (request: Readonly<HonuaRequestContext>, statusCode: number | undefined, reason: "authentication" | "retry") => void | Promise<void>;
|
|
389
|
+
/**
|
|
390
|
+
* Validate and replace a successful response before `after`
|
|
391
|
+
* interceptors run. The callback remains inside the request timeout and
|
|
392
|
+
* receives its combined caller/deadline signal. Bounded binary lanes use
|
|
393
|
+
* this to consume the network stream under a hard ceiling, then return
|
|
394
|
+
* an in-memory response that interceptors may inspect safely.
|
|
395
|
+
*/
|
|
396
|
+
prepareResponse?: (response: Response, deadlineSignal: AbortSignal | undefined) => Promise<Response>;
|
|
366
397
|
}): Promise<Response>;
|
|
367
398
|
private requestCachedMetadataJson;
|
|
368
399
|
private staleMetadataFallback;
|
|
@@ -475,24 +506,9 @@ export declare class HonuaClient {
|
|
|
475
506
|
processId: string;
|
|
476
507
|
} & OgcMetadataRequest): Promise<HonuaOgcProcessDescription>;
|
|
477
508
|
executeOgcProcess(request: OgcProcessExecuteRequest): Promise<HonuaOgcProcessJobAccepted>;
|
|
478
|
-
getOgcProcessJob(request:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
responseFormat?: string;
|
|
482
|
-
extraParams?: Record<string, string | number | boolean>;
|
|
483
|
-
}): Promise<HonuaOgcProcessJobStatus>;
|
|
484
|
-
getOgcProcessJobResults(request: {
|
|
485
|
-
jobId: string;
|
|
486
|
-
signal?: AbortSignal;
|
|
487
|
-
responseFormat?: string;
|
|
488
|
-
extraParams?: Record<string, string | number | boolean>;
|
|
489
|
-
}): Promise<HonuaOgcProcessJobResults>;
|
|
490
|
-
cancelOgcProcessJob(request: {
|
|
491
|
-
jobId: string;
|
|
492
|
-
signal?: AbortSignal;
|
|
493
|
-
responseFormat?: string;
|
|
494
|
-
extraParams?: Record<string, string | number | boolean>;
|
|
495
|
-
}): Promise<HonuaOgcProcessJobStatus>;
|
|
509
|
+
getOgcProcessJob(request: OgcProcessJobRequest): Promise<HonuaOgcProcessJobStatus>;
|
|
510
|
+
getOgcProcessJobResults(request: OgcProcessJobRequest): Promise<HonuaOgcProcessJobResults>;
|
|
511
|
+
cancelOgcProcessJob(request: OgcProcessJobRequest): Promise<HonuaOgcProcessJobStatus>;
|
|
496
512
|
getStacLanding(request?: OgcMetadataRequest): Promise<HonuaStacLandingResponse>;
|
|
497
513
|
listStacCollections(request?: OgcMetadataRequest): Promise<HonuaOgcCollectionsResponse>;
|
|
498
514
|
getStacCollection(request: OgcCollectionRequest): Promise<HonuaOgcCollectionMetadata>;
|
|
@@ -563,6 +579,8 @@ export declare class HonuaClient {
|
|
|
563
579
|
contentType?: string;
|
|
564
580
|
body?: BodyInit;
|
|
565
581
|
signal?: AbortSignal;
|
|
582
|
+
/** Maximum response-body bytes accepted before text decoding/parsing. */
|
|
583
|
+
maxResponseBytes?: number;
|
|
566
584
|
}): Promise<{
|
|
567
585
|
text: string;
|
|
568
586
|
contentType: string;
|
|
@@ -604,6 +622,12 @@ export declare class HonuaClient {
|
|
|
604
622
|
/** Whether any registered interceptor inspects responses (`after` hook). */
|
|
605
623
|
private hasAfterInterceptors;
|
|
606
624
|
private applyErrorInterceptors;
|
|
625
|
+
/**
|
|
626
|
+
* Start every terminal error hook independently so one nonsettling hook
|
|
627
|
+
* cannot prevent later hooks from observing the same failure. Each hook is
|
|
628
|
+
* contained so a detached deadline notification can never reject unhandled.
|
|
629
|
+
*/
|
|
630
|
+
private applyErrorInterceptorsConcurrently;
|
|
607
631
|
private refreshReplaySafeRequestAuth;
|
|
608
632
|
private sleepBeforeRetry;
|
|
609
633
|
}
|