@chrtco/sdk 0.10.45 → 0.10.46

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/dist/index.cjs CHANGED
@@ -57,6 +57,7 @@ __export(index_exports, {
57
57
  ChrtError: () => ChrtError,
58
58
  DEFAULT_CLICK_TOLERANCE: () => DEFAULT_CLICK_TOLERANCE,
59
59
  DEFAULT_CUSTOM_STYLE_CONFIG: () => DEFAULT_CUSTOM_STYLE_CONFIG,
60
+ DEFAULT_DEPTH_LABEL_SIZE: () => DEFAULT_DEPTH_LABEL_SIZE,
60
61
  DEFAULT_INSPECT_CLASS_RANK: () => DEFAULT_INSPECT_CLASS_RANK,
61
62
  DEFAULT_LABEL_SETTINGS: () => DEFAULT_LABEL_SETTINGS,
62
63
  DEFAULT_NAV_AID_SETTINGS: () => DEFAULT_NAV_AID_SETTINGS,
@@ -68,6 +69,8 @@ __export(index_exports, {
68
69
  DEFAULT_WATER_BODY_SETTINGS: () => DEFAULT_WATER_BODY_SETTINGS,
69
70
  DEPARE_FILL_BRANCH_TOKENS: () => DEPARE_FILL_BRANCH_TOKENS,
70
71
  DEPARE_FILL_FALLBACK_TOKEN: () => DEPARE_FILL_FALLBACK_TOKEN,
72
+ DEPTH_LABEL_CLASSES: () => DEPTH_LABEL_CLASSES,
73
+ DEPTH_LABEL_SIZES: () => DEPTH_LABEL_SIZES,
71
74
  DRAPEABLE_LAYER_TYPES: () => DRAPEABLE_LAYER_TYPES,
72
75
  INSPECT_CLASS_RANK: () => INSPECT_CLASS_RANK,
73
76
  INSPECT_RANK_DEVIATIONS: () => INSPECT_RANK_DEVIATIONS,
@@ -84,6 +87,7 @@ __export(index_exports, {
84
87
  LAND_ATTRIBUTION: () => LAND_ATTRIBUTION,
85
88
  LAND_BUILD_MAXZOOM: () => LAND_BUILD_MAXZOOM,
86
89
  LAND_REGION: () => LAND_REGION,
90
+ LARGE_SOUNDING_PADDING_PX: () => LARGE_SOUNDING_PADDING_PX,
87
91
  NAUTICAL_SYMBOLS: () => NAUTICAL_SYMBOLS,
88
92
  NAV_AID_LAYER_GROUPS: () => NAV_AID_LAYER_GROUPS,
89
93
  NAV_AID_QUERY_LAYERS: () => NAV_AID_QUERY_LAYERS,
@@ -138,6 +142,7 @@ __export(index_exports, {
138
142
  applyChrtSymbolSet: () => applyChrtSymbolSet,
139
143
  applyColorTheme: () => applyColorTheme,
140
144
  applyCustomStyleSettings: () => applyCustomStyleSettings,
145
+ applyDepthLabelSize: () => applyDepthLabelSize,
141
146
  applyRasterSymbolSet: () => applyRasterSymbolSet,
142
147
  applyS101SymbolSet: () => applyS101SymbolSet,
143
148
  atonIconExpression: () => atonIconExpression,
@@ -218,6 +223,7 @@ __export(index_exports, {
218
223
  isDepthAreaClassLayerId: () => isDepthAreaClassLayerId,
219
224
  isDrapeable: () => isDrapeable,
220
225
  isLabelLayerVisible: () => isLabelLayerVisible,
226
+ isMapLive: () => isMapLive,
221
227
  isNavAidLayer: () => isNavAidLayer,
222
228
  isNavAidLayerVisible: () => isNavAidLayerVisible,
223
229
  isSoundingLayerVisible: () => isSoundingLayerVisible,
@@ -235,6 +241,7 @@ __export(index_exports, {
235
241
  normalizeTheme: () => normalizeTheme,
236
242
  opaqueSplitBaseOf: () => opaqueSplitBaseOf,
237
243
  paginate: () => paginate,
244
+ parseDepthLabelSize: () => parseDepthLabelSize,
238
245
  parseListCodes: () => parseListCodes,
239
246
  parseSigseqTerms: () => parseSigseqTerms,
240
247
  parseSymbolFamily: () => parseSymbolFamily,
@@ -5299,6 +5306,11 @@ function capLuminance(hex, ceiling) {
5299
5306
  var NIGHT_INK = S52_NIGHT.CHBLK;
5300
5307
  var NIGHT_MUTED_INK = scaleLinearLight(S52_NIGHT.CHBLK, 0.43);
5301
5308
 
5309
+ // src/atlas/map-live.ts
5310
+ function isMapLive(map) {
5311
+ return map._removed !== true;
5312
+ }
5313
+
5302
5314
  // src/atlas/s52-linestyles-generated.ts
5303
5315
  var S52_LINESTYLES = {
5304
5316
  ACHARE51: {
@@ -27975,6 +27987,67 @@ function iconExpressionForFamily(objectClass, family) {
27975
27987
  }
27976
27988
  }
27977
27989
 
27990
+ // src/atlas/depth-label-size.ts
27991
+ var DEPTH_LABEL_SIZES = ["standard", "large"];
27992
+ var DEFAULT_DEPTH_LABEL_SIZE = "standard";
27993
+ function parseDepthLabelSize(raw) {
27994
+ if (!raw) return null;
27995
+ const lower = raw.toLowerCase();
27996
+ return DEPTH_LABEL_SIZES.find((s) => s === lower) ?? null;
27997
+ }
27998
+ var DEPTH_LABEL_CLASSES = /* @__PURE__ */ new Set([
27999
+ "SOUNDG",
28000
+ "DEPCNT",
28001
+ "UWTROC",
28002
+ "OBSTRN",
28003
+ "WRECKS"
28004
+ ]);
28005
+ var SEMIBOLD = ["Open Sans Semibold"];
28006
+ var HAZARD_DEPTH = {
28007
+ textSize: ["interpolate", ["linear"], ["zoom"], 12, 12, 16, 15],
28008
+ haloWidth: 1.4,
28009
+ font: SEMIBOLD
28010
+ };
28011
+ var LARGE = {
28012
+ // Standard: 7 / 8 / 10 / 12 at z8 / 11 / 14 / 16, halo 1.0, Semibold.
28013
+ SOUNDG: {
28014
+ textSize: ["interpolate", ["linear"], ["zoom"], 8, 10, 11, 11, 14, 14, 16, 17],
28015
+ haloWidth: 1.2,
28016
+ font: SEMIBOLD
28017
+ },
28018
+ // Standard: 8 / 10 at z10 / 14, halo 1.2, Regular.
28019
+ //
28020
+ // ⚠ ~1.2x, NOT 1.4x, AND SEMIBOLD CARRIES THE REST. A contour value rides
28021
+ // its line (`symbol-placement: line`) and needs a straight-enough run to fit;
28022
+ // it also shares rank 300 with the soundings, which place first. At 1.4x the
28023
+ // Boston harbour view kept 15 of Standard's 20 contour labels; at 1.2x, 18.
28024
+ DEPCNT: {
28025
+ textSize: ["interpolate", ["linear"], ["zoom"], 10, 10, 14, 12],
28026
+ haloWidth: 1.2,
28027
+ font: SEMIBOLD
28028
+ },
28029
+ UWTROC: HAZARD_DEPTH,
28030
+ OBSTRN: HAZARD_DEPTH,
28031
+ WRECKS: HAZARD_DEPTH
28032
+ };
28033
+ var LARGE_SOUNDING_PADDING_PX = 3.5;
28034
+ function applyDepthLabelSize(objectClass, layer, size) {
28035
+ if (size !== "large") return layer;
28036
+ const large = LARGE[objectClass];
28037
+ if (large === void 0) return layer;
28038
+ const layout = {
28039
+ ...layer.layout ?? {},
28040
+ "text-size": large.textSize,
28041
+ "text-font": [...large.font]
28042
+ };
28043
+ if (objectClass === "SOUNDG") layout["text-padding"] = LARGE_SOUNDING_PADDING_PX;
28044
+ return {
28045
+ ...layer,
28046
+ layout,
28047
+ paint: { ...layer.paint, "text-halo-width": large.haloWidth }
28048
+ };
28049
+ }
28050
+
27978
28051
  // src/atlas/base-bundle.ts
27979
28052
  var BASE_BUNDLE_ID = BASE_REGION;
27980
28053
  var BASE_BUNDLE_SCHEMA = "chrt.basemap-bundle/1";
@@ -29315,7 +29388,7 @@ function buildLabelLayer2(objectClass, ct, sourceId = DEFAULT_REGION, depthUnits
29315
29388
  if (getLabelBehavior(objectClass) === "orientation-cross-band") {
29316
29389
  layer.filter = LABEL_ANCHOR_FILTER;
29317
29390
  }
29318
- return layer;
29391
+ return applyDepthLabelSize(objectClass, layer, labelOpts.depthLabelSize);
29319
29392
  }
29320
29393
  function getGeomTypesForClass(objectClass, defaultType) {
29321
29394
  if (SYMBOL_MAP[objectClass] && defaultType === "symbol") {
@@ -29664,6 +29737,12 @@ var BASE_THEMES = {
29664
29737
  // CHRTland's own tan — one land colour
29665
29738
  inlandWater: "#B9CFDD",
29666
29739
  // muted, unmistakably not a charted blue
29740
+ // The uncharted hatch's stripe, held to 2.3:1 against `inlandWater` in
29741
+ // every palette (`inland-hatch-contrast.test.ts`) — the hatch says "we have
29742
+ // not charted this water", and stripes the eye cannot find say nothing.
29743
+ // DAY 3.08:1, darker than its ground. Also the colour the artwork file
29744
+ // itself is drawn in.
29745
+ inlandHatch: "#5B7383",
29667
29746
  // State furniture. These three were referenced by the layers but missing
29668
29747
  // from this table (and its type — the long-standing TS2339 trio), so the
29669
29748
  // lines shipped on MapLibre's DEFAULT black. Now deliberate: a hairline
@@ -29694,6 +29773,9 @@ var BASE_THEMES = {
29694
29773
  boundary: "#293135",
29695
29774
  jurisdiction: "#867D64",
29696
29775
  inlandWater: "#62717A",
29776
+ // Owner's choice, 2026-10-04: dark stripes, 2.37:1. The DAY stripe here
29777
+ // was 1.02:1 — invisible, so an uncharted lake read as plain water.
29778
+ inlandHatch: "#2E383F",
29697
29779
  // Label stays DARK here — the halo is still mid-toned, so 3:1 is reachable
29698
29780
  // downward and a bright label would be a new light source at dusk.
29699
29781
  stateLine: "#B5A987",
@@ -29727,6 +29809,10 @@ var BASE_THEMES = {
29727
29809
  boundary: "#131719",
29728
29810
  jurisdiction: "#353128",
29729
29811
  inlandWater: "#232A30",
29812
+ // The DAY stripe, lighter than this ground: 2.92:1, and L 0.16, under the
29813
+ // NIGHT muted-ink ceiling (`night-luminance.test.ts`). Red night draws the
29814
+ // NIGHT chart, so this is its stripe too.
29815
+ inlandHatch: "#5B7383",
29730
29816
  stateLine: "#484236",
29731
29817
  stateLabel: "#837963",
29732
29818
  stateHalo: "#353128",
@@ -30853,7 +30939,8 @@ function generateStyle(palette = "DAY", opts = {}) {
30853
30939
  label: buildLabelLayer2(objectClass, palette, sourceId, opts.depthUnits ?? "meters", {
30854
30940
  safetyContour: opts.safetyContour,
30855
30941
  twoShadeSoundings: opts.twoShadeSoundings,
30856
- soundingFontWeight: opts.soundingFontWeight
30942
+ soundingFontWeight: opts.soundingFontWeight,
30943
+ depthLabelSize: opts.depthLabelSize
30857
30944
  })
30858
30945
  });
30859
30946
  }
@@ -32200,6 +32287,7 @@ var Chrt = class {
32200
32287
  ChrtError,
32201
32288
  DEFAULT_CLICK_TOLERANCE,
32202
32289
  DEFAULT_CUSTOM_STYLE_CONFIG,
32290
+ DEFAULT_DEPTH_LABEL_SIZE,
32203
32291
  DEFAULT_INSPECT_CLASS_RANK,
32204
32292
  DEFAULT_LABEL_SETTINGS,
32205
32293
  DEFAULT_NAV_AID_SETTINGS,
@@ -32211,6 +32299,8 @@ var Chrt = class {
32211
32299
  DEFAULT_WATER_BODY_SETTINGS,
32212
32300
  DEPARE_FILL_BRANCH_TOKENS,
32213
32301
  DEPARE_FILL_FALLBACK_TOKEN,
32302
+ DEPTH_LABEL_CLASSES,
32303
+ DEPTH_LABEL_SIZES,
32214
32304
  DRAPEABLE_LAYER_TYPES,
32215
32305
  INSPECT_CLASS_RANK,
32216
32306
  INSPECT_RANK_DEVIATIONS,
@@ -32227,6 +32317,7 @@ var Chrt = class {
32227
32317
  LAND_ATTRIBUTION,
32228
32318
  LAND_BUILD_MAXZOOM,
32229
32319
  LAND_REGION,
32320
+ LARGE_SOUNDING_PADDING_PX,
32230
32321
  NAUTICAL_SYMBOLS,
32231
32322
  NAV_AID_LAYER_GROUPS,
32232
32323
  NAV_AID_QUERY_LAYERS,
@@ -32281,6 +32372,7 @@ var Chrt = class {
32281
32372
  applyChrtSymbolSet,
32282
32373
  applyColorTheme,
32283
32374
  applyCustomStyleSettings,
32375
+ applyDepthLabelSize,
32284
32376
  applyRasterSymbolSet,
32285
32377
  applyS101SymbolSet,
32286
32378
  atonIconExpression,
@@ -32361,6 +32453,7 @@ var Chrt = class {
32361
32453
  isDepthAreaClassLayerId,
32362
32454
  isDrapeable,
32363
32455
  isLabelLayerVisible,
32456
+ isMapLive,
32364
32457
  isNavAidLayer,
32365
32458
  isNavAidLayerVisible,
32366
32459
  isSoundingLayerVisible,
@@ -32378,6 +32471,7 @@ var Chrt = class {
32378
32471
  normalizeTheme,
32379
32472
  opaqueSplitBaseOf,
32380
32473
  paginate,
32474
+ parseDepthLabelSize,
32381
32475
  parseListCodes,
32382
32476
  parseSigseqTerms,
32383
32477
  parseSymbolFamily,