@chrtco/sdk 0.10.6 → 0.10.8
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/CHANGELOG.md +16 -0
- package/dist/atlas/browser.cjs +12 -1
- package/dist/atlas/browser.cjs.map +1 -1
- package/dist/atlas/browser.js +12 -1
- package/dist/atlas/browser.js.map +1 -1
- package/dist/index.cjs +1222 -542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -8
- package/dist/index.d.ts +141 -8
- package/dist/index.js +1216 -542
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to `@chrtco/sdk` will be documented in this file.
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
7
|
### Added
|
|
8
|
+
- **CHRTland on the Style API** — `StyleUrlOptions.land` / `.relief` thread
|
|
9
|
+
`?land=` / `?relief=` to `GET /v1/styles/{region}/style.json`. `generateStyle`
|
|
10
|
+
learned to emit CHRTland and the first-party app learned to ask for it, but
|
|
11
|
+
the SERVED style had no parameter, so every consumer that takes its style
|
|
12
|
+
from the worker — CHRTsail included — got a document with no `chrtland-*`
|
|
13
|
+
layers and no `CHRT_LAND` source at all. `land=1` adds the land base beneath
|
|
14
|
+
every S-57 class (it can never occlude a portrayal); `relief=1` adds the
|
|
15
|
+
terrarium hillshade, is separately opt-in, and requires `land` (`relief`
|
|
16
|
+
alone is a typed 400). Both are authorized like any region: the token must
|
|
17
|
+
carry `CHRT_LAND` / `CHRT_RELIEF` or the request is a 403 naming the missing
|
|
18
|
+
one, so a served style never declares a source whose tiles the holder cannot
|
|
19
|
+
fetch. **`CHRT_RELIEF` is granted by no chart source yet, so `relief=1` is
|
|
20
|
+
refused today** — it begins working with no SDK or API change once that
|
|
21
|
+
grant ships. CHRTland is **not chart data and not from a hydrographic
|
|
22
|
+
office**; never present its shoreline as charted. New exports: `LAND_REGION`,
|
|
23
|
+
`RELIEF_REGION`.
|
|
8
24
|
- **Render-mode lever on the Style API** (`sail#2`): `StyleUrlOptions.mode` /
|
|
9
25
|
`OfflineFetchStyleOptions.mode` — `"continuous"` (default) or
|
|
10
26
|
`"chart:{band}"` (`chart:Overview | chart:General | chart:Coastal |
|
package/dist/atlas/browser.cjs
CHANGED
|
@@ -15819,13 +15819,24 @@ var S101_TABLES = {
|
|
|
15819
15819
|
DUSK: S101_DUSK,
|
|
15820
15820
|
NIGHT: S101_NIGHT
|
|
15821
15821
|
};
|
|
15822
|
+
var warnedTokens = /* @__PURE__ */ new Set();
|
|
15823
|
+
function reportUnresolvedToken(token, table) {
|
|
15824
|
+
const key = `${table}:${token}`;
|
|
15825
|
+
if (warnedTokens.has(key)) return;
|
|
15826
|
+
warnedTokens.add(key);
|
|
15827
|
+
console.warn(
|
|
15828
|
+
`[chrt/s101] colour token "${token}" is not defined in the official S-101 ${table} profile. The symbol using it will draw with a substituted colour, which on a chart changes what the symbol MEANS. Re-check the vendored assets/s101/css/${table.toLowerCase()}SvgStyle.css against the pinned catalogue commit.`
|
|
15829
|
+
);
|
|
15830
|
+
}
|
|
15822
15831
|
function getThemedS101Svg(symbolName, table = "DAY") {
|
|
15823
15832
|
const raw = S101_POINT_SVGS[symbolName];
|
|
15824
15833
|
if (!raw) return null;
|
|
15825
15834
|
return raw.replace(/(fill|stroke)="([A-Z][A-Z0-9]{3,5})"/g, (match, attr, token) => {
|
|
15826
15835
|
if (token === "none") return match;
|
|
15827
15836
|
const hex = S101_TABLES[table][token];
|
|
15828
|
-
|
|
15837
|
+
if (hex) return `${attr}="${hex}"`;
|
|
15838
|
+
reportUnresolvedToken(token, table);
|
|
15839
|
+
return match;
|
|
15829
15840
|
});
|
|
15830
15841
|
}
|
|
15831
15842
|
|