@honua/sdk-esri-compat 0.1.12 → 0.1.13
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/README.md +2 -0
- package/columnar/apache-arrow.d.ts +17 -0
- package/columnar/apache-arrow.d.ts.map +1 -0
- package/columnar/apache-arrow.js +1036 -0
- package/columnar/batch-cache-conformance.d.ts +66 -0
- package/columnar/batch-cache-conformance.d.ts.map +1 -0
- package/columnar/batch-cache-conformance.js +317 -0
- package/columnar/batch-cache-indexeddb.d.ts +31 -0
- package/columnar/batch-cache-indexeddb.d.ts.map +1 -0
- package/columnar/batch-cache-indexeddb.js +148 -0
- package/columnar/batch-cache.d.ts +298 -0
- package/columnar/batch-cache.d.ts.map +1 -0
- package/columnar/batch-cache.js +757 -0
- package/columnar/geoarrow-aggregate.d.ts +178 -0
- package/columnar/geoarrow-aggregate.d.ts.map +1 -0
- package/columnar/geoarrow-aggregate.js +976 -0
- package/columnar/geoarrow-patch.d.ts +382 -0
- package/columnar/geoarrow-patch.d.ts.map +1 -0
- package/columnar/geoarrow-patch.js +1656 -0
- package/columnar/geoarrow-reproject.d.ts +22 -0
- package/columnar/geoarrow-reproject.d.ts.map +1 -0
- package/columnar/geoarrow-reproject.js +119 -0
- package/columnar/geoarrow-serialization.d.ts +68 -0
- package/columnar/geoarrow-serialization.d.ts.map +1 -0
- package/columnar/geoarrow-serialization.js +331 -0
- package/columnar/geoarrow-types.d.ts +271 -0
- package/columnar/geoarrow-types.d.ts.map +1 -0
- package/columnar/geoarrow-types.js +15 -0
- package/columnar/geoarrow.d.ts +52 -0
- package/columnar/geoarrow.d.ts.map +1 -0
- package/columnar/geoarrow.js +1469 -0
- package/columnar/index.d.ts +43 -0
- package/columnar/index.d.ts.map +1 -0
- package/columnar/index.js +29 -0
- package/columnar/operators.d.ts +70 -0
- package/columnar/operators.d.ts.map +1 -0
- package/columnar/operators.js +307 -0
- package/columnar/result.d.ts +369 -0
- package/columnar/result.d.ts.map +1 -0
- package/columnar/result.js +815 -0
- package/columnar/telemetry.d.ts +152 -0
- package/columnar/telemetry.d.ts.map +1 -0
- package/columnar/telemetry.js +265 -0
- package/columnar/transfer.d.ts +28 -0
- package/columnar/transfer.d.ts.map +1 -0
- package/columnar/transfer.js +669 -0
- package/columnar/types.d.ts +175 -0
- package/columnar/types.d.ts.map +1 -0
- package/columnar/types.js +22 -0
- package/columnar/worker.d.ts +157 -0
- package/columnar/worker.d.ts.map +1 -0
- package/columnar/worker.js +1059 -0
- package/connect-url-safety.d.ts +53 -0
- package/connect-url-safety.js +189 -0
- package/contract/pmtiles.d.ts +6 -5
- package/contract/pmtiles.d.ts.map +1 -1
- package/contract/pmtiles.js +30 -5
- package/core/client.d.ts.map +1 -1
- package/core/client.js +87 -19
- package/core/deprecation-notice.d.ts +28 -0
- package/core/deprecation-notice.d.ts.map +1 -0
- package/core/deprecation-notice.js +22 -0
- package/core/esri-geojson.d.ts.map +1 -1
- package/core/esri-geojson.js +10 -6
- package/core/optional-grpc-peer.d.ts +15 -0
- package/core/optional-grpc-peer.d.ts.map +1 -0
- package/core/optional-grpc-peer.js +60 -0
- package/esri-compat/basemap-gallery.d.ts +2 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -1
- package/esri-compat/basemap-gallery.js +12 -0
- package/esri-compat/basemap.d.ts +4 -0
- package/esri-compat/basemap.d.ts.map +1 -1
- package/esri-compat/basemap.js +70 -0
- package/esri-compat/bookmarks.d.ts +2 -0
- package/esri-compat/bookmarks.d.ts.map +1 -1
- package/esri-compat/bookmarks.js +12 -0
- package/esri-compat/controls.d.ts +18 -0
- package/esri-compat/controls.d.ts.map +1 -1
- package/esri-compat/controls.js +120 -57
- package/esri-compat/directions.d.ts +4 -0
- package/esri-compat/directions.d.ts.map +1 -1
- package/esri-compat/directions.js +30 -20
- package/esri-compat/editor.d.ts +4 -0
- package/esri-compat/editor.d.ts.map +1 -1
- package/esri-compat/editor.js +16 -0
- package/esri-compat/esri-config.d.ts +2 -1
- package/esri-compat/esri-config.d.ts.map +1 -1
- package/esri-compat/feature-effect.d.ts +23 -0
- package/esri-compat/feature-effect.d.ts.map +1 -0
- package/esri-compat/feature-effect.js +12 -0
- package/esri-compat/feature-form.d.ts +6 -0
- package/esri-compat/feature-form.d.ts.map +1 -1
- package/esri-compat/feature-form.js +63 -0
- package/esri-compat/feature-layer.d.ts +21 -2
- package/esri-compat/feature-layer.d.ts.map +1 -1
- package/esri-compat/feature-layer.js +172 -1
- package/esri-compat/feature-table.d.ts +5 -0
- package/esri-compat/feature-table.d.ts.map +1 -1
- package/esri-compat/feature-table.js +23 -0
- package/esri-compat/identity-manager.d.ts +1 -1
- package/esri-compat/identity-manager.js +1 -1
- package/esri-compat/legend.d.ts +2 -0
- package/esri-compat/legend.d.ts.map +1 -1
- package/esri-compat/legend.js +98 -0
- package/esri-compat/locator.d.ts +1 -1
- package/esri-compat/locator.js +1 -1
- package/esri-compat/map-view-mount.d.ts +1 -0
- package/esri-compat/map-view-mount.d.ts.map +1 -1
- package/esri-compat/map-view-mount.js +46 -25
- package/esri-compat/map-view.d.ts +13 -0
- package/esri-compat/map-view.d.ts.map +1 -1
- package/esri-compat/map-view.js +94 -8
- package/esri-compat/map.d.ts +5 -1
- package/esri-compat/map.d.ts.map +1 -1
- package/esri-compat/map.js +10 -0
- package/esri-compat/measurement.d.ts +2 -0
- package/esri-compat/measurement.d.ts.map +1 -1
- package/esri-compat/measurement.js +14 -0
- package/esri-compat/point.d.ts +7 -0
- package/esri-compat/point.d.ts.map +1 -1
- package/esri-compat/point.js +33 -3
- package/esri-compat/popup.d.ts +2 -0
- package/esri-compat/popup.d.ts.map +1 -1
- package/esri-compat/popup.js +12 -0
- package/esri-compat/portal.d.ts +1 -1
- package/esri-compat/portal.js +1 -1
- package/esri-compat/print.d.ts +3 -0
- package/esri-compat/print.d.ts.map +1 -1
- package/esri-compat/print.js +15 -0
- package/esri-compat/search.d.ts +4 -0
- package/esri-compat/search.d.ts.map +1 -1
- package/esri-compat/search.js +25 -28
- package/esri-compat/sketch.d.ts +2 -0
- package/esri-compat/sketch.d.ts.map +1 -1
- package/esri-compat/sketch.js +12 -0
- package/esri-compat/widget-host.d.ts +46 -17
- package/esri-compat/widget-host.d.ts.map +1 -1
- package/esri-compat/widget-host.js +84 -20
- package/esri-compat/widget-shell-hosts.d.ts +61 -0
- package/esri-compat/widget-shell-hosts.d.ts.map +1 -0
- package/esri-compat/widget-shell-hosts.js +76 -0
- package/index.d.ts +3 -1
- package/index.js +1 -0
- package/offline/digest.d.ts +15 -0
- package/offline/digest.js +58 -0
- package/offline/quota.d.ts +161 -0
- package/offline/quota.js +370 -0
- package/offline/types.d.ts +349 -0
- package/offline/types.js +75 -0
- package/package.json +21 -2
- 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/canonical.d.ts +7 -0
- package/query-planner/canonical.d.ts.map +1 -0
- package/query-planner/canonical.js +145 -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/cql2-json.d.ts +17 -0
- package/query-planner/cql2-json.d.ts.map +1 -0
- package/query-planner/cql2-json.js +646 -0
- package/query-planner/diagnostics.d.ts +35 -0
- package/query-planner/diagnostics.d.ts.map +1 -0
- package/query-planner/diagnostics.js +386 -0
- package/query-planner/duckdb.d.ts +79 -0
- package/query-planner/duckdb.d.ts.map +1 -0
- package/query-planner/duckdb.js +772 -0
- package/query-planner/execution-context.d.ts +5 -0
- package/query-planner/execution-context.d.ts.map +1 -0
- package/query-planner/execution-context.js +52 -0
- package/query-planner/executor.d.ts +5 -0
- package/query-planner/executor.d.ts.map +1 -0
- package/query-planner/executor.js +229 -0
- package/query-planner/geoservices.d.ts +91 -0
- package/query-planner/geoservices.d.ts.map +1 -0
- package/query-planner/geoservices.js +688 -0
- package/query-planner/grpc.d.ts +100 -0
- package/query-planner/grpc.d.ts.map +1 -0
- package/query-planner/grpc.js +760 -0
- package/query-planner/index.d.ts +59 -0
- package/query-planner/index.d.ts.map +1 -0
- package/query-planner/index.js +43 -0
- package/query-planner/ir.d.ts +25 -0
- package/query-planner/ir.d.ts.map +1 -0
- package/query-planner/ir.js +479 -0
- package/query-planner/local-aggregate.d.ts +5 -0
- package/query-planner/local-aggregate.d.ts.map +1 -0
- package/query-planner/local-aggregate.js +126 -0
- 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 +45 -0
- package/query-planner/odata.d.ts.map +1 -0
- package/query-planner/odata.js +519 -0
- package/query-planner/ogc-compiler.d.ts +55 -0
- package/query-planner/ogc-compiler.d.ts.map +1 -0
- package/query-planner/ogc-compiler.js +480 -0
- package/query-planner/ogc-features.d.ts +53 -0
- package/query-planner/ogc-features.d.ts.map +1 -0
- package/query-planner/ogc-features.js +639 -0
- package/query-planner/planner.d.ts +17 -0
- package/query-planner/planner.d.ts.map +1 -0
- package/query-planner/planner.js +937 -0
- 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/resource.d.ts +94 -0
- package/query-planner/resource.d.ts.map +1 -0
- package/query-planner/resource.js +526 -0
- package/query-planner/semantic-canonical.d.ts +15 -0
- package/query-planner/semantic-canonical.d.ts.map +1 -0
- package/query-planner/semantic-canonical.js +62 -0
- package/query-planner/semantic-compat.d.ts +10 -0
- package/query-planner/semantic-compat.d.ts.map +1 -0
- package/query-planner/semantic-compat.js +35 -0
- package/query-planner/semantic-compiler.d.ts +64 -0
- package/query-planner/semantic-compiler.d.ts.map +1 -0
- package/query-planner/semantic-compiler.js +81 -0
- package/query-planner/semantic-literals.d.ts +30 -0
- package/query-planner/semantic-literals.d.ts.map +1 -0
- package/query-planner/semantic-literals.js +133 -0
- package/query-planner/semantic-types.d.ts +265 -0
- package/query-planner/semantic-types.d.ts.map +1 -0
- package/query-planner/semantic-types.js +1 -0
- package/query-planner/semantic.d.ts +54 -0
- package/query-planner/semantic.d.ts.map +1 -0
- package/query-planner/semantic.js +1421 -0
- package/query-planner/types.d.ts +712 -0
- package/query-planner/types.d.ts.map +1 -0
- package/query-planner/types.js +49 -0
- 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-semantic.d.ts +58 -0
- package/query-planner/wfs-semantic.d.ts.map +1 -0
- package/query-planner/wfs-semantic.js +547 -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 +4 -0
- package/query-planner/wfs.d.ts.map +1 -0
- package/query-planner/wfs.js +2 -0
- package/widget-capabilities.d.ts +67 -0
- package/widget-capabilities.js +152 -0
|
@@ -5,15 +5,10 @@
|
|
|
5
5
|
* renders through the shared component set instead of shim-only markup
|
|
6
6
|
* (issue #493, REQ-004).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* registration: they never construct a host, never mount a component, and
|
|
13
|
-
* never emit the missing-kit diagnostic below. {@link expectedKitConstructor}
|
|
14
|
-
* additionally knows `honua-search` / `honua-measurement`, ready for the day
|
|
15
|
-
* `SearchCompat` / `MeasurementCompat` adopt the host; until then, do not
|
|
16
|
-
* describe the registration as something that makes "the widgets" render.
|
|
8
|
+
* Shims that construct this host delegate their container to a kit element.
|
|
9
|
+
* A shim that does not construct a host stays state-model-only. The host
|
|
10
|
+
* never imports the kit; {@link expectedKitConstructor} names the class that
|
|
11
|
+
* must own each tag.
|
|
17
12
|
*
|
|
18
13
|
* The host **never imports the web-component kit** — not even dynamically:
|
|
19
14
|
* the `/esri-compat` entrypoint is bundle-budgeted, and any intra-package
|
|
@@ -22,10 +17,15 @@
|
|
|
22
17
|
* once via {@link registerHonuaWidgetKit}:
|
|
23
18
|
*
|
|
24
19
|
* ```ts doc-test=skip reason="wiring snippet requires an application host"
|
|
20
|
+
* import { registerComponent } from "@honua/app-platform/controls";
|
|
25
21
|
* import { registerHonuaWidgetKit } from "@honua/sdk-esri-compat";
|
|
26
22
|
*
|
|
27
|
-
* //
|
|
28
|
-
*
|
|
23
|
+
* // One tag. registerComponent imports the side-effect-free elements module
|
|
24
|
+
* // and calls defineHonuaWebComponent for that catalog id only.
|
|
25
|
+
* await registerComponent("web-components.legend");
|
|
26
|
+
* registerHonuaWidgetKit({
|
|
27
|
+
* HonuaLegendElement: customElements.get("honua-legend"),
|
|
28
|
+
* });
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* The host is deliberately defensive:
|
|
@@ -66,18 +66,40 @@ export interface HonuaWidgetKitLike {
|
|
|
66
66
|
HonuaSearchElement?: CustomElementConstructor;
|
|
67
67
|
HonuaMeasurementElement?: CustomElementConstructor;
|
|
68
68
|
HonuaTimeSliderElement?: CustomElementConstructor;
|
|
69
|
+
HonuaEditorElement?: CustomElementConstructor;
|
|
70
|
+
HonuaFeatureEditorElement?: CustomElementConstructor;
|
|
71
|
+
HonuaFeatureTableElement?: CustomElementConstructor;
|
|
72
|
+
HonuaBookmarksElement?: CustomElementConstructor;
|
|
73
|
+
HonuaBasemapControlElement?: CustomElementConstructor;
|
|
74
|
+
HonuaLocateControlElement?: CustomElementConstructor;
|
|
75
|
+
HonuaSketchControlElement?: CustomElementConstructor;
|
|
76
|
+
HonuaPrintExportElement?: CustomElementConstructor;
|
|
77
|
+
HonuaFeatureInspectionElement?: CustomElementConstructor;
|
|
78
|
+
HonuaZoomElement?: CustomElementConstructor;
|
|
79
|
+
HonuaHomeElement?: CustomElementConstructor;
|
|
80
|
+
HonuaScaleBarElement?: CustomElementConstructor;
|
|
81
|
+
HonuaCompassElement?: CustomElementConstructor;
|
|
82
|
+
HonuaFullscreenElement?: CustomElementConstructor;
|
|
83
|
+
HonuaAttributionElement?: CustomElementConstructor;
|
|
84
|
+
HonuaFeaturePagerElement?: CustomElementConstructor;
|
|
85
|
+
HonuaAttachmentsElement?: CustomElementConstructor;
|
|
86
|
+
HonuaScaleRangeElement?: CustomElementConstructor;
|
|
87
|
+
HonuaDirectionsElement?: CustomElementConstructor;
|
|
88
|
+
HonuaChartElement?: CustomElementConstructor;
|
|
69
89
|
defineHonuaWebComponents?: (registry?: CustomElementRegistry) => void;
|
|
70
90
|
}
|
|
71
91
|
/** A kit module object, or a (possibly async) loader for one. */
|
|
72
92
|
export type HonuaWidgetKitSource = HonuaWidgetKitLike | (() => HonuaWidgetKitLike | Promise<HonuaWidgetKitLike>);
|
|
73
93
|
/**
|
|
74
94
|
* Injects the web-component kit that {@link HonuaWidgetHost} delegates to.
|
|
75
|
-
*
|
|
76
|
-
* (
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
95
|
+
* Register one tag with `registerComponent` from `@honua/app-platform/controls`
|
|
96
|
+
* (`src/controls/registry.ts`), then pass that tag's constructor here and omit
|
|
97
|
+
* `defineHonuaWebComponents`. Importing `@honua/app-platform/web-components`
|
|
98
|
+
* runs `defineHonuaWebComponents()` for every tag. Pass `undefined` to
|
|
99
|
+
* unregister: delegating shims return to headless mode, and each host drops
|
|
100
|
+
* any element it had mounted on its next {@link HonuaWidgetHost.mount} /
|
|
101
|
+
* {@link HonuaWidgetHost.update} rather than stranding a live component that
|
|
102
|
+
* no longer receives updates.
|
|
81
103
|
*
|
|
82
104
|
* Calling this also re-arms the one-time missing-kit diagnostic: registration
|
|
83
105
|
* is exactly the state the warning asks for, so an app that later unregisters
|
|
@@ -117,4 +139,11 @@ export declare class HonuaWidgetHost {
|
|
|
117
139
|
/** Removes the mounted element from the container. */
|
|
118
140
|
destroy(): void;
|
|
119
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Constructs a host when `container` is set and a DOM can resolve it.
|
|
144
|
+
* Headless construction returns `undefined` and does not touch a document.
|
|
145
|
+
*/
|
|
146
|
+
export declare function bindHonuaWidgetHost(tagName: string, container: unknown, eventBus?: CompatEventBus): HonuaWidgetHost | undefined;
|
|
147
|
+
/** Copies shim state onto the mounted element. Missing kit leaves the container empty. */
|
|
148
|
+
export declare function pushWidgetHostState(host: HonuaWidgetHost | undefined, state: Readonly<Record<string, unknown>>): void;
|
|
120
149
|
//# sourceMappingURL=widget-host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-host.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/widget-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAiBrD,oEAAoE;AACpE,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C,qBAAqB,CAAC,EAAE,wBAAwB,CAAC;IACjD,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,wBAAwB,CAAC;IACnD,sBAAsB,CAAC,EAAE,wBAAwB,CAAC;IAClD,wBAAwB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvE;AAED,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC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AAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAOrH"}
|
|
@@ -5,15 +5,10 @@
|
|
|
5
5
|
* renders through the shared component set instead of shim-only markup
|
|
6
6
|
* (issue #493, REQ-004).
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* registration: they never construct a host, never mount a component, and
|
|
13
|
-
* never emit the missing-kit diagnostic below. {@link expectedKitConstructor}
|
|
14
|
-
* additionally knows `honua-search` / `honua-measurement`, ready for the day
|
|
15
|
-
* `SearchCompat` / `MeasurementCompat` adopt the host; until then, do not
|
|
16
|
-
* describe the registration as something that makes "the widgets" render.
|
|
8
|
+
* Shims that construct this host delegate their container to a kit element.
|
|
9
|
+
* A shim that does not construct a host stays state-model-only. The host
|
|
10
|
+
* never imports the kit; {@link expectedKitConstructor} names the class that
|
|
11
|
+
* must own each tag.
|
|
17
12
|
*
|
|
18
13
|
* The host **never imports the web-component kit** — not even dynamically:
|
|
19
14
|
* the `/esri-compat` entrypoint is bundle-budgeted, and any intra-package
|
|
@@ -22,10 +17,15 @@
|
|
|
22
17
|
* once via {@link registerHonuaWidgetKit}:
|
|
23
18
|
*
|
|
24
19
|
* ```ts doc-test=skip reason="wiring snippet requires an application host"
|
|
20
|
+
* import { registerComponent } from "@honua/app-platform/controls";
|
|
25
21
|
* import { registerHonuaWidgetKit } from "@honua/sdk-esri-compat";
|
|
26
22
|
*
|
|
27
|
-
* //
|
|
28
|
-
*
|
|
23
|
+
* // One tag. registerComponent imports the side-effect-free elements module
|
|
24
|
+
* // and calls defineHonuaWebComponent for that catalog id only.
|
|
25
|
+
* await registerComponent("web-components.legend");
|
|
26
|
+
* registerHonuaWidgetKit({
|
|
27
|
+
* HonuaLegendElement: customElements.get("honua-legend"),
|
|
28
|
+
* });
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* The host is deliberately defensive:
|
|
@@ -67,12 +67,14 @@ let widgetKitSource;
|
|
|
67
67
|
let missingWidgetKitReported = false;
|
|
68
68
|
/**
|
|
69
69
|
* Injects the web-component kit that {@link HonuaWidgetHost} delegates to.
|
|
70
|
-
*
|
|
71
|
-
* (
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
70
|
+
* Register one tag with `registerComponent` from `@honua/app-platform/controls`
|
|
71
|
+
* (`src/controls/registry.ts`), then pass that tag's constructor here and omit
|
|
72
|
+
* `defineHonuaWebComponents`. Importing `@honua/app-platform/web-components`
|
|
73
|
+
* runs `defineHonuaWebComponents()` for every tag. Pass `undefined` to
|
|
74
|
+
* unregister: delegating shims return to headless mode, and each host drops
|
|
75
|
+
* any element it had mounted on its next {@link HonuaWidgetHost.mount} /
|
|
76
|
+
* {@link HonuaWidgetHost.update} rather than stranding a live component that
|
|
77
|
+
* no longer receives updates.
|
|
76
78
|
*
|
|
77
79
|
* Calling this also re-arms the one-time missing-kit diagnostic: registration
|
|
78
80
|
* is exactly the state the warning asks for, so an app that later unregisters
|
|
@@ -87,9 +89,11 @@ function missingWidgetKitMessage(tagName) {
|
|
|
87
89
|
return [
|
|
88
90
|
`[honua/esri-compat] <${tagName}> was not mounted because no Honua widget kit is registered,`,
|
|
89
91
|
"so this widget stays state-model-only and its container renders nothing.",
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
92
|
+
"Call registerComponent from @honua/app-platform/controls for that one tag, then",
|
|
93
|
+
"registerHonuaWidgetKit with the registered constructor and without defineHonuaWebComponents,",
|
|
94
|
+
"once during application startup. Importing @honua/app-platform/web-components runs",
|
|
95
|
+
"defineHonuaWebComponents() for every tag. This affects the shims that construct a widget host.",
|
|
96
|
+
`See ${WIDGET_KIT_DOCS_URL}`,
|
|
93
97
|
].join(" ");
|
|
94
98
|
}
|
|
95
99
|
/**
|
|
@@ -216,6 +220,26 @@ export class HonuaWidgetHost {
|
|
|
216
220
|
return this.#kitLoad;
|
|
217
221
|
}
|
|
218
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Constructs a host when `container` is set and a DOM can resolve it.
|
|
225
|
+
* Headless construction returns `undefined` and does not touch a document.
|
|
226
|
+
*/
|
|
227
|
+
export function bindHonuaWidgetHost(tagName, container, eventBus) {
|
|
228
|
+
if (container == null)
|
|
229
|
+
return undefined;
|
|
230
|
+
const host = new HonuaWidgetHost(tagName, container, eventBus);
|
|
231
|
+
return host.available ? host : undefined;
|
|
232
|
+
}
|
|
233
|
+
/** Copies shim state onto the mounted element. Missing kit leaves the container empty. */
|
|
234
|
+
export function pushWidgetHostState(host, state) {
|
|
235
|
+
if (!host)
|
|
236
|
+
return;
|
|
237
|
+
void host.update((element) => {
|
|
238
|
+
for (const [key, value] of Object.entries(state)) {
|
|
239
|
+
element[key] = value;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
219
243
|
/** Resolves the web-components kit class that must own `tagName` for delegation. */
|
|
220
244
|
function expectedKitConstructor(kit, tagName) {
|
|
221
245
|
switch (tagName) {
|
|
@@ -229,6 +253,46 @@ function expectedKitConstructor(kit, tagName) {
|
|
|
229
253
|
return kit.HonuaMeasurementElement;
|
|
230
254
|
case "honua-time-slider":
|
|
231
255
|
return kit.HonuaTimeSliderElement;
|
|
256
|
+
case "honua-editor":
|
|
257
|
+
return kit.HonuaEditorElement;
|
|
258
|
+
case "honua-feature-editor":
|
|
259
|
+
return kit.HonuaFeatureEditorElement;
|
|
260
|
+
case "honua-feature-table":
|
|
261
|
+
return kit.HonuaFeatureTableElement;
|
|
262
|
+
case "honua-bookmarks":
|
|
263
|
+
return kit.HonuaBookmarksElement;
|
|
264
|
+
case "honua-basemap-control":
|
|
265
|
+
return kit.HonuaBasemapControlElement;
|
|
266
|
+
case "honua-locate-control":
|
|
267
|
+
return kit.HonuaLocateControlElement;
|
|
268
|
+
case "honua-sketch-control":
|
|
269
|
+
return kit.HonuaSketchControlElement;
|
|
270
|
+
case "honua-print-export":
|
|
271
|
+
return kit.HonuaPrintExportElement;
|
|
272
|
+
case "honua-feature-inspection":
|
|
273
|
+
return kit.HonuaFeatureInspectionElement;
|
|
274
|
+
case "honua-zoom":
|
|
275
|
+
return kit.HonuaZoomElement;
|
|
276
|
+
case "honua-home":
|
|
277
|
+
return kit.HonuaHomeElement;
|
|
278
|
+
case "honua-scale-bar":
|
|
279
|
+
return kit.HonuaScaleBarElement;
|
|
280
|
+
case "honua-compass":
|
|
281
|
+
return kit.HonuaCompassElement;
|
|
282
|
+
case "honua-fullscreen":
|
|
283
|
+
return kit.HonuaFullscreenElement;
|
|
284
|
+
case "honua-attribution":
|
|
285
|
+
return kit.HonuaAttributionElement;
|
|
286
|
+
case "honua-feature-pager":
|
|
287
|
+
return kit.HonuaFeaturePagerElement;
|
|
288
|
+
case "honua-attachments":
|
|
289
|
+
return kit.HonuaAttachmentsElement;
|
|
290
|
+
case "honua-scale-range":
|
|
291
|
+
return kit.HonuaScaleRangeElement;
|
|
292
|
+
case "honua-directions":
|
|
293
|
+
return kit.HonuaDirectionsElement;
|
|
294
|
+
case "honua-chart":
|
|
295
|
+
return kit.HonuaChartElement;
|
|
232
296
|
default:
|
|
233
297
|
return undefined;
|
|
234
298
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compat hosts for the feature pager, attachment list, and scale range.
|
|
3
|
+
* They push shim state into the kit and do not build their own widget DOM.
|
|
4
|
+
*/
|
|
5
|
+
import type { CompatEventBus } from "./event-bus.js";
|
|
6
|
+
export declare class FeaturesCompat {
|
|
7
|
+
readonly view: unknown;
|
|
8
|
+
readonly container: unknown;
|
|
9
|
+
features: readonly unknown[];
|
|
10
|
+
private widgetHost;
|
|
11
|
+
constructor(options?: {
|
|
12
|
+
view?: unknown;
|
|
13
|
+
container?: unknown;
|
|
14
|
+
features?: readonly unknown[];
|
|
15
|
+
eventBus?: CompatEventBus;
|
|
16
|
+
});
|
|
17
|
+
setFeatures(features: readonly unknown[]): void;
|
|
18
|
+
private push;
|
|
19
|
+
}
|
|
20
|
+
export declare function attachmentNamesFromQuery(response: {
|
|
21
|
+
attachmentInfos?: readonly {
|
|
22
|
+
name?: string;
|
|
23
|
+
}[];
|
|
24
|
+
attachmentGroups?: readonly {
|
|
25
|
+
attachmentInfos?: readonly {
|
|
26
|
+
name?: string;
|
|
27
|
+
}[];
|
|
28
|
+
}[];
|
|
29
|
+
}): string[];
|
|
30
|
+
export declare class AttachmentsCompat {
|
|
31
|
+
readonly container: unknown;
|
|
32
|
+
readonly layer: {
|
|
33
|
+
queryAttachments?: (options?: unknown) => Promise<Parameters<typeof attachmentNamesFromQuery>[0]>;
|
|
34
|
+
} | undefined;
|
|
35
|
+
names: readonly string[];
|
|
36
|
+
private widgetHost;
|
|
37
|
+
constructor(options?: {
|
|
38
|
+
container?: unknown;
|
|
39
|
+
layer?: AttachmentsCompat["layer"];
|
|
40
|
+
names?: readonly string[];
|
|
41
|
+
eventBus?: CompatEventBus;
|
|
42
|
+
});
|
|
43
|
+
load(): Promise<readonly string[]>;
|
|
44
|
+
private push;
|
|
45
|
+
}
|
|
46
|
+
export declare class ScaleRangeCompat {
|
|
47
|
+
readonly container: unknown;
|
|
48
|
+
readonly layer: {
|
|
49
|
+
minScale?: number;
|
|
50
|
+
maxScale?: number;
|
|
51
|
+
setScaleRange?: (min: number, max: number) => void;
|
|
52
|
+
} | undefined;
|
|
53
|
+
private widgetHost;
|
|
54
|
+
constructor(options?: {
|
|
55
|
+
container?: unknown;
|
|
56
|
+
layer?: ScaleRangeCompat["layer"];
|
|
57
|
+
eventBus?: CompatEventBus;
|
|
58
|
+
});
|
|
59
|
+
private push;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=widget-shell-hosts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-shell-hosts.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/widget-shell-hosts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO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EAAE,SAAS,MAAM,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;KACtB;IASK,IAAI,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;IAQ/C,OAAO,CAAC,IAAI;CAGb;AAED,qBAAa,gBAAgB;IAC3B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,KAAK,EACjB;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAC5F,SAAS,CAAC;IACd,OAAO,CAAC,UAAU,CAA8B;gBAG9C,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAClC,QAAQ,CAAC,EAAE,cAAc,CAAC;KACtB;IAQR,OAAO,CAAC,IAAI;CAGb"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compat hosts for the feature pager, attachment list, and scale range.
|
|
3
|
+
* They push shim state into the kit and do not build their own widget DOM.
|
|
4
|
+
*/
|
|
5
|
+
import { bindHonuaWidgetHost, pushWidgetHostState } from "./widget-host.js";
|
|
6
|
+
export class FeaturesCompat {
|
|
7
|
+
view;
|
|
8
|
+
container;
|
|
9
|
+
features;
|
|
10
|
+
widgetHost;
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.view = options.view;
|
|
13
|
+
this.container = options.container;
|
|
14
|
+
this.features = options.features ?? [];
|
|
15
|
+
this.widgetHost = bindHonuaWidgetHost("honua-feature-pager", this.container, options.eventBus);
|
|
16
|
+
this.push();
|
|
17
|
+
}
|
|
18
|
+
setFeatures(features) {
|
|
19
|
+
this.features = features;
|
|
20
|
+
this.push();
|
|
21
|
+
}
|
|
22
|
+
push() {
|
|
23
|
+
pushWidgetHostState(this.widgetHost, { view: this.view, features: this.features });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function attachmentNamesFromQuery(response) {
|
|
27
|
+
const names = [];
|
|
28
|
+
for (const info of response.attachmentInfos ?? []) {
|
|
29
|
+
if (info.name)
|
|
30
|
+
names.push(info.name);
|
|
31
|
+
}
|
|
32
|
+
for (const group of response.attachmentGroups ?? []) {
|
|
33
|
+
for (const info of group.attachmentInfos ?? []) {
|
|
34
|
+
if (info.name)
|
|
35
|
+
names.push(info.name);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return names;
|
|
39
|
+
}
|
|
40
|
+
export class AttachmentsCompat {
|
|
41
|
+
container;
|
|
42
|
+
layer;
|
|
43
|
+
names = [];
|
|
44
|
+
widgetHost;
|
|
45
|
+
constructor(options = {}) {
|
|
46
|
+
this.container = options.container;
|
|
47
|
+
this.layer = options.layer;
|
|
48
|
+
this.names = options.names ?? [];
|
|
49
|
+
this.widgetHost = bindHonuaWidgetHost("honua-attachments", this.container, options.eventBus);
|
|
50
|
+
this.push();
|
|
51
|
+
}
|
|
52
|
+
async load() {
|
|
53
|
+
if (this.layer?.queryAttachments) {
|
|
54
|
+
this.names = attachmentNamesFromQuery(await this.layer.queryAttachments());
|
|
55
|
+
}
|
|
56
|
+
this.push();
|
|
57
|
+
return this.names;
|
|
58
|
+
}
|
|
59
|
+
push() {
|
|
60
|
+
pushWidgetHostState(this.widgetHost, { names: this.names });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class ScaleRangeCompat {
|
|
64
|
+
container;
|
|
65
|
+
layer;
|
|
66
|
+
widgetHost;
|
|
67
|
+
constructor(options = {}) {
|
|
68
|
+
this.container = options.container;
|
|
69
|
+
this.layer = options.layer;
|
|
70
|
+
this.widgetHost = bindHonuaWidgetHost("honua-scale-range", this.container, options.eventBus);
|
|
71
|
+
this.push();
|
|
72
|
+
}
|
|
73
|
+
push() {
|
|
74
|
+
pushWidgetHostState(this.widgetHost, { layer: this.layer });
|
|
75
|
+
}
|
|
76
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -137,6 +137,8 @@ export { EditorCompat } from "./esri-compat/editor.js";
|
|
|
137
137
|
export type { EditorHandleCompat, EditorLoadStatusCompat, EditorCompatOptions, EditorLayerInfoCompat, EditorWorkflowCompat, } from "./esri-compat/editor.js";
|
|
138
138
|
export { snappingOptionsToSnappingConfig } from "./esri-compat/snapping.js";
|
|
139
139
|
export type { SnappingFeatureSourceCompat, SnappingOptionsCompat } from "./esri-compat/snapping.js";
|
|
140
|
+
export { FeatureEffectCompat } from "./esri-compat/feature-effect.js";
|
|
141
|
+
export type { FeatureEffectCompatOptions } from "./esri-compat/feature-effect.js";
|
|
140
142
|
export { FeatureFilterCompat } from "./esri-compat/feature-filter.js";
|
|
141
143
|
export type { FeatureFilterCompatOptions, FeatureFilterEsriProperties, FeatureFilterGeometryCompat, FeatureFilterHandleCompat, FeatureFilterLoadStatusCompat, FeatureFilterSpatialRelationshipCompat, FeatureFilterTimeExtentCompat, } from "./esri-compat/feature-filter.js";
|
|
142
144
|
export { VectorTileLayerCompat } from "./esri-compat/vector-tile-layer.js";
|
|
@@ -151,4 +153,4 @@ export { ImageryLayerCompat } from "./esri-compat/imagery-layer.js";
|
|
|
151
153
|
export type { ImageryLayerCompatOptions, ImageryLayerExportOptions, ImageryLayerHandleCompat, ImageryLayerIdentifyOptions, ImageryLayerLoadStatusCompat, ImageryLayerQueryOptions, } from "./esri-compat/imagery-layer.js";
|
|
152
154
|
export { buffer as geometryEngineBuffer, contains as geometryEngineContains, convexHull as geometryEngineConvexHull, difference as geometryEngineDifference, geodesicArea as geometryEngineGeodesicArea, geodesicLength as geometryEngineGeodesicLength, geometryEngineAsyncCompat, geometryEngineCompat, intersect as geometryEngineIntersect, intersects as geometryEngineIntersects, planarArea as geometryEnginePlanarArea, planarLength as geometryEnginePlanarLength, simplify as geometryEngineSimplify, union as geometryEngineUnion, } from "./esri-compat/geometry-engine.js";
|
|
153
155
|
export type { EsriAreaUnit, EsriLinearUnit, GeometryEngineInput, } from "./esri-compat/geometry-engine.js";
|
|
154
|
-
//# sourceMappingURL=
|
|
156
|
+
//# sourceMappingURL=client-compat-entry.d.ts.map
|
package/index.js
CHANGED
|
@@ -69,6 +69,7 @@ export { TableListCompat } from "./esri-compat/table-list.js";
|
|
|
69
69
|
export { SketchCompat, resolveSketchToolBindingCompat } from "./esri-compat/sketch.js";
|
|
70
70
|
export { EditorCompat } from "./esri-compat/editor.js";
|
|
71
71
|
export { snappingOptionsToSnappingConfig } from "./esri-compat/snapping.js";
|
|
72
|
+
export { FeatureEffectCompat } from "./esri-compat/feature-effect.js";
|
|
72
73
|
export { FeatureFilterCompat } from "./esri-compat/feature-filter.js";
|
|
73
74
|
export { VectorTileLayerCompat } from "./esri-compat/vector-tile-layer.js";
|
|
74
75
|
export { GeoJSONLayerCompat } from "./esri-compat/geojson-layer.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Code-unit ordering, the deterministic sort used by every persisted identity. */
|
|
2
|
+
export declare function compareCodeUnits(left: string, right: string): number;
|
|
3
|
+
/**
|
|
4
|
+
* Serialize `value` with sorted own keys and no `undefined` members.
|
|
5
|
+
*
|
|
6
|
+
* The output is the digest pre-image for region and resource identity, so it is
|
|
7
|
+
* deliberately strict: an `undefined` anywhere would silently disappear from the
|
|
8
|
+
* identity and let two different selections collide.
|
|
9
|
+
*/
|
|
10
|
+
export declare function canonicalJson(value: unknown): string;
|
|
11
|
+
/** Portable Web Crypto SHA-256 over UTF-8 text or raw bytes. */
|
|
12
|
+
export declare function sha256(value: string | Uint8Array): Promise<`sha256:${string}`>;
|
|
13
|
+
/** Domain-separated digest of a canonical identity object. */
|
|
14
|
+
export declare function identityDigest(namespace: string, value: unknown): Promise<`sha256:${string}`>;
|
|
15
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { HonuaOfflineRegionError } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic identity primitives shared by every offline module.
|
|
4
|
+
*
|
|
5
|
+
* Manifest identity, snapshot resource identity, and the read path all have to
|
|
6
|
+
* agree byte-for-byte on what "the same selection" means, so the canonical
|
|
7
|
+
* serialization and the digest live in one module rather than being reimplemented
|
|
8
|
+
* per layer. Nothing here reads storage or accepts a request URL.
|
|
9
|
+
*/
|
|
10
|
+
const encoder = new TextEncoder();
|
|
11
|
+
/** Code-unit ordering, the deterministic sort used by every persisted identity. */
|
|
12
|
+
export function compareCodeUnits(left, right) {
|
|
13
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Serialize `value` with sorted own keys and no `undefined` members.
|
|
17
|
+
*
|
|
18
|
+
* The output is the digest pre-image for region and resource identity, so it is
|
|
19
|
+
* deliberately strict: an `undefined` anywhere would silently disappear from the
|
|
20
|
+
* identity and let two different selections collide.
|
|
21
|
+
*/
|
|
22
|
+
export function canonicalJson(value) {
|
|
23
|
+
if (value === null || typeof value !== "object") {
|
|
24
|
+
const encoded = JSON.stringify(value);
|
|
25
|
+
if (encoded === undefined) {
|
|
26
|
+
throw new HonuaOfflineRegionError("invalid-manifest", "Offline identity cannot contain undefined values.", {
|
|
27
|
+
path: "identity",
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return encoded;
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(value))
|
|
33
|
+
return `[${value.map(canonicalJson).join(",")}]`;
|
|
34
|
+
const entries = [];
|
|
35
|
+
for (const key in value) {
|
|
36
|
+
if (Object.hasOwn(value, key))
|
|
37
|
+
entries.push([key, value[key]]);
|
|
38
|
+
}
|
|
39
|
+
entries.sort(([left], [right]) => compareCodeUnits(left, right));
|
|
40
|
+
return `{${entries.map(([key, child]) => `${JSON.stringify(key)}:${canonicalJson(child)}`).join(",")}}`;
|
|
41
|
+
}
|
|
42
|
+
/** Portable Web Crypto SHA-256 over UTF-8 text or raw bytes. */
|
|
43
|
+
export async function sha256(value) {
|
|
44
|
+
const subtle = globalThis.crypto?.subtle;
|
|
45
|
+
if (!subtle) {
|
|
46
|
+
throw new HonuaOfflineRegionError("invalid-manifest", "Offline region identity and integrity require Web Crypto SHA-256.", { path: "crypto" });
|
|
47
|
+
}
|
|
48
|
+
const bytes = typeof value === "string" ? encoder.encode(value) : value;
|
|
49
|
+
const digestInput = bytes.buffer instanceof ArrayBuffer
|
|
50
|
+
? bytes
|
|
51
|
+
: Uint8Array.from(bytes);
|
|
52
|
+
const digest = await subtle.digest("SHA-256", digestInput);
|
|
53
|
+
return `sha256:${Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
54
|
+
}
|
|
55
|
+
/** Domain-separated digest of a canonical identity object. */
|
|
56
|
+
export async function identityDigest(namespace, value) {
|
|
57
|
+
return sha256(`${namespace}:v1:${canonicalJson(value)}`);
|
|
58
|
+
}
|