@versatiles/style 5.2.4 → 5.2.5

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.
Files changed (45) hide show
  1. package/README.MD +74 -42
  2. package/dist/color/abstract.d.ts +4 -4
  3. package/dist/color/hsl.d.ts +3 -3
  4. package/dist/color/hsl.js +4 -4
  5. package/dist/color/hsv.d.ts +3 -3
  6. package/dist/color/hsv.js +4 -4
  7. package/dist/color/index.d.ts +5 -5
  8. package/dist/color/index.js +5 -5
  9. package/dist/color/random.d.ts +1 -1
  10. package/dist/color/random.js +2 -2
  11. package/dist/color/rgb.d.ts +3 -3
  12. package/dist/color/rgb.js +4 -4
  13. package/dist/guess_style/guess_style.d.ts +1 -1
  14. package/dist/guess_style/guess_style.js +5 -5
  15. package/dist/guess_style/index.d.ts +2 -2
  16. package/dist/guess_style/index.js +1 -1
  17. package/dist/index.d.ts +13 -13
  18. package/dist/index.js +4 -4
  19. package/dist/lib/utils.js +1 -1
  20. package/dist/shortbread/index.d.ts +2 -2
  21. package/dist/shortbread/index.js +2 -2
  22. package/dist/shortbread/layers.d.ts +2 -2
  23. package/dist/style_builder/decorator.d.ts +3 -3
  24. package/dist/style_builder/decorator.js +3 -3
  25. package/dist/style_builder/recolor.d.ts +1 -1
  26. package/dist/style_builder/recolor.js +1 -1
  27. package/dist/style_builder/style_builder.d.ts +4 -4
  28. package/dist/style_builder/style_builder.js +5 -5
  29. package/dist/style_builder/types.d.ts +2 -2
  30. package/dist/styles/colorful.d.ts +2 -2
  31. package/dist/styles/colorful.js +1 -1
  32. package/dist/styles/eclipse.d.ts +1 -1
  33. package/dist/styles/eclipse.js +1 -1
  34. package/dist/styles/empty.d.ts +2 -2
  35. package/dist/styles/empty.js +1 -1
  36. package/dist/styles/graybeard.d.ts +1 -1
  37. package/dist/styles/graybeard.js +1 -1
  38. package/dist/styles/index.d.ts +1 -1
  39. package/dist/styles/index.js +5 -5
  40. package/dist/styles/neutrino.d.ts +2 -2
  41. package/dist/styles/neutrino.js +1 -1
  42. package/dist/types/index.d.ts +5 -5
  43. package/dist/types/index.js +2 -2
  44. package/dist/types/tilejson.d.ts +1 -1
  45. package/package.json +1 -1
package/README.MD CHANGED
@@ -5,37 +5,45 @@
5
5
 
6
6
  # VersaTiles Style
7
7
 
8
- Generates styles and sprites for MapLibre.
8
+ **VersaTiles Style** generates styles and sprites for MapLibre.
9
9
 
10
- # Styles
10
+ ---
11
11
 
12
- style name | preview
13
- -----------|--------------------------------------------------------------------------
14
- colorful | <img width="384" src="screenshots/colorful.png" alt="colorful style" />
15
- graybeard | <img width="384" src="screenshots/graybeard.png" alt="graybeard style" />
16
- eclipse | <img width="384" src="screenshots/eclipse.png" alt="eclipse style" />
17
- neutrino | <img width="384" src="screenshots/neutrino.png" alt="neutrino style" />
12
+ ## Styles Overview
18
13
 
14
+ | Style Name | Preview |
15
+ |---------------|---------------------------------------------------------------------------|
16
+ | **colorful** | <img width="384" src="screenshots/colorful.png" alt="colorful style" /> |
17
+ | **graybeard** | <img width="384" src="screenshots/graybeard.png" alt="graybeard style" /> |
18
+ | **eclipse** | <img width="384" src="screenshots/eclipse.png" alt="eclipse style" /> |
19
+ | **neutrino** | <img width="384" src="screenshots/neutrino.png" alt="neutrino style" /> |
19
20
 
20
- # Use styles for versatiles.org
21
+ ---
21
22
 
