@elite-dangerous-almanac/core 0.2.15 → 0.2.16
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 +19 -6
- package/dist/{chunk-T3WRI2U2.js → chunk-B5ZKDHBW.js} +1 -1
- package/dist/{chunk-T3WRI2U2.js.map → chunk-B5ZKDHBW.js.map} +1 -1
- package/dist/galaxy-map/index.d.ts +7 -2
- package/dist/galaxy-map/index.js +1 -1
- package/dist/galaxy-map/markers.d.ts +3 -2
- package/dist/galaxy-map/markers.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -68,9 +68,19 @@ assets/ships/<symbol>/schematic-top.svg
|
|
|
68
68
|
assets/ships/<symbol>/schematic-bottom.svg
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
`<symbol>` is the exact ship symbol returned by the ships catalogue.
|
|
72
|
-
|
|
73
|
-
the
|
|
71
|
+
`<symbol>` is the exact ship symbol returned by the ships catalogue. The package exports
|
|
72
|
+
every asset path under `@elite-dangerous-almanac/core/assets/`, so an application names
|
|
73
|
+
the file the catalogue names and lets its own bundler emit it:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
import illustration from '@elite-dangerous-almanac/core/assets/ships/SideWinder/illustration.svg?url';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The `?url` suffix is Vite's syntax, not the package's. Another bundler reaches the same
|
|
80
|
+
path through its own asset rule — webpack 5 takes a plain import against an
|
|
81
|
+
`asset/resource` rule, or `new URL('<path>', import.meta.url)`. TypeScript needs an
|
|
82
|
+
ambient declaration for whichever form you use, such as `vite/client` or your own
|
|
83
|
+
`declare module '*.svg?url'`; the package ships none, because the form is the bundler's.
|
|
74
84
|
|
|
75
85
|
`gunsight.svg` is a `600 × 600` frontal plot of the fixed-weapon aim points at a nominal
|
|
76
86
|
1,000-metre target range. Each weapon group under `#weapon-dots` carries the same
|
|
@@ -109,9 +119,12 @@ holds one SVG per marker:
|
|
|
109
119
|
assets/galaxy-map/<symbol>.svg
|
|
110
120
|
```
|
|
111
121
|
|
|
112
|
-
`<symbol>` is the exact symbol the catalogue returns
|
|
113
|
-
|
|
114
|
-
|
|
122
|
+
`<symbol>` is the exact symbol the catalogue returns, and the package exports that path,
|
|
123
|
+
so the catalogue and the artwork stay one source:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
import titan from '@elite-dangerous-almanac/core/assets/galaxy-map/titan.svg?url';
|
|
127
|
+
```
|
|
115
128
|
|
|
116
129
|
A marker is safe to embed inline as supplied: it holds only static `svg`, `title`,
|
|
117
130
|
`defs`, `mask`, `filter`, `feGaussianBlur`, `g`, `use`, `path`, `rect`, `circle` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createKeyIndex,findInKeyIndex}from"./chunk-BKWLI44T.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var markers_default=[{symbol:"bookmark",color:"#FF2800",frameColor:"#FF2800"},{symbol:"community-goal",color:"#FF9A00",frameColor:"#FF9A00"},{symbol:"conflict-zone",color:"#FFAE00",frameColor:"#FFAE00"},{symbol:"destination",color:"#FF2800",frameColor:"#FF2800"},{symbol:"engineer",color:"#FF2800",frameColor:"#FF2800"},{symbol:"fleet-carrier",color:"#FF2800",frameColor:"#FF2800"},{symbol:"front-line",color:"#9418FF",frameColor:"#4A00B5"},{symbol:"mission",color:"#005DFF",frameColor:"#005DFF"},{symbol:"squadron-carrier",color:"#63FFF7",frameColor:"#63FFF7"},{symbol:"starter-zone",color:"#FF2800",frameColor:"#FF2800"},{symbol:"station-abandoned",color:"#211C21",frameColor:"#211C21"},{symbol:"station-damaged",color:"#FF3400",frameColor:"#FF3400"},{symbol:"station-repairing",color:"#FF9210",frameColor:"#FF9210"},{symbol:"station-under-attack",color:"#FF0000",frameColor:"#FF0000"},{symbol:"titan",color:"#FF0000",frameColor:"#FF0000"},{symbol:"waypoint",color:"#FF2800",frameColor:"#FF2800"}];var GALAXY_MAP_MARKERS=deepFreeze(markers_default);var MARKER_INDEX=createKeyIndex(GALAXY_MAP_MARKERS,"symbol");function getGalaxyMapMarker(symbol){return findInKeyIndex(MARKER_INDEX,symbol,"getGalaxyMapMarker: symbol")}function getGalaxyMapMarkerColor(symbol){return findInKeyIndex(MARKER_INDEX,symbol,"getGalaxyMapMarkerColor: symbol")?.color??null}export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor};//# sourceMappingURL=chunk-
|
|
1
|
+
import{createKeyIndex,findInKeyIndex}from"./chunk-BKWLI44T.js";import{deepFreeze}from"./chunk-DURKO7JU.js";var markers_default=[{symbol:"bookmark",color:"#FF2800",frameColor:"#FF2800"},{symbol:"community-goal",color:"#FF9A00",frameColor:"#FF9A00"},{symbol:"conflict-zone",color:"#FFAE00",frameColor:"#FFAE00"},{symbol:"destination",color:"#FF2800",frameColor:"#FF2800"},{symbol:"engineer",color:"#FF2800",frameColor:"#FF2800"},{symbol:"fleet-carrier",color:"#FF2800",frameColor:"#FF2800"},{symbol:"front-line",color:"#9418FF",frameColor:"#4A00B5"},{symbol:"mission",color:"#005DFF",frameColor:"#005DFF"},{symbol:"squadron-carrier",color:"#63FFF7",frameColor:"#63FFF7"},{symbol:"starter-zone",color:"#FF2800",frameColor:"#FF2800"},{symbol:"station-abandoned",color:"#211C21",frameColor:"#211C21"},{symbol:"station-damaged",color:"#FF3400",frameColor:"#FF3400"},{symbol:"station-repairing",color:"#FF9210",frameColor:"#FF9210"},{symbol:"station-under-attack",color:"#FF0000",frameColor:"#FF0000"},{symbol:"titan",color:"#FF0000",frameColor:"#FF0000"},{symbol:"waypoint",color:"#FF2800",frameColor:"#FF2800"}];var GALAXY_MAP_MARKERS=deepFreeze(markers_default);var MARKER_INDEX=createKeyIndex(GALAXY_MAP_MARKERS,"symbol");function getGalaxyMapMarker(symbol){return findInKeyIndex(MARKER_INDEX,symbol,"getGalaxyMapMarker: symbol")}function getGalaxyMapMarkerColor(symbol){return findInKeyIndex(MARKER_INDEX,symbol,"getGalaxyMapMarkerColor: symbol")?.color??null}export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor};//# sourceMappingURL=chunk-B5ZKDHBW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/galaxy-map/markers.ts"],"names":["createKeyIndex","findInKeyIndex","deepFreeze","markers_default","symbol","color","GALAXY_MAP_MARKERS","MARKER_INDEX","getGalaxyMapMarker","getGalaxyMapMarkerColor"],"mappings":"O,
|
|
1
|
+
{"version":3,"sources":["../src/galaxy-map/markers.ts"],"names":["createKeyIndex","findInKeyIndex","deepFreeze","markers_default","symbol","color","GALAXY_MAP_MARKERS","MARKER_INDEX","getGalaxyMapMarker","getGalaxyMapMarkerColor"],"mappings":"O,4kCA8DO,IAAMM,mBAAiDJ,WAC1DC,iBAGJ,IAAMI,aAAeP,eAAeM,mBAAoB,UAmBjD,SAASE,mBAAmBJ,QAC/B,OAAOH,eAAeM,aAAcH,OAAQ,6BAChD,CAkBO,SAASK,wBAAwBL,QACpC,OAAOH,eAAeM,aAAcH,OAAQ,oCAAoCC,OAAS,IAC7F,QAAAC,mBAAAE,mBAAAC"}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* GALAXY_MAP_MARKERS[0].symbol; // -> 'bookmark'
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
|
-
* A symbol also names the marker's vector asset,
|
|
15
|
-
*
|
|
14
|
+
* A symbol also names the marker's vector asset, so one string gives both the colour
|
|
15
|
+
* and the file:
|
|
16
16
|
*
|
|
17
17
|
* ```ts
|
|
18
18
|
* import { getGalaxyMapMarker } from '@elite-dangerous-almanac/core/galaxy-map';
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
* `assets/galaxy-map/${symbol}.svg`; // -> 'assets/galaxy-map/titan.svg'
|
|
22
22
|
* ```
|
|
23
23
|
*
|
|
24
|
+
* The package exports that path under `@elite-dangerous-almanac/core/assets/`. A
|
|
25
|
+
* bundler resolves an asset import statically, so write the whole specifier as a
|
|
26
|
+
* literal — `@elite-dangerous-almanac/core/assets/galaxy-map/titan.svg` — rather than
|
|
27
|
+
* building it from a symbol at run time.
|
|
28
|
+
*
|
|
24
29
|
* Every shape in an asset paints with `currentColor`, and the root `<svg>` carries the
|
|
25
30
|
* marker's own colour. A host that embeds the file inline therefore recolours it with
|
|
26
31
|
* one CSS `color` declaration, and one that loads it with `<img>` keeps the game's
|
package/dist/galaxy-map/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor}from"../chunk-
|
|
1
|
+
export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor}from"../chunk-B5ZKDHBW.js"; //# sourceMappingURL=index.js.map
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* The galaxy map's location markers and the colours the game draws them in.
|
|
3
3
|
*
|
|
4
4
|
* @remarks
|
|
5
|
-
* Each marker's `symbol` also names its vector asset,
|
|
6
|
-
*
|
|
5
|
+
* Each marker's `symbol` also names its vector asset, which the package exports as
|
|
6
|
+
* `@elite-dangerous-almanac/core/assets/galaxy-map/<symbol>.svg` and whose root
|
|
7
|
+
* `<svg>` carries the same `color` this catalogue reports.
|
|
7
8
|
*
|
|
8
9
|
* Read from the in-game galaxy map; see
|
|
9
10
|
* [ATTRIBUTIONS.md](https://github.com/Elite-Dangerous-Almanac/Almanac-Core/blob/main/ATTRIBUTIONS.md)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor}from"../chunk-
|
|
1
|
+
export{GALAXY_MAP_MARKERS,getGalaxyMapMarker,getGalaxyMapMarkerColor}from"../chunk-B5ZKDHBW.js"; //# sourceMappingURL=markers.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elite-dangerous-almanac/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "Elite Dangerous static data and calculations: astronomy, ships and outfitting, personal equipment and engineering, materials, market commodities, localized display text and galaxy-map markers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"typescript"
|
|
50
50
|
],
|
|
51
51
|
"exports": {
|
|
52
|
+
"./assets/*": "./assets/*",
|
|
52
53
|
"./astro": {
|
|
53
54
|
"types": "./dist/astro/index.d.ts",
|
|
54
55
|
"import": "./dist/astro/index.js"
|