@ngis/plugin-ui 0.4.0 → 0.4.1

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.
Files changed (42) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.d.ts +2 -2
  3. package/dist/index.mjs +1 -1
  4. package/dist/src/api/analysis.d.ts +38 -1
  5. package/dist/src/api/crs.d.ts +110 -0
  6. package/dist/src/api/resources.d.ts +174 -10
  7. package/dist/src/api/scenes.d.ts +103 -4
  8. package/dist/src/api/workflows.d.ts +10 -1
  9. package/dist/src/components/plugin-ui/ChartCanvas.d.ts +3 -0
  10. package/dist/src/components/plugin-ui/ParamForm.d.ts +67 -5
  11. package/dist/src/components/plugin-ui/PickerField.d.ts +17 -0
  12. package/dist/src/components/plugin-ui/RunButton.d.ts +8 -0
  13. package/dist/src/components/plugin-ui/crs-issue-messages.d.ts +157 -0
  14. package/dist/src/components/plugin-ui/flow-ports.d.ts +17 -0
  15. package/dist/src/components/plugin-ui/param-widgets.d.ts +2 -2
  16. package/dist/src/components/plugin-ui/picker-model.d.ts +49 -0
  17. package/dist/src/components/plugin-ui/run-data.d.ts +32 -4
  18. package/dist/src/components/plugin-ui/w2-contracts.d.ts +61 -0
  19. package/dist/src/components/plugin-ui/w3-contracts.d.ts +16 -1
  20. package/dist/src/components/resources/CrsPicker/CrsChip.d.ts +60 -0
  21. package/dist/src/components/resources/CrsPicker/CrsParamControl.d.ts +10 -0
  22. package/dist/src/components/resources/CrsPicker/CrsPicker.d.ts +41 -0
  23. package/dist/src/components/resources/CrsPicker/crs-recent.d.ts +40 -0
  24. package/dist/src/components/resources/CrsPicker/index.d.ts +14 -0
  25. package/dist/src/components/resources/resource-library-crs.d.ts +117 -0
  26. package/dist/src/components/ui/dialog.d.ts +25 -0
  27. package/dist/src/domain/algorithms/flow-field-style.d.ts +68 -0
  28. package/dist/src/domain/map/types.d.ts +2 -0
  29. package/dist/src/domain/models/crs.d.ts +187 -0
  30. package/dist/src/domain/models/dataset-kind.d.ts +256 -0
  31. package/dist/src/domain/models/flow-field-style.d.ts +32 -0
  32. package/dist/src/features/gis/components/GisAttributeTable.d.ts +11 -3
  33. package/dist/src/features/gis/hooks/useDatasetFeatureWindow.d.ts +5 -9
  34. package/dist/src/features/gis/lib/attributeFilters.d.ts +24 -0
  35. package/dist/src/sdk/facets/types.d.ts +73 -2
  36. package/dist/src/sdk/map-api.d.ts +5 -2
  37. package/dist/src/types/analysis.d.ts +111 -7
  38. package/dist/src/types/extensions.d.ts +43 -0
  39. package/dist/src/types/gis.d.ts +1 -1
  40. package/package.json +6 -37
  41. package/LICENSE +0 -13
  42. package/README.md +0 -25
@@ -26,6 +26,7 @@
26
26
  * `src/sdk/facets/types.ts`; F14.2 fixes the schema family's home here.
27
27
  */
28
28
  import type { NgisDataType } from "../sdk/facets/types";
29
+ import type { NgisValidationIssue } from "../domain/models/crs";
29
30
  export type WorkSurface = "workflow" | "insight" | "code";
30
31
  export type RightDockMode = "none" | "ai";
31
32
  export type MapFocusMode = "split" | "map" | "work";