22
- You in the the [latest release](https://github.com/versatiles-org/versatiles-style/releases/latest/) you can find:
23
- - [`styles.tar.gz`](https://github.com/versatiles-org/versatiles-style/releases/latest/download/styles.tar.gz) containing all styles, each in multiple languages.
24
- Be aware that these styles use `tiles.versatiles.org` as source for tiles, fonts (glyphs) and icons (sprites).
25
- - [`sprites.tar.gz`](https://github.com/versatiles-org/versatiles-style/releases/latest/download/sprites.tar.gz) containing sprites, used e.g. for map icons
26
- - [`versatiles-style.tar.gz`](https://github.com/versatiles-org/versatiles-style/releases/latest/download/versatiles-style.tar.gz) containing a JavaScript file to generate your own style in the browser.
23
+ ## Using VersaTiles Styles
27
24
 
28
- # Generating styles on-the-fly
25
+ ### Prebuilt Styles and Sprites
29
26
 
30
- ## Generating styles in the frontend (web browser)
27
+ Download the assets from the [latest release](https://github.com/versatiles-org/versatiles-style/releases/latest/):
31
28
 
32
- Download latest release:
29
+ - **[styles.tar.gz](https://github.com/versatiles-org/versatiles-style/releases/latest/download/styles.tar.gz):** Contains all styles in multiple languages.
30
+ - **Note:** These styles use `tiles.versatiles.org` as the source for tiles, fonts (glyphs), and icons (sprites).
31
+ - **[sprites.tar.gz](https://github.com/versatiles-org/versatiles-style/releases/latest/download/sprites.tar.gz):** Includes map icons and other sprites.
32
+ - **[versatiles-style.tar.gz](https://github.com/versatiles-org/versatiles-style/releases/latest/download/versatiles-style.tar.gz):** Contains a JavaScript file to generate styles dynamically in the browser.
33
+
34
+ ---
35
+
36
+ ## Generating Styles On-the-Fly
37
+
38
+ ### Frontend Usage (Web Browser)
39
+
40
+ Download the latest release:
33
41
 
34
42
  ```bash
35
43
  curl -Ls "https://github.com/versatiles-org/versatiles-style/releases/latest/download/versatiles-style.tar.gz" | gzip -d | tar -xf -
36
44
  ```
37
45
 
38
- Use it in:
46
+ Integrate it into your HTML application:
39
47
 
40
48
  ```html
41
49
  <div id="map"></div>
@@ -55,56 +63,80 @@ Use it in:
55
63
  </script>
56
64
  ```
57
65
 
58
- ## Generating styles in the backend (Node.js)
66
+ ### Backend Usage (Node.js)
59
67
 
60
- Install `@versatiles/style` via NPM:
68
+ Install the library via NPM:
61
69
 
62
70
  ```bash
63
71
  npm install @versatiles/style
64
72
  ```
65
73
 
66
- Use it in Node.js:
74
+ Generate styles programmatically:
67
75
 
68
76
  ```javascript
69
77
  import { colorful } from '@versatiles/style';
70
- let style = colorful({
78
+ import { writeFileSync } from 'node:fs';
79
+
80
+ const style = colorful({
71
81
  language: 'en',
72
82
  });
73
83
  writeFileSync('style.json', JSON.stringify(style));
74
84
  ```
75
85
 
76
- ### Methods for generating styles
86
+ ---
77
87
 
78
- This library provides:
79
- - `style = colorful(options);` [documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/colorful.md)
80
- - `style = eclipse(options);` [documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/eclipse.md)
81
- - `style = graybeard(options);` [documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/graybeard.md)
82
- - `style = neutrino(options);` [documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/neutrino.md)
88
+ ## Style Generation Methods
83
89
 
84
- [Where `options` is an optional object](https://github.com/versatiles-org/versatiles-style/blob/main/docs/interfaces/StyleBuilderOptions.md)
90
+ The library offers the following style generation methods:
85
91
 
86
- ### Method: `guessStyle(options)`
92
+ - `colorful(options)` - [Documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/colorful.md)
93
+ - `eclipse(options)` - [Documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/eclipse.md)
94
+ - `graybeard(options)` - [Documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/graybeard.md)
95
+ - `neutrino(options)` - [Documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/neutrino.md)
96
+
97
+ **`options`**: An optional object to customize the styles. [Learn more](https://github.com/versatiles-org/versatiles-style/blob/main/docs/interfaces/StyleBuilderOptions.md)
98
+
99
+ ### Guess Style Method
87
100
 
88
101
  ```javascript
89
102
  const style = guessStyle(options);
90
103
  ```
91
- [documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/guessStyle.md)
104
+ [Documentation](https://github.com/versatiles-org/versatiles-style/blob/main/docs/functions/guessStyle.md)
105
+
106
+ ---
107
+
108
+ ## Build Instructions
92
109
 
93
- # Build
110
+ ### Prerequisites
94
111
 
95
- Please note that for building new sprites you need `optipng`.
112
+ To build new sprites, ensure `optipng` is installed.
96
113
 
97
- ## SVG Sources
114
+ ### SVG Source Requirements
115
+
116
+ - SVGs must consist only of paths and should not contain any `transform()` attributes.
117
+ - Styles and colors within the SVG are ignored.
118
+ - All length values must be specified in pixels without units.
119
+
120
+ ### Configuration
121
+
122
+ Define icon sets in the configuration file: [`scripts/config-sprites.ts`](./scripts/config-sprites.ts)
123
+
124
+ ---
125
+
126
+ ## Development
127
+
128
+ Run the project in development mode:
129
+
130
+ ```bash
131
+ npm run dev
132
+ ```
98
133
 
99
- * SVG sources should consist only of paths and not contain any `transform()`s.
100
- * Colors and styles are ignored.
101
- * All lengths must be in pixels without unit.
134
+ A local server will be available at [http://localhost:8080](http://localhost:8080). Use it to select a style, edit definitions in `src/styles/...`, and reload the page to view the changes.
102
135
 
103
- ## Configuration
136
+ ---
104
137
 
105
- Iconsets can be defined in [`scripts/config-sprites.ts`](./scripts/config-sprites.ts)
138
+ ## Licenses
106
139
 
107
- # Licenses
140
+ - **Source Code:** [Unlicense](./LICENSE.md)
141
+ - **Iconsets and Rendered Spritemaps:** [CC0 1.0 Universal](./icons/LICENSE.md)
108
142
 
109
- * Sourcecode: [Unlicense](./LICENSE.md)
110
- * Iconsets and rendered Spritemaps: [CC0 1.0 Universal](./icons/LICENSE.md)
@@ -1,7 +1,7 @@
1
- import type { HSL } from './hsl';
2
- import type { HSV } from './hsv';
3
- import { RandomColorOptions } from './random';
4
- import type { RGB } from './rgb';
1
+ import type { HSL } from './hsl.js';
2
+ import type { HSV } from './hsv.js';
3
+ import { RandomColorOptions } from './random.js';
4
+ import type { RGB } from './rgb.js';
5
5
  export declare abstract class Color {
6
6
  static parse: (input: Color | string) => Color;
7
7
  static HSL: typeof HSL;
@@ -1,6 +1,6 @@
1
- import { Color } from './abstract';
2
- import { HSV } from './hsv';
3
- import { RGB } from './rgb';
1
+ import { Color } from './abstract.js';
2
+ import { HSV } from './hsv.js';
3
+ import { RGB } from './rgb.js';
4
4
  export declare class HSL extends Color {
5
5
  readonly h: number;
6
6
  readonly s: number;
package/dist/color/hsl.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Color } from './abstract';
2
- import { HSV } from './hsv';
3
- import { RGB } from './rgb';
4
- import { clamp, formatFloat, mod } from './utils';
1
+ import { Color } from './abstract.js';
2
+ import { HSV } from './hsv.js';
3
+ import { RGB } from './rgb.js';
4
+ import { clamp, formatFloat, mod } from './utils.js';
5
5
  export class HSL extends Color {
6
6
  h = 0; // between 0 and 360
7
7
  s = 0; // between 0 and 100
@@ -1,6 +1,6 @@
1
- import { Color } from './abstract';
2
- import { HSL } from './hsl';
3
- import { RGB } from './rgb';
1
+ import { Color } from './abstract.js';
2
+ import { HSL } from './hsl.js';
3
+ import { RGB } from './rgb.js';
4
4
  export declare class HSV extends Color {
5
5
  readonly h: number;
6
6
  readonly s: number;
package/dist/color/hsv.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Color } from './abstract';
2
- import { HSL } from './hsl';
3
- import { RGB } from './rgb';
4
- import { clamp, mod } from './utils';
1
+ import { Color } from './abstract.js';
2
+ import { HSL } from './hsl.js';
3
+ import { RGB } from './rgb.js';
4
+ import { clamp, mod } from './utils.js';
5
5
  export class HSV extends Color {
6
6
  h = 0; // between 0 and 360
7
7
  s = 0; // between 0 and 100
@@ -1,6 +1,6 @@
1
- import { Color } from './abstract';
2
- export type { RandomColorOptions } from './random';
3
- export type { HSL } from './hsl';
4
- export type { HSV } from './hsv';
5
- export type { RGB } from './rgb';
1
+ import { Color } from './abstract.js';
2
+ export type { RandomColorOptions } from './random.js';
3
+ export type { HSL } from './hsl.js';
4
+ export type { HSV } from './hsv.js';
5
+ export type { RGB } from './rgb.js';
6
6
  export { Color };
@@ -1,8 +1,8 @@
1
- import { Color } from './abstract';
2
- import { HSL } from './hsl';
3
- import { HSV } from './hsv';
4
- import randomColor from './random';
5
- import { RGB } from './rgb';
1
+ import { Color } from './abstract.js';
2
+ import { HSL } from './hsl.js';
3
+ import { HSV } from './hsv.js';
4
+ import randomColor from './random.js';
5
+ import { RGB } from './rgb.js';
6
6
  Color.parse = function (input) {
7
7
  if (input instanceof Color)
8
8
  return input;
@@ -1,4 +1,4 @@
1
- import { HSV } from './hsv';
1
+ import { HSV } from './hsv.js';
2
2
  export interface RandomColorOptions {
3
3
  seed?: string;
4
4
  hue?: number | string;
@@ -1,5 +1,5 @@
1
- import { HSV } from './hsv';
2
- import { mod } from './utils';
1
+ import { HSV } from './hsv.js';
2
+ import { mod } from './utils.js';
3
3
  let colorDictionary = new Map();
4
4
  export default function randomColor(options) {
5
5
  if (colorDictionary.size === 0)
@@ -1,6 +1,6 @@
1
- import { HSL } from './hsl';
2
- import { HSV } from './hsv';
3
- import { Color } from './abstract';
1
+ import { HSL } from './hsl.js';
2
+ import { HSV } from './hsv.js';
3
+ import { Color } from './abstract.js';
4
4
  export declare class RGB extends Color {
5
5
  readonly r: number;
6
6
  readonly g: number;
package/dist/color/rgb.js CHANGED
@@ -1,7 +1,7 @@
1
- import { HSL } from './hsl';
2
- import { HSV } from './hsv';
3
- import { Color } from './abstract';
4
- import { clamp, formatFloat } from './utils';
1
+ import { HSL } from './hsl.js';
2
+ import { HSV } from './hsv.js';
3
+ import { Color } from './abstract.js';
4
+ import { clamp, formatFloat } from './utils.js';
5
5
  export class RGB extends Color {
6
6
  r = 0; // between 0 and 255
7
7
  g = 0; // between 0 and 255
@@ -1,4 +1,4 @@
1
- import type { TileJSONSpecification } from '../types/index';
1
+ import type { TileJSONSpecification } from '../types/index.js';
2
2
  import type { SpriteSpecification, StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
3
3
  export interface GuessStyleOptions {
4
4
  baseUrl?: string;
@@ -1,8 +1,8 @@
1
- import { isTileJSONSpecification } from '../types/index';
2
- import { deepClone, resolveUrl } from '../lib/utils';
3
- import { colorful } from '../styles/index';
4
- import { Color } from '../color/index';
5
- import { isRasterTileJSONSpecification } from '../types/tilejson';
1
+ import { isTileJSONSpecification } from '../types/index.js';
2
+ import { deepClone, resolveUrl } from '../lib/utils.js';
3
+ import { colorful } from '../styles/index.js';
4
+ import { Color } from '../color/index.js';
5
+ import { isRasterTileJSONSpecification } from '../types/tilejson.js';
6
6
  export function guessStyle(tileJSON, options) {
7
7
  tileJSON = deepClone(tileJSON);
8
8
  if (options && options.baseUrl) {
@@ -1,2 +1,2 @@
1
- export type { GuessStyleOptions } from './guess_style';
2
- export { guessStyle } from './guess_style';
1
+ export type { GuessStyleOptions } from './guess_style.js';
2
+ export { guessStyle } from './guess_style.js';
@@ -1,2 +1,2 @@
1
- export { guessStyle } from './guess_style';
1
+ export { guessStyle } from './guess_style.js';
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- export { colorful, eclipse, graybeard, neutrino, type StyleBuilderFunction } from './styles/index';
1
+ export { colorful, eclipse, graybeard, neutrino, type StyleBuilderFunction } from './styles/index.js';
2
2
  export declare const styles: {
3
- colorful: import("./styles/index").StyleBuilderFunction;
4
- eclipse: import("./styles/index").StyleBuilderFunction;
5
- graybeard: import("./styles/index").StyleBuilderFunction;
6
- neutrino: import("./styles/index").StyleBuilderFunction;
3
+ colorful: import("./styles/index.js").StyleBuilderFunction;
4
+ eclipse: import("./styles/index.js").StyleBuilderFunction;
5
+ graybeard: import("./styles/index.js").StyleBuilderFunction;
6
+ neutrino: import("./styles/index.js").StyleBuilderFunction;
7
7
  };
8
- export type { GuessStyleOptions } from './guess_style/index';
9
- export type { RGB, HSL, HSV, RandomColorOptions } from './color/index';
10
- export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './types/tilejson';
11
- export type { VectorLayer } from './types/index';
12
- export type { StyleBuilderOptions, Language, StyleBuilderColors, StyleBuilderColorsEnsured, StyleBuilderFonts } from './style_builder/types';
13
- export type { RecolorOptions } from './style_builder/recolor';
14
- export { guessStyle } from './guess_style/index';
15
- export { Color } from './color/index';
8
+ export type { GuessStyleOptions } from './guess_style/index.js';
9
+ export type { RGB, HSL, HSV, RandomColorOptions } from './color/index.js';
10
+ export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './types/tilejson.js';
11
+ export type { VectorLayer } from './types/index.js';
12
+ export type { StyleBuilderOptions, Language, StyleBuilderColors, StyleBuilderColorsEnsured, StyleBuilderFonts } from './style_builder/types.js';
13
+ export type { RecolorOptions } from './style_builder/recolor.js';
14
+ export { guessStyle } from './guess_style/index.js';
15
+ export { Color } from './color/index.js';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export { colorful, eclipse, graybeard, neutrino } from './styles/index';
2
- import { colorful, eclipse, graybeard, neutrino } from './styles/index';
1
+ export { colorful, eclipse, graybeard, neutrino } from './styles/index.js';
2
+ import { colorful, eclipse, graybeard, neutrino } from './styles/index.js';
3
3
  export const styles = {
4
4
  colorful,
5
5
  eclipse,
6
6
  graybeard,
7
7
  neutrino,
8
8
  };
9
- export { guessStyle } from './guess_style/index';
10
- export { Color } from './color/index';
9
+ export { guessStyle } from './guess_style/index.js';
10
+ export { Color } from './color/index.js';
11
11
  //# sourceMappingURL=index.js.map
package/dist/lib/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Color } from '../color/index';
1
+ import { Color } from '../color/index.js';
2
2
  // Utility function to deep clone an object
3
3
  export function deepClone(obj) {
4
4
  const type = typeof obj;
@@ -1,2 +1,2 @@
1
- export { getShortbreadTemplate } from './template';
2
- export { getShortbreadLayers } from './layers';
1
+ export { getShortbreadTemplate } from './template.js';
2
+ export { getShortbreadLayers } from './layers.js';
@@ -1,3 +1,3 @@
1
- export { getShortbreadTemplate } from './template';
2
- export { getShortbreadLayers } from './layers';
1
+ export { getShortbreadTemplate } from './template.js';
2
+ export { getShortbreadLayers } from './layers.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import type { MaplibreLayerDefinition } from '../types/index';
2
- import { Language } from '../style_builder/types';
1
+ import type { MaplibreLayerDefinition } from '../types/index.js';
2
+ import { Language } from '../style_builder/types.js';
3
3
  export declare function getShortbreadLayers(option: {
4
4
  readonly language: Language;
5
5
  }): MaplibreLayerDefinition[];
@@ -1,4 +1,4 @@
1
- import type { MaplibreLayer } from '../types/index';
2
- import type { StyleRules } from './types';
3
- import type { CachedRecolor } from './recolor';
1
+ import type { MaplibreLayer } from '../types/index.js';
2
+ import type { StyleRules } from './types.js';
3
+ import type { CachedRecolor } from './recolor.js';
4
4
  export declare function decorate(layers: MaplibreLayer[], rules: StyleRules, recolor: CachedRecolor): MaplibreLayer[];
@@ -1,7 +1,7 @@
1
- import { Color } from '../color/index';
1
+ import { Color } from '../color/index.js';
2
2
  import expandBraces from 'brace-expansion';
3
- import maplibreProperties from '../shortbread/properties';
4
- import { deepMerge } from '../lib/utils';
3
+ import maplibreProperties from '../shortbread/properties.js';
4
+ import { deepMerge } from '../lib/utils.js';
5
5
  export function decorate(layers, rules, recolor) {
6
6
  const layerIds = layers.map(l => l.id);
7
7
  const layerIdSet = new Set(layerIds);
@@ -1,4 +1,4 @@
1
- import { Color } from '../color/index';
1
+ import { Color } from '../color/index.js';
2
2
  export interface RecolorOptions {
3
3
  invertBrightness?: boolean;
4
4
  rotate?: number;
@@ -1,4 +1,4 @@
1
- import { Color } from '../color/index';
1
+ import { Color } from '../color/index.js';
2
2
  export function getDefaultRecolorFlags() {
3
3
  return {
4
4
  invertBrightness: false,
@@ -1,7 +1,7 @@
1
- import { Color } from '../color/index';
2
- import type { StyleSpecification } from '../types/maplibre';
3
- import type { StyleBuilderColors, StyleBuilderColorsEnsured, StyleBuilderFonts, StyleBuilderOptions } from './types';
4
- import type { StyleRules, StyleRulesOptions } from './types';
1
+ import { Color } from '../color/index.js';
2
+ import type { StyleSpecification } from '../types/maplibre.js';
3
+ import type { StyleBuilderColors, StyleBuilderColorsEnsured, StyleBuilderFonts, StyleBuilderOptions } from './types.js';
4
+ import type { StyleRules, StyleRulesOptions } from './types.js';
5
5
  export declare abstract class StyleBuilder {
6
6
  #private;
7
7
  abstract readonly name: string;
@@ -1,8 +1,8 @@
1
- import { Color } from '../color/index';
2
- import { getShortbreadTemplate, getShortbreadLayers } from '../shortbread/index';
3
- import { decorate } from './decorator';
4
- import { CachedRecolor, getDefaultRecolorFlags } from './recolor';
5
- import { basename, deepClone, resolveUrl } from '../lib/utils';
1
+ import { Color } from '../color/index.js';
2
+ import { getShortbreadTemplate, getShortbreadLayers } from '../shortbread/index.js';
3
+ import { decorate } from './decorator.js';
4
+ import { CachedRecolor, getDefaultRecolorFlags } from './recolor.js';
5
+ import { basename, deepClone, resolveUrl } from '../lib/utils.js';
6
6
  // StyleBuilder class definition
7
7
  export class StyleBuilder {
8
8
  #sourceName = 'versatiles-shortbread';
@@ -1,5 +1,5 @@
1
- import type { Color } from '../color/index';
2
- import type { RecolorOptions } from './recolor';
1
+ import type { Color } from '../color/index.js';
2
+ import type { RecolorOptions } from './recolor.js';
3
3
  import { SpriteSpecification } from '@maplibre/maplibre-gl-style-spec';
4
4
  /** Represents language suffixes used in map styles. */
5
5
  export type Language = 'de' | 'en' | null;
@@ -1,5 +1,5 @@
1
- import { StyleBuilder } from '../style_builder/style_builder';
2
- import type { StyleBuilderColors, StyleRules, StyleRulesOptions } from '../style_builder/types';
1
+ import { StyleBuilder } from '../style_builder/style_builder.js';
2
+ import type { StyleBuilderColors, StyleRules, StyleRulesOptions } from '../style_builder/types.js';
3
3
  export default class Colorful extends StyleBuilder {
4
4
  readonly name: string;
5
5
  defaultFonts: {
@@ -1,4 +1,4 @@
1
- import { StyleBuilder } from '../style_builder/style_builder';
1
+ import { StyleBuilder } from '../style_builder/style_builder.js';
2
2
  export default class Colorful extends StyleBuilder {
3
3
  name = 'Colorful';
4
4
  defaultFonts = {
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Eclipse extends Colorful {
3
3
  readonly name: string;
4
4
  constructor();
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Eclipse extends Colorful {
3
3
  name = 'Eclipse';
4
4
  constructor() {
@@ -1,5 +1,5 @@
1
- import type { StyleRules, StyleRulesOptions } from '../style_builder/types';
2
- import Colorful from './colorful';
1
+ import type { StyleRules, StyleRulesOptions } from '../style_builder/types.js';
2
+ import Colorful from './colorful.js';
3
3
  export default class Empty extends Colorful {
4
4
  readonly name: string;
5
5
  protected getStyleRules(_options: StyleRulesOptions): StyleRules;
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Empty extends Colorful {
3
3
  name = 'Empty';
4
4
  getStyleRules(_options) {
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Graybeard extends Colorful {
3
3
  readonly name: string;
4
4
  constructor();
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Graybeard extends Colorful {
3
3
  name = 'Graybeard';
4
4
  constructor() {
@@ -1,4 +1,4 @@
1
- import type { StyleBuilderOptions } from '../style_builder/types';
1
+ import type { StyleBuilderOptions } from '../style_builder/types.js';
2
2
  import { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
3
3
  export interface StyleBuilderFunction {
4
4
  (options?: StyleBuilderOptions): StyleSpecification;
@@ -1,9 +1,9 @@
1
1
  // import styles
2
- import Colorful from './colorful';
3
- import Eclipse from './eclipse';
4
- import Graybeard from './graybeard';
5
- import Neutrino from './neutrino';
6
- import Empty from './empty';
2
+ import Colorful from './colorful.js';
3
+ import Eclipse from './eclipse.js';
4
+ import Graybeard from './graybeard.js';
5
+ import Neutrino from './neutrino.js';
6
+ import Empty from './empty.js';
7
7
  function getStyleBuilder(styleBuilder) {
8
8
  const fn = function (options) {
9
9
  return new styleBuilder().build(options);
@@ -1,5 +1,5 @@
1
- import { StyleBuilderColors, StyleRules, StyleRulesOptions } from '../style_builder/types';
2
- import Colorful from './colorful';
1
+ import { StyleBuilderColors, StyleRules, StyleRulesOptions } from '../style_builder/types.js';
2
+ import Colorful from './colorful.js';
3
3
  export default class Neutrino extends Colorful {
4
4
  readonly name: string;
5
5
  defaultFonts: {
@@ -1,4 +1,4 @@
1
- import Colorful from './colorful';
1
+ import Colorful from './colorful.js';
2
2
  export default class Neutrino extends Colorful {
3
3
  name = 'Neutrino';
4
4
  defaultFonts = {
@@ -1,5 +1,5 @@
1
- export type { MaplibreLayerDefinition, MaplibreLayer } from './maplibre';
2
- export type { VectorLayer } from './vector_layer';
3
- export { isTileJSONSpecification } from './tilejson';
4
- export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './tilejson';
5
- export { isVectorLayers } from './vector_layer';
1
+ export type { MaplibreLayerDefinition, MaplibreLayer } from './maplibre.js';
2
+ export type { VectorLayer } from './vector_layer.js';
3
+ export { isTileJSONSpecification } from './tilejson.js';
4
+ export type { TileJSONSpecification, TileJSONSpecificationRaster, TileJSONSpecificationVector } from './tilejson.js';
5
+ export { isVectorLayers } from './vector_layer.js';
@@ -1,3 +1,3 @@
1
- export { isTileJSONSpecification } from './tilejson';
2
- export { isVectorLayers } from './vector_layer';
1
+ export { isTileJSONSpecification } from './tilejson.js';
2
+ export { isVectorLayers } from './vector_layer.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { VectorLayer } from './vector_layer';
1
+ import type { VectorLayer } from './vector_layer.js';
2
2
  /** Basic structure for TileJSON specification, applicable to both raster and vector types. */
3
3
  export interface TileJSONSpecificationRaster {
4
4
  tilejson?: '3.0.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versatiles/style",
3
- "version": "5.2.4",
3
+ "version": "5.2.5",
4
4
  "description": "Generate StyleJSON for MapLibre",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",