@chrtco/sdk 0.10.6 → 0.10.7
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/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 +660 -479
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -7
- package/dist/index.d.ts +91 -7
- package/dist/index.js +656 -479
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/atlas/browser.js
CHANGED
|
@@ -15781,13 +15781,24 @@ var S101_TABLES = {
|
|
|
15781
15781
|
DUSK: S101_DUSK,
|
|
15782
15782
|
NIGHT: S101_NIGHT
|
|
15783
15783
|
};
|
|
15784
|
+
var warnedTokens = /* @__PURE__ */ new Set();
|
|
15785
|
+
function reportUnresolvedToken(token, table) {
|
|
15786
|
+
const key = `${table}:${token}`;
|
|
15787
|
+
if (warnedTokens.has(key)) return;
|
|
15788
|
+
warnedTokens.add(key);
|
|
15789
|
+
console.warn(
|
|
15790
|
+
`[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.`
|
|
15791
|
+
);
|
|
15792
|
+
}
|
|
15784
15793
|
function getThemedS101Svg(symbolName, table = "DAY") {
|
|
15785
15794
|
const raw = S101_POINT_SVGS[symbolName];
|
|
15786
15795
|
if (!raw) return null;
|
|
15787
15796
|
return raw.replace(/(fill|stroke)="([A-Z][A-Z0-9]{3,5})"/g, (match, attr, token) => {
|
|
15788
15797
|
if (token === "none") return match;
|
|
15789
15798
|
const hex = S101_TABLES[table][token];
|
|
15790
|
-
|
|
15799
|
+
if (hex) return `${attr}="${hex}"`;
|
|
15800
|
+
reportUnresolvedToken(token, table);
|
|
15801
|
+
return match;
|
|
15791
15802
|
});
|
|
15792
15803
|
}
|
|
15793
15804
|
|