@@ -35,15 +36,31 @@ export type NgisParamRole = "input" | "option" | "output";
35
36
  /**
36
37
  * Total, frozen. **There is NO fallback widget:** an unknown key is a
37
38
  * render-time error surfaced in place, never a silently-degraded text input.
38
- * A Y3 widget registry missing any of the twelve is a defect.
39
+ * A Y3 widget registry missing any of the thirteen is a defect.
39
40
  *
40
41
  * `field-select`, `extent` and `textarea` are **never emitted by YB1 in v1** —
41
42
  * no builtin schema expresses a field, a bbox or a long-text parameter. They
42
43
  * are in the union because the registry must be total over it, and because an
43
44
  * author's `ParamForm` `widgets` override and a recipe's promoted inputs can
44
45
  * select them.
46
+ *
47
+ * ## `"crs"` is the thirteenth, and it **AMENDS F14.2** (Stage 25, F25.3)
48
+ *
49
+ * F14.2 froze twelve keys and called the union closed. `"crs"` is added by an
50
+ * explicit amendment, not by growth: it is the widget for `ngis:outputCrs`, the
51
+ * one **platform** parameter every tool's UI schema carries (F25.4), and there
52
+ * was no key in the twelve that could carry a coordinate reference system
53
+ * without lying about it — `select` would have needed a closed choice list over
54
+ * the EPSG registry, and `text` would have accepted anything.
55
+ *
56
+ * Because {@link NgisWidgetRegistry} is a *total* mapped type, an external
57
+ * implementer that does not add the key **fails to compile. That is the intended
58
+ * signal**, recorded here as an amendment rather than discovered as an accident.
59
+ * S25-02 enumerated every implementer in the repo — there are none outside
60
+ * `src/` — and the union has **nine** in-repo gate sites, not one; F25.3 lists
61
+ * them.
45
62
  */
