@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,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app-platform sketch default for `<honua-feature-editor>` (issue #680,
|
|
3
|
+
* REQ-002): a terra-draw-backed geometry adapter that stays bound across the
|
|
4
|
+
* editor's draft lifecycle.
|
|
5
|
+
*
|
|
6
|
+
* The SDK already ships the renderer-neutral sketch/snapping seam
|
|
7
|
+
* (`bindTerraDrawSketch`, `createTerraDrawSketch`, `createTerraDrawSnapping`,
|
|
8
|
+
* `terraDrawSketchToolCapabilities` on `@honua/sdk-js/runtime`). What
|
|
9
|
+
* app-platform adds here is *lifecycle composition*: a
|
|
10
|
+
* {@link HonuaFeatureEditorWorkflow} builds a fresh contract sketch workflow
|
|
11
|
+
* every time a draft opens, so a one-shot binding would silently stop driving
|
|
12
|
+
* the editor after the first submit. {@link bindEditorSketch} watches the
|
|
13
|
+
* workflow and re-binds terra-draw to each new draft's model, and reports
|
|
14
|
+
* terra-draw's true tool support (which upgrades `rectangle` / `circle` from
|
|
15
|
+
* the contract's renderer-support-required defaults) into the workflow so the
|
|
16
|
+
* editor's tool buttons are truthful.
|
|
17
|
+
*
|
|
18
|
+
* terra-draw itself stays an optional peer: {@link bindEditorSketch} takes a
|
|
19
|
+
* duck-typed instance the app already constructed, and only
|
|
20
|
+
* {@link createTerraDrawEditorSketch} — the one-call default — pulls the peer
|
|
21
|
+
* in, through the runtime module's own lazy `import()`.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { resolveSnappingConfig } from "../contract/edit-snapping.js";
|
|
26
|
+
import { bindTerraDrawSketch, createTerraDrawSketch, terraDrawSketchToolCapabilities, } from "../runtime/terra-draw-sketch.js";
|
|
27
|
+
/**
|
|
28
|
+
* Binds an already-constructed terra-draw instance to an editor workflow, and
|
|
29
|
+
* keeps it bound as drafts open and close.
|
|
30
|
+
*
|
|
31
|
+
* Also reports terra-draw's real tool support into the workflow, so the
|
|
32
|
+
* editor's `rectangle` / `circle` buttons become enabled instead of showing
|
|
33
|
+
* the contract's "requires renderer support" reason.
|
|
34
|
+
*/
|
|
35
|
+
export function bindEditorSketch(draw, options) {
|
|
36
|
+
return createAdapter(options, () => draw);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Snapping options to hand terra-draw for an editor workflow.
|
|
40
|
+
*
|
|
41
|
+
* terra-draw resolves `snapping.toCustom` once per mode, at construction, and
|
|
42
|
+
* `createTerraDrawSnapping` captures the `model` it is given — but the editor
|
|
43
|
+
* builds a *new* contract sketch model for every draft. Passing the model
|
|
44
|
+
* directly would pin snapping to the first draft forever, so
|
|
45
|
+
* `setSnapping(...)` on any later draft would silently do nothing.
|
|
46
|
+
*
|
|
47
|
+
* This returns a stable options object whose `model` is a thin live view that
|
|
48
|
+
* resolves the workflow's *current* model on each pointer event, falling back
|
|
49
|
+
* to `config` (or disabled snapping) while no draft is open.
|
|
50
|
+
*
|
|
51
|
+
* Use it when constructing terra-draw yourself alongside
|
|
52
|
+
* {@link bindEditorSketch}; {@link createTerraDrawEditorSketch} applies it for
|
|
53
|
+
* you.
|
|
54
|
+
*/
|
|
55
|
+
export function editorSnappingOptions(workflow, snapping) {
|
|
56
|
+
const fallback = resolveSnappingConfig(snapping.config ?? { enabled: false });
|
|
57
|
+
const liveModel = {
|
|
58
|
+
snappingConfig: () => workflow.sketchModel()?.snappingConfig() ?? fallback,
|
|
59
|
+
};
|
|
60
|
+
// Deliberately no `config`: `createTerraDrawSnapping` only consults the model
|
|
61
|
+
// when `config` is absent, which is exactly the live path we want.
|
|
62
|
+
return { index: snapping.index, model: liveModel };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The app-platform terra-draw default: constructs terra-draw for a MapLibre
|
|
66
|
+
* map (pulling the optional `terra-draw` peers lazily through the runtime
|
|
67
|
+
* module), wires SDK snapping, and binds it to the editor workflow for the
|
|
68
|
+
* lifetime of the adapter.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const workflow = createFeatureEditorWorkflow({ source });
|
|
73
|
+
* const sketch = await createTerraDrawEditorSketch(map, { workflow });
|
|
74
|
+
* editor.workflow = workflow; // <honua-feature-editor>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export async function createTerraDrawEditorSketch(map, options) {
|
|
78
|
+
const { workflow } = options;
|
|
79
|
+
workflow.configureSketchTools(terraDrawSketchToolCapabilities(options.modes));
|
|
80
|
+
const model = workflow.sketchModel() ?? bootstrapModel(workflow);
|
|
81
|
+
const snapping = options.snapping ? editorSnappingOptions(workflow, options.snapping) : undefined;
|
|
82
|
+
const controller = await createTerraDrawSketch(map, {
|
|
83
|
+
model,
|
|
84
|
+
...bindPassThrough(options),
|
|
85
|
+
...(snapping ? { snapping } : {}),
|
|
86
|
+
});
|
|
87
|
+
// The controller's own binding covers whichever model existed at
|
|
88
|
+
// construction; the adapter owns every binding from here on.
|
|
89
|
+
controller.remove();
|
|
90
|
+
const adapter = createAdapter(options, () => controller.draw);
|
|
91
|
+
return {
|
|
92
|
+
...adapter,
|
|
93
|
+
setTool: (tool) => adapter.setTool(tool),
|
|
94
|
+
select: () => adapter.select(),
|
|
95
|
+
cancel: () => adapter.cancel(),
|
|
96
|
+
undo: () => adapter.undo(),
|
|
97
|
+
redo: () => adapter.redo(),
|
|
98
|
+
syncFromModel: () => adapter.syncFromModel(),
|
|
99
|
+
ready: () => adapter.ready(),
|
|
100
|
+
remove: () => adapter.remove(),
|
|
101
|
+
stop() {
|
|
102
|
+
adapter.remove();
|
|
103
|
+
controller.stop();
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
// ── shared adapter ───────────────────────────────────────────────────────
|
|
108
|
+
function createAdapter(options, drawOf) {
|
|
109
|
+
const { workflow } = options;
|
|
110
|
+
// Report terra-draw's real tool support so the editor's rectangle / circle
|
|
111
|
+
// buttons stop showing the contract's "requires renderer support" reason.
|
|
112
|
+
workflow.configureSketchTools(terraDrawSketchToolCapabilities(options.modes));
|
|
113
|
+
let handle;
|
|
114
|
+
let bound;
|
|
115
|
+
let pending = Promise.resolve();
|
|
116
|
+
let removed = false;
|
|
117
|
+
const rebind = () => {
|
|
118
|
+
if (removed)
|
|
119
|
+
return;
|
|
120
|
+
const model = workflow.sketchModel();
|
|
121
|
+
if (model === bound)
|
|
122
|
+
return;
|
|
123
|
+
handle?.remove();
|
|
124
|
+
handle = undefined;
|
|
125
|
+
bound = model;
|
|
126
|
+
if (!model)
|
|
127
|
+
return;
|
|
128
|
+
handle = bindTerraDrawSketch(drawOf(), { model, ...bindPassThrough(options) });
|
|
129
|
+
};
|
|
130
|
+
const schedule = () => {
|
|
131
|
+
pending = pending.then(() => {
|
|
132
|
+
rebind();
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const subscription = workflow.subscribe(schedule);
|
|
136
|
+
rebind();
|
|
137
|
+
return {
|
|
138
|
+
setTool(tool) {
|
|
139
|
+
if (handle)
|
|
140
|
+
return handle.setTool(tool);
|
|
141
|
+
return workflow.startSketch(tool);
|
|
142
|
+
},
|
|
143
|
+
select() {
|
|
144
|
+
handle?.select();
|
|
145
|
+
},
|
|
146
|
+
cancel() {
|
|
147
|
+
handle?.cancel();
|
|
148
|
+
},
|
|
149
|
+
undo() {
|
|
150
|
+
return handle ? handle.undo() : workflow.undo();
|
|
151
|
+
},
|
|
152
|
+
redo() {
|
|
153
|
+
return handle ? handle.redo() : workflow.redo();
|
|
154
|
+
},
|
|
155
|
+
syncFromModel() {
|
|
156
|
+
return handle?.syncFromModel() ?? false;
|
|
157
|
+
},
|
|
158
|
+
ready() {
|
|
159
|
+
return pending;
|
|
160
|
+
},
|
|
161
|
+
remove() {
|
|
162
|
+
removed = true;
|
|
163
|
+
subscription.remove();
|
|
164
|
+
handle?.remove();
|
|
165
|
+
handle = undefined;
|
|
166
|
+
bound = undefined;
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function bindPassThrough(options) {
|
|
171
|
+
return {
|
|
172
|
+
...(options.transformGeometry ? { transformGeometry: options.transformGeometry } : {}),
|
|
173
|
+
...(options.restoreGeometry ? { restoreGeometry: options.restoreGeometry } : {}),
|
|
174
|
+
...(options.featureFilter ? { featureFilter: options.featureFilter } : {}),
|
|
175
|
+
...(options.toolForMode ? { toolForMode: options.toolForMode } : {}),
|
|
176
|
+
...(options.onFinish ? { onFinish: options.onFinish } : {}),
|
|
177
|
+
...(options.onDelete ? { onDelete: options.onDelete } : {}),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* terra-draw needs a model at construction time, but an editor may have no
|
|
182
|
+
* draft open yet. Opening a throwaway create draft yields a real contract
|
|
183
|
+
* sketch workflow to construct against; the adapter re-binds to whatever draft
|
|
184
|
+
* the host opens next.
|
|
185
|
+
*/
|
|
186
|
+
function bootstrapModel(workflow) {
|
|
187
|
+
workflow.begin("create");
|
|
188
|
+
const model = workflow.sketchModel();
|
|
189
|
+
if (!model) {
|
|
190
|
+
throw new Error("createTerraDrawEditorSketch: the editor workflow could not open a draft to bind terra-draw against " +
|
|
191
|
+
"(the source does not support editing). Bind a sketch adapter only to an editable source.");
|
|
192
|
+
}
|
|
193
|
+
return model;
|
|
194
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host-facing edit workflow behind `<honua-feature-editor>` (issue #680).
|
|
3
|
+
*
|
|
4
|
+
* This is the composition layer: it owns a public contract
|
|
5
|
+
* {@link EditSketchWorkflowModel} (which itself owns the edit session, undo /
|
|
6
|
+
* redo, snapping, attachment staging, optimistic hooks, and the single
|
|
7
|
+
* `applyEdits` call) and adds only what an operational editing UI needs on top
|
|
8
|
+
* and the protocol layer deliberately does not model:
|
|
9
|
+
*
|
|
10
|
+
* - **Draft identity.** A draft is scoped to `source` + feature id + the
|
|
11
|
+
* concurrency token observed when it opened, so an unrelated realtime change
|
|
12
|
+
* can be recognised and ignored without disturbing the form
|
|
13
|
+
* ({@link HonuaFeatureEditorWorkflow.applyExternalChange}, REQ-005).
|
|
14
|
+
* - **Subtype-aware pre-transport validation.** Subtype overrides change the
|
|
15
|
+
* valid choices per field. Rather than duplicating the contract validator,
|
|
16
|
+
* {@link HonuaFeatureEditorWorkflow.validate} builds a throwaway
|
|
17
|
+
* `createEditSession` over the *subtype-resolved* field list and runs the
|
|
18
|
+
* contract's own `validate()` against it, merging the result with the live
|
|
19
|
+
* model's session-level verdict. An invalid draft is rejected with
|
|
20
|
+
* `transported: false` — nothing reaches the wire.
|
|
21
|
+
* - **An explicit conflict gate.** A version/etag/precondition failure (or a
|
|
22
|
+
* divergent external change) parks the draft in `"conflict"`; `submit()`
|
|
23
|
+
* refuses to retransport until {@link HonuaFeatureEditorWorkflow.resolveConflict}
|
|
24
|
+
* records a decision (REQ-004 / REQ-005).
|
|
25
|
+
* - **Redacted state.** Snapshots and events describe staged attachments but
|
|
26
|
+
* never carry the payload — a `Blob` or a (possibly credential-bearing)
|
|
27
|
+
* string URL stays inside the edit session.
|
|
28
|
+
*
|
|
29
|
+
* No protocol adapter is imported and no status is ever optimistic about a
|
|
30
|
+
* rejected edit: every non-`"succeeded"` submit result maps to
|
|
31
|
+
* `"rejected"` / `"conflict"` / `"unsupported"` / `"cancelled"`, never
|
|
32
|
+
* `"committed"`.
|
|
33
|
+
*
|
|
34
|
+
* @module
|
|
35
|
+
*/
|
|
36
|
+
import { type EditWorkflowFailureKind, type EditWorkflowField, type EditWorkflowMetadataOptions, type EditWorkflowOperation, type EditWorkflowOptimisticHooks, type EditWorkflowValidationResult } from "../contract/edit-session.js";
|
|
37
|
+
import { type EditSketchTool, type EditSketchToolCapability, type EditSketchToolCapabilityInput, type EditSketchUndoSnapshot, type EditSketchWorkflowModel } from "../contract/edit-sketch.js";
|
|
38
|
+
import type { SnappingConfig } from "../contract/edit-snapping.js";
|
|
39
|
+
import type { CanonicalFeature, FeatureId, Source, SourceId } from "../contract/types.js";
|
|
40
|
+
import { type HonuaEditorAttachmentDraft, type HonuaEditorFormModel, type HonuaEditorOperation, type HonuaEditorOperationAvailability, type HonuaEditorOperationOverrides, type HonuaEditorSubtypeConfig } from "./feature-editor-model.js";
|
|
41
|
+
/** Lifecycle state of the editor. Never `"committed"` for a rejected edit. */
|
|
42
|
+
export type HonuaFeatureEditorStatus = "idle" | "draft" | "submitting" | "committed" | "rejected" | "conflict" | "cancelled" | "unsupported";
|
|
43
|
+
/** Identity a draft is scoped to until it is accepted. */
|
|
44
|
+
export interface HonuaFeatureEditorIdentity {
|
|
45
|
+
readonly sourceId: SourceId;
|
|
46
|
+
readonly featureId?: FeatureId;
|
|
47
|
+
/** Concurrency token observed when the draft opened, when the source has one. */
|
|
48
|
+
readonly version?: unknown;
|
|
49
|
+
readonly versionField?: string;
|
|
50
|
+
}
|
|
51
|
+
/** A failure surfaced to the UI, normalized from the contract's own failure list. */
|
|
52
|
+
export interface HonuaFeatureEditorFailure {
|
|
53
|
+
readonly kind: EditWorkflowFailureKind;
|
|
54
|
+
readonly operation: EditWorkflowOperation;
|
|
55
|
+
readonly code?: number;
|
|
56
|
+
readonly description: string;
|
|
57
|
+
}
|
|
58
|
+
/** How a conflicting draft may be resolved. */
|
|
59
|
+
export type HonuaFeatureEditorConflictChoice = "keep-mine" | "discard-mine" | "reload";
|
|
60
|
+
/** An unresolved conflict. `submit()` refuses to transport while this is set. */
|
|
61
|
+
export interface HonuaFeatureEditorConflict {
|
|
62
|
+
readonly reason: string;
|
|
63
|
+
readonly versionField?: string;
|
|
64
|
+
/** Token the draft carries. */
|
|
65
|
+
readonly mine?: unknown;
|
|
66
|
+
/** Token observed on the server / in the external change, when known. */
|
|
67
|
+
readonly theirs?: unknown;
|
|
68
|
+
readonly choices: readonly HonuaFeatureEditorConflictChoice[];
|
|
69
|
+
}
|
|
70
|
+
/** Geometry / sketch state, mirrored from the contract sketch workflow. */
|
|
71
|
+
export interface HonuaFeatureEditorSketchState {
|
|
72
|
+
readonly status: "idle" | "sketching" | "ready" | "unsupported";
|
|
73
|
+
readonly activeTool?: EditSketchTool;
|
|
74
|
+
readonly tools: readonly EditSketchToolCapability[];
|
|
75
|
+
readonly geometry: Record<string, unknown> | null | undefined;
|
|
76
|
+
readonly snapping: Pick<SnappingConfig, "enabled" | "tolerance">;
|
|
77
|
+
}
|
|
78
|
+
/** Everything the editor UI renders. Carries no attachment payloads. */
|
|
79
|
+
export interface HonuaFeatureEditorSnapshot {
|
|
80
|
+
readonly status: HonuaFeatureEditorStatus;
|
|
81
|
+
readonly operation?: HonuaEditorOperation;
|
|
82
|
+
readonly identity?: HonuaFeatureEditorIdentity;
|
|
83
|
+
readonly operations: readonly HonuaEditorOperationAvailability[];
|
|
84
|
+
readonly form?: HonuaEditorFormModel;
|
|
85
|
+
readonly sketch?: HonuaFeatureEditorSketchState;
|
|
86
|
+
readonly undo: EditSketchUndoSnapshot;
|
|
87
|
+
readonly attachments: readonly HonuaEditorAttachmentDraft[];
|
|
88
|
+
readonly attachmentsSupported: boolean;
|
|
89
|
+
readonly failures: readonly HonuaFeatureEditorFailure[];
|
|
90
|
+
readonly conflict?: HonuaFeatureEditorConflict;
|
|
91
|
+
readonly dirty: boolean;
|
|
92
|
+
readonly busy: boolean;
|
|
93
|
+
readonly message: string;
|
|
94
|
+
readonly committedFeatureId?: FeatureId;
|
|
95
|
+
}
|
|
96
|
+
/** Outcome of a `submit()` / `retry()`. `transported` is false for pre-flight rejections. */
|
|
97
|
+
export interface HonuaFeatureEditorCommit {
|
|
98
|
+
readonly status: HonuaFeatureEditorStatus;
|
|
99
|
+
readonly operation: HonuaEditorOperation;
|
|
100
|
+
readonly transported: boolean;
|
|
101
|
+
readonly committedFeatureId?: FeatureId;
|
|
102
|
+
readonly failures: readonly HonuaFeatureEditorFailure[];
|
|
103
|
+
readonly attachments: readonly HonuaEditorAttachmentDraft[];
|
|
104
|
+
readonly snapshot: HonuaFeatureEditorSnapshot;
|
|
105
|
+
/**
|
|
106
|
+
* True when this submit no longer owned the workflow by the time the
|
|
107
|
+
* transport settled — a newer draft had already been opened (or the draft was
|
|
108
|
+
* cancelled and replaced). The workflow state was left entirely to the newer
|
|
109
|
+
* draft, so `status` is reported as `"cancelled"` and `snapshot` describes the
|
|
110
|
+
* *current* draft, not this one. The server outcome for the superseded edit is
|
|
111
|
+
* in `failures` (empty means the service reported no failure), but the
|
|
112
|
+
* workflow makes no claim about it.
|
|
113
|
+
*/
|
|
114
|
+
readonly superseded?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** Result of reconciling one external (realtime) feature change. */
|
|
117
|
+
export type HonuaFeatureEditorExternalChangeOutcome = "ignored" | "reconciled" | "conflict";
|
|
118
|
+
export interface HonuaFeatureEditorOptions<T = Record<string, unknown>> {
|
|
119
|
+
/** Editable source. Only the public `Source` contract is used. */
|
|
120
|
+
readonly source: Source<T>;
|
|
121
|
+
/**
|
|
122
|
+
* Field / domain / primary-key / conflict metadata. Defaults to the source's
|
|
123
|
+
* public schema, with coded-value and range domains projected across (see
|
|
124
|
+
* `editorFieldsFromSchema`).
|
|
125
|
+
*/
|
|
126
|
+
readonly metadata?: EditWorkflowMetadataOptions;
|
|
127
|
+
/** Subtype configuration; drives per-subtype choices and overrides. */
|
|
128
|
+
readonly subtypes?: HonuaEditorSubtypeConfig;
|
|
129
|
+
/** Per-operation host denials (e.g. a service's `deleteEnabled: false`). Deny-only. */
|
|
130
|
+
readonly operations?: HonuaEditorOperationOverrides;
|
|
131
|
+
/** Sketch tool capabilities; a sketch adapter (e.g. terra-draw) supplies its own. */
|
|
132
|
+
readonly sketchTools?: Partial<Record<EditSketchTool, EditSketchToolCapabilityInput>>;
|
|
133
|
+
readonly snapping?: Partial<SnappingConfig>;
|
|
134
|
+
readonly rollbackOnFailure?: boolean;
|
|
135
|
+
/** Optimistic apply/rollback/commit hooks, passed straight to the edit session. */
|
|
136
|
+
readonly optimistic?: EditWorkflowOptimisticHooks<T>;
|
|
137
|
+
}
|
|
138
|
+
type EditorListener = (snapshot: HonuaFeatureEditorSnapshot) => void;
|
|
139
|
+
export declare class HonuaFeatureEditorWorkflow<T = Record<string, unknown>> {
|
|
140
|
+
#private;
|
|
141
|
+
readonly source: Source<T>;
|
|
142
|
+
constructor(options: HonuaFeatureEditorOptions<T>);
|
|
143
|
+
/** Subscribes to snapshot changes. Mirrors the kit's `{ remove() }` idiom. */
|
|
144
|
+
subscribe(listener: EditorListener): {
|
|
145
|
+
remove(): void;
|
|
146
|
+
};
|
|
147
|
+
/** The underlying contract sketch workflow, for a sketch adapter to bind to. */
|
|
148
|
+
sketchModel(): EditSketchWorkflowModel<T> | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Subtype-resolved field metadata for the open draft, or — before one is
|
|
151
|
+
* opened — for the recorded selection. Resolving against the selection
|
|
152
|
+
* matters: a subtype's overrides can flip a field's editability, so using the
|
|
153
|
+
* default subtype here would report the wrong `update` / `delete`
|
|
154
|
+
* availability for the feature the host actually selected.
|
|
155
|
+
*/
|
|
156
|
+
fields(): readonly EditWorkflowField[];
|
|
157
|
+
/** Truthful per-operation availability for the current source and selection. */
|
|
158
|
+
operations(): readonly HonuaEditorOperationAvailability[];
|
|
159
|
+
/**
|
|
160
|
+
* Merged pre-transport validation: the contract validator run over the
|
|
161
|
+
* subtype-resolved field list, unioned with the live session's own
|
|
162
|
+
* session-level verdict (capability, identity, attachment support).
|
|
163
|
+
*/
|
|
164
|
+
validate(): EditWorkflowValidationResult;
|
|
165
|
+
/** Current UI state. Never contains an attachment payload. */
|
|
166
|
+
snapshot(): HonuaFeatureEditorSnapshot;
|
|
167
|
+
/**
|
|
168
|
+
* Records the host's current selection (table row, map click, search result)
|
|
169
|
+
* so `update` / `delete` availability reflects it before a draft is opened.
|
|
170
|
+
*
|
|
171
|
+
* Ignored while a draft is open — an open draft owns its identity. A
|
|
172
|
+
* *committed* draft is the one exception: it is finished, and the host's
|
|
173
|
+
* re-read of the record it just wrote carries the only fresh concurrency
|
|
174
|
+
* token there is. Refusing it would leave `selection()` on the pre-commit
|
|
175
|
+
* feature, so the next `update` would reopen on a stale token the service has
|
|
176
|
+
* to reject. Accepting it closes the finished draft without touching the
|
|
177
|
+
* committed status or message — nothing about the commit is retracted.
|
|
178
|
+
*/
|
|
179
|
+
setSelection(feature: CanonicalFeature<T> | undefined): HonuaFeatureEditorSnapshot;
|
|
180
|
+
/** The host selection `update` / `delete` drafts open on. */
|
|
181
|
+
selection(): CanonicalFeature<T> | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Opens a draft, defaulting to the recorded selection. When the requested
|
|
184
|
+
* operation is not truthfully available the draft is refused and the reason
|
|
185
|
+
* recorded — never silently downgraded.
|
|
186
|
+
*/
|
|
187
|
+
begin(operation: HonuaEditorOperation, feature?: CanonicalFeature<T>): HonuaFeatureEditorSnapshot;
|
|
188
|
+
/** Discards the draft and aborts any in-flight submit. */
|
|
189
|
+
cancel(): HonuaFeatureEditorSnapshot;
|
|
190
|
+
/** Reverts the draft to the feature it opened on, keeping the draft open. */
|
|
191
|
+
discardChanges(): HonuaFeatureEditorSnapshot;
|
|
192
|
+
/**
|
|
193
|
+
* Records raw control input for a field, coerced to the field's own type
|
|
194
|
+
* (coded values resolve back to the domain code's type, so a numeric code
|
|
195
|
+
* never reaches transport as a string).
|
|
196
|
+
*/
|
|
197
|
+
setValue(name: string, raw: string | boolean | null): HonuaFeatureEditorSnapshot;
|
|
198
|
+
/** Records several already-typed attribute values at once. */
|
|
199
|
+
setValues(values: Readonly<Record<string, unknown>>): HonuaFeatureEditorSnapshot;
|
|
200
|
+
/** Arms a sketch tool. Unsupported tools report their reason rather than throwing. */
|
|
201
|
+
startSketch(tool: EditSketchTool): EditSketchToolCapability;
|
|
202
|
+
/** Applies a geometry through the sketch workflow (undoable). */
|
|
203
|
+
setGeometry(tool: EditSketchTool, geometry: Record<string, unknown> | null): HonuaFeatureEditorSnapshot;
|
|
204
|
+
undo(): boolean;
|
|
205
|
+
redo(): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Stages an attachment. The payload is handed straight to the edit session;
|
|
208
|
+
* only redacted metadata enters the snapshot.
|
|
209
|
+
*/
|
|
210
|
+
stageAttachment(attachment: Blob | File | string, options?: {
|
|
211
|
+
name?: string;
|
|
212
|
+
contentType?: string;
|
|
213
|
+
parentId?: FeatureId;
|
|
214
|
+
}): HonuaFeatureEditorSnapshot;
|
|
215
|
+
/** Stages an attachment deletion. */
|
|
216
|
+
stageAttachmentDelete(attachmentIds: readonly FeatureId[], options?: {
|
|
217
|
+
parentId?: FeatureId;
|
|
218
|
+
}): HonuaFeatureEditorSnapshot;
|
|
219
|
+
/**
|
|
220
|
+
* Replaces the sketch tool capabilities (a sketch adapter such as terra-draw
|
|
221
|
+
* calls this so `rectangle` / `circle` become truthfully supported). An open
|
|
222
|
+
* draft is rebuilt in place, preserving values, geometry, and staged
|
|
223
|
+
* attachments; undo history restarts because tool support is a new baseline.
|
|
224
|
+
*/
|
|
225
|
+
configureSketchTools(tools: Partial<Record<EditSketchTool, EditSketchToolCapabilityInput>>): HonuaFeatureEditorSnapshot;
|
|
226
|
+
/**
|
|
227
|
+
* Validates, then applies the draft through the contract edit session.
|
|
228
|
+
*
|
|
229
|
+
* Refuses to transport when the draft is invalid or an unresolved conflict is
|
|
230
|
+
* parked (`transported: false`). Every non-success result maps to a
|
|
231
|
+
* rejected / conflict / unsupported state — never `"committed"`.
|
|
232
|
+
*/
|
|
233
|
+
submit(): Promise<HonuaFeatureEditorCommit>;
|
|
234
|
+
/** Re-submits after a rejection (or after a resolved conflict). */
|
|
235
|
+
retry(): Promise<HonuaFeatureEditorCommit>;
|
|
236
|
+
/**
|
|
237
|
+
* Records an explicit decision for a parked conflict.
|
|
238
|
+
*
|
|
239
|
+
* - `"keep-mine"` keeps the draft and, when the source's concurrency token
|
|
240
|
+
* is known, adopts the observed server token so the retry can pass the
|
|
241
|
+
* service's precondition (an explicit overwrite).
|
|
242
|
+
* - `"discard-mine"` reverts the draft to the feature it opened on.
|
|
243
|
+
* - `"reload"` closes the draft; the host is expected to reopen it on fresh
|
|
244
|
+
* server state.
|
|
245
|
+
*/
|
|
246
|
+
resolveConflict(choice: HonuaFeatureEditorConflictChoice): HonuaFeatureEditorSnapshot;
|
|
247
|
+
/**
|
|
248
|
+
* Adopts the service's post-write concurrency token into a draft that stays
|
|
249
|
+
* open on purpose — the partial outcome where the feature edit applied and
|
|
250
|
+
* only an attachment was refused (issue #680).
|
|
251
|
+
*
|
|
252
|
+
* A protocol like GeoServices returns nothing but `objectId` and `success`
|
|
253
|
+
* from `applyEdits`, so the new token exists only in the host's re-read of the
|
|
254
|
+
* record. Feeding that back through {@link setValue} would read as a user
|
|
255
|
+
* revision and clear the rejected status and the recorded failures — erasing
|
|
256
|
+
* exactly the truth about what the service refused. This does not: status,
|
|
257
|
+
* failures, and staged-attachment outcomes all survive, so {@link retry}
|
|
258
|
+
* re-transports the same recovery against the version now on file instead of
|
|
259
|
+
* the one the accepted write already consumed.
|
|
260
|
+
*
|
|
261
|
+
* The draft's own baseline is deliberately left alone: it is still the values
|
|
262
|
+
* this draft opened on, and moving it could make an unrelated server-assigned
|
|
263
|
+
* field look like a read-only edit the user made.
|
|
264
|
+
*
|
|
265
|
+
* Returns `false` — changing nothing — when no draft is open, when the record
|
|
266
|
+
* is a different feature, or when the source publishes no concurrency token.
|
|
267
|
+
*/
|
|
268
|
+
adoptServerState(feature: CanonicalFeature<T>): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Reconciles one externally changed feature against the open draft (REQ-005).
|
|
271
|
+
*
|
|
272
|
+
* - A change to a different feature is `"ignored"`: no state changes and no
|
|
273
|
+
* listener runs, so selection, unsaved values, focus, and geometry survive
|
|
274
|
+
* unrelated realtime traffic untouched.
|
|
275
|
+
* - A change to the drafted feature carrying the same concurrency token is
|
|
276
|
+
* `"reconciled"`: the baseline adopts the server values, and only fields the
|
|
277
|
+
* user has *not* touched adopt the new values.
|
|
278
|
+
* - A change carrying a different token is a `"conflict"`: the draft is
|
|
279
|
+
* untouched and parked until {@link resolveConflict} records a decision.
|
|
280
|
+
*/
|
|
281
|
+
applyExternalChange(feature: CanonicalFeature<T>): HonuaFeatureEditorExternalChangeOutcome;
|
|
282
|
+
}
|
|
283
|
+
/** Creates a {@link HonuaFeatureEditorWorkflow}. */
|
|
284
|
+
export declare function createFeatureEditorWorkflow<T = Record<string, unknown>>(options: HonuaFeatureEditorOptions<T>): HonuaFeatureEditorWorkflow<T>;
|
|
285
|
+
export {};
|
|
286
|
+
//# sourceMappingURL=feature-editor-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-editor-workflow.d.ts","sourceRoot":"","sources":["../../../src/web-components/feature-editor-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KA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