jmapcloud-ng-core-types 2.0.23-qa.2 → 2.0.23-qa.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "2.0.23-qa.2",
3
+ "version": "2.0.23-qa.4",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "types": "ambient.d.ts",
@@ -320,6 +320,8 @@ declare global {
320
320
  /** @internal */ type JSimpleSearchResult = simplesearch.JSimpleSearchResult
321
321
  /** @internal */ type JSimpleSearchResultHit = simplesearch.JSimpleSearchResultHit
322
322
  /** @internal */ type JWindow = startupoptions.JWindow
323
+ /** @internal */ type JCoreUIPreset = startupoptions.JCoreUIPreset
324
+ /** @internal */ type JCoreUIOptions = startupoptions.JCoreUIOptions
323
325
  /** @internal */ type JCoreOptions = startupoptions.JCoreOptions
324
326
  /** @internal */ type JTABLE_ATTRIBUTE_TYPES = table.JTABLE_ATTRIBUTE_TYPES
325
327
  /** @internal */ const JTABLE_ATTRIBUTE_TYPES: typeof table.JTABLE_ATTRIBUTE_TYPES
@@ -14,12 +14,103 @@ export type JWindow = globalThis.Window & {
14
14
  __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: any
15
15
  }
16
16
 
17
+ /**
18
+ * A ready-made choice of interface pieces for the `ui` startup option.
19
+ *
20
+ * - `"full"`: the side panel, simple search, geocoding and the Add Geometry button when eligible.
21
+ * - `"minimal"`: the map and its own controls, without those app controls.
22
+ */
23
+ export type JCoreUIPreset = "full" | "minimal"
24
+
25
+ /**
26
+ * Piece-by-piece choice of the NG interface, for the `ui` startup option.
27
+ *
28
+ * Start from a preset and write only the pieces that differ from it:
29
+ *
30
+ * ```html
31
+ * <script type="text/javascript">
32
+ * window.JMAP_OPTIONS = {
33
+ * ...
34
+ * // A map with the simple search control and nothing else.
35
+ * ui: { preset: "minimal", simpleSearch: true }
36
+ * }
37
+ * </script>
38
+ * ```
39
+ *
40
+ * A piece written here wins over the older option for the same piece
41
+ * (`application.simpleSearchControlVisible`, `application.geocodingControlVisible`) and
42
+ * over its URL parameter. A piece that only comes from the preset does not.
43
+ *
44
+ * `JMap.Application` and the `application` startup options are available when the drawer,
45
+ * simple search or geocoding is enabled. The mouseover does not require the application UI.
46
+ *
47
+ * A piece that is off turns off what depends on it. With the drawer off, no panel is
48
+ * opened at startup (`application.panel`, `ngPanel`) and the entries that open the
49
+ * geometry panel are hidden: the Add Geometry button and the edit menu's geometry entry.
50
+ *
51
+ * Unknown UI options and invalid values are ignored, with a warning in the console.
52
+ */
53
+ export interface JCoreUIOptions {
54
+ /**
55
+ * The preset the pieces start from. Default: `"full"`.
56
+ */
57
+ preset?: JCoreUIPreset
58
+ /**
59
+ * The side panel: its menu, its panels and its open/close button.
60
+ *
61
+ * When `false`, the panels are not displayed. What is only reachable from a panel is
62
+ * then unavailable: the selection table, the print layout, the attribute table, and the
63
+ * logout, language and theme settings.
64
+ *
65
+ * Use `true` or `{ panels: { layer: false, "reports-panel": true } }` to enable the drawer.
66
+ * An explicit panel entry overrides `application.disabledPanels` and `ngDisabledPanels`,
67
+ * including `all`. `false` hides the panel without disabling its extension; `true` allows
68
+ * it to appear once registered. This applies to built-in and extension panels at every
69
+ * map size.
70
+ *
71
+ * The preset decides the panels that `panels` does not list. In `"full"` they follow
72
+ * `application.disabledPanels` and `ngDisabledPanels`. In `"minimal"` they are hidden,
73
+ * so `{ preset: "minimal", drawer: { panels: { layer: true } } }` displays the layer
74
+ * panel alone.
75
+ *
76
+ * With `panels`, `JMap.Application.Panel.add` ignores a panel that is hidden here, and
77
+ * `JMap.Application.Panel.removeById` can remove the last panel.
78
+ *
79
+ * `application.panel` and `application.sidePanelInitialVisibility` apply to a drawer
80
+ * that is enabled. The drawer is not displayed when no panels are available.
81
+ */
82
+ drawer?: boolean | { panels?: Record<string, boolean> }
83
+ /**
84
+ * The simple search control over the map.
85
+ */
86
+ simpleSearch?: boolean
87
+ /**
88
+ * The geocoding ("find location") control over the map.
89
+ */
90
+ geocoding?: boolean
91
+ /**
92
+ * The map's feature popup. Defaults to `true` in both presets and follows the layer's
93
+ * existing popup eligibility. `false` suppresses popups without disabling selection.
94
+ */
95
+ mouseOver?: boolean
96
+ /**
97
+ * The Add Geometry ("+") button over the map. Defaults to `true` in `"full"` and to
98
+ * `false` in `"minimal"`.
99
+ *
100
+ * The button opens the drawer's `geometry` panel, so it requires the drawer, that panel
101
+ * and an editable layer. With the drawer off or the `geometry` panel hidden, `true` is
102
+ * ignored with a warning in the console. This option does not change editing
103
+ * permissions or other creation and editing entry points.
104
+ */
105
+ addGeometry?: boolean
106
+ }
107
+
17
108
  /**
18
109
  * Startup options for JMap Cloud NG.
19
110
  *
20
111
  * Set `window.JMAP_OPTIONS` before loading the JMap Cloud NG script. The same
21
- * package can start with the full interface (`ui: "full"`, the default) or with
22
- * a minimal interface (`ui: "minimal"`).
112
+ * package can start with the full interface (`ui: "full"`, the default), with
113
+ * a minimal interface (`ui: "minimal"`), or with a chosen set of interface pieces.
23
114
  *
24
115
  * ```html
25
116
  * <html>
@@ -339,21 +430,25 @@ export interface JCoreOptions {
339
430
  extensionsUrlOverride?: JExtensionServerOverride[]
340
431
  /**
341
432
  * @deprecated Has no effect and is ignored at runtime. Control the shell with the `ui`
342
- * startup option (`"full"` | `"minimal"`) or the `?ngUi=` URL parameter instead. Kept
343
- * for source compatibility and will be removed in a future major version.
433
+ * startup option or the `?ngUi=` URL parameter instead. Kept for source compatibility
434
+ * and will be removed in a future major version.
344
435
  *
345
436
  * Previously: setting this to `true` suppressed the built-in boot shell
346
437
  * (loader, login panel, project selection panel).
347
438
  */
348
439
  hideMainLayout?: boolean
349
440
  /**
350
- * Selects which UI shell NG renders on top of the map runtime.
441
+ * Chooses which pieces of the NG interface are displayed over the map.
442
+ *
443
+ * - `"full"` (default): the side panel, simple search, geocoding and the Add Geometry
444
+ * button when eligible.
445
+ * - `"minimal"`: the map and its own controls. `JMap.Application` is not available.
446
+ * - an object: a preset plus the pieces to turn on or off. See {@link JCoreUIOptions}.
351
447
  *
352
- * - `"full"` (default) loads the full NG side-panel UI as a lazy chunk.
353
- * - `"minimal"` boots the map runtime and skips the full-UI chunk entirely.
448
+ * The value is read once, when NG starts, and cannot be changed afterwards.
354
449
  *
355
- * Equivalent to the `?ngUi=full|minimal` URL parameter (also accepted as `#ngUi=…`); this
356
- * option wins when both are set.
450
+ * A preset can also be given in the URL as `?ngUi=full|minimal` (also accepted as
451
+ * `#ngUi=…`); this option wins when both are set. The object has no URL form.
357
452
  */
358
- ui?: "full" | "minimal"
453
+ ui?: JCoreUIPreset | JCoreUIOptions
359
454
  }