46
- export type NgisWidgetKey = "resource-select" | "resource-multi" | "select" | "multi-select" | "switch" | "number" | "integer" | "text" | "textarea" | "output-name" | "field-select" | "extent";
63
+ export type NgisWidgetKey = "resource-select" | "resource-multi" | "select" | "multi-select" | "switch" | "number" | "integer" | "text" | "textarea" | "output-name" | "field-select" | "extent" | "crs";
47
64
  export interface NgisUiSchemaChoice {
48
65
  value: string;
49
66
  label: string;
@@ -109,7 +126,26 @@ export interface NgisToolUiSchema {
109
126
  * rule `recipeVersion` carries in F14.6).
110
127
  */
111
128
  export declare const NGIS_UI_SCHEMA_VERSION: 1;
112
- /** `PASS | ADAPTABLE | UNKNOWN | FAIL`, passed through verbatim. */
129
+ /**
130
+ * `PASS | ADAPTABLE | UNKNOWN | FAIL`, passed through verbatim.
131
+ *
132
+ * **Stage 29 (F29.8) — `verdict` and issue code are INDEPENDENT axes.**
133
+ * `"ADAPTABLE"` is the same token for Stage 26's **CRS** adaptation and Stage
134
+ * 29's **kind** adaptation; `verdict` carries *what*, `issues[]` carries *why*,
135
+ * and **only the issue code distinguishes them**. A test that asserts nothing but
136
+ * `verdict === "ADAPTABLE"` passes on the CRS case (`binding-adaptable.json`
137
+ * `B02`) and proves Stage 26's code path rather than this stage's — which is why
138
+ * the predicate is `isKindAdaptableIssue` in
139
+ * `src/domain/models/dataset-kind.ts`, over the code and never over the verdict.
140
+ *
141
+ * The kind code is `KIND_ADAPTABLE`, severity `advisory`, `port` set, and **`fix`
142
+ * absent** — `NgisValidationIssueFix` means *"set this parameter to this value"*
143
+ * and there is no parameter that turns a kind adaptation on or off, so a client
144
+ * rendering a one-click fix here has invented an affordance the server cannot
145
+ * honour. (CRS differs: `ngis:outputCrs` is a real parameter.) `NgisCrsIssueCode`
146
+ * is already open, so the code needs no union edit. Rendering it is `S29-33`'s
147
+ * (W3), and the client never re-classifies a server verdict or severity (`G-U`).
148
+ */
113
149
  export type NgisBindingVerdict = "PASS" | "ADAPTABLE" | "UNKNOWN" | "FAIL";
114
150
  /** `READY | NEEDS_CONFIGURATION | NOT_EXECUTABLE`, passed through verbatim. */
115
151
  export type NgisExecutionVerdict = "READY" | "NEEDS_CONFIGURATION" | "NOT_EXECUTABLE";
@@ -130,9 +166,30 @@ export interface NgisBindingValidationEntry {
130
166
  verdict: NgisBindingVerdict;
131
167
  reason: string;
132
168
  geometry_type: string;
133
- srid: number;
134
- native_srid: number;
135
- working_srid: number;
169
+ /**
170
+ * **Stage 25 (F25.1):** the numeric triple `srid` / `native_srid` /
171
+ * `working_srid` is gone **from this interface**. It was one of the three SRID
172
+ * vocabularies that never met, and the only one that could tell a caller
173
+ * "unknown" — it spelled it `0`, which every consumer read as a CRS. A
174
+ * binding's CRS is the dataset's `crs: NgisCrsRef | null`.
175
+ *
176
+ * **CORRECTION OF RECORD (`S25-V255`, S25-32, W3).** This comment used to say
177
+ * the triple was gone "from this entry **and from the wire**". The second half
178
+ * was false when it was written and is still false: `validation_rest.py:72-74`
179
+ * and `binding_validation.py:183-185` send all three fields on both the REST
180
+ * and the gRPC leg to this day. The W3 kickoff marked them
181
+ * `[deprecated = true]` in `geoanalysis.proto`; removing them needs
182
+ * `binding_validation.py`'s `x-required-srid` path to lose its only CRS
183
+ * source, which is not a W3 change.
184
+ *
185
+ * The distinction matters because this file is **quoted verbatim** into the
186
+ * published contract reference at `/market/devkit/docs`: a wrong sentence here
187
+ * is a wrong sentence in the SDK documentation a plugin author reads. What is
188
+ * true is that **the client drops them on the floor** — nothing in this repo
189
+ * declares or reads them, so no frontend code path can be misled by a `0`.
190
+ * That is a client guarantee, not a wire fact, and the two are only the same
191
+ * sentence when the server has actually stopped sending.
192
+ */
136
193
  access_mode: string;
137
194
  executable: boolean;
138
195
  }
@@ -145,6 +202,19 @@ export interface NgisBindingValidation {
145
202
  unresolved_ports: readonly string[];
146
203
  errors: readonly string[];
147
204
  warnings: readonly string[];
205
+ /**
206
+ * **Stage 25 (F25.6), additive.** Typed per-port issues. The F14.9 string
207
+ * arrays above are unchanged and keep their meaning; this channel carries the
208
+ * `param`/`port` routing and the one-click `fix` a string cannot.
209
+ *
210
+ * This half and {@link NgisExecutionValidation.issues} are **one channel read
211
+ * at two levels**, exactly as the F14.9 string arrays are: a blocking entry
212
+ * here blocks the submit too. Reading only the other level was `S29-V234`.
213
+ *
214
+ * Optional because a server that has not shipped F25.6 omits it, and an
215
+ * absent `issues` is "the server said nothing", never "the server said fine".
216
+ */
217
+ issues?: readonly NgisValidationIssue[];
148
218
  }
149
219
  /** `ValidateToolExecutionResponse`, field-for-field, with `normalized_params_json`
150
220
  * replaced by the decoded `normalized_params` object (the one divergence). */
@@ -161,6 +231,15 @@ export interface NgisExecutionValidation {
161
231
  execution_mode: NgisExecutionMode;
162
232
  /** Decoded. The proto's `normalized_params_json` string is never sent to a browser. */
163
233
  normalized_params: Readonly<Record<string, string>>;
234
+ /**
235
+ * **Stage 25 (F25.6), additive.** See {@link NgisBindingValidation.issues}.
236
+ * `isSubmitBlocked` counts a `severity: "blocking"` entry here **or on that
237
+ * half**, in addition to F14.9's existing rule; the client never suppresses,
238
+ * downgrades or re-classifies a server issue (G-U) — and declining to gate on
239
+ * a severity the server declared is a suppression, which is why reading only
240
+ * this level was a defect (`S29-V234`) rather than a narrower reading.
241
+ */
242
+ issues?: readonly NgisValidationIssue[];
164
243
  }
165
244
  /** `POST /api/analysis/tools/{tool_id}/validate-execution` body. */
166
245
  export interface NgisValidateExecutionBody {
@@ -172,7 +251,32 @@ export interface NgisValidateExecutionBody {
172
251
  expected_scene_generation?: number;
173
252
  output_mode?: NgisOutputMode;
174
253
  target_resource_id?: string | null;
175
- target_srid?: number;
254
+ /**
255
+ * **Stage 25 (F25.12):** `target_srid` is removed. It was typed, forwarded to
256
+ * validation, and **set by no component** — dead plumbing, and its presence
257
+ * made a numeric SRID look like a supported way to ask for a projection. The
258
+ * replacement is F25.4's `outputCrs?: string` (a `NgisCrsRef` key, not an
259
+ * integer), added on the submit and validate bodies by the W2 session that
260
+ * owns `RunButton` / `run-data.ts`.
261
+ *
262
+ * **Added here by S25-23 (W2), which is that session.**
263
+ */
264
+ /**
265
+ * **Stage 25 (F25.4).** The `ngis:outputCrs` platform parameter, as an
266
+ * `NgisCrsRef` **key** (`"EPSG:32650"`, `"custom:<ulid>"`).
267
+ *
268
+ * **This one field is camelCase in an otherwise snake_case body, and that is
269
+ * the server's spelling, not a slip.** The W2 dispatch is explicit: the proto
270
+ * carries `output_crs` on `SubmitTaskRequest` / the validate messages, and the
271
+ * REST legs take `outputCrs`. Re-spelling it here to match the neighbours
272
+ * would put a field on the wire that `ngis-geoanalysis` does not read — which
273
+ * is exactly the failure `target_srid` had, arriving forever and meaning
274
+ * nothing.
275
+ *
276
+ * Absent means "compute in the primary input's own CRS" (R4). The client never
277
+ * substitutes a value for an absent one (G-CRS).
278
+ */
279
+ outputCrs?: string;
176
280
  }
177
281
  /** `POST /api/analysis/tools/{tool_id}/validate-bindings` body. */
178
282
  export interface NgisValidateBindingsBody {
@@ -184,7 +184,44 @@ export interface PackageManifestDto {
184
184
  homepage?: string;
185
185
  publisher?: string;
186
186
  changelog?: string;
187
+ /**
188
+ * Semantic tool requirements declared by a UI plugin. The alias is local to
189
+ * this manifest; only the host receives the resolved, opaque implementation
190
+ * id at runtime. A bundle must therefore bind a tool through its alias, never
191
+ * through a UUID copied from the tool catalogue.
192
+ */
193
+ toolDependencies?: NgisToolDependencyDeclaration[];
194
+ }
195
+ /** Stable, publisher-owned identity for a tool dependency. */
196
+ export interface NgisToolDependencyReference {
197
+ namespace: string;
198
+ toolKey: string;
199
+ contractRange: string;
200
+ }
201
+ /** Optional structural contract that narrows a semantic dependency further. */
202
+ export interface NgisToolDependencyRequiredContract {
203
+ inputs?: Record<string, string>;
204
+ outputs?: Record<string, string>;
205
+ parameters?: string[];
187
206
  }
207
+ export interface NgisToolDependencyDeclaration {
208
+ /** Locally unique manifest key, used by plugin code at runtime. */
209
+ alias: string;
210
+ ref: NgisToolDependencyReference;
211
+ requiredContract?: NgisToolDependencyRequiredContract;
212
+ }
213
+ /** Resolver outcomes are intentionally specific enough to render an honest UI. */
214
+ export type NgisToolDependencyUnavailableReason = "tool_missing" | "tool_disabled" | "tool_forbidden" | "tool_version_unavailable" | "tool_contract_incompatible" | "dependency_unavailable";
215
+ export type NgisResolvedToolDependency = {
216
+ available: true;
217
+ toolId: string;
218
+ toolRevision: number;
219
+ contractVersion: string;
220
+ schemaFingerprint: string;
221
+ } | {
222
+ available: false;
223
+ reason: NgisToolDependencyUnavailableReason;
224
+ };
188
225
  export interface ExtensionInstallDto {
189
226
  extId: string;
190
227
  enabled: boolean;
@@ -267,6 +304,12 @@ export interface BootExtensionEntryDto {
267
304
  manifest: PackageManifestDto;
268
305
  bundleUrl: string;
269
306
  integrity: string;
307
+ /**
308
+ * Per-viewer resolution of `manifest.toolDependencies`. This is host data,
309
+ * not bundle configuration: `toolId` is deliberately never written back into
310
+ * the manifest or exposed as an authoring-time identifier.
311
+ */
312
+ dependencies?: Record<string, NgisResolvedToolDependency>;
270
313
  /**
271
314
  * The resolved version's declared scopes — a projection of
272
315
  * `manifest.permissions` (Stage 13 XB1), where an absent key and `[]` mean
@@ -83,7 +83,7 @@ export type GisToolId = "draw-point" | "draw-line" | "draw-polygon" | "draw-rect
83
83
  * command catalog; host-only composite controls can ride on the rail without
84
84
  * becoming invocable map tools.
85
85
  */
86
- export type GisRailItemId = GisToolId | "multi-view" | "flow-field";
86
+ export type GisRailItemId = GisToolId | "multi-view" | "smart-plotting";
87
87
  /** How a tool behaves when invoked from the rail. */
88
88
  export type GisToolKind = "mode" | "measure" | "action" | "dropdown";
89
89
  /** One-shot actions the rail fires on the map via the imperative handle
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@ngis/plugin-ui",
3
- "version": "0.4.0",
4
- "description": "Host-connected React components and flow bindings for NeoGIS plugin authors.",
5
- "license": "Apache-2.0",
3
+ "version": "0.4.1",
4
+ "description": "Host-connected smart components for NGIS plugin authors (Stage 14, F14.14). Pickers, the generated ParamForm, run/task/result surfaces and <Flow> bindings. Consumed in-repo through the pnpm workspace; the backend tarball channel is deferred to Stage 15.",
5
+ "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "type": "module",
8
- "sideEffects": false,
9
8
  "main": "./dist/index.cjs",
10
9
  "module": "./dist/index.mjs",
11
10
  "types": "./dist/index.d.ts",
@@ -16,42 +15,12 @@
16
15
  "require": "./dist/index.cjs"
17
16
  }
18
17
  },
19
- "files": [
20
- "dist"
21
- ],
22
- "engines": {
23
- "node": ">=20"
24
- },
25
18
  "peerDependencies": {
26
- "@ngis/plugin-sdk": "^0.4.0",
27
- "react": "^19.0.0"
28
- },
29
- "peerDependenciesMeta": {
30
- "@ngis/plugin-sdk": {
31
- "optional": true
32
- },
33
- "react": {
34
- "optional": true
35
- }
19
+ "@ngis/plugin-sdk": "0.4.1"
36
20
  },
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/GeoScenarioScripter/NeoGIS-Frontend.git",
40
- "directory": "packages/plugin-ui"
41
- },
42
- "homepage": "https://github.com/GeoScenarioScripter/NeoGIS-Frontend#readme",
43
- "bugs": {
44
- "url": "https://github.com/GeoScenarioScripter/NeoGIS-Frontend/issues"
45
- },
46
- "keywords": [
47
- "neogis",
48
- "gis",
49
- "plugin",
50
- "react"
21
+ "files": [
22
+ "dist"
51
23
  ],
52
- "publishConfig": {
53
- "access": "public"
54
- },
55
24
  "scripts": {
56
25
  "build": "node scripts/build.mjs",
57
26
  "prepack": "npm run build"
package/LICENSE DELETED
@@ -1,13 +0,0 @@
1
- Copyright 2026 NeoGIS contributors
2
-
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
-
7
- https://www.apache.org/licenses/LICENSE-2.0
8
-
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
package/README.md DELETED
@@ -1,25 +0,0 @@
1
- # @ngis/plugin-ui
2
-
3
- Host-connected React components and flow bindings for NeoGIS plugin authors.
4
-
5
- ```bash
6
- npm install --save-dev @ngis/plugin-sdk @ngis/plugin-ui react @types/react
7
- ```
8
-
9
- ```tsx
10
- import { ResourceSelect } from "@ngis/plugin-ui";
11
-
12
- <ResourceSelect
13
- host={host}
14
- value={resourceId}
15
- onChange={setResourceId}
16
- />;
17
- ```
18
-
19
- This is a NeoGIS host contract, not a standalone component library. The running
20
- host owns the component implementations and React instance; the npm package
21
- ships their public declarations and lazy host-delegating shims. Plugin builds
22
- must leave `react`, `react-dom`, `react/jsx-runtime`, `@ngis/plugin-sdk`, and
23
- `@ngis/plugin-ui` external.
24
-
25
- `@ngis/plugin-ui` and `@ngis/plugin-sdk` use the same API version.