@chrtco/sdk 0.10.24 → 0.10.26

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
@@ -4764,7 +4764,7 @@ var S52_DAY = {
4764
4764
  SNDG1: "#7d898c",
4765
4765
  SNDG2: "#070707",
4766
4766
  DEPSC: "#525a5c",
4767
- DEPCN: "#7d898c",
4767
+ DEPCN: "#555555",
4768
4768
  // Utility / infrastructure
4769
4769
  UINFD: "#070707",
4770
4770
  UINFF: "#7d898c",
@@ -4838,7 +4838,7 @@ var S52_DUSK = {
4838
4838
  SNDG1: "#606060",
4839
4839
  SNDG2: "#b0b0b0",
4840
4840
  DEPSC: "#606060",
4841
- DEPCN: "#606060",
4841
+ DEPCN: "#2E2E2E",
4842
4842
  UINFD: "#b0b0b0",
4843
4843
  UINFF: "#606060",
4844
4844
  UINFR: "#b05060",
@@ -4909,7 +4909,24 @@ var S52_NIGHT = {
4909
4909
  SNDG1: "#383028",
4910
4910
  SNDG2: "#c8aa78",
4911
4911
  DEPSC: "#383028",
4912
- DEPCN: "#383028",
4912
+ // ⚠ DELIBERATE DEVIATION from the published S-52 NIGHT value (#1f2223),
4913
+ // recorded here because `docs/validation/s52-spec-gap-matrix.json` tracks
4914
+ // this token as `value-differs` and the CHRTstyles programme is bringing
4915
+ // colours TO spec — this one moves further away, on purpose.
4916
+ //
4917
+ // Spec NIGHT DEPCN is near-black, which measures ~1.1:1 against this
4918
+ // palette's own deep water (#051a28). S-52's NIGHT table assumes a
4919
+ // dark-adapted eye in a darkened wheelhouse; on a phone or a laptop at
4920
+ // anchor it is not dim, it is absent — reported as "can't see bottom
4921
+ // contours in night mode only". A contour nobody can see fails the
4922
+ // standard's intent while matching its number.
4923
+ //
4924
+ // The palette already makes this trade elsewhere and in the same
4925
+ // direction: NIGHT's CHBLK/CSTLN/OUTLW are #c8aa78, light warm linework on
4926
+ // dark water. This value is that family, dimmed to stay subordinate to the
4927
+ // coastline. Revisit with the CHRTstyles programme, which owns the
4928
+ // spec-vs-legibility call across all 63 tokens.
4929
+ DEPCN: "#A68E84",
4913
4930
  UINFD: "#c8aa78",
4914
4931
  UINFF: "#383028",
4915
4932
  UINFR: "#682030",
@@ -5843,7 +5860,16 @@ var S52_LOOKUP = {
5843
5860
  category: "Depths",
5844
5861
  displayCategory: "STANDARD",
5845
5862
  int1Ref: "I30",
5846
- style: { type: "line", paint: { "line-color": "CHGRD", "line-width": 0.5 } },
5863
+ // S-52 names a dedicated depth-contour colour, and this used the shared
5864
+ // chart-grey instead. Reported 2026-09-02: "can't see bottom contours in
5865
+ // night mode only" — measured at 1.06:1 against the deepest NIGHT water,
5866
+ // which is invisible. DAY was 2.00:1 and DUSK 1.63:1 off the same token,
5867
+ // so the bug was worst where the palette is darkest.
5868
+ //
5869
+ // CHGRD is shared by dozens of linestyles (s52-linestyles-generated.ts),
5870
+ // so it could not be retuned for contours without moving all of them.
5871
+ // DEPCN exists in all three palettes and is the token S-52 specifies.
5872
+ style: { type: "line", paint: { "line-color": "DEPCN", "line-width": 0.5 } },
5847
5873
  viewingGroup: 13030,
5848
5874
  scamin: 45e3
5849
5875
  },
@@ -28611,6 +28637,9 @@ function bandVariantMinzoom(layer, B) {
28611
28637
  if (isExemptOpaqueFill(layer) && FILL_FLOOR_FREE_BANDS.has(B)) {
28612
28638
  return classMinzoom;
28613
28639
  }
28640
+ if (isExemptOpaqueFill(layer)) {
28641
+ return BAND_PRIORITY_RANGES[B].minzoom;
28642
+ }
28614
28643
  return Math.max(classMinzoom, BAND_PRIORITY_RANGES[B].minzoom);
28615
28644
  }
28616
28645
  var GENERALISED_AREA_FILL_CLASSES = /* @__PURE__ */ new Set([
@@ -29633,6 +29662,7 @@ var DOMINANCE_EXEMPT_CLASSES = /* @__PURE__ */ new Set([
29633
29662
  "RTPBCN",
29634
29663
  "RDOSTA"
29635
29664
  ]);
29665
+ var FINE_LAND_REPAINT_MIN_BAND = 4;
29636
29666
  function isDominanceExempt(layer) {
29637
29667
  for (const cls of DOMINANCE_EXEMPT_CLASSES) {
29638
29668
  if (layer.id.startsWith(`s52-${cls}-`)) return true;
@@ -30010,7 +30040,9 @@ function generateStyle(palette = "DAY", opts = {}) {
30010
30040
  }
30011
30041
  }
30012
30042
  {
30013
- const TERMINAL_FILL_RE = /^s52-(?:LNDARE|DEPARE)-fill-band[456]$/;
30043
+ const TERMINAL_FILL_RE = new RegExp(
30044
+ `^s52-(?:${[...DOMINANCE_EXEMPT_FILL_CLASSES].join("|")})-fill-band[456]$`
30045
+ );
30014
30046
  for (const l of layers) {
30015
30047
  const lay = l;
30016
30048
  if (!TERMINAL_FILL_RE.test(lay.id)) continue;
@@ -30142,6 +30174,20 @@ function generateStyle(palette = "DAY", opts = {}) {
30142
30174
  repaint.push(domVariant);
30143
30175
  }
30144
30176
  }
30177
+ if (parseInt(b, 10) >= FINE_LAND_REPAINT_MIN_BAND) {
30178
+ for (const l of relocated.filter(
30179
+ (x) => bandOf(x) === b && isLndareFill(x)
30180
+ )) {
30181
+ const src = l;
30182
+ const landClone = {
30183
+ ...asBaseTan(l),
30184
+ id: `${src.id}-overpair`,
30185
+ metadata: { ...src.metadata ?? {}, "chrt:role": "charted-land-repaint" }
30186
+ };
30187
+ delete landClone.maxzoom;
30188
+ repaint.push(landClone);
30189
+ }
30190
+ }
30145
30191
  }
30146
30192
  const isCoalneLine = (l) => /^s52-COALNE-line-band\d(-domBy\d)?$/.test(l.id);
30147
30193
  for (const l of layers.filter(isCoalneLine)) {
@@ -30170,6 +30216,21 @@ function generateStyle(palette = "DAY", opts = {}) {
30170
30216
  ...restAbove.slice(pairAt + 1)
30171
30217
  ];
30172
30218
  }
30219
+ {
30220
+ const hsAt = restFinal.findIndex(
30221
+ (l) => l.type === "hillshade"
30222
+ );
30223
+ let lastRepaint = -1;
30224
+ restFinal.forEach((l, i) => {
30225
+ if (/-overpair(-|$)/.test(l.id)) lastRepaint = i;
30226
+ });
30227
+ if (hsAt !== -1 && lastRepaint > hsAt) {
30228
+ const reordered = [...restFinal];
30229
+ const [hs] = reordered.splice(hsAt, 1);
30230
+ reordered.splice(lastRepaint, 0, hs);
30231
+ restFinal = reordered;
30232
+ }
30233
+ }
30173
30234
  return [restFinal[0], ...baseBlock, ...seaare, ...ordered, ...restFinal.slice(1)];
30174
30235
  })() : layers;
30175
30236
  for (const id of [