@sovereignsquad/gds-core 3.9.0 → 6.9.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/README.md +33 -0
- package/dist/GdsBadge-DqTdnomt.d.mts +417 -0
- package/dist/GdsBadge-DqTdnomt.d.ts +417 -0
- package/dist/PartnerDiscovery-As_-JKtb.d.ts +732 -0
- package/dist/PartnerDiscovery-Bwxixtka.d.mts +732 -0
- package/dist/QuickStartCard-Bgjdfs_t.d.ts +20798 -0
- package/dist/QuickStartCard-DnZMDjzb.d.mts +20798 -0
- package/dist/chunk-3B5MK2PG.mjs +6349 -0
- package/dist/{chunk-TQ7ZYMEA.mjs → chunk-5G3XZWSW.mjs} +4916 -6400
- package/dist/chunk-5GH7XD7X.mjs +430 -0
- package/dist/chunk-6WDH57MJ.mjs +430 -0
- package/dist/chunk-A32PWTD2.mjs +430 -0
- package/dist/chunk-BD5XQH5Z.mjs +430 -0
- package/dist/chunk-DBJE4TRO.mjs +430 -0
- package/dist/chunk-EQ7Y2PUI.mjs +1842 -0
- package/dist/chunk-F76YTG3S.mjs +430 -0
- package/dist/chunk-HJVDKPVW.mjs +245 -0
- package/dist/chunk-IMT3UTOT.mjs +430 -0
- package/dist/chunk-J66ITCXC.mjs +473 -0
- package/dist/chunk-KEYBUMOR.mjs +430 -0
- package/dist/chunk-KLFTBWEG.mjs +430 -0
- package/dist/chunk-KNP35WAB.mjs +27 -0
- package/dist/chunk-LERXSJHD.mjs +430 -0
- package/dist/chunk-MKEWYVTJ.mjs +430 -0
- package/dist/chunk-NTNVQZJU.mjs +89 -0
- package/dist/chunk-OH5HH4G3.mjs +430 -0
- package/dist/chunk-SPPTDVJC.mjs +211 -0
- package/dist/chunk-W5O2JSVK.mjs +20 -0
- package/dist/{chunk-BUC7QXRO.mjs → chunk-WI24JME4.mjs} +13 -5
- package/dist/chunk-ZFGYQSNR.mjs +33 -0
- package/dist/client.d.mts +1616 -64
- package/dist/client.d.ts +1616 -64
- package/dist/client.js +13417 -6683
- package/dist/client.mjs +303 -60
- package/dist/en-D9CWSH3F.d.mts +428 -0
- package/dist/en-D9CWSH3F.d.ts +428 -0
- package/dist/index.d.mts +632 -5
- package/dist/index.d.ts +632 -5
- package/dist/index.js +22423 -13558
- package/dist/index.mjs +2198 -61
- package/dist/locales/lazy/all.d.mts +2 -0
- package/dist/locales/lazy/all.d.ts +2 -0
- package/dist/locales/lazy/all.js +5150 -0
- package/dist/locales/lazy/all.mjs +50 -0
- package/dist/locales/lazy/ar.d.mts +2 -0
- package/dist/locales/lazy/ar.d.ts +2 -0
- package/dist/locales/lazy/ar.js +870 -0
- package/dist/locales/lazy/ar.mjs +10 -0
- package/dist/locales/lazy/de.d.mts +2 -0
- package/dist/locales/lazy/de.d.ts +2 -0
- package/dist/locales/lazy/de.js +870 -0
- package/dist/locales/lazy/de.mjs +10 -0
- package/dist/locales/lazy/es.d.mts +2 -0
- package/dist/locales/lazy/es.d.ts +2 -0
- package/dist/locales/lazy/es.js +870 -0
- package/dist/locales/lazy/es.mjs +10 -0
- package/dist/locales/lazy/fr.d.mts +2 -0
- package/dist/locales/lazy/fr.d.ts +2 -0
- package/dist/locales/lazy/fr.js +870 -0
- package/dist/locales/lazy/fr.mjs +10 -0
- package/dist/locales/lazy/he.d.mts +2 -0
- package/dist/locales/lazy/he.d.ts +2 -0
- package/dist/locales/lazy/he.js +870 -0
- package/dist/locales/lazy/he.mjs +10 -0
- package/dist/locales/lazy/hu.d.mts +2 -0
- package/dist/locales/lazy/hu.d.ts +2 -0
- package/dist/locales/lazy/hu.js +870 -0
- package/dist/locales/lazy/hu.mjs +10 -0
- package/dist/locales/lazy/index.d.mts +25 -0
- package/dist/locales/lazy/index.d.ts +25 -0
- package/dist/locales/lazy/index.js +479 -0
- package/dist/locales/lazy/index.mjs +9 -0
- package/dist/locales/lazy/it.d.mts +2 -0
- package/dist/locales/lazy/it.d.ts +2 -0
- package/dist/locales/lazy/it.js +870 -0
- package/dist/locales/lazy/it.mjs +10 -0
- package/dist/locales/lazy/ja.d.mts +2 -0
- package/dist/locales/lazy/ja.d.ts +2 -0
- package/dist/locales/lazy/ja.js +870 -0
- package/dist/locales/lazy/ja.mjs +10 -0
- package/dist/locales/lazy/ko.d.mts +2 -0
- package/dist/locales/lazy/ko.d.ts +2 -0
- package/dist/locales/lazy/ko.js +870 -0
- package/dist/locales/lazy/ko.mjs +10 -0
- package/dist/locales/lazy/ru.d.mts +2 -0
- package/dist/locales/lazy/ru.d.ts +2 -0
- package/dist/locales/lazy/ru.js +870 -0
- package/dist/locales/lazy/ru.mjs +10 -0
- package/dist/locales/lazy/zh.d.mts +2 -0
- package/dist/locales/lazy/zh.d.ts +2 -0
- package/dist/locales/lazy/zh.js +870 -0
- package/dist/locales/lazy/zh.mjs +10 -0
- package/dist/map.css +658 -0
- package/dist/map.d.mts +118 -0
- package/dist/map.d.ts +118 -0
- package/dist/map.js +778 -0
- package/dist/map.mjs +395 -0
- package/dist/reference-theme-explorer.d.mts +34 -0
- package/dist/reference-theme-explorer.d.ts +34 -0
- package/dist/reference-theme-explorer.js +9488 -0
- package/dist/reference-theme-explorer.mjs +1988 -0
- package/dist/rich-text-editor.d.mts +32 -0
- package/dist/rich-text-editor.d.ts +32 -0
- package/dist/rich-text-editor.js +469 -0
- package/dist/rich-text-editor.mjs +115 -0
- package/dist/server.d.mts +112 -248
- package/dist/server.d.ts +112 -248
- package/dist/server.js +8461 -1889
- package/dist/server.mjs +598 -57
- package/package.json +110 -10
- package/dist/AISearchCard-Bbnsd-yl.d.mts +0 -7786
- package/dist/AISearchCard-Bbnsd-yl.d.ts +0 -7786
- package/dist/chunk-5AJJNRZF.mjs +0 -5847
package/dist/map.d.mts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { GdsAccentName, GdsThemePresetId } from '@sovereignsquad/gds-theme';
|
|
4
|
+
import { G as GdsBadgeAccentShade } from './GdsBadge-DqTdnomt.mjs';
|
|
5
|
+
import '@mantine/core';
|
|
6
|
+
import '@tabler/icons-react';
|
|
7
|
+
|
|
8
|
+
/** A tile source and the credit that must be displayed wherever it renders. */
|
|
9
|
+
interface GdsMapTileSource {
|
|
10
|
+
/** Tile URL template. */
|
|
11
|
+
url: string;
|
|
12
|
+
/** Plain-text credit. Required — a source without one cannot be constructed. */
|
|
13
|
+
attributionText: string;
|
|
14
|
+
/** Link the credit points at. */
|
|
15
|
+
attributionHref: string;
|
|
16
|
+
/** Maximum zoom the source serves. */
|
|
17
|
+
maxZoom: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default source: OpenStreetMap's standard raster tiles. Frozen so the attribution cannot be
|
|
21
|
+
* mutated off the shared object.
|
|
22
|
+
*/
|
|
23
|
+
declare const GDS_OSM_TILE_SOURCE: GdsMapTileSource;
|
|
24
|
+
/** Thrown when a tile source is missing the credit its licence requires. */
|
|
25
|
+
declare class GdsTileAttributionError extends Error {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validates a tile source before use. Throws rather than falling back to the default.
|
|
30
|
+
*/
|
|
31
|
+
declare function assertGdsTileSource(source: GdsMapTileSource): GdsMapTileSource;
|
|
32
|
+
|
|
33
|
+
/** A geographic point. */
|
|
34
|
+
interface GdsLatLng {
|
|
35
|
+
lat: number;
|
|
36
|
+
lng: number;
|
|
37
|
+
}
|
|
38
|
+
/** A geographic rectangle. */
|
|
39
|
+
interface GdsLatLngBounds {
|
|
40
|
+
north: number;
|
|
41
|
+
south: number;
|
|
42
|
+
east: number;
|
|
43
|
+
west: number;
|
|
44
|
+
}
|
|
45
|
+
/** What the map is centred on and how far it is zoomed. */
|
|
46
|
+
interface GdsMapViewport {
|
|
47
|
+
center: GdsLatLng;
|
|
48
|
+
zoom: number;
|
|
49
|
+
}
|
|
50
|
+
/** One placed marker. */
|
|
51
|
+
interface GdsMapMarker {
|
|
52
|
+
id: string;
|
|
53
|
+
position: GdsLatLng;
|
|
54
|
+
accent: GdsAccentName;
|
|
55
|
+
/** Accessible name. Required; never derive from an icon's import name. */
|
|
56
|
+
label: string;
|
|
57
|
+
shade?: GdsBadgeAccentShade;
|
|
58
|
+
/** The position is approximate; rendered distinctly rather than implying false precision. */
|
|
59
|
+
approximate?: boolean;
|
|
60
|
+
selected?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** Lifecycle state, surfaced so a consumer can render its own loading and error affordances. */
|
|
63
|
+
type GdsMapState = 'initializing' | 'ready' | 'error';
|
|
64
|
+
/** Props for {@link GdsMap}. */
|
|
65
|
+
interface GdsMapProps {
|
|
66
|
+
/** Markers to place. Re-placed imperatively when this changes, because Leaflet owns their DOM. */
|
|
67
|
+
markers: GdsMapMarker[];
|
|
68
|
+
/** Controlled viewport. When supplied the map does not self-manage its view. */
|
|
69
|
+
viewport?: GdsMapViewport;
|
|
70
|
+
/** Initial viewport when uncontrolled. Ignored once `viewport` is supplied. */
|
|
71
|
+
defaultViewport?: GdsMapViewport;
|
|
72
|
+
/** Fit to these bounds on mount. Mutually exclusive with `defaultViewport`. */
|
|
73
|
+
fitBounds?: GdsLatLngBounds;
|
|
74
|
+
/** Closest-out zoom the user may reach. Defaults to 3 — far enough out to show a continent. */
|
|
75
|
+
minZoom?: number;
|
|
76
|
+
/** Closest-in zoom. Clamped to what the tile source actually serves, so tiles never 404. */
|
|
77
|
+
maxZoom?: number;
|
|
78
|
+
/** Restricts panning, so a user cannot lose the map entirely. */
|
|
79
|
+
maxBounds?: GdsLatLngBounds;
|
|
80
|
+
/**
|
|
81
|
+
* Fired after the view settles. `reason` distinguishes a user gesture from a programmatic
|
|
82
|
+
* move, so a consumer syncing URL state does not fight its own updates.
|
|
83
|
+
*/
|
|
84
|
+
onViewportChange?: (viewport: GdsMapViewport, reason: 'user' | 'programmatic') => void;
|
|
85
|
+
/** Fired when a marker is activated. Receives the marker id, never the engine's object. */
|
|
86
|
+
onMarkerSelect?: (markerId: string) => void;
|
|
87
|
+
/** Currently selected marker id, for a consumer driving selection from outside the map. */
|
|
88
|
+
selectedMarkerId?: string;
|
|
89
|
+
/** `false` renders a non-interactive map. */
|
|
90
|
+
interactive?: boolean;
|
|
91
|
+
/** Preset and scheme the map is themed by; drives the destroy/re-init on a theme switch. */
|
|
92
|
+
preset?: GdsThemePresetId | string;
|
|
93
|
+
/** Colour scheme the map is themed by; part of the identity that triggers re-initialisation. */
|
|
94
|
+
colorScheme?: 'light' | 'dark';
|
|
95
|
+
/** Accessible name for the map region. Required, for the same reason marker labels are. */
|
|
96
|
+
label: string;
|
|
97
|
+
/** Reports lifecycle transitions, so a consumer can render its own loading or error affordance. */
|
|
98
|
+
onStateChange?: (state: GdsMapState) => void;
|
|
99
|
+
/** Height of the map surface. Defaults to a governed token. */
|
|
100
|
+
height?: string;
|
|
101
|
+
/** Tile source. Defaults to OpenStreetMap; any replacement must carry its own attribution. */
|
|
102
|
+
tileSource?: GdsMapTileSource;
|
|
103
|
+
/** Placement of the text-equivalent marker list. No value removes it; presence isn't configurable. */
|
|
104
|
+
listPlacement?: 'below' | 'above';
|
|
105
|
+
/** On-map preview for a selected marker. Renders inside a Leaflet popup via a React portal. */
|
|
106
|
+
renderMarkerPreview?: (markerId: string) => ReactNode;
|
|
107
|
+
/** No tile access expected (air-gapped/restricted network). Renders markers/list without tiles, as the intended state. */
|
|
108
|
+
offline?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Map surface backed by Leaflet and OpenStreetMap raster tiles.
|
|
112
|
+
*
|
|
113
|
+
* Exported from a dedicated subpath, not the main barrel, since Leaflet is browser-only.
|
|
114
|
+
* Renders a placeholder on the server and during initialisation.
|
|
115
|
+
*/
|
|
116
|
+
declare function GdsMap({ markers, viewport, defaultViewport, fitBounds, minZoom, maxZoom, maxBounds, onViewportChange, onMarkerSelect, selectedMarkerId, interactive, preset, colorScheme, label, onStateChange, height, tileSource, listPlacement, offline, renderMarkerPreview, }: GdsMapProps): react.JSX.Element;
|
|
117
|
+
|
|
118
|
+
export { GDS_OSM_TILE_SOURCE, type GdsLatLng, type GdsLatLngBounds, GdsMap, type GdsMapMarker, type GdsMapProps, type GdsMapState, type GdsMapTileSource, type GdsMapViewport, GdsTileAttributionError, assertGdsTileSource };
|
package/dist/map.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { GdsAccentName, GdsThemePresetId } from '@sovereignsquad/gds-theme';
|
|
4
|
+
import { G as GdsBadgeAccentShade } from './GdsBadge-DqTdnomt.js';
|
|
5
|
+
import '@mantine/core';
|
|
6
|
+
import '@tabler/icons-react';
|
|
7
|
+
|
|
8
|
+
/** A tile source and the credit that must be displayed wherever it renders. */
|
|
9
|
+
interface GdsMapTileSource {
|
|
10
|
+
/** Tile URL template. */
|
|
11
|
+
url: string;
|
|
12
|
+
/** Plain-text credit. Required — a source without one cannot be constructed. */
|
|
13
|
+
attributionText: string;
|
|
14
|
+
/** Link the credit points at. */
|
|
15
|
+
attributionHref: string;
|
|
16
|
+
/** Maximum zoom the source serves. */
|
|
17
|
+
maxZoom: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default source: OpenStreetMap's standard raster tiles. Frozen so the attribution cannot be
|
|
21
|
+
* mutated off the shared object.
|
|
22
|
+
*/
|
|
23
|
+
declare const GDS_OSM_TILE_SOURCE: GdsMapTileSource;
|
|
24
|
+
/** Thrown when a tile source is missing the credit its licence requires. */
|
|
25
|
+
declare class GdsTileAttributionError extends Error {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Validates a tile source before use. Throws rather than falling back to the default.
|
|
30
|
+
*/
|
|
31
|
+
declare function assertGdsTileSource(source: GdsMapTileSource): GdsMapTileSource;
|
|
32
|
+
|
|
33
|
+
/** A geographic point. */
|
|
34
|
+
interface GdsLatLng {
|
|
35
|
+
lat: number;
|
|
36
|
+
lng: number;
|
|
37
|
+
}
|
|
38
|
+
/** A geographic rectangle. */
|
|
39
|
+
interface GdsLatLngBounds {
|
|
40
|
+
north: number;
|
|
41
|
+
south: number;
|
|
42
|
+
east: number;
|
|
43
|
+
west: number;
|
|
44
|
+
}
|
|
45
|
+
/** What the map is centred on and how far it is zoomed. */
|
|
46
|
+
interface GdsMapViewport {
|
|
47
|
+
center: GdsLatLng;
|
|
48
|
+
zoom: number;
|
|
49
|
+
}
|
|
50
|
+
/** One placed marker. */
|
|
51
|
+
interface GdsMapMarker {
|
|
52
|
+
id: string;
|
|
53
|
+
position: GdsLatLng;
|
|
54
|
+
accent: GdsAccentName;
|
|
55
|
+
/** Accessible name. Required; never derive from an icon's import name. */
|
|
56
|
+
label: string;
|
|
57
|
+
shade?: GdsBadgeAccentShade;
|
|
58
|
+
/** The position is approximate; rendered distinctly rather than implying false precision. */
|
|
59
|
+
approximate?: boolean;
|
|
60
|
+
selected?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** Lifecycle state, surfaced so a consumer can render its own loading and error affordances. */
|
|
63
|
+
type GdsMapState = 'initializing' | 'ready' | 'error';
|
|
64
|
+
/** Props for {@link GdsMap}. */
|
|
65
|
+
interface GdsMapProps {
|
|
66
|
+
/** Markers to place. Re-placed imperatively when this changes, because Leaflet owns their DOM. */
|
|
67
|
+
markers: GdsMapMarker[];
|
|
68
|
+
/** Controlled viewport. When supplied the map does not self-manage its view. */
|
|
69
|
+
viewport?: GdsMapViewport;
|
|
70
|
+
/** Initial viewport when uncontrolled. Ignored once `viewport` is supplied. */
|
|
71
|
+
defaultViewport?: GdsMapViewport;
|
|
72
|
+
/** Fit to these bounds on mount. Mutually exclusive with `defaultViewport`. */
|
|
73
|
+
fitBounds?: GdsLatLngBounds;
|
|
74
|
+
/** Closest-out zoom the user may reach. Defaults to 3 — far enough out to show a continent. */
|
|
75
|
+
minZoom?: number;
|
|
76
|
+
/** Closest-in zoom. Clamped to what the tile source actually serves, so tiles never 404. */
|
|
77
|
+
maxZoom?: number;
|
|
78
|
+
/** Restricts panning, so a user cannot lose the map entirely. */
|
|
79
|
+
maxBounds?: GdsLatLngBounds;
|
|
80
|
+
/**
|
|
81
|
+
* Fired after the view settles. `reason` distinguishes a user gesture from a programmatic
|
|
82
|
+
* move, so a consumer syncing URL state does not fight its own updates.
|
|
83
|
+
*/
|
|
84
|
+
onViewportChange?: (viewport: GdsMapViewport, reason: 'user' | 'programmatic') => void;
|
|
85
|
+
/** Fired when a marker is activated. Receives the marker id, never the engine's object. */
|
|
86
|
+
onMarkerSelect?: (markerId: string) => void;
|
|
87
|
+
/** Currently selected marker id, for a consumer driving selection from outside the map. */
|
|
88
|
+
selectedMarkerId?: string;
|
|
89
|
+
/** `false` renders a non-interactive map. */
|
|
90
|
+
interactive?: boolean;
|
|
91
|
+
/** Preset and scheme the map is themed by; drives the destroy/re-init on a theme switch. */
|
|
92
|
+
preset?: GdsThemePresetId | string;
|
|
93
|
+
/** Colour scheme the map is themed by; part of the identity that triggers re-initialisation. */
|
|
94
|
+
colorScheme?: 'light' | 'dark';
|
|
95
|
+
/** Accessible name for the map region. Required, for the same reason marker labels are. */
|
|
96
|
+
label: string;
|
|
97
|
+
/** Reports lifecycle transitions, so a consumer can render its own loading or error affordance. */
|
|
98
|
+
onStateChange?: (state: GdsMapState) => void;
|
|
99
|
+
/** Height of the map surface. Defaults to a governed token. */
|
|
100
|
+
height?: string;
|
|
101
|
+
/** Tile source. Defaults to OpenStreetMap; any replacement must carry its own attribution. */
|
|
102
|
+
tileSource?: GdsMapTileSource;
|
|
103
|
+
/** Placement of the text-equivalent marker list. No value removes it; presence isn't configurable. */
|
|
104
|
+
listPlacement?: 'below' | 'above';
|
|
105
|
+
/** On-map preview for a selected marker. Renders inside a Leaflet popup via a React portal. */
|
|
106
|
+
renderMarkerPreview?: (markerId: string) => ReactNode;
|
|
107
|
+
/** No tile access expected (air-gapped/restricted network). Renders markers/list without tiles, as the intended state. */
|
|
108
|
+
offline?: boolean;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Map surface backed by Leaflet and OpenStreetMap raster tiles.
|
|
112
|
+
*
|
|
113
|
+
* Exported from a dedicated subpath, not the main barrel, since Leaflet is browser-only.
|
|
114
|
+
* Renders a placeholder on the server and during initialisation.
|
|
115
|
+
*/
|
|
116
|
+
declare function GdsMap({ markers, viewport, defaultViewport, fitBounds, minZoom, maxZoom, maxBounds, onViewportChange, onMarkerSelect, selectedMarkerId, interactive, preset, colorScheme, label, onStateChange, height, tileSource, listPlacement, offline, renderMarkerPreview, }: GdsMapProps): react.JSX.Element;
|
|
117
|
+
|
|
118
|
+
export { GDS_OSM_TILE_SOURCE, type GdsLatLng, type GdsLatLngBounds, GdsMap, type GdsMapMarker, type GdsMapProps, type GdsMapState, type GdsMapTileSource, type GdsMapViewport, GdsTileAttributionError, assertGdsTileSource };
|